summaryrefslogtreecommitdiff
path: root/kex.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-11-04 08:26:52 +1100
committerDamien Miller <djm@mindrot.org>2013-11-04 08:26:52 +1100
commit1e1242604eb0fd510fe93f81245c529237ffc513 (patch)
treed15eb5e9442cd3d812d6ade20775864f1600825a /kex.h
parentd2252c79191d069372ed6effce7c7a2de93448cd (diff)
- markus@cvs.openbsd.org 2013/11/02 21:59:15
[kex.c kex.h myproposal.h ssh-keyscan.c sshconnect2.c sshd.c] use curve25519 for default key exchange (curve25519-sha256@libssh.org); initial patch from Aris Adamantiadis; ok djm@
Diffstat (limited to 'kex.h')
-rw-r--r--kex.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/kex.h b/kex.h
index 9f1e1adb3..0f67f5934 100644
--- a/kex.h
+++ b/kex.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.h,v 1.56 2013/07/19 07:37:48 markus Exp $ */ 1/* $OpenBSD: kex.h,v 1.57 2013/11/02 21:59:15 markus 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.
@@ -43,6 +43,7 @@
43#define KEX_ECDH_SHA2_NISTP256 "ecdh-sha2-nistp256" 43#define KEX_ECDH_SHA2_NISTP256 "ecdh-sha2-nistp256"
44#define KEX_ECDH_SHA2_NISTP384 "ecdh-sha2-nistp384" 44#define KEX_ECDH_SHA2_NISTP384 "ecdh-sha2-nistp384"
45#define KEX_ECDH_SHA2_NISTP521 "ecdh-sha2-nistp521" 45#define KEX_ECDH_SHA2_NISTP521 "ecdh-sha2-nistp521"
46#define KEX_CURVE25519_SHA256 "curve25519-sha256@libssh.org"
46 47
47#define COMP_NONE 0 48#define COMP_NONE 0
48#define COMP_ZLIB 1 49#define COMP_ZLIB 1
@@ -74,6 +75,7 @@ enum kex_exchange {
74 KEX_DH_GEX_SHA1, 75 KEX_DH_GEX_SHA1,
75 KEX_DH_GEX_SHA256, 76 KEX_DH_GEX_SHA256,
76 KEX_ECDH_SHA2, 77 KEX_ECDH_SHA2,
78 KEX_C25519_SHA256,
77 KEX_MAX 79 KEX_MAX
78}; 80};
79 81
@@ -161,6 +163,8 @@ void kexgex_client(Kex *);
161void kexgex_server(Kex *); 163void kexgex_server(Kex *);
162void kexecdh_client(Kex *); 164void kexecdh_client(Kex *);
163void kexecdh_server(Kex *); 165void kexecdh_server(Kex *);
166void kexc25519_client(Kex *);
167void kexc25519_server(Kex *);
164 168
165void 169void
166kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int, 170kex_dh_hash(char *, char *, char *, int, char *, int, u_char *, int,
@@ -175,6 +179,19 @@ kex_ecdh_hash(const EVP_MD *, const EC_GROUP *, char *, char *, char *, int,
175 char *, int, u_char *, int, const EC_POINT *, const EC_POINT *, 179 char *, int, u_char *, int, const EC_POINT *, const EC_POINT *,
176 const BIGNUM *, u_char **, u_int *); 180 const BIGNUM *, u_char **, u_int *);
177#endif 181#endif
182void
183kex_c25519_hash(const EVP_MD *, char *, char *, char *, int,
184 char *, int, u_char *, int, const u_char *, const u_char *,
185 const BIGNUM *, u_char **, u_int *);
186
187#define CURVE25519_SIZE 32
188void kexc25519_keygen(u_char[CURVE25519_SIZE], u_char[CURVE25519_SIZE])
189 __attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
190 __attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)));
191BIGNUM *kexc25519_shared_key(const u_char[CURVE25519_SIZE],
192 const u_char[CURVE25519_SIZE])
193 __attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
194 __attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)));
178 195
179void 196void
180derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]); 197derive_ssh1_session_id(BIGNUM *, BIGNUM *, u_int8_t[8], u_int8_t[16]);