Only perform special TLS handling if TLS has been configured
authorMatt Caswell <matt@openssl.org>
Mon, 4 Jan 2021 17:29:35 +0000 (17:29 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 6 Jan 2021 11:08:35 +0000 (11:08 +0000)
Skip over special TLS steps for stream ciphers if we haven't been
configured for TLS.

Fixes #12528

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

providers/implementations/ciphers/ciphercommon.c

index 0941210f20a69be4e76f09e99467d53a2dcfae90..0e3e367dfc3b9a14a349bbfd3c26b9cd4ca3c380 100644 (file)
@@ -429,7 +429,7 @@ int ossl_cipher_generic_stream_update(void *vctx, unsigned char *out,
     }
 
     *outl = inl;
-    if (!ctx->enc) {
+    if (!ctx->enc && ctx->tlsversion > 0) {
         /*
         * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
         * cipher_aes_cbc_hmac_sha256_hw.c