From db3b86e7f34f4c3ccb42e98465f2069aa642a85f Mon Sep 17 00:00:00 2001
From: Dan McGee <dan@archlinux.org>
Date: Tue, 7 Jun 2011 17:29:55 -0500
Subject: 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>
---
 src/util/testdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/util/testdb.c')

diff --git a/src/util/testdb.c b/src/util/testdb.c
index 4937480d..af5007e2 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -151,7 +151,7 @@ static int check_syncdbs(alpm_list_t *dbnames) {
 
 	for(i = dbnames; i; i = alpm_list_next(i)) {
 		char *dbname = alpm_list_getdata(i);
-		db = alpm_db_register_sync(handle, dbname);
+		db = alpm_db_register_sync(handle, dbname, PM_PGP_VERIFY_OPTIONAL);
 		if(db == NULL) {
 			fprintf(stderr, "error: could not register sync database (%s)\n",
 					alpm_strerror(alpm_errno(handle)));
-- 
cgit v1.2.3-2-g168b