aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-nks.c
diff options
context:
space:
mode:
Diffstat (limited to 'scd/app-nks.c')
-rw-r--r--scd/app-nks.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/scd/app-nks.c b/scd/app-nks.c
index 01db56b30..44ee222e2 100644
--- a/scd/app-nks.c
+++ b/scd/app-nks.c
@@ -1136,6 +1136,24 @@ do_readcert (app_t app, const char *certid,
*cert = NULL;
*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))
nks_app_id = NKS_APP_NKS;
else if (!strncmp (certid, "NKS-ESIGN.", 10))