Skip to content

Commit

Permalink
Revert "[crypto] PSA SPAKE2+ introduction (project-chip#32924) (proje…
Browse files Browse the repository at this point in the history
…ct-chip#33190)"

This reverts commit 5524d5b.

Signed-off-by: Adrian Gielniewski <[email protected]>
  • Loading branch information
adigie committed Nov 28, 2024
1 parent 3905d38 commit 82a5ea8
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 402 deletions.
3 changes: 1 addition & 2 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ else()
endif()

if (CONFIG_CHIP_CRYPTO_PSA)
matter_add_gn_arg_string("chip_crypto" "psa")
matter_add_gn_arg_bool ("chip_crypto_psa_spake2p" CONFIG_PSA_WANT_ALG_SPAKE2P_MATTER)
matter_add_gn_arg_string("chip_crypto" "psa")
endif()

if (BOARD STREQUAL "native_posix")
Expand Down
1 change: 0 additions & 1 deletion config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ config MBEDTLS_HEAP_SIZE

config CHIP_CRYPTO_PSA
default y if !CHIP_WIFI
imply PSA_WANT_ALG_SPAKE2P_MATTER

if CHIP_CRYPTO_PSA

Expand Down
8 changes: 0 additions & 8 deletions src/crypto/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ buildconfig_header("crypto_buildconfig") {
defines = [
"CHIP_CRYPTO_MBEDTLS=${chip_crypto_mbedtls}",
"CHIP_CRYPTO_PSA=${chip_crypto_psa}",
"CHIP_CRYPTO_PSA_SPAKE2P=${chip_crypto_psa_spake2p}",
"CHIP_CRYPTO_OPENSSL=${chip_crypto_openssl}",
"CHIP_CRYPTO_BORINGSSL=${chip_crypto_boringssl}",
"CHIP_CRYPTO_PLATFORM=${chip_crypto_platform}",
Expand Down Expand Up @@ -157,13 +156,6 @@ static_library("crypto") {
]
}

if (chip_crypto_psa_spake2p) {
sources += [
"PSASpake2p.cpp",
"PSASpake2p.h",
]
}

public_configs = []

cflags = [ "-Wconversion" ]
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/CHIPCryptoPAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ CHIP_ERROR Spake2p::KeyConfirm(const uint8_t * in, size_t in_len)
return CHIP_NO_ERROR;
}

CHIP_ERROR Spake2p::GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key)
CHIP_ERROR Spake2p::GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key) const
{
VerifyOrReturnError(state == CHIP_SPAKE2P_STATE::KC, CHIP_ERROR_INTERNAL);

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/CHIPCryptoPAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ class Spake2p
*
* @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise
**/
CHIP_ERROR GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key);
CHIP_ERROR GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key) const;

CHIP_ERROR InternalHash(const uint8_t * in, size_t in_len);
CHIP_ERROR WriteMN();
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/CHIPCryptoPALPSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class PsaKdf
private:
CHIP_ERROR InitOperation(psa_key_id_t hkdfKey, const ByteSpan & salt, const ByteSpan & info);

psa_key_id_t mSecretKeyId = PSA_KEY_ID_NULL;
psa_key_id_t mSecretKeyId = 0;
psa_key_derivation_operation_t mOperation = PSA_KEY_DERIVATION_OPERATION_INIT;
};

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/PSASessionKeystore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void PSASessionKeystore::DestroyKey(HkdfKeyHandle & key)
auto & keyId = key.AsMutable<psa_key_id_t>();

psa_destroy_key(keyId);
keyId = PSA_KEY_ID_NULL;
keyId = 0;
}

} // namespace Crypto
Expand Down
201 changes: 0 additions & 201 deletions src/crypto/PSASpake2p.cpp

This file was deleted.

Loading

0 comments on commit 82a5ea8

Please sign in to comment.