]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Ensure cipher_generic_initkey gets passed the actual provider ctx
authorMatt Caswell <matt@openssl.org>
Mon, 22 Jun 2020 14:04:50 +0000 (15:04 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 6 Jul 2020 08:26:09 +0000 (09:26 +0100)
We were not correctly passing the provider ctx down the chain during
initialisation of a new cipher ctx. Instead the provider ctx got set to
NULL.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12288)

providers/implementations/include/prov/ciphercommon.h

index 18bb5790267262d82e183e6f118e6e6d667baa4b..55adf3caa2f590cc034943125aa942a4b1ff29b0 100644 (file)
@@ -175,7 +175,8 @@ static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
      if (ctx != NULL) {                                                        \
          cipher_generic_initkey(ctx, kbits, blkbits, ivbits,                   \
                                 EVP_CIPH_##UCMODE##_MODE, flags,               \
-                                PROV_CIPHER_HW_##alg##_##lcmode(kbits), NULL); \
+                                PROV_CIPHER_HW_##alg##_##lcmode(kbits),        \
+                                provctx);                                      \
      }                                                                         \
      return ctx;                                                               \
 }                                                                              \