versions below the minimum required by the security level.
input & ok jsing
-/* $OpenBSD: ssl_clnt.c,v 1.148 2022/06/29 08:34:04 tb Exp $ */
+/* $OpenBSD: ssl_clnt.c,v 1.149 2022/06/30 11:17:49 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
goto end;
}
+ if (!ssl_security_version(s,
+ s->s3->hs.our_min_tls_version)) {
+ SSLerror(s, SSL_R_VERSION_TOO_LOW);
+ ret = -1;
+ goto end;
+ }
+
if (!ssl3_setup_init_buffer(s)) {
ret = -1;
goto end;
-/* $OpenBSD: ssl_locl.h,v 1.407 2022/06/29 21:18:04 tb Exp $ */
+/* $OpenBSD: ssl_locl.h,v 1.408 2022/06/30 11:17:49 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int ssl_security(const SSL *ssl, int op, int bits, int nid, void *other);
int ssl_ctx_security_dh(const SSL_CTX *ctx, DH *dh);
int ssl_security_dh(const SSL *ssl, DH *dh);
+int ssl_security_version(const SSL *ssl, int version);
int ssl_security_cert(const SSL_CTX *ctx, const SSL *ssl, X509 *x509,
int is_peer, int *out_error);
int ssl_security_cert_chain(const SSL *ssl, STACK_OF(X509) *sk,
-/* $OpenBSD: ssl_seclevel.c,v 1.11 2022/06/30 07:09:45 tb Exp $ */
+/* $OpenBSD: ssl_seclevel.c,v 1.12 2022/06/30 11:17:49 tb Exp $ */
/*
* Copyright (c) 2020 Theo Buehler <tb@openbsd.org>
*
ssl->cert->security_ex_data);
}
+int
+ssl_security_version(const SSL *ssl, int tls_version)
+{
+ return ssl_security(ssl, SSL_SECOP_VERSION, 0, tls_version, NULL);
+}
+
int
ssl_ctx_security_dh(const SSL_CTX *ctx, DH *dh)
{
-/* $OpenBSD: ssl_srvr.c,v 1.145 2022/06/29 08:27:51 tb Exp $ */
+/* $OpenBSD: ssl_srvr.c,v 1.146 2022/06/30 11:17:50 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
goto end;
}
+ if (!ssl_security_version(s,
+ s->s3->hs.our_min_tls_version)) {
+ SSLerror(s, SSL_R_VERSION_TOO_LOW);
+ ret = -1;
+ goto end;
+ }
+
if (!ssl3_setup_init_buffer(s)) {
ret = -1;
goto end;
-/* $OpenBSD: ssl_versions.c,v 1.22 2022/02/05 14:54:10 jsing Exp $ */
+/* $OpenBSD: ssl_versions.c,v 1.23 2022/06/30 11:17:50 tb Exp $ */
/*
* Copyright (c) 2016, 2017 Joel Sing <jsing@openbsd.org>
*
return 0;
}
+ if (!ssl_security_version(s, shared_version))
+ return 0;
+
*max_ver = shared_version;
return 1;
&max_tls_version))
return 0;
- return (server_tls_version >= min_tls_version &&
- server_tls_version <= max_tls_version);
+ if (server_tls_version < min_tls_version ||
+ server_tls_version > max_tls_version)
+ return 0;
+
+ return ssl_security_version(s, server_tls_version);
}
int