diff options
author | Colin Watson <cjwatson@debian.org> | 2011-01-24 11:46:57 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2011-01-24 11:46:57 +0000 |
commit | 0970072c89b079b022538e3c366fbfa2c53fc821 (patch) | |
tree | b7024712d74234bb5a8b036ccbc9109e2e211296 /kex.h | |
parent | 4e8aa4da57000c7bba8e5c49163bc0c0ca383f78 (diff) | |
parent | 478ff799463ca926a8dfbabf058f4e84aaffc65a (diff) |
merge 5.7p1
Diffstat (limited to 'kex.h')
-rw-r--r-- | kex.h | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -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 | ||
150 | int kex_names_valid(const char *); | ||
151 | |||
144 | Kex *kex_setup(char *[PROPOSAL_MAX]); | 152 | Kex *kex_setup(char *[PROPOSAL_MAX]); |
145 | void kex_finish(Kex *); | 153 | void kex_finish(Kex *); |
146 | 154 | ||
@@ -154,6 +162,8 @@ void kexdh_client(Kex *); | |||
154 | void kexdh_server(Kex *); | 162 | void kexdh_server(Kex *); |
155 | void kexgex_client(Kex *); | 163 | void kexgex_client(Kex *); |
156 | void kexgex_server(Kex *); | 164 | void kexgex_server(Kex *); |
165 | void kexecdh_client(Kex *); | ||
166 | void kexecdh_server(Kex *); | ||
157 | 167 | ||
158 | #ifdef GSSAPI | 168 | #ifdef GSSAPI |
159 | void kexgss_client(Kex *); | 169 | void kexgss_client(Kex *); |
@@ -167,11 +177,22 @@ void | |||
167 | kexgex_hash(const EVP_MD *, char *, char *, char *, int, char *, | 177 | kexgex_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 | ||
181 | void | ||
182 | kex_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 *); | ||
185 | int kex_ecdh_name_to_nid(const char *); | ||
186 | const 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 | ||
171 | void | 192 | void |
172 | derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]); | 193 | derive_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) |
175 | void dump_digest(char *, u_char *, int); | 196 | void dump_digest(char *, u_char *, int); |
176 | #endif | 197 | #endif |
177 | 198 | ||