diff options
author | markus@openbsd.org <markus@openbsd.org> | 2015-01-19 19:52:16 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-01-20 09:13:01 +1100 |
commit | 091c302829210c41e7f57c3f094c7b9c054306f0 (patch) | |
tree | 800de5dc85b877a85d1f269ae5bb09b0dc3fa7a7 /kex.h | |
parent | 4e62cc68ce4ba20245d208b252e74e91d3785b74 (diff) |
upstream commit
update packet.c & isolate, introduce struct ssh a) switch
packet.c to buffer api and isolate per-connection info into struct ssh b)
(de)serialization of the state is moved from monitor to packet.c c) the old
packet.c API is implemented in opacket.[ch] d) compress.c/h is removed and
integrated into packet.c with and ok djm@
Diffstat (limited to 'kex.h')
-rw-r--r-- | kex.h | 39 |
1 files changed, 19 insertions, 20 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kex.h,v 1.66 2015/01/15 09:40:00 djm Exp $ */ | 1 | /* $OpenBSD: kex.h,v 1.67 2015/01/19 19:52:16 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. |
@@ -82,15 +82,15 @@ enum kex_exchange { | |||
82 | 82 | ||
83 | #define KEX_INIT_SENT 0x0001 | 83 | #define KEX_INIT_SENT 0x0001 |
84 | 84 | ||
85 | typedef struct Kex Kex; | 85 | typedef struct kex Kex; |
86 | typedef struct Comp Comp; | 86 | typedef struct sshcomp Comp; |
87 | typedef struct sshmac Mac; | 87 | typedef struct sshmac Mac; |
88 | typedef struct Enc Enc; | 88 | typedef struct sshenc Enc; |
89 | typedef struct Newkeys Newkeys; | 89 | typedef struct newkeys Newkeys; |
90 | 90 | ||
91 | struct Enc { | 91 | struct sshenc { |
92 | char *name; | 92 | char *name; |
93 | const Cipher *cipher; | 93 | const struct sshcipher *cipher; |
94 | int enabled; | 94 | int enabled; |
95 | u_int key_len; | 95 | u_int key_len; |
96 | u_int iv_len; | 96 | u_int iv_len; |
@@ -98,20 +98,20 @@ struct Enc { | |||
98 | u_char *key; | 98 | u_char *key; |
99 | u_char *iv; | 99 | u_char *iv; |
100 | }; | 100 | }; |
101 | struct Comp { | 101 | struct sshcomp { |
102 | int type; | 102 | u_int type; |
103 | int enabled; | 103 | int enabled; |
104 | char *name; | 104 | char *name; |
105 | }; | 105 | }; |
106 | struct Newkeys { | 106 | struct newkeys { |
107 | Enc enc; | 107 | struct sshenc enc; |
108 | Mac mac; | 108 | struct sshmac mac; |
109 | Comp comp; | 109 | struct sshcomp comp; |
110 | }; | 110 | }; |
111 | struct Kex { | 111 | struct kex { |
112 | u_char *session_id; | 112 | u_char *session_id; |
113 | u_int session_id_len; | 113 | size_t session_id_len; |
114 | Newkeys *newkeys[MODE_MAX]; | 114 | struct newkeys *newkeys[MODE_MAX]; |
115 | u_int we_need; | 115 | u_int we_need; |
116 | u_int dh_need; | 116 | u_int dh_need; |
117 | int server; | 117 | int server; |
@@ -119,8 +119,8 @@ struct Kex { | |||
119 | int hostkey_type; | 119 | int hostkey_type; |
120 | int kex_type; | 120 | int kex_type; |
121 | int roaming; | 121 | int roaming; |
122 | Buffer my; | 122 | struct sshbuf *my; |
123 | Buffer peer; | 123 | struct sshbuf *peer; |
124 | sig_atomic_t done; | 124 | sig_atomic_t done; |
125 | int flags; | 125 | int flags; |
126 | int hash_alg; | 126 | int hash_alg; |
@@ -140,14 +140,13 @@ char *kex_alg_list(char); | |||
140 | 140 | ||
141 | Kex *kex_setup(char *[PROPOSAL_MAX]); | 141 | Kex *kex_setup(char *[PROPOSAL_MAX]); |
142 | void kex_finish(Kex *); | 142 | void kex_finish(Kex *); |
143 | void kex_free_newkeys(struct newkeys *); | ||
143 | 144 | ||
144 | void kex_send_kexinit(Kex *); | 145 | void kex_send_kexinit(Kex *); |
145 | void kex_input_kexinit(int, u_int32_t, void *); | 146 | void kex_input_kexinit(int, u_int32_t, void *); |
146 | void kex_derive_keys(Kex *, u_char *, u_int, const u_char *, u_int); | 147 | void kex_derive_keys(Kex *, u_char *, u_int, const u_char *, u_int); |
147 | void kex_derive_keys_bn(Kex *, u_char *, u_int, const BIGNUM *); | 148 | void kex_derive_keys_bn(Kex *, u_char *, u_int, const BIGNUM *); |
148 | 149 | ||
149 | Newkeys *kex_get_newkeys(int); | ||
150 | |||
151 | void kexdh_client(Kex *); | 150 | void kexdh_client(Kex *); |
152 | void kexdh_server(Kex *); | 151 | void kexdh_server(Kex *); |
153 | void kexgex_client(Kex *); | 152 | void kexgex_client(Kex *); |