summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keyscan.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-08-31 11:54:45 +0000
committerdjm <djm@openbsd.org>2010-08-31 11:54:45 +0000
commitf6c050330e4dc3006a2e35a95631a28ac664b4a2 (patch)
treee4cd3aea0a8d352dad72a59862bdc5f85fa4eac6 /usr.bin/ssh/ssh-keyscan.c
parentWIP suspend/resume support for loongson lemote. Okay miod@. (diff)
downloadwireguard-openbsd-f6c050330e4dc3006a2e35a95631a28ac664b4a2.tar.xz
wireguard-openbsd-f6c050330e4dc3006a2e35a95631a28ac664b4a2.zip
Implement Elliptic Curve Cryptography modes for key exchange (ECDH) and
host/user keys (ECDSA) as specified by RFC5656. ECDH and ECDSA offer better performance than plain DH and DSA at the same equivalent symmetric key length, as well as much shorter keys. Only the mandatory sections of RFC5656 are implemented, specifically the three REQUIRED curves nistp256, nistp384 and nistp521 and only ECDH and ECDSA. Point compression (optional in RFC5656 is NOT implemented). Certificate host and user keys using the new ECDSA key types are supported. Note that this code has not been tested for interoperability and may be subject to change. feedback and ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh-keyscan.c')
-rw-r--r--usr.bin/ssh/ssh-keyscan.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c
index 586ca5f3aa0..8acca49413b 100644
--- a/usr.bin/ssh/ssh-keyscan.c
+++ b/usr.bin/ssh/ssh-keyscan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.82 2010/06/22 04:54:30 djm Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.83 2010/08/31 11:54:45 djm Exp $ */
/*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
*
@@ -47,9 +47,10 @@ int IPv4or6 = AF_UNSPEC;
int ssh_port = SSH_DEFAULT_PORT;
-#define KT_RSA1 1
-#define KT_DSA 2
-#define KT_RSA 4
+#define KT_RSA1 1
+#define KT_DSA 2
+#define KT_RSA 4
+#define KT_ECDSA 8
int get_keytypes = KT_RSA; /* Get only RSA keys by default */
@@ -236,6 +237,7 @@ keygrab_ssh2(con *c)
c->c_kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client;
c->c_kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
c->c_kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
+ c->c_kex->kex[KEX_ECDH_SHA2] = kexecdh_client;
c->c_kex->verify_host_key = hostjump;
if (!(j = setjmp(kexjmp))) {
@@ -655,6 +657,9 @@ main(int argc, char **argv)
case KEY_DSA:
get_keytypes |= KT_DSA;
break;
+ case KEY_ECDSA:
+ get_keytypes |= KT_ECDSA;
+ break;
case KEY_RSA:
get_keytypes |= KT_RSA;
break;