Skip to content

Commit 4433f1a

Browse files
committed
Make --enable-aeskeywrap drive HAVE_AES_KEYWRAP (F-3401)
After gating slot.c advertisement on HAVE_AES_KEYWRAP, the --enable-aeskeywrap build option (which defined the unused HAVE_AES_KEY_WRAP) no longer controlled anything. Point the option at the canonical HAVE_AES_KEYWRAP so it actually enables the feature end-to-end. Only ever define the macro when the option is enabled; never emit an #undef. The previous configure DISABLE_DEFS path and the cmake/options.h.in entry would otherwise generate '#undef HAVE_AES_KEYWRAP' in wolfpkcs11/options.h, which - included after wolfssl/options.h - would clobber the wolfSSL-provided macro and silently disable key wrap. The option can now only force it on; keywrap is impossible without wolfSSL's wc_AesKeyWrap regardless.
1 parent fab1cb1 commit 4433f1a

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ add_option("WOLFPKCS11_AESKEYWRAP"
244244
"no" "yes;no")
245245

246246
if(WOLFPKCS11_AESKEYWRAP)
247-
list(APPEND WOLFPKCS11_DEFINITIONS "-DHAVE_AES_KEY_WRAP")
247+
list(APPEND WOLFPKCS11_DEFINITIONS "-DHAVE_AES_KEYWRAP")
248248
endif()
249249

250250
# AES-CBC

cmake/options.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ extern "C" {
5454
#cmakedefine NO_DH
5555
#undef NO_AES
5656
#cmakedefine NO_AES
57-
#undef HAVE_AES_KEY_WRAP
58-
#cmakedefine HAVE_AES_KEY_WRAP
5957
#undef NO_AES_CBC
6058
#cmakedefine NO_AES_CBC
6159
#undef HAVE_AESGCM

configure.ac

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,12 @@ AC_ARG_ENABLE([aeskeywrap],
223223
[ ENABLED_AESKEYWRAP=$enableval ],
224224
[ ENABLED_AESKEYWRAP=no ]
225225
)
226+
# The implementation and mechanism advertisement gate on HAVE_AES_KEYWRAP (the
227+
# wolfSSL macro). Only force it on when requested; never emit an #undef, which
228+
# would clobber a wolfSSL build that already provides key wrap.
226229
if test "$ENABLED_AESKEYWRAP" = "yes"
227230
then
228-
AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEY_WRAP"
229-
else
230-
DISABLE_DEFS="$DISABLE_DEFS -DHAVE_AES_KEY_WRAP"
231+
AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP"
231232
fi
232233

233234
AC_ARG_ENABLE([aescbc],

0 commit comments

Comments
 (0)