summaryrefslogtreecommitdiff
path: root/kex.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-08-31 22:41:14 +1000
committerDamien Miller <djm@mindrot.org>2010-08-31 22:41:14 +1000
commiteb8b60e320cdade9f4c07e2abacfb92c52e01348 (patch)
tree4e5bc25790566402e5b7ae00cefd2c57e867ef09 /kex.h
parentda108ece6843f1268aa36d7c8ed0030dc53acd15 (diff)
- djm@cvs.openbsd.org 2010/08/31 11:54:45
[PROTOCOL PROTOCOL.agent PROTOCOL.certkeys auth2-jpake.c authfd.c] [authfile.c buffer.h dns.c kex.c kex.h key.c key.h monitor.c] [monitor_wrap.c myproposal.h packet.c packet.h pathnames.h readconf.c] [ssh-add.1 ssh-add.c ssh-agent.1 ssh-agent.c ssh-keygen.1 ssh-keygen.c] [ssh-keyscan.1 ssh-keyscan.c ssh-keysign.8 ssh.1 ssh.c ssh2.h] [ssh_config.5 sshconnect.c sshconnect2.c sshd.8 sshd.c sshd_config.5] [uuencode.c uuencode.h bufec.c kexecdh.c kexecdhc.c kexecdhs.c ssh-ecdsa.c] 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 'kex.h')
-rw-r--r--kex.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/kex.h b/kex.h
index 62fa2ea50..a183ffda2 100644
--- a/kex.h
+++ b/kex.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.h,v 1.49 2010/02/26 20:29:54 djm Exp $ */ 1/* $OpenBSD: kex.h,v 1.50 2010/08/31 11:54:45 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -29,6 +29,7 @@
29#include <signal.h> 29#include <signal.h>
30#include <openssl/evp.h> 30#include <openssl/evp.h>
31#include <openssl/hmac.h> 31#include <openssl/hmac.h>
32#include <openssl/ec.h>
32 33
33#define KEX_COOKIE_LEN 16 34#define KEX_COOKIE_LEN 16
34 35
@@ -37,6 +38,8 @@
37#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1" 38#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1"
38#define KEX_DHGEX_SHA256 "diffie-hellman-group-exchange-sha256" 39#define KEX_DHGEX_SHA256 "diffie-hellman-group-exchange-sha256"
39#define KEX_RESUME "resume@appgate.com" 40#define KEX_RESUME "resume@appgate.com"
41/* The following represents the family of ECDH methods */
42#define KEX_ECDH_SHA256 "ecdh-sha2-"
40 43
41#define COMP_NONE 0 44#define COMP_NONE 0
42#define COMP_ZLIB 1 45#define COMP_ZLIB 1
@@ -67,6 +70,7 @@ enum kex_exchange {
67 KEX_DH_GRP14_SHA1, 70 KEX_DH_GRP14_SHA1,
68 KEX_DH_GEX_SHA1, 71 KEX_DH_GEX_SHA1,
69 KEX_DH_GEX_SHA256, 72 KEX_DH_GEX_SHA256,
73 KEX_ECDH_SHA2,
70 KEX_MAX 74 KEX_MAX
71}; 75};
72 76
@@ -145,6 +149,8 @@ void kexdh_client(Kex *);
145void kexdh_server(Kex *); 149void kexdh_server(Kex *);
146void kexgex_client(Kex *); 150void kexgex_client(Kex *);
147void kexgex_server(Kex *); 151void kexgex_server(Kex *);
152void kexecdh_client(Kex *);
153void kexecdh_server(Kex *);
148 154
149void 155void
150kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int, 156kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int,
@@ -153,11 +159,17 @@ void
153kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, 159kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *,
154 int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, 160 int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *,
155 BIGNUM *, BIGNUM *, u_char **, u_int *); 161 BIGNUM *, BIGNUM *, u_char **, u_int *);
162void
163kex_ecdh_hash(const EVP_MD *, const EC_GROUP *, char *, char *, char *, int,
164 char *, int, u_char *, int, const EC_POINT *, const EC_POINT *,
165 const BIGNUM *, u_char **, u_int *);
166
167int kex_ecdh_name_to_nid(const char *);
156 168
157void 169void
158derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]); 170derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]);
159 171
160#if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) 172#if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) || defined(DEBUG_KEXECDH)
161void dump_digest(char *, u_char *, int); 173void dump_digest(char *, u_char *, int);
162#endif 174#endif
163 175