diff options
author | Werner Koch <[email protected]> | 2018-03-06 15:26:26 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2018-03-06 15:26:26 +0000 |
commit | f574aabeeb873f14a586f80cac16b857e6088534 (patch) | |
tree | e84428513719a4e50cb1df1be509c12d34eb434a /g10/call-agent.c | |
parent | gpg: Avoid writing a zero length last chunk in AEAD mode. (diff) | |
parent | agent: Also evict cached items via a timer. (diff) | |
download | gnupg-f574aabeeb873f14a586f80cac16b857e6088534.tar.gz gnupg-f574aabeeb873f14a586f80cac16b857e6088534.zip |
Merge branch 'STABLE-BRANCH-2-2' into wk-master
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 61d06c663..b1f589bbc 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -381,10 +381,11 @@ unhexify_fpr (const char *hexstr, unsigned char *fpr) for (s=hexstr, n=0; hexdigitp (s); s++, n++) ; - if (*s || (n != 40)) + if ((*s && *s != ' ') || (n != 40)) return 0; /* no fingerprint (invalid or wrong length). */ - for (s=hexstr, n=0; *s; s += 2, n++) + for (s=hexstr, n=0; *s && n < 20; s += 2, n++) fpr[n] = xtoi_2 (s); + return 1; /* okay */ } @@ -625,6 +626,24 @@ learn_status_cb (void *opaque, const char *line) else if (no == 3) parm->fpr3time = strtoul (line, NULL, 10); } + else if (keywordlen == 11 && !memcmp (keyword, "KEYPAIRINFO", keywordlen)) + { + const char *hexgrp = line; + int no; + + while (*line && !spacep (line)) + line++; + while (spacep (line)) + line++; + if (strncmp (line, "OPENPGP.", 8)) + ; + else if ((no = atoi (line+8)) == 1) + unhexify_fpr (hexgrp, parm->grp1); + else if (no == 2) + unhexify_fpr (hexgrp, parm->grp2); + else if (no == 3) + unhexify_fpr (hexgrp, parm->grp3); + } else if (keywordlen == 6 && !memcmp (keyword, "CA-FPR", keywordlen)) { int no = atoi (line); |