Skip to content

Commit 1443ec8

Browse files
committed
Removed 3DES from PSA config
1 parent cb791c3 commit 1443ec8

5 files changed

Lines changed: 14 additions & 8 deletions

File tree

docs/DICE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ families must implement the appropriate subset based on hardware support.
6565
- Test-only fallback: when `WOLFBOOT_UDS_UID_FALLBACK_FORTEST=1`, targets
6666
may derive UDS from the device UID for demo purposes. This should not be
6767
used in production builds.
68+
- HKDF hash selection follows the configured measurement hash; for
69+
`WOLFBOOT_HASH_SHA3_384`, HKDF uses SHA3-384 as well.
6870
- `hal_attestation_get_ueid(uint8_t *buf, size_t *len)`
6971
- Returns a stable UEID. If unavailable, the UEID is derived from UDS.
7072
- `hal_attestation_get_implementation_id(uint8_t *buf, size_t *len)`

include/user_settings.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,12 @@ extern int tolower(int c);
378378
# define HAVE_AES_ECB
379379
# define WOLFSSL_AES_CFB
380380
# define WOLFSSL_AES_OFB
381-
# define WOLFSSL_DES3
382-
# define WOLFSSL_DES_ECB
381+
# ifndef NO_DES3
382+
# define NO_DES3
383+
# endif
384+
# ifndef NO_DES3_TLS_SUITES
385+
# define NO_DES3_TLS_SUITES
386+
# endif
383387
# define HAVE_CHACHA
384388
# define HAVE_POLY1305
385389
# define WOLFSSL_CMAC
@@ -510,7 +514,9 @@ extern int tolower(int c);
510514
#define NO_CERT
511515
#define NO_SESSION_CACHE
512516
#define NO_HC128
517+
#ifndef NO_DES3
513518
#define NO_DES3
519+
#endif
514520
#define NO_WRITEV
515521
#ifndef WOLFBOOT_PARTITION_FILENAME
516522
#define NO_FILESYSTEM
@@ -532,7 +538,6 @@ extern int tolower(int c);
532538

533539
#if defined(WOLFCRYPT_TZ_PSA)
534540
#undef NO_CMAC
535-
#undef NO_DES3
536541
#undef NO_KDF
537542
#endif
538543

options.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ ifeq ($(WOLFCRYPT_TZ_PSA),1)
769769
CFLAGS+=-DWOLFCRYPT_TZ_PSA
770770
CFLAGS+=-DWOLFSSL_PSA_ENGINE
771771
CFLAGS+=-DWOLFPSA_CUSTOM_STORE
772+
CFLAGS+=-DNO_DES3 -DNO_DES3_TLS_SUITES
772773
WOLFPSA_CFLAGS+=-I$(WOLFBOOT_LIB_WOLFPSA)
773774
WOLFPSA_CFLAGS+=-I$(WOLFBOOT_LIB_WOLFPSA)/wolfpsa
774775
LDFLAGS+=--specs=nano.specs
@@ -779,7 +780,6 @@ ifeq ($(WOLFCRYPT_TZ_PSA),1)
779780
WOLFCRYPT_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/hmac.o
780781
WOLFCRYPT_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/dh.o
781782
WOLFCRYPT_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/chacha.o
782-
WOLFCRYPT_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/des3.o
783783
ifeq ($(findstring random.o,$(WOLFCRYPT_OBJS)),)
784784
WOLFCRYPT_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/random.o
785785
endif

src/dice/dice.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
#define WOLFBOOT_DICE_KDF_HASH_SIZE SHA384_DIGEST_SIZE
9494
#define WOLFBOOT_MEASUREMENT_HASH_NAME "sha-384"
9595
#elif defined(WOLFBOOT_HASH_SHA3_384)
96-
#define WOLFBOOT_DICE_KDF_HASH_TYPE WC_HASH_TYPE_SHA384
96+
#define WOLFBOOT_DICE_KDF_HASH_TYPE WC_HASH_TYPE_SHA3_384
9797
#define WOLFBOOT_DICE_KDF_HASH_SIZE 48
9898
#define WOLFBOOT_MEASUREMENT_HASH_NAME "sha3-384"
9999
#else
@@ -661,9 +661,6 @@ static int wolfboot_attest_get_private_key(ecc_key *key,
661661
uint8_t priv[WOLFBOOT_DICE_KEY_LEN];
662662
size_t priv_len = sizeof(priv);
663663

664-
if (hal_attestation_get_iak_private_key == NULL) {
665-
return -1;
666-
}
667664
if (hal_attestation_get_iak_private_key(priv, &priv_len) != 0) {
668665
return -1;
669666
}

test-app/wcs/user_settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ extern int tolower(int c);
132132
#define NO_CERT
133133
#define NO_SESSION_CACHE
134134
#define NO_HC128
135+
#ifndef NO_DES3
135136
#define NO_DES3
137+
#endif
136138
#define NO_WRITEV
137139
#define NO_DEV_RANDOM
138140
#define NO_FILESYSTEM

0 commit comments

Comments
 (0)