Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/os-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
'--enable-dtls --enable-dtlscid --enable-dtls13 --enable-secure-renegotiation
--enable-psk --enable-aesccm --enable-nullcipher
CPPFLAGS=-DWOLFSSL_STATIC_RSA',
'--enable-she=standard --enable-cmac',
'--enable-she=extended --enable-cmac --enable-cryptocb --enable-cryptocbutils',
'--enable-she=standard --enable-cmac CPPFLAGS=''-DNO_WC_SHE_IMPORT_M123'' ',
'--enable-she=extended --enable-cmac --enable-cryptocb --enable-cryptocbutils
CPPFLAGS=''-DNO_WC_SHE_GETUID -DNO_WC_SHE_GETCOUNTER -DNO_WC_SHE_EXPORTKEY'' ',
'--enable-ascon --enable-experimental',
'--enable-ascon CPPFLAGS=-DWOLFSSL_ASCON_UNROLL --enable-experimental',
'--enable-all CPPFLAGS=''-DNO_AES_192 -DNO_AES_256'' ',
Expand Down
7 changes: 7 additions & 0 deletions .wolfssl_known_macro_extras
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ NO_TKERNEL_MEM_POOL
NO_TLSX_PSKKEM_PLAIN_ANNOUNCE
NO_VERIFY_OID
NO_WC_DHGENERATEPUBLIC
NO_WC_SHE_EXPORTKEY
NO_WC_SHE_GETCOUNTER
NO_WC_SHE_GETUID
NO_WC_SHE_IMPORT_M123
NO_WC_SSIZE_TYPE
NO_WOLFSSL_ALLOC_ALIGN
NO_WOLFSSL_AUTOSAR_CRYIF
Expand Down Expand Up @@ -884,6 +888,9 @@ WOLFSSL_SE050_NO_TRNG
WOLFSSL_SECURE_RENEGOTIATION_ON_BY_DEFAULT
WOLFSSL_SERVER_EXAMPLE
WOLFSSL_SETTINGS_FILE
WOLFSSL_SH224
WOLFSSL_SHE
WOLFSSL_SHE_EXTENDED
WOLFSSL_SHA256_ALT_CH_MAJ
WOLFSSL_SHA512_HASHTYPE
WOLFSSL_SHUTDOWNONCE
Expand Down
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,26 @@ if(WOLFSSL_CMAC)
endif()
endif()

# SHE (Secure Hardware Extension) key update message generation
# standard: core SHE support, extended: adds custom KDF/header overrides
add_option("WOLFSSL_SHE"
"Enable SHE key update support (standard|extended|no)"
"no" "standard;extended;no")

if(WOLFSSL_SHE STREQUAL "standard" OR WOLFSSL_SHE STREQUAL "extended")
if (NOT WOLFSSL_AES)
message(FATAL_ERROR "Cannot use SHE without AES.")
else()
list(APPEND WOLFSSL_DEFINITIONS
"-DWOLFSSL_SHE")
endif()
endif()

if(WOLFSSL_SHE STREQUAL "extended")
list(APPEND WOLFSSL_DEFINITIONS
"-DWOLFSSL_SHE_EXTENDED")
endif()

# TODO: - RC2
# - FIPS, again (there's more logic for FIPS in configure.ac)
# - Selftest
Expand Down Expand Up @@ -2816,6 +2836,7 @@ if(WOLFSSL_EXAMPLES)
tests/api/test_hash.c
tests/api/test_hmac.c
tests/api/test_cmac.c
tests/api/test_she.c
tests/api/test_des3.c
tests/api/test_chacha.c
tests/api/test_poly1305.c
Expand Down
20 changes: 20 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6116,6 +6116,25 @@ 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],
[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
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHE"
fi

if test "x$ENABLED_SHE" = "xextended"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHE_EXTENDED"
fi

# AES-XTS
AC_ARG_ENABLE([aesxts],
Expand Down Expand Up @@ -11508,6 +11527,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"])
Expand Down
16 changes: 16 additions & 0 deletions src/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ if BUILD_CMAC
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/cmac.c
endif

if BUILD_SHE
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/she.c
endif

src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fips.c \
wolfcrypt/src/fips_test.c

Expand Down Expand Up @@ -424,6 +428,10 @@ if BUILD_CMAC
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/cmac.c
endif

if BUILD_SHE
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/she.c
endif

src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fips.c \
wolfcrypt/src/fips_test.c

Expand Down Expand Up @@ -673,6 +681,10 @@ if BUILD_CMAC
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/cmac.c
endif

if BUILD_SHE
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/she.c
endif

if BUILD_CURVE448
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/curve448.c
endif
Expand Down Expand Up @@ -1005,6 +1017,10 @@ if !BUILD_FIPS_V2_PLUS
if BUILD_CMAC
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/cmac.c
endif

if BUILD_SHE
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/she.c
endif
endif !BUILD_FIPS_V2_PLUS

if !BUILD_FIPS_V2
Expand Down
9 changes: 9 additions & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
#include <tests/api/test_hash.h>
#include <tests/api/test_hmac.h>
#include <tests/api/test_cmac.h>
#include <tests/api/test_she.h>
#include <tests/api/test_des3.h>
#include <tests/api/test_chacha.h>
#include <tests/api/test_poly1305.h>
Expand Down Expand Up @@ -34012,6 +34013,14 @@ TEST_CASE testCases[] = {
TEST_HMAC_DECLS,
/* CMAC */
TEST_CMAC_DECLS,
/* SHE */
TEST_SHE_DECLS,
#ifdef WOLFSSL_SHE_EXTENDED
TEST_SHE_EXT_DECLS,
#endif
#if defined(WOLF_CRYPTO_CB) && defined(WOLFSSL_SHE)
TEST_SHE_CB_DECLS,
#endif

/* Cipher */
/* Triple-DES */
Expand Down
3 changes: 3 additions & 0 deletions tests/api/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ tests_unit_test_SOURCES += tests/api/test_hash.c
# MAC
tests_unit_test_SOURCES += tests/api/test_hmac.c
tests_unit_test_SOURCES += tests/api/test_cmac.c
# SHE
tests_unit_test_SOURCES += tests/api/test_she.c
# Cipher
tests_unit_test_SOURCES += tests/api/test_des3.c
tests_unit_test_SOURCES += tests/api/test_chacha.c
Expand Down Expand Up @@ -124,6 +126,7 @@ EXTRA_DIST += tests/api/test_digest.h
EXTRA_DIST += tests/api/test_hash.h
EXTRA_DIST += tests/api/test_hmac.h
EXTRA_DIST += tests/api/test_cmac.h
EXTRA_DIST += tests/api/test_she.h
EXTRA_DIST += tests/api/test_des3.h
EXTRA_DIST += tests/api/test_chacha.h
EXTRA_DIST += tests/api/test_poly1305.h
Expand Down
Loading
Loading