Do database signature checking at load time
commitdb3b86e7f34f4c3ccb42e98465f2069aa642a85f
authorDan McGee <dan@archlinux.org>
Tue, 7 Jun 2011 22:29:55 +0000 (7 17:29 -0500)
committerDan McGee <dan@archlinux.org>
Fri, 24 Jun 2011 07:34:50 +0000 (24 02:34 -0500)
tree34ee212bbcc0385674908f0d427779732f9aadfb
parent94d22f93096e210cd00d2e9c97c65f77d49ae387
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>
lib/libalpm/alpm.h
lib/libalpm/be_sync.c
lib/libalpm/db.c
lib/libalpm/db.h
src/pacman/conf.c
src/util/cleanupdelta.c
src/util/testdb.c
test/pacman/tests/sign001.py