diff options
author | jsing <> | 2021-02-07 15:04:10 +0000 |
---|---|---|
committer | jsing <> | 2021-02-07 15:04:10 +0000 |
commit | 1e3243705c6918de211100bcbd8ef0b8488d215e (patch) | |
tree | 39da1e539db935f3cc8ae0aeec4e7f7ceb5cc61e /src/lib/libssl/ssl_srvr.c | |
parent | 5a642e2e581776f13874ce5444f9f27501465e56 (diff) | |
download | openbsd-1e3243705c6918de211100bcbd8ef0b8488d215e.tar.gz openbsd-1e3243705c6918de211100bcbd8ef0b8488d215e.tar.bz2 openbsd-1e3243705c6918de211100bcbd8ef0b8488d215e.zip |
Factor out the legacy stack version checks.
Also check for explicit version numbers, rather than just the major version
value.
ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_srvr.c')
-rw-r--r-- | src/lib/libssl/ssl_srvr.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index 3551ee41ee..15768bb565 100644 --- a/src/lib/libssl/ssl_srvr.c +++ b/src/lib/libssl/ssl_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_srvr.c,v 1.90 2021/01/26 14:22:20 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.91 2021/02/07 15:04:10 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 | * |
@@ -213,19 +213,12 @@ ssl3_accept(SSL *s) | |||
213 | if (cb != NULL) | 213 | if (cb != NULL) |
214 | cb(s, SSL_CB_HANDSHAKE_START, 1); | 214 | cb(s, SSL_CB_HANDSHAKE_START, 1); |
215 | 215 | ||
216 | if (SSL_is_dtls(s)) { | 216 | if (!ssl_legacy_stack_version(s, s->version)) { |
217 | if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { | 217 | SSLerror(s, ERR_R_INTERNAL_ERROR); |
218 | SSLerror(s, ERR_R_INTERNAL_ERROR); | 218 | ret = -1; |
219 | ret = -1; | 219 | goto end; |
220 | goto end; | ||
221 | } | ||
222 | } else { | ||
223 | if ((s->version >> 8) != 3) { | ||
224 | SSLerror(s, ERR_R_INTERNAL_ERROR); | ||
225 | ret = -1; | ||
226 | goto end; | ||
227 | } | ||
228 | } | 220 | } |
221 | |||
229 | s->internal->type = SSL_ST_ACCEPT; | 222 | s->internal->type = SSL_ST_ACCEPT; |
230 | 223 | ||
231 | if (!ssl3_setup_init_buffer(s)) { | 224 | if (!ssl3_setup_init_buffer(s)) { |