Skip to content
Merged
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
17 changes: 10 additions & 7 deletions test/wh_test_she.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ enum {
#define TEST_ADMIN_PIN "1234"
#endif

#if defined(WOLFHSM_CFG_KEYWRAP) && defined(HAVE_AESGCM) && \
!defined(WOLFHSM_CFG_TEST_CLIENT_ONLY)
#if defined(WOLFHSM_CFG_KEYWRAP) && defined(HAVE_AESGCM)
/* Id of the trusted KEK the server task provisions for the SHE<->keywrap
* interop tests. Defined here so the server task can use it too. */
* interop tests. Defined here so both the client section and the server task
* can use it. */
#define WH_SHE_INTEROP_KEK_ID 0x20
#endif /* WOLFHSM_CFG_KEYWRAP && HAVE_AESGCM && !TEST_CLIENT_ONLY */
#endif /* WOLFHSM_CFG_KEYWRAP && HAVE_AESGCM */
Comment thread
AlexLanzano marked this conversation as resolved.

#ifdef WOLFHSM_CFG_ENABLE_CLIENT
/* Helper function to destroy a SHE key so the unit tests don't
Expand Down Expand Up @@ -482,9 +482,11 @@ int whTest_SheClientConfig(whClientConfig* config)
}

/* Needs the trusted KEK the server task provisions in NVM, so this only
* runs in the in-process (client+server) build. */
* runs in the in-process (client+server) build, guarded the same way as
* whTest_SheClientConfigBoundarySecureBoot below. */
#if defined(WOLFHSM_CFG_KEYWRAP) && defined(HAVE_AESGCM) && \
!defined(WOLFHSM_CFG_TEST_CLIENT_ONLY)
defined(WOLFHSM_CFG_TEST_POSIX) && defined(WOLFHSM_CFG_ENABLE_CLIENT) && \
defined(WOLFHSM_CFG_ENABLE_SERVER)
/* SHE <-> keywrap interop: wrap-export a SHE key, prime an unused SHE slot
* via unwrap-and-cache and use it, and verify the SHE counter rollback
* guard on unwrap-and-cache. */
Expand Down Expand Up @@ -761,7 +763,8 @@ int whTest_SheClientConfig(whClientConfig* config)

WH_TEST_PRINT("SHE <-> keywrap interop SUCCESS\n");
}
#endif /* WOLFHSM_CFG_KEYWRAP && HAVE_AESGCM && !TEST_CLIENT_ONLY */
#endif /* WOLFHSM_CFG_KEYWRAP && HAVE_AESGCM && WOLFHSM_CFG_TEST_POSIX &&
WOLFHSM_CFG_ENABLE_CLIENT && WOLFHSM_CFG_ENABLE_SERVER */

/* destroy "pre-programmed" keys so we don't leak NVM */
if ((ret = _destroySheKey(client, WH_SHE_BOOT_MAC_KEY_ID)) != 0) {
Expand Down
Loading