mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-09 12:54:23 +01:00
gpg: Allow "futuredefault" as alias for "future-default".
* g10/keygen.c (parse_key_parameter_string): Allow "futuredefault" and use case-insensitive matching (quick_generate_keypair): Ditto. (parse_algo_usage_expire): Ditto. -- The man page is sometimes rendered in a way that the hyphen may be not be considered as part of the string. And while at it we also allow case-insensitivity. GnuPG-bug-id: 3655 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
412bb7a801
commit
4d3c500f47
14
g10/keygen.c
14
g10/keygen.c
@ -3153,9 +3153,10 @@ parse_key_parameter_string (const char *string, int part,
|
|||||||
*r_subcurve = NULL;
|
*r_subcurve = NULL;
|
||||||
|
|
||||||
if (!string || !*string
|
if (!string || !*string
|
||||||
|| !strcmp (string, "default") || !strcmp (string, "-"))
|
|| !ascii_strcasecmp (string, "default") || !strcmp (string, "-"))
|
||||||
string = get_default_pubkey_algo ();
|
string = get_default_pubkey_algo ();
|
||||||
else if (!strcmp (string, "future-default"))
|
else if (!ascii_strcasecmp (string, "future-default")
|
||||||
|
|| !ascii_strcasecmp (string, "futuredefault"))
|
||||||
string = FUTURE_STD_KEY_PARAM;
|
string = FUTURE_STD_KEY_PARAM;
|
||||||
|
|
||||||
primary = xstrdup (string);
|
primary = xstrdup (string);
|
||||||
@ -3984,9 +3985,10 @@ quick_generate_keypair (ctrl_t ctrl, const char *uid, const char *algostr,
|
|||||||
if (!*expirestr || strcmp (expirestr, "-") == 0)
|
if (!*expirestr || strcmp (expirestr, "-") == 0)
|
||||||
expirestr = default_expiration_interval;
|
expirestr = default_expiration_interval;
|
||||||
|
|
||||||
if ((!*algostr || !strcmp (algostr, "default")
|
if ((!*algostr || !ascii_strcasecmp (algostr, "default")
|
||||||
|| !strcmp (algostr, "future-default"))
|
|| !ascii_strcasecmp (algostr, "future-default")
|
||||||
&& (!*usagestr || !strcmp (usagestr, "default")
|
|| !ascii_strcasecmp (algostr, "futuredefault"))
|
||||||
|
&& (!*usagestr || !ascii_strcasecmp (usagestr, "default")
|
||||||
|| !strcmp (usagestr, "-")))
|
|| !strcmp (usagestr, "-")))
|
||||||
{
|
{
|
||||||
/* Use default key parameters. */
|
/* Use default key parameters. */
|
||||||
@ -4928,7 +4930,7 @@ parse_algo_usage_expire (ctrl_t ctrl, int for_subkey,
|
|||||||
|
|
||||||
/* Parse the usage string. */
|
/* Parse the usage string. */
|
||||||
if (!usagestr || !*usagestr
|
if (!usagestr || !*usagestr
|
||||||
|| !strcmp (usagestr, "default") || !strcmp (usagestr, "-"))
|
|| !ascii_strcasecmp (usagestr, "default") || !strcmp (usagestr, "-"))
|
||||||
; /* Keep usage from parse_key_parameter_string. */
|
; /* Keep usage from parse_key_parameter_string. */
|
||||||
else if ((wantuse = parse_usagestr (usagestr)) != -1)
|
else if ((wantuse = parse_usagestr (usagestr)) != -1)
|
||||||
use = wantuse;
|
use = wantuse;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user