summaryrefslogtreecommitdiffstats
path: root/kexecdh.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-09-24 14:11:14 +0200
committerDamien Miller <djm@mindrot.org>2010-09-24 14:11:14 +0200
commitd5f62bf280b0798d7009d4424594a648a4e887fb (patch)
tree5f18078ea61f6c5503dc4addfb2f17d13844692c /kexecdh.c
parent - djm@cvs.openbsd.org 2010/09/20 07:19:27 (diff)
downloadopenssh-d5f62bf280b0798d7009d4424594a648a4e887fb.tar.xz
openssh-d5f62bf280b0798d7009d4424594a648a4e887fb.zip
- djm@cvs.openbsd.org 2010/09/22 05:01:30
[kex.c kex.h kexecdh.c kexecdhc.c kexecdhs.c readconf.c readconf.h] [servconf.c servconf.h ssh_config.5 sshconnect2.c sshd.c sshd_config.5] add a KexAlgorithms knob to the client and server configuration to allow selection of which key exchange methods are used by ssh(1) and sshd(8) and their order of preference. ok markus@
Diffstat (limited to 'kexecdh.c')
-rw-r--r--kexecdh.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/kexecdh.c b/kexecdh.c
index 4c58a5122..f13f69d3b 100644
--- a/kexecdh.c
+++ b/kexecdh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexecdh.c,v 1.2 2010/09/09 10:45:45 djm Exp $ */
+/* $OpenBSD: kexecdh.c,v 1.3 2010/09/22 05:01:29 djm Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2010 Damien Miller. All rights reserved.
@@ -48,15 +48,9 @@
int
kex_ecdh_name_to_nid(const char *kexname)
{
- int ret;
-
if (strlen(kexname) < sizeof(KEX_ECDH_SHA2_STEM) - 1)
fatal("%s: kexname too short \"%s\"", __func__, kexname);
- ret = key_curve_name_to_nid(kexname + sizeof(KEX_ECDH_SHA2_STEM) - 1);
- if (ret == -1)
- fatal("%s: unsupported curve negotiated \"%s\"", __func__,
- kexname);
- return ret;
+ return key_curve_name_to_nid(kexname + sizeof(KEX_ECDH_SHA2_STEM) - 1);
}
const EVP_MD *
@@ -64,6 +58,8 @@ kex_ecdh_name_to_evpmd(const char *kexname)
{
int nid = kex_ecdh_name_to_nid(kexname);
+ if (nid == -1)
+ fatal("%s: unsupported ECDH curve \"%s\"", __func__, kexname);
return key_ec_nid_to_evpmd(nid);
}