Skip to content

Commit fdb9723

Browse files
ArekBalysNordiccarlescufi
authored andcommitted
[nrf toup] [Crypto] Stop compiling legacy SPAKE2P if PSA is available
If the CHIP_CRYPTO_PSA_SPAKE2P is enabled the build system should not compile Legacy Spake2p implementation, because the PSA one is available in the PSASpake2p.cpp file.
1 parent 970c948 commit fdb9723

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/crypto/CHIPCryptoPALPSA.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,9 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t &
761761
return CHIP_NO_ERROR;
762762
}
763763

764+
// We should compile this SPAKE2P implementation only if the PSA implementation is not in use.
765+
#if !CHIP_CRYPTO_PSA_SPAKE2P
766+
764767
typedef struct Spake2p_Context
765768
{
766769
mbedtls_ecp_group curve;
@@ -1066,5 +1069,7 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointIsValid(void * R)
10661069
return CHIP_NO_ERROR;
10671070
}
10681071

1072+
#endif // !CHIP_CRYPTO_PSA_SPAKE2P
1073+
10691074
} // namespace Crypto
10701075
} // namespace chip

0 commit comments

Comments
 (0)