]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix broken strict-warnings build in sskdf and x963kdf
authorNeil Horman <nhorman@openssl.org>
Fri, 20 Feb 2026 10:48:53 +0000 (05:48 -0500)
committerNeil Horman <nhorman@openssl.org>
Sun, 22 Feb 2026 17:45:57 +0000 (12:45 -0500)
when configuring with:

./Configure no-sskdf --strict-warnings

The build breaks as sskdf_new is defined but not used (as the same sskdf
file is used to implement x963kdf with a different new dispatch
function).  i.e. we will build the file when sskdf is disabled but
x963kdf is enabled, omitting any use of sskdf_new

Easy fix, just gate the inclusion of sskdf_new on #ifndef
OPENSSL_NO_SSKDF.

Do the same for X963KDF, which has the same problem (thank you for
pointing that out @t8m)

Fixes #30105

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Sun Feb 22 17:46:00 2026
(Merged from https://github.com/openssl/openssl/pull/30106)

providers/implementations/kdfs/sskdf.c

index 1747d95c1a34e84f6b9c7fd2bf2e647238ff75eb..2626ce9d0eb87ea6011519a3b1643bf3f349d972 100644 (file)
@@ -88,8 +88,12 @@ struct sskdf_all_set_ctx_params_st {
 };
 
 static OSSL_FUNC_kdf_newctx_fn sskdf_common_new;
+#ifndef OPENSSL_NO_SSKDF
 static OSSL_FUNC_kdf_newctx_fn sskdf_new;
+#endif
+#ifndef OPENSSL_NO_X963KDF
 static OSSL_FUNC_kdf_newctx_fn x963_new;
+#endif
 static OSSL_FUNC_kdf_dupctx_fn sskdf_dup;
 static OSSL_FUNC_kdf_freectx_fn sskdf_free;
 static OSSL_FUNC_kdf_reset_fn sskdf_reset;
@@ -334,6 +338,7 @@ static void *sskdf_common_new(void *provctx)
     return ctx;
 }
 
+#ifndef OPENSSL_NO_SSKDF
 static void *sskdf_new(void *provctx)
 {
 #ifdef FIPS_MODULE
@@ -344,7 +349,9 @@ static void *sskdf_new(void *provctx)
 
     return sskdf_common_new(provctx);
 }
+#endif
 
+#ifndef OPENSSL_NO_X963KDF
 static void *x963_new(void *provctx)
 {
 #ifdef FIPS_MODULE
@@ -355,6 +362,7 @@ static void *x963_new(void *provctx)
 
     return sskdf_common_new(provctx);
 }
+#endif
 
 static void sskdf_reset(void *vctx)
 {