diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/card-call-scd.c | 25 | ||||
-rw-r--r-- | tools/gpg-card.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tools/card-call-scd.c b/tools/card-call-scd.c index 8800c5b52..0b529f06a 100644 --- a/tools/card-call-scd.c +++ b/tools/card-call-scd.c @@ -161,6 +161,11 @@ release_card_info (card_info_t info) info->kinfo = kinfo; } info->chvusage[0] = info->chvusage[1] = 0; + for (i=0; i < DIM(info->supported_keyalgo); i++) + { + free_strlist (info->supported_keyalgo[i]); + info->supported_keyalgo[i] = NULL; + } } @@ -1042,6 +1047,26 @@ learn_status_cb (void *opaque, const char *line) xfree (parm->dispserialno); parm->dispserialno = unescape_status_string (line); } + else if (!memcmp (keyword, "KEY-ATTR-INFO", keywordlen)) + { + if (!strncmp (line, "OPENPGP.", 8)) + { + int no; + + line += 8; + no = atoi (line); + if (no >= 1 && no <= 3) + { + no--; + line++; + while (spacep (line)) + line++; + append_to_strlist (&parm->supported_keyalgo[no], + xstrdup (line)); + } + } + /* Skip when it's not "OPENPGP.[123]". */ + } break; default: diff --git a/tools/gpg-card.h b/tools/gpg-card.h index 067720d6c..8c8bc0671 100644 --- a/tools/gpg-card.h +++ b/tools/gpg-card.h @@ -22,6 +22,7 @@ #define GNUPG_GPG_CARD_H #include "../common/session-env.h" +#include "../common/strlist.h" /* We keep all global options in the structure OPT. */ @@ -188,6 +189,7 @@ struct card_info_s int kdf_do_enabled; /* True if card has a KDF object. */ int uif[3]; /* True if User Interaction Flag is on. */ /* 1 = on, 2 = permanent on. */ + strlist_t supported_keyalgo[3]; }; typedef struct card_info_s *card_info_t; |