Skip to content

Commit 82a5ea8

Browse files
committed
Revert "[crypto] PSA SPAKE2+ introduction (project-chip#32924) (project-chip#33190)"
This reverts commit 5524d5b. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 3905d38 commit 82a5ea8

16 files changed

+12
-402
lines changed

config/nrfconnect/chip-module/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ else()
168168
endif()
169169

170170
if (CONFIG_CHIP_CRYPTO_PSA)
171-
matter_add_gn_arg_string("chip_crypto" "psa")
172-
matter_add_gn_arg_bool ("chip_crypto_psa_spake2p" CONFIG_PSA_WANT_ALG_SPAKE2P_MATTER)
171+
matter_add_gn_arg_string("chip_crypto" "psa")
173172
endif()
174173

175174
if (BOARD STREQUAL "native_posix")

config/nrfconnect/chip-module/Kconfig.defaults

-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ config MBEDTLS_HEAP_SIZE
298298

299299
config CHIP_CRYPTO_PSA
300300
default y if !CHIP_WIFI
301-
imply PSA_WANT_ALG_SPAKE2P_MATTER
302301

303302
if CHIP_CRYPTO_PSA
304303

src/crypto/BUILD.gn

-8
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ buildconfig_header("crypto_buildconfig") {
5151
defines = [
5252
"CHIP_CRYPTO_MBEDTLS=${chip_crypto_mbedtls}",
5353
"CHIP_CRYPTO_PSA=${chip_crypto_psa}",
54-
"CHIP_CRYPTO_PSA_SPAKE2P=${chip_crypto_psa_spake2p}",
5554
"CHIP_CRYPTO_OPENSSL=${chip_crypto_openssl}",
5655
"CHIP_CRYPTO_BORINGSSL=${chip_crypto_boringssl}",
5756
"CHIP_CRYPTO_PLATFORM=${chip_crypto_platform}",
@@ -157,13 +156,6 @@ static_library("crypto") {
157156
]
158157
}
159158

160-
if (chip_crypto_psa_spake2p) {
161-
sources += [
162-
"PSASpake2p.cpp",
163-
"PSASpake2p.h",
164-
]
165-
}
166-
167159
public_configs = []
168160

169161
cflags = [ "-Wconversion" ]

src/crypto/CHIPCryptoPAL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ CHIP_ERROR Spake2p::KeyConfirm(const uint8_t * in, size_t in_len)
501501
return CHIP_NO_ERROR;
502502
}
503503

504-
CHIP_ERROR Spake2p::GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key)
504+
CHIP_ERROR Spake2p::GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key) const
505505
{
506506
VerifyOrReturnError(state == CHIP_SPAKE2P_STATE::KC, CHIP_ERROR_INTERNAL);
507507

src/crypto/CHIPCryptoPAL.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ class Spake2p
12161216
*
12171217
* @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise
12181218
**/
1219-
CHIP_ERROR GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key);
1219+
CHIP_ERROR GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key) const;
12201220

12211221
CHIP_ERROR InternalHash(const uint8_t * in, size_t in_len);
12221222
CHIP_ERROR WriteMN();

src/crypto/CHIPCryptoPALPSA.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class PsaKdf
146146
private:
147147
CHIP_ERROR InitOperation(psa_key_id_t hkdfKey, const ByteSpan & salt, const ByteSpan & info);
148148

149-
psa_key_id_t mSecretKeyId = PSA_KEY_ID_NULL;
149+
psa_key_id_t mSecretKeyId = 0;
150150
psa_key_derivation_operation_t mOperation = PSA_KEY_DERIVATION_OPERATION_INIT;
151151
};
152152

src/crypto/PSASessionKeystore.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void PSASessionKeystore::DestroyKey(HkdfKeyHandle & key)
188188
auto & keyId = key.AsMutable<psa_key_id_t>();
189189

190190
psa_destroy_key(keyId);
191-
keyId = PSA_KEY_ID_NULL;
191+
keyId = 0;
192192
}
193193

194194
} // namespace Crypto

src/crypto/PSASpake2p.cpp

-201
This file was deleted.

0 commit comments

Comments
 (0)