diff options
author | Dan McGee <dan@archlinux.org> | 2011-06-07 17:29:55 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-24 02:34:50 -0500 |
commit | db3b86e7f34f4c3ccb42e98465f2069aa642a85f (patch) | |
tree | 34ee212bbcc0385674908f0d427779732f9aadfb /lib/libalpm/alpm.h | |
parent | 94d22f93096e210cd00d2e9c97c65f77d49ae387 (diff) | |
download | pacman-db3b86e7f34f4c3ccb42e98465f2069aa642a85f.tar.xz |
Do database signature checking at load time
This is the ideal place to do it as all clients should be checking the
return value and ensuring there are no errors. This is similar to
pkg_load().
We also add an additional step of validation after we download a new
database; a subsequent '-y' operation can potentially invalidate the
original check at registration time.
Note that this implementation is still a bit naive; if a signature is
invalid it is currently impossible to refresh and re-download the file
without manually deleting it first. Similarly, if one downloads a
database and the check fails, the database object is still there and can
be used. These shortcomings will be addressed in a future commit.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/alpm.h')
-rw-r--r-- | lib/libalpm/alpm.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 715e502a..eb2eff88 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -357,9 +357,12 @@ alpm_list_t *alpm_option_get_syncdbs(pmhandle_t *handle); /** Register a sync database of packages. * @param handle the context handle * @param treename the name of the sync repository + * @param check_sig what level of signature checking to perform on the + * database; note that this must be a '.sig' file type verification * @return a pmdb_t* on success (the value), NULL on error */ -pmdb_t *alpm_db_register_sync(pmhandle_t *handle, const char *treename); +pmdb_t *alpm_db_register_sync(pmhandle_t *handle, const char *treename, + pgp_verify_t check_sig); /** Unregister a package database. * @param db pointer to the package database to unregister |