From 20ca075d9605e27e25a780bcc465c7371400ca61 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 28 Jun 2016 15:49:11 +0200 Subject: [PATCH] gpg: Add hack to --quick-gen-key to create Curve25519 keys. * g10/keygen.c (quick_generate_keypair): Add special algo string "test-default". -- Well, this is a hack to quickly create keys with the algorithms we will eventually use as defaults. Usage: gpg -v --quick-gen-key --passphrase '' --batch USERID test-default Signed-off-by: Werner Koch --- g10/keygen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/g10/keygen.c b/g10/keygen.c index b7c8e83ac..c5612756c 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -3610,7 +3610,13 @@ quick_generate_keypair (ctrl_t ctrl, const char *uid, const char *algostr, } } - if (*algostr || *usagestr || *expirestr) + + if (!strcmp (algostr, "test-default")) + { + para = quickgen_set_para (para, 0, PUBKEY_ALGO_EDDSA, 0, "Ed25519", 0); + para = quickgen_set_para (para, 1, PUBKEY_ALGO_ECDH, 0, "Curve25519", 0); + } + else if (*algostr || *usagestr || *expirestr) { /* Extended unattended mode. Creates only the primary key. */ int algo;