summaryrefslogtreecommitdiff
path: root/kex.h
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2011-01-24 11:46:57 +0000
committerColin Watson <cjwatson@debian.org>2011-01-24 11:46:57 +0000
commit0970072c89b079b022538e3c366fbfa2c53fc821 (patch)
treeb7024712d74234bb5a8b036ccbc9109e2e211296 /kex.h
parent4e8aa4da57000c7bba8e5c49163bc0c0ca383f78 (diff)
parent478ff799463ca926a8dfbabf058f4e84aaffc65a (diff)
merge 5.7p1
Diffstat (limited to 'kex.h')
-rw-r--r--kex.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/kex.h b/kex.h
index d2668b149..fa50b2ccb 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.52 2010/09/22 05:01:29 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,9 @@
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#ifdef OPENSSL_HAS_ECC
33#include <openssl/ec.h>
34#endif
32 35
33#define KEX_COOKIE_LEN 16 36#define KEX_COOKIE_LEN 16
34 37
@@ -37,6 +40,8 @@
37#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1" 40#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1"
38#define KEX_DHGEX_SHA256 "diffie-hellman-group-exchange-sha256" 41#define KEX_DHGEX_SHA256 "diffie-hellman-group-exchange-sha256"
39#define KEX_RESUME "resume@appgate.com" 42#define KEX_RESUME "resume@appgate.com"
43/* The following represents the family of ECDH methods */
44#define KEX_ECDH_SHA2_STEM "ecdh-sha2-"
40 45
41#define COMP_NONE 0 46#define COMP_NONE 0
42#define COMP_ZLIB 1 47#define COMP_ZLIB 1
@@ -67,6 +72,7 @@ enum kex_exchange {
67 KEX_DH_GRP14_SHA1, 72 KEX_DH_GRP14_SHA1,
68 KEX_DH_GEX_SHA1, 73 KEX_DH_GEX_SHA1,
69 KEX_DH_GEX_SHA256, 74 KEX_DH_GEX_SHA256,
75 KEX_ECDH_SHA2,
70 KEX_GSS_GRP1_SHA1, 76 KEX_GSS_GRP1_SHA1,
71 KEX_GSS_GRP14_SHA1, 77 KEX_GSS_GRP14_SHA1,
72 KEX_GSS_GEX_SHA1, 78 KEX_GSS_GEX_SHA1,
@@ -141,6 +147,8 @@ struct Kex {
141 void (*kex[KEX_MAX])(Kex *); 147 void (*kex[KEX_MAX])(Kex *);
142}; 148};
143 149
150int kex_names_valid(const char *);
151
144Kex *kex_setup(char *[PROPOSAL_MAX]); 152Kex *kex_setup(char *[PROPOSAL_MAX]);
145void kex_finish(Kex *); 153void kex_finish(Kex *);
146 154
@@ -154,6 +162,8 @@ void kexdh_client(Kex *);
154void kexdh_server(Kex *); 162void kexdh_server(Kex *);
155void kexgex_client(Kex *); 163void kexgex_client(Kex *);
156void kexgex_server(Kex *); 164void kexgex_server(Kex *);
165void kexecdh_client(Kex *);
166void kexecdh_server(Kex *);
157 167
158#ifdef GSSAPI 168#ifdef GSSAPI
159void kexgss_client(Kex *); 169void kexgss_client(Kex *);
@@ -167,11 +177,22 @@ void
167kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, 177kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *,
168 int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *, 178 int, u_char *, int, int, int, int, BIGNUM *, BIGNUM *, BIGNUM *,
169 BIGNUM *, BIGNUM *, u_char **, u_int *); 179 BIGNUM *, BIGNUM *, u_char **, u_int *);
180#ifdef OPENSSL_HAS_ECC
181void
182kex_ecdh_hash(const EVP_MD *, const EC_GROUP *, char *, char *, char *, int,
183 char *, int, u_char *, int, const EC_POINT *, const EC_POINT *,
184 const BIGNUM *, u_char **, u_int *);
185int kex_ecdh_name_to_nid(const char *);
186const EVP_MD *kex_ecdh_name_to_evpmd(const char *);
187#else
188# define kex_ecdh_name_to_nid(x) (-1)
189# define kex_ecdh_name_to_evpmd(x) (NULL)
190#endif
170 191
171void 192void
172derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]); 193derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]);
173 194
174#if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) 195#if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) || defined(DEBUG_KEXECDH)
175void dump_digest(char *, u_char *, int); 196void dump_digest(char *, u_char *, int);
176#endif 197#endif
177 198