diff options
author | Jonas Witschel <diabonas@archlinux.org> | 2019-10-02 16:40:54 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-10-07 03:07:39 +0200 |
commit | 80e2e1c7c9f2cc2795f497f2101b0aeb7b7e8638 (patch) | |
tree | d890a6b126de7dcb68a49d4783a0351dec56024b /lib/libalpm/be_package.c | |
parent | 0c4a8ae24b8395b0dd4f8046615336e394a8e3f8 (diff) | |
download | pacman-80e2e1c7c9f2cc2795f497f2101b0aeb7b7e8638.tar.gz pacman-80e2e1c7c9f2cc2795f497f2101b0aeb7b7e8638.tar.xz |
signing: move key import confirmation before key_search
Ask the user whether they want to import a missing key before even doing
a search on the keyserver. This will be useful for getting Web Key
Directory support in place: for a WKD, looking up and importing a key
are a single action, so the current key_search -> QUESTION -> key_import
workflow does not apply.
Since only the ID of the package signing key is available before
key_search, we display the packager variable in addition to the key ID
for user convenience.
Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_package.c')
-rw-r--r-- | lib/libalpm/be_package.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index ac911bdb..6c93d12b 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -731,6 +731,8 @@ int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int ful { int validation = 0; char *sigpath; + alpm_pkg_t *pkg_temp; + char *packager; CHECK_HANDLE(handle, return -1); ASSERT(pkg != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); @@ -755,9 +757,17 @@ int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int ful for(k = keys; k; k = k->next) { char *key = k->data; if(_alpm_key_in_keychain(handle, key) == 0) { - if(_alpm_key_import(handle, key) == -1) { + pkg_temp = _alpm_pkg_load_internal(handle, filename, full); + if(pkg_temp) { + packager = pkg_temp->packager; + _alpm_pkg_free(pkg_temp); + } else { + packager = NULL; + } + if(_alpm_key_import(handle, packager, key) == -1) { fail = 1; } + free(packager); } } FREELIST(keys); |