summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_clnt.c
diff options
context:
space:
mode:
authorjsing <>2021-02-07 15:04:10 +0000
committerjsing <>2021-02-07 15:04:10 +0000
commitff76d1cff85d5e2902acc8c8be909fe6a7c33390 (patch)
tree39da1e539db935f3cc8ae0aeec4e7f7ceb5cc61e /src/lib/libssl/ssl_clnt.c
parentb4b8a48cdfd397e4350388fe0e6ff7928e35242f (diff)
downloadopenbsd-ff76d1cff85d5e2902acc8c8be909fe6a7c33390.tar.gz
openbsd-ff76d1cff85d5e2902acc8c8be909fe6a7c33390.tar.bz2
openbsd-ff76d1cff85d5e2902acc8c8be909fe6a7c33390.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_clnt.c')
-rw-r--r--src/lib/libssl/ssl_clnt.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index 4a6e8b06a8..25164ea012 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.76 2020/10/14 16:57:33 jsing Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.77 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 *
@@ -212,18 +212,10 @@ ssl3_connect(SSL *s)
212 if (cb != NULL) 212 if (cb != NULL)
213 cb(s, SSL_CB_HANDSHAKE_START, 1); 213 cb(s, SSL_CB_HANDSHAKE_START, 1);
214 214
215 if (SSL_is_dtls(s)) { 215 if (!ssl_legacy_stack_version(s, s->version)) {
216 if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00)) { 216 SSLerror(s, ERR_R_INTERNAL_ERROR);
217 SSLerror(s, ERR_R_INTERNAL_ERROR); 217 ret = -1;
218 ret = -1; 218 goto end;
219 goto end;
220 }
221 } else {
222 if ((s->version & 0xff00) != 0x0300) {
223 SSLerror(s, ERR_R_INTERNAL_ERROR);
224 ret = -1;
225 goto end;
226 }
227 } 219 }
228 220
229 /* s->version=SSL3_VERSION; */ 221 /* s->version=SSL3_VERSION; */