@@ -1455,6 +1455,16 @@ ifneq ($(CERT_CHAIN_VERIFY),)
14551455 CERT_CHAIN_GEN_ALGO+ =rsapss4096
14561456 endif
14571457
1458+ # If SIGN didn't match any of the cert-chain-supported algos above,
1459+ # fail loudly at make time instead of producing a malformed script
1460+ # invocation (empty --leaf-algo) that fails with a confusing error.
1461+ ifeq ($(strip $(CERT_CHAIN_GEN_ALGO)),)
1462+ $(error CERT_CHAIN_VERIFY=1 is not supported with SIGN=$(SIGN). \
1463+ The dummy cert chain generator supports SIGN values : ECC256, \
1464+ ECC384, RSA2048, RSA3072, RSA4096, RSAPSS2048, RSAPSS3072, \
1465+ RSAPSS4096. Set USER_CERT_CHAIN=<path> to supply a pre-built chain.)
1466+ endif
1467+
14581468 # Per-level overrides for the dummy chain generator. Defaults: CA chain
14591469 # uses the same algo as the leaf (SIGN-derived), SHA256 for cert sigs.
14601470 # The leaf algo is fixed by SIGN — the leaf cert wraps the wolfBoot
@@ -1475,9 +1485,12 @@ ifneq ($(CERT_CHAIN_VERIFY),)
14751485 # Auto-bridge: the verifier in the bootloader must support whatever
14761486 # algo and hash actually sign the dummy chain. Without this, a
14771487 # non-default GEN_CA_ALGO/GEN_CA_HASH builds successfully but fails at
1478- # runtime when the matching wolfCrypt module is absent.
1479- AUX_PK_ALGOS += $(CERT_CHAIN_GEN_CA_ALGO )
1480- AUX_HASH_ALGOS += $(CERT_CHAIN_GEN_CA_HASH )
1488+ # runtime when the matching wolfCrypt module is absent. `override` is
1489+ # required so a user-supplied AUX_PK_ALGOS/AUX_HASH_ALGOS on the make
1490+ # command line (which would otherwise be read-only) doesn't silently
1491+ # defeat the auto-bridge.
1492+ override AUX_PK_ALGOS += $(CERT_CHAIN_GEN_CA_ALGO )
1493+ override AUX_HASH_ALGOS += $(CERT_CHAIN_GEN_CA_HASH )
14811494 endif
14821495 SIGN_OPTIONS += --cert-chain $(CERT_CHAIN_FILE )
14831496endif
@@ -1533,7 +1546,7 @@ ifneq ($(strip $(AUX_PK_ALGOS)$(AUX_HASH_ALGOS)),)
15331546 endif
15341547 # PSS padding - any rsapss* token enables PSS for all selected RSA sizes
15351548 ifneq ($(filter rsapss2048 rsapss3072 rsapss4096,$(AUX_PK_ALGOS_LIST)),)
1536- CFLAGS += -DWOLFBOOT_AUX_RSA_PSS
1549+ CFLAGS += -DWOLFBOOT_AUX_PK_RSA_PSS
15371550 endif
15381551 # Add RSA objects if any RSA (PKCS#1 v1.5 or PSS) aux PK is requested
15391552 ifneq ($(filter rsa2048 rsa3072 rsa4096 rsapss2048 rsapss3072 rsapss4096,$(AUX_PK_ALGOS_LIST)),)
0 commit comments