diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-04 01:56:17 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-04-04 01:56:17 +0000 |
commit | 20d7c7b02c92c28007dba8b08e617a415146d1df (patch) | |
tree | 8b5258b1065f6ad079d7410c3a29562903f128bb /kex.h | |
parent | 86ebcb6cf55ea296a7921d157afdc03c07102933 (diff) |
- markus@cvs.openbsd.org 2001/04/03 19:53:29
[dh.c dh.h kex.c kex.h sshconnect2.c sshd.c]
move kex to kex*.c, used dispatch_set() callbacks for kex. should
make rekeying easier.
Diffstat (limited to 'kex.h')
-rw-r--r-- | kex.h | 58 |
1 files changed, 26 insertions, 32 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kex.h,v 1.17 2001/03/29 21:17:40 markus Exp $ */ | 1 | /* $OpenBSD: kex.h,v 1.18 2001/04/03 19:53:29 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | #include <openssl/evp.h> | 29 | #include <openssl/evp.h> |
30 | #include "buffer.h" | 30 | #include "buffer.h" |
31 | #include "cipher.h" | ||
32 | #include "key.h" | ||
31 | 33 | ||
32 | #define KEX_DH1 "diffie-hellman-group1-sha1" | 34 | #define KEX_DH1 "diffie-hellman-group1-sha1" |
33 | #define KEX_DHGEX "diffie-hellman-group-exchange-sha1" | 35 | #define KEX_DHGEX "diffie-hellman-group-exchange-sha1" |
@@ -82,6 +84,7 @@ struct Comp { | |||
82 | int enabled; | 84 | int enabled; |
83 | char *name; | 85 | char *name; |
84 | }; | 86 | }; |
87 | #define KEX_INIT_SENT 0x0001 | ||
85 | struct Kex { | 88 | struct Kex { |
86 | Enc enc [MODE_MAX]; | 89 | Enc enc [MODE_MAX]; |
87 | Mac mac [MODE_MAX]; | 90 | Mac mac [MODE_MAX]; |
@@ -91,40 +94,31 @@ struct Kex { | |||
91 | char *name; | 94 | char *name; |
92 | int hostkey_type; | 95 | int hostkey_type; |
93 | int kex_type; | 96 | int kex_type; |
97 | |||
98 | /* used during kex */ | ||
99 | Buffer my; | ||
100 | Buffer peer; | ||
101 | int newkeys; | ||
102 | int flags; | ||
103 | void *state; | ||
104 | char *client_version_string; | ||
105 | char *server_version_string; | ||
106 | |||
107 | int (*check_host_key)(Key *hostkey); | ||
108 | Key *(*load_host_key)(int type); | ||
94 | }; | 109 | }; |
95 | 110 | ||
96 | Buffer *kex_init(char *myproposal[PROPOSAL_MAX]); | 111 | void kex_derive_keys(Kex *k, u_char *hash, BIGNUM *shared_secret); |
97 | void | ||
98 | kex_exchange_kexinit( | ||
99 | Buffer *my_kexinit, Buffer *peer_kexint, | ||
100 | char *peer_proposal[PROPOSAL_MAX]); | ||
101 | Kex * | ||
102 | kex_choose_conf(char *cprop[PROPOSAL_MAX], | ||
103 | char *sprop[PROPOSAL_MAX], int server); | ||
104 | int kex_derive_keys(Kex *k, u_char *hash, BIGNUM *shared_secret); | ||
105 | void packet_set_kex(Kex *k); | 112 | void packet_set_kex(Kex *k); |
113 | Kex *kex_start(char *proposal[PROPOSAL_MAX]); | ||
114 | void kex_send_newkeys(void); | ||
115 | void kex_protocol_error(int type, int plen, void *ctxt); | ||
106 | 116 | ||
107 | u_char * | 117 | void kexdh(Kex *); |
108 | kex_hash( | 118 | void kexgex(Kex *); |
109 | char *client_version_string, | 119 | |
110 | char *server_version_string, | 120 | #if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) |
111 | char *ckexinit, int ckexinitlen, | 121 | void dump_digest(char *msg, u_char *digest, int len); |
112 | char *skexinit, int skexinitlen, | 122 | #endif |
113 | char *serverhostkeyblob, int sbloblen, | ||
114 | BIGNUM *client_dh_pub, | ||
115 | BIGNUM *server_dh_pub, | ||
116 | BIGNUM *shared_secret); | ||
117 | 123 | ||
118 | u_char * | ||
119 | kex_hash_gex( | ||
120 | char *client_version_string, | ||
121 | char *server_version_string, | ||
122 | char *ckexinit, int ckexinitlen, | ||
123 | char *skexinit, int skexinitlen, | ||
124 | char *serverhostkeyblob, int sbloblen, | ||
125 | int min, int wantbits, int max, | ||
126 | BIGNUM *prime, BIGNUM *gen, | ||
127 | BIGNUM *client_dh_pub, | ||
128 | BIGNUM *server_dh_pub, | ||
129 | BIGNUM *shared_secret); | ||
130 | #endif | 124 | #endif |