From d7d75da50543bc7259c5a6e6367b58cbca7f1b7b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 11 Feb 2020 14:49:11 +0100 Subject: scd:openpgp: Allow auto-changing of the key attributes in genkey. * scd/app-openpgp.c (struct app_local_s): Add field keyalgo. (parse_algorithm_attribute): Store the new keyalgo field. (change_keyattr): Change info message. (change_keyattr_from_string): Rewrite to also accept a keyref and a keyalgo string. (do_genkey): Change the keyattr if a keyalgo string is given. -- Having this feature makes it easier to use OpenPGP cards in a similar way to other cards. Note that the explicit changing via SETATTR is still supported. Signed-off-by: Werner Koch --- scd/command.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scd/command.c') diff --git a/scd/command.c b/scd/command.c index 60904429c..527fb9385 100644 --- a/scd/command.c +++ b/scd/command.c @@ -1363,7 +1363,7 @@ cmd_writekey (assuan_context_t ctx, char *line) static const char hlp_genkey[] = - "GENKEY [--force] [--timestamp=] \n" + "GENKEY [--force] [--timestamp=] [--algo=ALGO] \n" "\n" "Generate a key on-card identified by , which is application\n" "specific. Return values are also application specific. For OpenPGP\n" @@ -1385,6 +1385,9 @@ static const char hlp_genkey[] = "value. The value needs to be in ISO Format; e.g.\n" "\"--timestamp=20030316T120000\" and after 1970-01-01 00:00:00.\n" "\n" + "The option --algo can be used to request creation using a specific\n" + "algorithm. The possible algorithms are card dependent.\n" + "\n" "The public part of the key can also later be retrieved using the\n" "READKEY command."; static gpg_error_t @@ -1562,7 +1565,7 @@ static const char hlp_checkpin[] = " entry system, only the regular CHV will get blocked and not the\n" " dangerous CHV3. IDSTR is the usual card's serial number in hex\n" " notation; an optional fingerprint part will get ignored. There\n" - " is however a special mode if the IDSTR is sffixed with the\n" + " is however a special mode if the IDSTR is suffixed with the\n" " literal string \"[CHV3]\": In this case the Admin PIN is checked\n" " if and only if the retry counter is still at 3.\n" "\n" -- cgit v1.2.3