Skip to content

Commit bbe5c49

Browse files
committed
fix: remove unimplemented PQC stub registrations from mbedtls
When both spdm-mbedtls and spdm-aws-lc features are enabled (e.g., CI matrix combos where RUN_REQUESTER_FEATURES includes spdm-mbedtls and run_rust_spdm_emu_pqc appends spdm-aws-lc), the mbedtls backend registers its unimplemented!() PQC stubs (pqc_asym_verify, kem_decap, kem_encap) first via crypto_mbedtls_register_handles(). Since these use OnceCell (first-writer-wins), the subsequent aws-lc register() calls silently fail, causing PQC verification to panic with 'not implemented' from spdmlib_crypto_mbedtls. Remove the three unimplemented PQC registrations from crypto_mbedtls_register_handles(). This allows aws-lc's real PQC implementations to register successfully regardless of feature combination order. Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
1 parent 23c2d9d commit bbe5c49

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

test/spdm-emu/src/crypto.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,12 @@ pub fn crypto_mbedtls_register_handles() {
1010
spdmlib_crypto_mbedtls::asym_verify_impl::DEFAULT.clone(),
1111
);
1212

13-
spdmlib::crypto::pqc_asym_verify::register(
14-
spdmlib_crypto_mbedtls::pqc_asym_verify_impl::DEFAULT.clone(),
15-
);
16-
1713
spdmlib::crypto::cert_operation::register(
1814
spdmlib_crypto_mbedtls::cert_operation_impl::DEFAULT.clone(),
1915
);
2016

2117
spdmlib::crypto::dhe::register(spdmlib_crypto_mbedtls::dhe_impl::DEFAULT.clone());
2218

23-
spdmlib::crypto::kem_decap::register(spdmlib_crypto_mbedtls::kem_impl::DEFAULT_DECAP.clone());
24-
25-
spdmlib::crypto::kem_encap::register(spdmlib_crypto_mbedtls::kem_impl::DEFAULT_ENCAP.clone());
26-
2719
spdmlib::crypto::hash::register(spdmlib_crypto_mbedtls::hash_impl::DEFAULT.clone());
2820

2921
spdmlib::crypto::hkdf::register(spdmlib_crypto_mbedtls::hkdf_impl::DEFAULT.clone());

0 commit comments

Comments
 (0)