summaryrefslogtreecommitdiff
path: root/kex.h
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-01-19 19:52:16 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 09:13:01 +1100
commit091c302829210c41e7f57c3f094c7b9c054306f0 (patch)
tree800de5dc85b877a85d1f269ae5bb09b0dc3fa7a7 /kex.h
parent4e62cc68ce4ba20245d208b252e74e91d3785b74 (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.h39
1 files changed, 19 insertions, 20 deletions
diff --git a/kex.h b/kex.h
index ef4a1f096..ffceb9fe4 100644
--- a/kex.h
+++ b/kex.h
@@ -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
85typedef struct Kex Kex; 85typedef struct kex Kex;
86typedef struct Comp Comp; 86typedef struct sshcomp Comp;
87typedef struct sshmac Mac; 87typedef struct sshmac Mac;
88typedef struct Enc Enc; 88typedef struct sshenc Enc;
89typedef struct Newkeys Newkeys; 89typedef struct newkeys Newkeys;
90 90
91struct Enc { 91struct 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};
101struct Comp { 101struct sshcomp {
102 int type; 102 u_int type;
103 int enabled; 103 int enabled;
104 char *name; 104 char *name;
105}; 105};
106struct Newkeys { 106struct newkeys {
107 Enc enc; 107 struct sshenc enc;
108 Mac mac; 108 struct sshmac mac;
109 Comp comp; 109 struct sshcomp comp;
110}; 110};
111struct Kex { 111struct 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
141Kex *kex_setup(char *[PROPOSAL_MAX]); 141Kex *kex_setup(char *[PROPOSAL_MAX]);
142void kex_finish(Kex *); 142void kex_finish(Kex *);
143void kex_free_newkeys(struct newkeys *);
143 144
144void kex_send_kexinit(Kex *); 145void kex_send_kexinit(Kex *);
145void kex_input_kexinit(int, u_int32_t, void *); 146void kex_input_kexinit(int, u_int32_t, void *);
146void kex_derive_keys(Kex *, u_char *, u_int, const u_char *, u_int); 147void kex_derive_keys(Kex *, u_char *, u_int, const u_char *, u_int);
147void kex_derive_keys_bn(Kex *, u_char *, u_int, const BIGNUM *); 148void kex_derive_keys_bn(Kex *, u_char *, u_int, const BIGNUM *);
148 149
149Newkeys *kex_get_newkeys(int);
150
151void kexdh_client(Kex *); 150void kexdh_client(Kex *);
152void kexdh_server(Kex *); 151void kexdh_server(Kex *);
153void kexgex_client(Kex *); 152void kexgex_client(Kex *);