mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
scd:nks: Add support of KEYGRIP for do_readcert.
* scd/app-nks.c (do_readcert): Support KEYGRIP. -- GnuPG-bug-id: 5150 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> (cherry picked from commit 4020cd9d656264bec5e7fb5e45c5e06eff8656c3)
This commit is contained in:
parent
ea7234d2f5
commit
1f2823e0be
@ -1136,6 +1136,24 @@ do_readcert (app_t app, const char *certid,
|
|||||||
*cert = NULL;
|
*cert = NULL;
|
||||||
*certlen = 0;
|
*certlen = 0;
|
||||||
|
|
||||||
|
/* Handle the case with KEYGRIP. */
|
||||||
|
if (strlen (certid) == 40)
|
||||||
|
{
|
||||||
|
char keygripstr[2*KEYGRIP_LEN+1];
|
||||||
|
|
||||||
|
i = -1;
|
||||||
|
err = iterate_over_filelist (app, certid, 0, keygripstr, &i);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
if (filelist[i].iskeypair > 0)
|
||||||
|
fid = filelist[i].iskeypair;
|
||||||
|
else
|
||||||
|
fid = filelist[i].fid;
|
||||||
|
|
||||||
|
return readcert_from_ef (app, fid, cert, certlen);
|
||||||
|
}
|
||||||
|
|
||||||
if (!strncmp (certid, "NKS-NKS3.", 9))
|
if (!strncmp (certid, "NKS-NKS3.", 9))
|
||||||
nks_app_id = NKS_APP_NKS;
|
nks_app_id = NKS_APP_NKS;
|
||||||
else if (!strncmp (certid, "NKS-ESIGN.", 10))
|
else if (!strncmp (certid, "NKS-ESIGN.", 10))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user