summaryrefslogtreecommitdiffstats
path: root/tools/gpg-card.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-06-30 14:36:44 +0200
committerWerner Koch <wk@gnupg.org>2020-06-30 14:41:49 +0200
commitfb10b6cba43f4ed8675093ac25f461de4dacdce9 (patch)
tree5ab56b9fed34be42287665eb0b36dc6f0b8e0f23 /tools/gpg-card.h
parentecc: Support Ed448/X448 key generation. (diff)
downloadgnupg2-fb10b6cba43f4ed8675093ac25f461de4dacdce9.tar.xz
gnupg2-fb10b6cba43f4ed8675093ac25f461de4dacdce9.zip
card: Better detect removed cards. Add TCOS PIN menu.
* tools/card-call-scd.c (scd_change_pin): Add arg 'nullpin'. * tools/gpg-card.h (struct card_info_s): Add field 'card_removed'. * tools/gpg-card.c (fixup_scd_errors): New. (maybe_set_card_removed): New. (list_one_kinfo): Change type of first arg to get access to INFO. Set card_removed flag. (list_all_kinfo): Improve label alignment. (cmd_list): Check that the current card is still available. (cmd_passwd): Add option --nullpin and menu to chnage TCOS PINs. (dispatch_command): Handle card_removed flag. (interactive_loop): Ditto. -- Note that that I was not able to change the NullPIN of the standard PIN using a Signature V2 Brainpool test card. Changing the NullPIN of the QES PIN worked, though. I checked the commands send to scdaemon and they were correct - I used the very same command with gpg-connect-agent last week to set a Pin for a production Brainpool Signature card. Thus this might be a problem with this specific test card. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to '')
-rw-r--r--tools/gpg-card.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gpg-card.h b/tools/gpg-card.h
index 82064999c..56e117bf3 100644
--- a/tools/gpg-card.h
+++ b/tools/gpg-card.h
@@ -139,6 +139,7 @@ struct card_info_s
{
int initialized; /* True if a learn command was successful. */
int need_sn_cmd; /* The SERIALNO command needs to be issued. */
+ int card_removed; /* Helper flag set by some listing functions. */
int error; /* private. */
char *reader; /* Reader information. */
char *cardtype; /* NULL or type of the card. */
@@ -232,7 +233,7 @@ gpg_error_t scd_readcert (const char *certidstr,
gpg_error_t scd_readkey (const char *keyrefstr, gcry_sexp_t *r_result);
gpg_error_t scd_cardlist (strlist_t *result);
gpg_error_t scd_applist (strlist_t *result, int all);
-gpg_error_t scd_change_pin (const char *pinref, int reset_mode);
+gpg_error_t scd_change_pin (const char *pinref, int reset_mode, int nullpin);
gpg_error_t scd_checkpin (const char *serialno);
unsigned long agent_get_s2k_count (void);