mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg: Allow use of "default" algo for--quick-addkey.
* g10/keygen.c (quick_generate_keypair): Write a status error. (parse_algo_usage_expire): Set a default curve. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
30a011cfd6
commit
0fd332bc1f
@ -3614,6 +3614,7 @@ quick_generate_keypair (ctrl_t ctrl, const char *uid, const char *algostr,
|
|||||||
|| !cpr_get_answer_is_yes_def ("quick_keygen.force",
|
|| !cpr_get_answer_is_yes_def ("quick_keygen.force",
|
||||||
_("Create anyway? (y/N) "), 0))
|
_("Create anyway? (y/N) "), 0))
|
||||||
{
|
{
|
||||||
|
write_status_error ("genkey", gpg_error (304));
|
||||||
log_inc_errorcount (); /* we used log_info */
|
log_inc_errorcount (); /* we used log_info */
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -4457,12 +4458,14 @@ parse_algo_usage_expire (ctrl_t ctrl, int for_subkey,
|
|||||||
algo = for_subkey? DEFAULT_STD_SUBALGO : DEFAULT_STD_ALGO;
|
algo = for_subkey? DEFAULT_STD_SUBALGO : DEFAULT_STD_ALGO;
|
||||||
use = for_subkey? DEFAULT_STD_SUBKEYUSE : DEFAULT_STD_KEYUSE;
|
use = for_subkey? DEFAULT_STD_SUBKEYUSE : DEFAULT_STD_KEYUSE;
|
||||||
nbits = for_subkey? DEFAULT_STD_SUBKEYSIZE : DEFAULT_STD_KEYSIZE;
|
nbits = for_subkey? DEFAULT_STD_SUBKEYSIZE : DEFAULT_STD_KEYSIZE;
|
||||||
|
curve = for_subkey? DEFAULT_STD_SUBCURVE : DEFAULT_STD_CURVE;
|
||||||
}
|
}
|
||||||
else if (!strcmp (algostr, "future-default"))
|
else if (!strcmp (algostr, "future-default"))
|
||||||
{
|
{
|
||||||
algo = for_subkey? FUTURE_STD_SUBALGO : FUTURE_STD_ALGO;
|
algo = for_subkey? FUTURE_STD_SUBALGO : FUTURE_STD_ALGO;
|
||||||
use = for_subkey? FUTURE_STD_SUBKEYUSE : FUTURE_STD_KEYUSE;
|
use = for_subkey? FUTURE_STD_SUBKEYUSE : FUTURE_STD_KEYUSE;
|
||||||
nbits = for_subkey? FUTURE_STD_SUBKEYSIZE : FUTURE_STD_KEYSIZE;
|
nbits = for_subkey? FUTURE_STD_SUBKEYSIZE : FUTURE_STD_KEYSIZE;
|
||||||
|
curve = for_subkey? FUTURE_STD_SUBCURVE : FUTURE_STD_CURVE;
|
||||||
}
|
}
|
||||||
else if (*algostr == '&' && strlen (algostr) == 41)
|
else if (*algostr == '&' && strlen (algostr) == 41)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user