mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
scd,openpgp: Support READCERT by keygrip.
* scd/app-openpgp.c (do_readcert): Allow use of keygrip. -- GnuPG-bug-id: 6002 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
59c481bb86
commit
273b8ec193
@ -2266,7 +2266,28 @@ do_readcert (app_t app, const char *certid,
|
||||
|
||||
*cert = NULL;
|
||||
*certlen = 0;
|
||||
if (!ascii_strcasecmp (certid, "OPENPGP.3"))
|
||||
if (strlen (certid) == 40)
|
||||
{
|
||||
int keyno;
|
||||
const unsigned char *keygrip_str;
|
||||
|
||||
for (keyno = 0; keyno < 3; keyno++)
|
||||
{
|
||||
keygrip_str = app->app_local->pk[keyno].keygrip_str;
|
||||
if (!strncmp (keygrip_str, certid, 40))
|
||||
break;
|
||||
}
|
||||
|
||||
if (keyno == 2)
|
||||
;
|
||||
else if (keyno == 1)
|
||||
occurrence = 1;
|
||||
else if (keyno == 0)
|
||||
occurrence = 2;
|
||||
else
|
||||
return gpg_error (GPG_ERR_INV_ID);
|
||||
}
|
||||
else if (!ascii_strcasecmp (certid, "OPENPGP.3"))
|
||||
;
|
||||
else if (!ascii_strcasecmp (certid, "OPENPGP.2"))
|
||||
occurrence = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user