aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpg-card.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* card: Allow card selection with LIST.Werner Koch2019-04-031-33/+81
| | | | | | | | | | | | * tools/card-call-scd.c (start_agent): Request serialno only whean started. (scd_serialno): Allow NULL for r_serialno. * tools/gpg-card.c (cmd_factoryreset): Use changed scd_serialno. (cmd_list): New. (dispatch_command): Use cmd_list for cmdLIST. (interactive_loop): Ditto. Signed-off-by: Werner Koch <[email protected]>
* common: Extend function pubkey_algo_string.Werner Koch2019-04-021-1/+1
| | | | | | | | * common/sexputil.c (pubkey_algo_string): Add arg R_ALGOID. * sm/certreqgen-ui.c (gpgsm_gencertreq_tty): Adjust. * tools/gpg-card.c (list_one_kinfo): Ditto. Signed-off-by: Werner Koch <[email protected]>
* card: For passwd add a PIV menu and make the OpenPGP menu optional.Werner Koch2019-03-281-80/+101
| | | | | | | * tools/gpg-card.c (get_selection): New. (cmd_passwd): Reworked. Signed-off-by: Werner Koch <[email protected]>
* card: Allow "yubikey disable" only for Yubikey-5 and later.Werner Koch2019-03-281-1/+1
| | | | | | | | | | | | | | | * tools/card-yubikey.c (yubikey_commands): Add new arg INFO and test for Yubikey-5. * tools/gpg-card.c (cmd_yubikey): Pass info to yubikey_commands. -- The configuration can be read from a Yubikey-4 but not be written. The mode command is also not useful because it allows only the selection of transports. It does not allow to disable single applications based on one transport (like OPGP and PIV). Thsi patch shows an appropriate error message. Signed-off-by: Werner Koch <[email protected]>
* card: Allow PEM encoded certificates in "writecert".Werner Koch2019-03-061-0/+14
| | | | | | * tools/gpg-card.c (cmd_writecert): Convert from base64. Signed-off-by: Werner Koch <[email protected]>
* card: Print the keyref also for non-initialized slots.Werner Koch2019-03-061-21/+12
| | | | | | | | * tools/gpg-card.c (list_one_kinfo): Add arg label_keyref and change callers. -- Signed-off-by: Werner Koch <[email protected]>
* card: Print card version. Check for bad Yubikeys.Werner Koch2019-03-051-6/+34
| | | | | | | | | | | | | | | * scd/app.c (app_new_register): Set card version for Yubikeys. (app_write_learn_status): Print CARDVERSION and APPVERSION. * tools/card-call-scd.c (learn_status_cb): Detect them. * tools/gpg-card.h (struct card_info_s): Add appversion and cardversion. * tools/gpg-card.c (list_openpgp): Remove version printing from serial number. (print_a_version): New. (list_card): Print card and app version. (cmd_generate): Do not allow broken Yubikeys. Signed-off-by: Werner Koch <[email protected]>
* scd:piv: Implement import of private keys for Yubikeys.Werner Koch2019-03-051-4/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-piv.c (concat_tlv_list): Add arg 'secure' and adjust callers. (writekey_rsa, writekey_ecc): New. (do_writekey): New. (do_writecert): Provide a better error message for an empty cert. (app_select_piv): Register do_writekey. * scd/iso7816.c (iso7816_send_apdu): New. * scd/app-common.h (APP_WRITEKEY_FLAG_FORCE): New. * agent/command.c (cmd_keytocard): Make the timestamp optional. * tools/card-call-scd.c (inq_writekey_parms): Remove. (scd_writekey): Rewrite. * tools/gpg-card.c (cmd_writekey): New. (enum cmdids): Add cmdWRITEKEY. (dispatch_command, interactive_loop): Call cmd_writekey. -- This has been tested with gpgsm and RSA keys. For ECC keys only partly tested using the sample OpenPGP nistp256 and nistp384 keys because gpgsm does not yet support ECC certificates and thus we can't write the certificates to the cert object after a writekey. Note that they nevertheless show up in "gpgcard list" because gpg-card searches for them in gpg and gpgsm. However, this does not work completely. Signed-off-by: Werner Koch <[email protected]>
* card: Remove the "admin" command.Werner Koch2019-03-011-114/+67
| | | | | | | | | | | | | | * tools/gpg-card.c (cmd_passwd): Remove arg allow_admin. (enum cmdids): Rename cmdAUTHENTICATE to cmdAUTH and cmdFACTORYRESET to cmdFACTRST. (cmds): Remove column 'admin_only'. (interactive_loop): Remove admin_only stuff. -- That command has always been an annoyance. Symbols have been renamed for source cosmetics. Signed-off-by: Werner Koch <[email protected]>
* card: Rename gpg-card-tool to gpg-card.Werner Koch2019-02-251-0/+3452
* tools/card-tool-keys.c: Rename to card-keys.c. * tools/card-tool-misc.c: Rename to card-misc.c. * tools/card-tool-yubikey.c: Rename to card-yubikey.c. * tools/card-tool.h: Rename to gpg-card.h. * tools/gpg-card-tool-w32info.rc: Rename to gpg-card-w32info.rc * doc/card-tool.texi: Rename top gpg-card.texi Signed-off-by: Werner Koch <[email protected]>