1 From ec26975d442163b66d1646a48e022bc8c2f1607a Mon Sep 17 00:00:00 2001
2 From: Sergey Ponomarev <stokito@gmail.com>
3 Date: Sun, 27 Aug 2023 00:07:05 +0300
4 Subject: dropbearkey.c Ignore unsupported command line options
6 To generate non interactively a key with OpenSSH the simplest command is:
8 ssh-keygen -t ed25519 -q -N '' -f ~/.ssh/id_ed25519
10 The command has two options -q quiet and -N passphrase which aren't supported by the dropbearkey.
12 To improve interoperability add explicit ignoring of the -q and -N with empty passphrase.
13 Also ignore the -v even if the DEBUG_TRACE is not set.
15 Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
17 dropbearkey.c | 15 +++++++++++++--
18 1 file changed, 13 insertions(+), 2 deletions(-)
22 @@ -159,6 +159,7 @@ int main(int argc, char ** argv) {
23 enum signkey_type keytype = DROPBEAR_SIGNKEY_NONE;
24 char * typetext = NULL;
25 char * sizetext = NULL;
26 + char * passphrase = NULL;
27 unsigned int bits = 0, genbits;
30 @@ -194,11 +195,16 @@ int main(int argc, char ** argv) {
37 debug_trace = DROPBEAR_VERBOSE_LEVEL;
42 + break; /* quiet is default */
47 fprintf(stderr, "Unknown argument %s\n", argv[i]);
49 @@ -266,6 +272,11 @@ int main(int argc, char ** argv) {
50 check_signkey_bits(keytype, bits);;
53 + if (passphrase && *passphrase != '\0') {
54 + fprintf(stderr, "Only empty passphrase is supported\n");
58 genbits = signkey_generate_get_bits(keytype, bits);
59 fprintf(stderr, "Generating %u bit %s key, this may take a while...\n", genbits, typetext);
60 if (signkey_generate(keytype, bits, filename, 0) == DROPBEAR_FAILURE)