summaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-09-22 16:15:47 +0200
committerWerner Koch <wk@gnupg.org>2020-09-22 16:15:47 +0200
commitb810320b1bf76209dc1087cb91ca34232d9268c3 (patch)
treef8d3d583ce1aafcaec735dd15130bda242a4d221 /sm
parentcommon: Fix name of keyboxd. (diff)
downloadgnupg2-b810320b1bf76209dc1087cb91ca34232d9268c3.tar.xz
gnupg2-b810320b1bf76209dc1087cb91ca34232d9268c3.zip
sm: Fix returning of the ephemeral flag in keyboxd mode.
* sm/keydb.c (search_status_cb): Skip over the ubid.
Diffstat (limited to 'sm')
-rw-r--r--sm/keydb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sm/keydb.c b/sm/keydb.c
index f7d815e65..13eb1a407 100644
--- a/sm/keydb.c
+++ b/sm/keydb.c
@@ -1512,6 +1512,7 @@ search_status_cb (void *opaque, const char *line)
KEYDB_HANDLE hd = opaque;
gpg_error_t err = 0;
const char *s;
+ unsigned int n;
if ((s = has_leading_keyword (line, "PUBKEY_INFO")))
{
@@ -1522,13 +1523,14 @@ search_status_cb (void *opaque, const char *line)
hd->last_ubid_valid = 0;
while (*s && !spacep (s))
s++;
- if (hex2fixedbuf (s, hd->last_ubid, sizeof hd->last_ubid))
- hd->last_ubid_valid = 1;
- else
+ if (!(n=hex2fixedbuf (s, hd->last_ubid, sizeof hd->last_ubid)))
err = gpg_error (GPG_ERR_INV_VALUE);
- while (spacep (s))
- s++;
- hd->last_is_ephemeral = (*s == 'e');
+ else
+ {
+ hd->last_ubid_valid = 1;
+ s += n;
+ hd->last_is_ephemeral = (*s == 'e');
+ }
}
}