summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-03-26 02:40:16 +0100
committerDan McGee <dan@archlinux.org>2011-04-21 02:42:01 +0200
commit6760ec2b770e65f2aae9cfd39135cefd49961195 (patch)
tree1cff3dd732c5a4e6a7c262c8163e32e52eb7f6d5 /lib/libalpm/handle.c
parent2c8c763723b43ddcb865aab325afc9c76907cb64 (diff)
downloadpacman-6760ec2b770e65f2aae9cfd39135cefd49961195.tar.gz
pacman-6760ec2b770e65f2aae9cfd39135cefd49961195.tar.xz
Allow VerifySig to act as a default verification in [options]
* add _alpm_db_get_sigverify_level * add alpm_option_{get,set}_default_sigverify And set the default verification level to OPTIONAL if not set otherwise. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index b55b02a4..c4b98631 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -50,6 +50,8 @@ pmhandle_t *_alpm_handle_new()
CALLOC(handle, 1, sizeof(pmhandle_t), RET_ERR(PM_ERR_MEMORY, NULL));
+ handle->sigverify = PM_PGP_VERIFY_OPTIONAL;
+
return handle;
}
@@ -625,4 +627,17 @@ int SYMEXPORT alpm_option_set_checkspace(int checkspace)
return 0;
}
+int SYMEXPORT alpm_option_set_default_sigverify(pgp_verify_t level)
+{
+ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
+ handle->sigverify = level;
+ return 0;
+}
+
+pgp_verify_t SYMEXPORT alpm_option_get_default_sigverify()
+{
+ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, PM_PGP_VERIFY_UNKNOWN));
+ return handle->sigverify;
+}
+
/* vim: set ts=2 sw=2 noet: */