Ciphers using an MD5 HMAC are not allowed on security levels >= 1 and
using a SHA-1 HMAC is disallowed on security levels >= 4. This disables
RC4-MD5 by default.
ok jsing
-/* $OpenBSD: ssl_seclevel.c,v 1.22 2022/07/07 17:08:28 tb Exp $ */
+/* $OpenBSD: ssl_seclevel.c,v 1.23 2022/07/19 18:55:12 tb Exp $ */
/*
* Copyright (c) 2020 Theo Buehler <tb@openbsd.org>
*
if (cipher->algorithm_auth & SSL_aNULL)
return 0;
+ if (cipher->algorithm_mac & SSL_MD5)
+ return 0;
+
if (security_level <= 1)
return 1;
- if (cipher->algorithm_enc == SSL_RC4)
+ if (cipher->algorithm_enc & SSL_RC4)
return 0;
if (security_level <= 2)
cipher->algorithm_ssl != SSL_TLSV1_3)
return 0;
+ if (security_level <= 3)
+ return 1;
+
+ if (cipher->algorithm_mac & SSL_SHA1)
+ return 0;
+
return 1;
}