]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
srtpkdf: check libctx null before use
authorNikola Pajkovsky <nikolap@openssl.org>
Tue, 17 Feb 2026 10:03:52 +0000 (11:03 +0100)
committerNeil Horman <nhorman@openssl.org>
Wed, 18 Feb 2026 16:33:54 +0000 (11:33 -0500)
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
MergeDate: Wed Feb 18 16:34:05 2026
(Merged from https://github.com/openssl/openssl/pull/30040)

providers/implementations/kdfs/srtpkdf.c

index f8839ff59a0a03683fb9a112dd2a4b24753ba408..0c8693d5db36ec04c6267f567153f839694ec892 100644 (file)
@@ -192,11 +192,13 @@ static int kdf_srtpkdf_derive(void *vctx, unsigned char *key, size_t keylen,
 {
     KDF_SRTPKDF *ctx = (KDF_SRTPKDF *)vctx;
     const EVP_CIPHER *cipher;
-    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
+    OSSL_LIB_CTX *libctx;
 
     if (!ossl_prov_is_running() || !kdf_srtpkdf_set_ctx_params(ctx, params))
         return 0;
 
+    libctx = PROV_LIBCTX_OF(ctx->provctx);
+
     cipher = ossl_prov_cipher_cipher(&ctx->cipher);
     if (cipher == NULL) {
         ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER);