aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-scd.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-03-05 14:49:20 +0000
committerWerner Koch <[email protected]>2019-03-05 14:49:20 +0000
commite897e1e255ef9870dfd1639d6f4e97bdf4e83b34 (patch)
tree5571c7633161ca25697fa7222ea8ec64f50091ce /agent/call-scd.c
parentgpg: Make invalid primary key algos obvious in key listings. (diff)
downloadgnupg-e897e1e255ef9870dfd1639d6f4e97bdf4e83b34.tar.gz
gnupg-e897e1e255ef9870dfd1639d6f4e97bdf4e83b34.zip
scd:piv: Implement import of private keys for Yubikeys.
* 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]>
Diffstat (limited to 'agent/call-scd.c')
-rw-r--r--agent/call-scd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 1189bd477..4c0186d74 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -1088,7 +1088,8 @@ agent_card_writekey (ctrl_t ctrl, int force, const char *serialno,
char line[ASSUAN_LINELENGTH];
struct inq_needpin_parm_s parms;
- (void)serialno;
+ (void)serialno; /* NULL or a number to check for the correct card.
+ * But is is not implemented. */
err = start_scd (ctrl);
if (err)