cross-reference the DH and RSA SECLEVEL to level of security mappings
authorHubert Kario <hkario@redhat.com>
Mon, 21 Jun 2021 14:52:14 +0000 (16:52 +0200)
committerPauli <pauli@openssl.org>
Tue, 22 Jun 2021 23:26:15 +0000 (09:26 +1000)
Since the DH check is used only in DHE-PSK ciphersuites, it's
easy to miss it when updating the RSA mapping. Add cross-references
so that they remain consistent.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15853)

crypto/x509/x509_vfy.c
ssl/ssl_cert.c

index f020d4864d6f108c0fd3ee3c96d4ea93cf4c5c47..18c6172c9800e45f028b0f03c6c24018915eff7f 100644 (file)
@@ -3364,6 +3364,10 @@ STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
     return result;
 }
 
+/*
+ * note that there's a corresponding minbits_table in ssl/ssl_cert.c
+ * in ssl_get_security_level_bits that's used for selection of DH parameters
+ */
 static const int minbits_table[] = { 80, 112, 128, 192, 256 };
 static const int NUM_AUTH_LEVELS = OSSL_NELEM(minbits_table);
 
index 4f3c2f8ee7814e1540550d4e034e2a3f2efb95dd..547e9b9ccdd80553349e298592883a864a928f18 100644 (file)
@@ -963,6 +963,11 @@ int ssl_cert_set_cert_store(CERT *c, X509_STORE *store, int chain, int ref)
 int ssl_get_security_level_bits(const SSL *s, const SSL_CTX *ctx, int *levelp)
 {
     int level;
+    /*
+     * note that there's a corresponding minbits_table
+     * in crypto/x509/x509_vfy.c that's used for checking the security level
+     * of RSA and DSA keys
+     */
     static const int minbits_table[5 + 1] = { 0, 80, 112, 128, 192, 256 };
 
     if (ctx != NULL)