summaryrefslogtreecommitdiffhomepage
path: root/svr-runopts.c
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@users.noreply.github.com>2020-03-11 21:09:45 +0500
committerGitHub <noreply@github.com>2020-03-12 00:09:45 +0800
commit3d12521735e7ef7e48be217af0f27d68e23050a7 (patch)
tree5e6a8afcc2ff403d235f0157095db5b80aa173b3 /svr-runopts.c
parentb2007beeb0203c8f9f3d6d07329d0d1fceea91c7 (diff)
Add Ed25519 support (#91)
* Add support for Ed25519 as a public key type Ed25519 is a elliptic curve signature scheme that offers better security than ECDSA and DSA and good performance. It may be used for both user and host keys. OpenSSH key import and fuzzer are not supported yet. Initially inspired by Peter Szabo. * Add curve25519 and ed25519 fuzzers * Add import and export of Ed25519 keys
Diffstat (limited to 'svr-runopts.c')
-rw-r--r--svr-runopts.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/svr-runopts.c b/svr-runopts.c
index d7a0d5a..d430825 100644
--- a/svr-runopts.c
+++ b/svr-runopts.c
@@ -57,6 +57,9 @@ static void printhelp(const char * progname) {
#if DROPBEAR_ECDSA
" - ecdsa %s\n"
#endif
+#if DROPBEAR_ED25519
+ " - ed25519 %s\n"
+#endif
#if DROPBEAR_DELAY_HOSTKEY
"-R Create hostkeys as required\n"
#endif
@@ -117,6 +120,9 @@ static void printhelp(const char * progname) {
#if DROPBEAR_ECDSA
ECDSA_PRIV_FILENAME,
#endif
+#if DROPBEAR_ED25519
+ ED25519_PRIV_FILENAME,
+#endif
MAX_AUTH_TRIES,
DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE,
DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT);
@@ -538,6 +544,13 @@ static void loadhostkey(const char *keyfile, int fatal_duplicate) {
}
#endif
#endif /* DROPBEAR_ECDSA */
+
+#if DROPBEAR_ED25519
+ if (type == DROPBEAR_SIGNKEY_ED25519) {
+ loadhostkey_helper("ed25519", (void**)&read_key->ed25519key, (void**)&svr_opts.hostkey->ed25519key, fatal_duplicate);
+ }
+#endif
+
sign_key_free(read_key);
TRACE(("leave loadhostkey"))
}
@@ -579,6 +592,9 @@ void load_all_hostkeys() {
#if DROPBEAR_ECDSA
loadhostkey(ECDSA_PRIV_FILENAME, 0);
#endif
+#if DROPBEAR_ED25519
+ loadhostkey(ED25519_PRIV_FILENAME, 0);
+#endif
}
#if DROPBEAR_RSA
@@ -642,6 +658,14 @@ void load_all_hostkeys() {
#endif
#endif /* DROPBEAR_ECDSA */
+#if DROPBEAR_ED25519
+ if (!svr_opts.delay_hostkey && !svr_opts.hostkey->ed25519key) {
+ disablekey(DROPBEAR_SIGNKEY_ED25519);
+ } else {
+ any_keys = 1;
+ }
+#endif
+
if (!any_keys) {
dropbear_exit("No hostkeys available. 'dropbear -R' may be useful or run dropbearkey.");
}