diff options
| author | jsing <> | 2015-09-11 14:52:17 +0000 |
|---|---|---|
| committer | jsing <> | 2015-09-11 14:52:17 +0000 |
| commit | 3b074f2713c35cff8731567c2f0859e34c056c10 (patch) | |
| tree | a226e2884e4e229f6c42260f24b7d14b1710540a /src/lib/libssl/t1_meth.c | |
| parent | 9750a3821f26639c541ea7c893d977024d363b62 (diff) | |
| download | openbsd-3b074f2713c35cff8731567c2f0859e34c056c10.tar.gz openbsd-3b074f2713c35cff8731567c2f0859e34c056c10.tar.bz2 openbsd-3b074f2713c35cff8731567c2f0859e34c056c10.zip | |
Put the *method* data structures and functions in the same place.
We can also now nuke ssl23_get_method() since it is the same as
tls1_get_method(). And the empty file can bite the dust.
ok bcook@ miod@
Diffstat (limited to 'src/lib/libssl/t1_meth.c')
| -rw-r--r-- | src/lib/libssl/t1_meth.c | 76 |
1 files changed, 60 insertions, 16 deletions
diff --git a/src/lib/libssl/t1_meth.c b/src/lib/libssl/t1_meth.c index 48341525d8..aea4c04547 100644 --- a/src/lib/libssl/t1_meth.c +++ b/src/lib/libssl/t1_meth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: t1_meth.c,v 1.16 2015/02/06 08:30:23 jsing Exp $ */ | 1 | /* $OpenBSD: t1_meth.c,v 1.17 2015/09/11 14:52:17 jsing Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -64,6 +64,38 @@ | |||
| 64 | 64 | ||
| 65 | static const SSL_METHOD *tls1_get_method(int ver); | 65 | static const SSL_METHOD *tls1_get_method(int ver); |
| 66 | 66 | ||
| 67 | const SSL_METHOD TLS_method_data = { | ||
| 68 | .version = TLS1_2_VERSION, | ||
| 69 | .ssl_new = tls1_new, | ||
| 70 | .ssl_clear = tls1_clear, | ||
| 71 | .ssl_free = tls1_free, | ||
| 72 | .ssl_accept = ssl23_accept, | ||
| 73 | .ssl_connect = ssl23_connect, | ||
| 74 | .ssl_read = ssl23_read, | ||
| 75 | .ssl_peek = ssl23_peek, | ||
| 76 | .ssl_write = ssl23_write, | ||
| 77 | .ssl_shutdown = ssl_undefined_function, | ||
| 78 | .ssl_renegotiate = ssl_undefined_function, | ||
| 79 | .ssl_renegotiate_check = ssl_ok, | ||
| 80 | .ssl_get_message = ssl3_get_message, | ||
| 81 | .ssl_read_bytes = ssl3_read_bytes, | ||
| 82 | .ssl_write_bytes = ssl3_write_bytes, | ||
| 83 | .ssl_dispatch_alert = ssl3_dispatch_alert, | ||
| 84 | .ssl_ctrl = ssl3_ctrl, | ||
| 85 | .ssl_ctx_ctrl = ssl3_ctx_ctrl, | ||
| 86 | .get_cipher_by_char = ssl3_get_cipher_by_char, | ||
| 87 | .put_cipher_by_char = ssl3_put_cipher_by_char, | ||
| 88 | .ssl_pending = ssl_undefined_const_function, | ||
| 89 | .num_ciphers = ssl3_num_ciphers, | ||
| 90 | .get_cipher = ssl3_get_cipher, | ||
| 91 | .get_ssl_method = tls1_get_method, | ||
| 92 | .get_timeout = ssl23_default_timeout, | ||
| 93 | .ssl3_enc = &ssl3_undef_enc_method, | ||
| 94 | .ssl_version = ssl_undefined_void_function, | ||
| 95 | .ssl_callback_ctrl = ssl3_callback_ctrl, | ||
| 96 | .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, | ||
| 97 | }; | ||
| 98 | |||
| 67 | const SSL_METHOD TLSv1_method_data = { | 99 | const SSL_METHOD TLSv1_method_data = { |
| 68 | .version = TLS1_VERSION, | 100 | .version = TLS1_VERSION, |
| 69 | .ssl_new = tls1_new, | 101 | .ssl_new = tls1_new, |
| @@ -160,32 +192,44 @@ const SSL_METHOD TLSv1_2_method_data = { | |||
| 160 | .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, | 192 | .ssl_ctx_callback_ctrl = ssl3_ctx_callback_ctrl, |
| 161 | }; | 193 | }; |
| 162 | 194 | ||
| 195 | static const SSL_METHOD * | ||
| 196 | tls1_get_method(int ver) | ||
| 197 | { | ||
| 198 | if (ver == TLS1_2_VERSION) | ||
| 199 | return (TLSv1_2_method()); | ||
| 200 | if (ver == TLS1_1_VERSION) | ||
| 201 | return (TLSv1_1_method()); | ||
| 202 | if (ver == TLS1_VERSION) | ||
| 203 | return (TLSv1_method()); | ||
| 204 | return (NULL); | ||
| 205 | } | ||
| 206 | |||
| 163 | const SSL_METHOD * | 207 | const SSL_METHOD * |
| 164 | TLSv1_method(void) | 208 | SSLv23_method(void) |
| 165 | { | 209 | { |
| 166 | return &TLSv1_method_data; | 210 | return (TLS_method()); |
| 167 | } | 211 | } |
| 168 | 212 | ||
| 169 | const SSL_METHOD * | 213 | const SSL_METHOD * |
| 170 | TLSv1_1_method(void) | 214 | TLS_method(void) |
| 171 | { | 215 | { |
| 172 | return &TLSv1_1_method_data; | 216 | return &TLS_method_data; |
| 173 | } | 217 | } |
| 174 | 218 | ||
| 175 | const SSL_METHOD * | 219 | const SSL_METHOD * |
| 176 | TLSv1_2_method(void) | 220 | TLSv1_method(void) |
| 177 | { | 221 | { |
| 178 | return &TLSv1_2_method_data; | 222 | return (&TLSv1_method_data); |
| 179 | } | 223 | } |
| 180 | 224 | ||
| 181 | static const SSL_METHOD * | 225 | const SSL_METHOD * |
| 182 | tls1_get_method(int ver) | 226 | TLSv1_1_method(void) |
| 183 | { | 227 | { |
| 184 | if (ver == TLS1_2_VERSION) | 228 | return (&TLSv1_1_method_data); |
| 185 | return (TLSv1_2_method()); | 229 | } |
| 186 | if (ver == TLS1_1_VERSION) | 230 | |
| 187 | return (TLSv1_1_method()); | 231 | const SSL_METHOD * |
| 188 | if (ver == TLS1_VERSION) | 232 | TLSv1_2_method(void) |
| 189 | return (TLSv1_method()); | 233 | { |
| 190 | return (NULL); | 234 | return (&TLSv1_2_method_data); |
| 191 | } | 235 | } |
