diff options
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index b02d6c68f..83ca921a7 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -798,7 +798,22 @@ scd_keypairinfo_status_cb (void *opaque, const char *line) p++; while (*p && !spacep (p)) p++; - *p = 0; + if (*p) + { + *p++ = 0; + while (spacep (p)) + p++; + while (*p && !spacep (p)) + { + switch (*p++) + { + case 'c': sl->flags |= GCRY_PK_USAGE_CERT; break; + case 's': sl->flags |= GCRY_PK_USAGE_SIGN; break; + case 'e': sl->flags |= GCRY_PK_USAGE_ENCR; break; + case 'a': sl->flags |= GCRY_PK_USAGE_AUTH; break; + } + } + } } } @@ -808,7 +823,8 @@ scd_keypairinfo_status_cb (void *opaque, const char *line) /* Read the keypairinfo lines of the current card directly from * scdaemon. The list is returned as a string made up of the keygrip, - * a space and the keyref. */ + * a space and the keyref. The flags of the string carry the usage + * bits. */ gpg_error_t agent_scd_keypairinfo (ctrl_t ctrl, strlist_t *r_list) { |