Fix enable-weak-ssl-ciphers
authorMatt Caswell <matt@openssl.org>
Thu, 7 Jan 2021 17:40:09 +0000 (17:40 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 13 Jan 2021 09:04:49 +0000 (09:04 +0000)
Commit e260bee broke the enable-weak-ssl-ciphers option. The stitched
rc4-hmac-md5 cipher implementation did not recognise the tls_version
parameter, and therefore was being incorrectly handled.

Fixes #13795

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/13803)

providers/implementations/ciphers/cipher_rc4_hmac_md5.c

index 69d47b03fe2cca3d94592b16a35a2df285487a16..ee0cff9b86b743796c71c1e6f2b393f24afc6f91 100644 (file)
@@ -169,6 +169,14 @@ static int rc4_hmac_md5_set_ctx_params(void *vctx, const OSSL_PARAM params[])
         }
         GET_HW(ctx)->init_mackey(&ctx->base, p->data, p->data_size);
     }
+    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
+    if (p != NULL) {
+        if (!OSSL_PARAM_get_uint(p, &ctx->base.tlsversion)) {
+            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+            return 0;
+        }
+    }
+
     return 1;
 }