Skip to content

Commit

Permalink
Alignments to the Matter Core.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArekBalysNordic committed Apr 10, 2024
1 parent 95a846b commit 1cdfb43
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/crypto/PSASpake2p.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Project CHIP Authors
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -181,7 +181,7 @@ CHIP_ERROR PSASpake2p_P256_SHA256_HKDF_HMAC::KeyConfirm(const uint8_t * in, size
return CHIP_NO_ERROR;
}

CHIP_ERROR PSASpake2p_P256_SHA256_HKDF_HMAC::GetKeys(uint8_t * out, size_t * out_len)
CHIP_ERROR PSASpake2p_P256_SHA256_HKDF_HMAC::GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key) const
{
auto & keyId = key.AsMutable<psa_key_id_t>();

Expand All @@ -191,7 +191,7 @@ CHIP_ERROR PSASpake2p_P256_SHA256_HKDF_HMAC::GetKeys(uint8_t * out, size_t * out
psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_DERIVE);
psa_set_key_algorithm(&attributes, PSA_ALG_HKDF(PSA_ALG_SHA_256));

psa_status_t status = psa_pake_get_shared_key(&mOperation, &attributes, &keyId);
psa_status_t status = psa_pake_get_shared_key(const_cast<psa_pake_operation_t *>(&(mOperation)), &attributes, &keyId);
VerifyOrReturnError(status == PSA_SUCCESS, CHIP_ERROR_INTERNAL);

return CHIP_NO_ERROR;
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/PSASpake2p.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Project CHIP Authors
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -151,7 +151,7 @@ class PSASpake2p_P256_SHA256_HKDF_HMAC
*
* @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise
**/
CHIP_ERROR GetKeys(uint8_t * out, size_t * out_len);
CHIP_ERROR GetKeys(SessionKeystore & keystore, HkdfKeyHandle & key) const;

private:
psa_pake_operation_t mOperation = PSA_PAKE_OPERATION_INIT;
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/secure_channel/PASESession.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class DLL_EXPORT PASESession : public Messaging::UnsolicitedMessageHandler,
Optional<Protocols::SecureChannel::MsgType> mNextExpectedMsg;

#if CHIP_CRYPTO_PSA_SPAKE2P
Spake2p_P256_SHA256_HKDF_HMAC mSpake2p;
Crypto::PSASpake2p_P256_SHA256_HKDF_HMAC mSpake2p;
#else
Crypto::Spake2p_P256_SHA256_HKDF_HMAC mSpake2p;
#endif
Expand Down

0 comments on commit 1cdfb43

Please sign in to comment.