-
Notifications
You must be signed in to change notification settings - Fork 959
Add SHE (Secure Hardware Extension) support to wolfCrypt #10009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
681b769
cf5a5a2
5665fa4
5d69c5b
ba9cf0d
ce92fe5
9b0f4f7
8a973e2
1d6af16
e6280cd
004f3ff
a30330c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5944,6 +5944,31 @@ fi | |
| AS_IF([test "x$ENABLED_CMAC" = "xyes"], | ||
| [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC -DWOLFSSL_AES_DIRECT"]) | ||
|
|
||
| # SHE (Secure Hardware Extension) key update message generation | ||
| # --enable-she=standard: standard SHE support | ||
| # --enable-she=extended: standard + extended overrides (custom KDF/headers) | ||
| AC_ARG_ENABLE([she], | ||
bigbrett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [AS_HELP_STRING([--enable-she@<:@=standard|extended@:>@], | ||
| [Enable SHE key update support (default: disabled)])], | ||
| [ ENABLED_SHE=$enableval ], | ||
| [ ENABLED_SHE=no ] | ||
| ) | ||
|
|
||
| if test "x$ENABLED_SHE" = "xstandard" || test "x$ENABLED_SHE" = "xextended" | ||
| then | ||
| if test "$ENABLED_AESCBC" = "no" | ||
| then | ||
| AC_MSG_ERROR([SHE requires AES-CBC. Cannot use --disable-aescbc with --enable-she.]) | ||
| fi | ||
| AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHE -DWOLFSSL_CMAC -DWOLFSSL_AES_DIRECT" | ||
| ENABLED_CMAC=yes | ||
| ENABLED_AESCBC=yes | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MEDIUM-5: configure.ac SHE section sets
|
||
| fi | ||
|
|
||
| if test "x$ENABLED_SHE" = "xextended" | ||
| then | ||
| AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHE_EXTENDED" | ||
| fi | ||
|
|
||
| # AES-XTS | ||
| AC_ARG_ENABLE([aesxts], | ||
|
|
@@ -11543,6 +11568,7 @@ AM_CONDITIONAL([BUILD_FIPS_V6],[test $HAVE_FIPS_VERSION = 6]) | |
| AM_CONDITIONAL([BUILD_FIPS_V6_PLUS],[test $HAVE_FIPS_VERSION -ge 6]) | ||
| AM_CONDITIONAL([BUILD_SIPHASH],[test "x$ENABLED_SIPHASH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) | ||
| AM_CONDITIONAL([BUILD_CMAC],[test "x$ENABLED_CMAC" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) | ||
| AM_CONDITIONAL([BUILD_SHE],[test "x$ENABLED_SHE" = "xstandard" || test "x$ENABLED_SHE" = "xextended" || test "x$ENABLED_USERSETTINGS" = "xyes"]) | ||
| AM_CONDITIONAL([BUILD_SELFTEST],[test "x$ENABLED_SELFTEST" = "xyes"]) | ||
| AM_CONDITIONAL([BUILD_SHA224],[test "x$ENABLED_SHA224" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) | ||
| AM_CONDITIONAL([BUILD_SHA3],[test "x$ENABLED_SHA3" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"]) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HIGH-1: CMakeLists.txt missing required SHE dependency definitions
CMakeLists.txt:1649-1656Description: The CMakeLists.txt SHE section only adds
-DWOLFSSL_SHEbut does not add-DWOLFSSL_CMACor-DWOLFSSL_AES_DIRECT, nor does it force-enable the CMAC option. By contrast,configure.accorrectly adds all three flags and setsENABLED_CMAC=yesandENABLED_AESCBC=yes. A CMake build with-DWOLFSSL_SHE=standard(without separately enabling CMAC) will hit the#error "SHE requires CMAC"directive inwc_she.c.Code:
Recommendation: Mirror the
configure.acbehavior: force-enable CMAC (and thus AES_DIRECT) when SHE is enabled. For example:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
override_cache(WOLFSSL_CMAC "yes")andoverride_cache(WOLFSSL_AESCBC "yes")to the CMakeLists.txt SHE block. CMAC's own blockalready handles adding
-DWOLFSSL_CMAC -DWOLFSSL_AES_DIRECTwhen it's enabled, so theoverride is all that's needed to cascade the dependencies correctly.