mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Correctly handle keyblocks followed by legacy keys.
* g10/keyring.c (keyring_get_keyblock): If we encounter a legacy packet after already having some non-legacy packets, then treat the legacy packet as a keyblock boundary, not as part of the keyblock. * g10/t-keydb-get-keyblock.c: New file. * g10/t-keydb-get-keyblock.gpg: New file. * g10/Makefile.am (EXTRA_DIST): Add t-keydb-get-keyblock.gpg. (module_tests): Add t-keydb-get-keyblock. (t_keydb_get_keyblock_SOURCES): New variable. (t_keydb_get_keyblock_LDADD): Likewise. -- Signed-off-by: Neal H. Walfield GnuPG-bug-id: 2151
This commit is contained in:
parent
8f6099ac51
commit
ad9befab12
4 changed files with 80 additions and 3 deletions
|
@ -419,7 +419,19 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
|
|||
continue;
|
||||
}
|
||||
if (gpg_err_code (rc) == GPG_ERR_LEGACY_KEY)
|
||||
break; /* Upper layer needs to handle this. */
|
||||
{
|
||||
if (in_cert)
|
||||
/* It is not this key that is problematic, but the
|
||||
following key. */
|
||||
{
|
||||
rc = 0;
|
||||
hd->found.n_packets --;
|
||||
}
|
||||
else
|
||||
/* Upper layer needs to handle this. */
|
||||
;
|
||||
break;
|
||||
}
|
||||
if (rc) {
|
||||
log_error ("keyring_get_keyblock: read error: %s\n",
|
||||
gpg_strerror (rc) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue