From 3255594dd4195e20c02b14174e2e66301ee956a7 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 30 Nov 2023 14:45:06 +0100 Subject: [PATCH] Remove WELL from empty/uninitialized error names (#30737) * Remove WELL from empty/uninitialized error names * Fix trimmed new line in ERROR_CODES --- docs/ERROR_CODES.md | 4 ++-- .../infineon/psoc6/src/AppTask.cpp | 2 +- .../infineon/psoc6/src/AppTask.cpp | 2 +- .../lighting-app/infineon/psoc6/src/AppTask.cpp | 2 +- examples/lock-app/infineon/psoc6/src/AppTask.cpp | 2 +- .../linux/LinuxCommissionableDataProvider.cpp | 12 ++++++------ .../ExampleOperationalCredentialsIssuer.cpp | 2 +- src/credentials/DeviceAttestationVendorReserved.h | 2 +- src/crypto/CHIPCryptoPALOpenSSL.cpp | 6 +++--- src/crypto/CHIPCryptoPALPSA.cpp | 6 +++--- src/crypto/CHIPCryptoPALmbedTLS.cpp | 6 +++--- src/include/platform/KeyValueStoreManager.h | 10 +++++----- .../internal/GenericPlatformManagerImpl_Zephyr.ipp | 2 +- src/lib/address_resolve/AddressResolve.h | 2 +- .../address_resolve/AddressResolve_DefaultImpl.cpp | 2 +- src/lib/core/CHIPError.cpp | 10 +++++----- src/lib/core/CHIPError.h | 8 ++++---- src/lib/core/tests/TestCHIPErrorStr.cpp | 4 ++-- src/lib/dnssd/Discovery_ImplPlatform.cpp | 12 ++++++------ src/lib/shell/commands/Dns.cpp | 2 +- src/platform/Darwin/KeyValueStoreManagerImpl.mm | 6 +++--- src/platform/ESP32/ConfigurationManagerImpl.cpp | 2 +- src/platform/ESP32/ESP32CHIPCryptoPAL.cpp | 2 +- .../Infineon/PSOC6/KeyValueStoreManagerImpl.cpp | 8 ++++---- .../GenericThreadStackManagerImpl_OpenThread.hpp | 8 ++++---- src/platform/Tizen/ThreadStackManagerImpl.cpp | 14 +++++++------- .../nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp | 4 ++-- .../crypto/se05x/CHIPCryptoPALHsm_se05x_p256.cpp | 8 ++++---- .../crypto/se05x/CHIPCryptoPAL_HostFallBack.cpp | 6 +++--- .../k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp | 2 +- src/platform/nxp/k32w/k32w1/CHIPCryptoPalK32W1.cpp | 6 +++--- .../k32w1/K32W1PersistentStorageOpKeystore.cpp | 6 +++--- .../silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp | 6 +++--- .../silabs/efr32/CHIPCryptoPALPsaEfr32.cpp | 6 +++--- .../silabs/efr32/Efr32PsaOperationalKeystore.cpp | 10 +++++----- 35 files changed, 96 insertions(+), 96 deletions(-) diff --git a/docs/ERROR_CODES.md b/docs/ERROR_CODES.md index 924eaaee6b3bc6..d828eef779b69f 100644 --- a/docs/ERROR_CODES.md +++ b/docs/ERROR_CODES.md @@ -42,8 +42,8 @@ This file was **AUTOMATICALLY** generated by | 25 | 0x19 | `CHIP_ERROR_BUFFER_TOO_SMALL` | | 26 | 0x1A | `CHIP_ERROR_DUPLICATE_KEY_ID` | | 27 | 0x1B | `CHIP_ERROR_WRONG_KEY_TYPE` | -| 28 | 0x1C | `CHIP_ERROR_WELL_UNINITIALIZED` | -| 29 | 0x1D | `CHIP_ERROR_WELL_EMPTY` | +| 28 | 0x1C | `CHIP_ERROR_UNINITIALIZED` | +| 29 | 0x1D | `CHIP_ERROR_EMPTY` | | 30 | 0x1E | `CHIP_ERROR_INVALID_STRING_LENGTH` | | 31 | 0x1F | `CHIP_ERROR_INVALID_LIST_LENGTH` | | 33 | 0x21 | `CHIP_ERROR_END_OF_TLV` | diff --git a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp index 3fde24f3817d04..e9f9dc1a171484 100644 --- a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp @@ -163,7 +163,7 @@ CHIP_ERROR AppTask::Init() if (rc != 0) { P6_LOG("boot_set_confirmed failed"); - appError(CHIP_ERROR_WELL_UNINITIALIZED); + appError(CHIP_ERROR_UNINITIALIZED); } #endif // Register the callback to init the MDNS server when connectivity is available diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp index efbbb4af9ec705..3fcbc365fbc426 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp @@ -160,7 +160,7 @@ CHIP_ERROR AppTask::Init() if (rc != 0) { P6_LOG("boot_set_confirmed failed"); - appError(CHIP_ERROR_WELL_UNINITIALIZED); + appError(CHIP_ERROR_UNINITIALIZED); } #endif // Register the callback to init the MDNS server when connectivity is available diff --git a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp index 987213e84073e1..2315086b246594 100644 --- a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp @@ -177,7 +177,7 @@ CHIP_ERROR AppTask::Init() if (rc != 0) { P6_LOG("boot_set_confirmed failed"); - appError(CHIP_ERROR_WELL_UNINITIALIZED); + appError(CHIP_ERROR_UNINITIALIZED); } #endif // Register the callback to init the MDNS server when connectivity is available diff --git a/examples/lock-app/infineon/psoc6/src/AppTask.cpp b/examples/lock-app/infineon/psoc6/src/AppTask.cpp index ea8ae2417e55b7..e3be287e024442 100644 --- a/examples/lock-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lock-app/infineon/psoc6/src/AppTask.cpp @@ -282,7 +282,7 @@ void AppTask::Init() if (rc != 0) { P6_LOG("boot_set_confirmed failed"); - appError(CHIP_ERROR_WELL_UNINITIALIZED); + appError(CHIP_ERROR_UNINITIALIZED); } #endif // Initialise WSTK buttons PB0 and PB1 (including debounce). diff --git a/examples/platform/linux/LinuxCommissionableDataProvider.cpp b/examples/platform/linux/LinuxCommissionableDataProvider.cpp index a4d1d8ca3db52e..dac5adb4a0bbbb 100644 --- a/examples/platform/linux/LinuxCommissionableDataProvider.cpp +++ b/examples/platform/linux/LinuxCommissionableDataProvider.cpp @@ -42,7 +42,7 @@ CHIP_ERROR LinuxCommissionableDataProvider::Init(chip::Optional> spake2pSalt, uint32_t spake2pIterationCount, chip::Optional setupPasscode, uint16_t discriminator) { - VerifyOrReturnError(mIsInitialized == false, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized == false, CHIP_ERROR_UNINITIALIZED); if (discriminator > chip::kMaxDiscriminatorValue) { @@ -174,21 +174,21 @@ CHIP_ERROR LinuxCommissionableDataProvider::Init(chip::Optional= kSpake2p_Max_PBKDF_Salt_Length, CHIP_ERROR_BUFFER_TOO_SMALL); memcpy(saltBuf.data(), mPaseSalt.data(), mPaseSalt.size()); @@ -199,7 +199,7 @@ CHIP_ERROR LinuxCommissionableDataProvider::GetSpake2pSalt(chip::MutableByteSpan CHIP_ERROR LinuxCommissionableDataProvider::GetSpake2pVerifier(chip::MutableByteSpan & verifierBuf, size_t & outVerifierLen) { - VerifyOrReturnError(mIsInitialized == true, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized == true, CHIP_ERROR_UNINITIALIZED); // By now, serialized verifier from Init should be correct size VerifyOrReturnError(mSerializedPaseVerifier.size() == kSpake2p_VerifierSerialized_Length, CHIP_ERROR_INTERNAL); @@ -214,7 +214,7 @@ CHIP_ERROR LinuxCommissionableDataProvider::GetSpake2pVerifier(chip::MutableByte CHIP_ERROR LinuxCommissionableDataProvider::GetSetupPasscode(uint32_t & setupPasscode) { - VerifyOrReturnError(mIsInitialized == true, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized == true, CHIP_ERROR_UNINITIALIZED); // Pretend not implemented if we don't have a passcode value externally set if (!mSetupPasscode.HasValue()) diff --git a/src/controller/ExampleOperationalCredentialsIssuer.cpp b/src/controller/ExampleOperationalCredentialsIssuer.cpp index 09a9a5a99bc9bb..d3d405a5a27f83 100644 --- a/src/controller/ExampleOperationalCredentialsIssuer.cpp +++ b/src/controller/ExampleOperationalCredentialsIssuer.cpp @@ -323,7 +323,7 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::GenerateNOCChain(const ByteSpan const ByteSpan & PAI, Callback::Callback * onCompletion) { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); // At this point, Credential issuer may wish to validate the CSR information (void) attestationChallenge; (void) csrNonce; diff --git a/src/credentials/DeviceAttestationVendorReserved.h b/src/credentials/DeviceAttestationVendorReserved.h index 6e674179b1eb2f..fe10fa74285aaf 100644 --- a/src/credentials/DeviceAttestationVendorReserved.h +++ b/src/credentials/DeviceAttestationVendorReserved.h @@ -88,7 +88,7 @@ class DeviceAttestationVendorReservedDeconstructor */ CHIP_ERROR GetNextVendorReservedElement(struct VendorReservedElement & element) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); if (mIsDone) { return CHIP_END_OF_TLV; diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index 1854bebfb94ca4..f31911e3b3cbd7 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -698,7 +698,7 @@ CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_len ERR_clear_error(); static_assert(P256ECDSASignature::Capacity() >= kP256_ECDSA_Signature_Length_Raw, "P256ECDSASignature must be large enough"); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); nid = _nidForCurve(MapECName(mPublicKey.Type())); VerifyOrExit(nid != NID_undef, error = CHIP_ERROR_INVALID_ARGUMENT); @@ -917,7 +917,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k EC_KEY * ec_key = EC_KEY_dup(to_const_EC_KEY(&mKeypair)); VerifyOrExit(ec_key != nullptr, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); local_key = EVP_PKEY_new(); VerifyOrExit(local_key != nullptr, error = CHIP_ERROR_INTERNAL); @@ -1197,7 +1197,7 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & X509_NAME * subject = X509_NAME_new(); VerifyOrExit(subject != nullptr, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); result = X509_REQ_set_version(x509_req, 0); VerifyOrExit(result == 1, error = CHIP_ERROR_INTERNAL); diff --git a/src/crypto/CHIPCryptoPALPSA.cpp b/src/crypto/CHIPCryptoPALPSA.cpp index af5d375e987e42..85a3355ff3b3fd 100644 --- a/src/crypto/CHIPCryptoPALPSA.cpp +++ b/src/crypto/CHIPCryptoPALPSA.cpp @@ -479,7 +479,7 @@ static int CryptoRNG(void * ctxt, uint8_t * out_buffer, size_t out_length) CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(isBufferNonEmpty(msg, msg_length), CHIP_ERROR_INVALID_ARGUMENT); CHIP_ERROR error = CHIP_NO_ERROR; @@ -558,7 +558,7 @@ CHIP_ERROR P256PublicKey::ECDSA_validate_hash_signature(const uint8_t * hash, co CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_key, P256ECDHDerivedSecret & out_secret) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); CHIP_ERROR error = CHIP_NO_ERROR; psa_status_t status = PSA_SUCCESS; @@ -728,7 +728,7 @@ P256Keypair::~P256Keypair() CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const { VerifyOrReturnError(isBufferNonEmpty(out_csr, csr_length), CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); MutableByteSpan csr(out_csr, csr_length); ReturnErrorOnFailure(GenerateCertificateSigningRequest(this, csr)); diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index b8b526fba7e1f9..3981ff30575d00 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -450,7 +450,7 @@ static inline const mbedtls_ecp_keypair * to_const_keypair(const P256KeypairCont CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; @@ -593,7 +593,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k const mbedtls_ecp_keypair * keypair = to_const_keypair(&mKeypair); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); result = mbedtls_ecp_group_load(&ecp_grp, MapECPGroupId(remote_public_key.Type())); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); @@ -787,7 +787,7 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & pk.CHIP_CRYPTO_PAL_PRIVATE(pk_ctx) = to_keypair(&mKeypair); VerifyOrExit(pk.CHIP_CRYPTO_PAL_PRIVATE(pk_info) != nullptr, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); mbedtls_x509write_csr_set_key(&csr, &pk); diff --git a/src/include/platform/KeyValueStoreManager.h b/src/include/platform/KeyValueStoreManager.h index cb777571d486b3..837750c9f661b8 100644 --- a/src/include/platform/KeyValueStoreManager.h +++ b/src/include/platform/KeyValueStoreManager.h @@ -69,7 +69,7 @@ class KeyValueStoreManager * CHIP_ERROR_BUFFER_TOO_SMALL the buffer could not fit the entire * value, but as many bytes as possible * were written to it - * CHIP_ERROR_WELL_UNINITIALIZED the KVS is not initialized + * CHIP_ERROR_UNINITIALIZED the KVS is not initialized * CHIP_ERROR_INVALID_ARGUMENT key is empty or too long or value is * too large */ @@ -93,7 +93,7 @@ class KeyValueStoreManager * CHIP_ERROR_BUFFER_TOO_SMALL the buffer could not fit the entire * value, but as many bytes as possible * were written to it - * CHIP_ERROR_WELL_UNINITIALIZED the KVS is not initialized + * CHIP_ERROR_UNINITIALIZED the KVS is not initialized * CHIP_ERROR_INVALID_ARGUMENT key is empty or too long or value is * too large */ @@ -120,7 +120,7 @@ class KeyValueStoreManager * CHIP_ERROR_INTEGRITY_CHECK_FAILED checksum validation failed after * writing the data * CHIP_ERROR_PERSISTED_STORAGE_FAILED failed to write the value. - * CHIP_ERROR_WELL_UNINITIALIZED the KVS is not initialized + * CHIP_ERROR_UNINITIALIZED the KVS is not initialized * CHIP_ERROR_INVALID_ARGUMENT key is empty or too long or value is * too large */ @@ -139,7 +139,7 @@ class KeyValueStoreManager * CHIP_ERROR_INTEGRITY_CHECK_FAILED checksum validation failed after * writing the data * CHIP_ERROR_PERSISTED_STORAGE_FAILED failed to write the value. - * CHIP_ERROR_WELL_UNINITIALIZED the KVS is not initialized + * CHIP_ERROR_UNINITIALIZED the KVS is not initialized * CHIP_ERROR_INVALID_ARGUMENT key is empty or too long or value is * too large */ @@ -165,7 +165,7 @@ class KeyValueStoreManager * CHIP_ERROR_INTEGRITY_CHECK_FAILED checksum validation failed after * erasing data * CHIP_ERROR_PERSISTED_STORAGE_FAILED failed to erase the value. - * CHIP_ERROR_WELL_UNINITIALIZED the KVS is not initialized + * CHIP_ERROR_UNINITIALIZED the KVS is not initialized * CHIP_ERROR_INVALID_ARGUMENT key is empty or too long */ CHIP_ERROR Delete(const char * key); diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp index 7a5d9c265b1880..0c8e0d374763a7 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp @@ -209,7 +209,7 @@ template CHIP_ERROR GenericPlatformManagerImpl_Zephyr::_StartEventLoopTask(void) { if (!mChipThreadStack) - return CHIP_ERROR_WELL_UNINITIALIZED; + return CHIP_ERROR_UNINITIALIZED; const auto tid = k_thread_create(&mChipThread, mChipThreadStack, CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE, EventLoopTaskMain, this, nullptr, nullptr, CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY, 0, K_NO_WAIT); diff --git a/src/lib/address_resolve/AddressResolve.h b/src/lib/address_resolve/AddressResolve.h index dc960232e83afa..5e2ad1a09bc0e8 100644 --- a/src/lib/address_resolve/AddressResolve.h +++ b/src/lib/address_resolve/AddressResolve.h @@ -225,7 +225,7 @@ class Resolver /// This method will return CHIP_ERROR_INCORRECT_STATE if the handle is /// still active. /// - /// This method will return CHIP_ERROR_WELL_EMPTY if there are no more + /// This method will return CHIP_ERROR_EMPTY if there are no more /// results. /// /// This method may return other errors in some cases. diff --git a/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp b/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp index 9b8e0240654682..0b1fdeadfde829 100644 --- a/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp +++ b/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp @@ -195,7 +195,7 @@ CHIP_ERROR Resolver::LookupNode(const NodeLookupRequest & request, Impl::NodeLoo CHIP_ERROR Resolver::TryNextResult(Impl::NodeLookupHandle & handle) { VerifyOrReturnError(!mActiveLookups.Contains(&handle), CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturnError(handle.HasLookupResult(), CHIP_ERROR_WELL_EMPTY); + VerifyOrReturnError(handle.HasLookupResult(), CHIP_ERROR_EMPTY); auto listener = handle.GetListener(); auto peerId = handle.GetRequest().GetPeerId(); diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index fe7090007812dd..9e15fa11673b75 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -140,17 +140,17 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_WRONG_KEY_TYPE.AsInteger(): desc = "Wrong key type"; break; - case CHIP_ERROR_WELL_UNINITIALIZED.AsInteger(): - desc = "Well uninitialized"; + case CHIP_ERROR_UNINITIALIZED.AsInteger(): + desc = "Uninitialized"; break; - case CHIP_ERROR_WELL_EMPTY.AsInteger(): - desc = "Well empty"; + case CHIP_ERROR_EMPTY.AsInteger(): + desc = "Empty"; break; case CHIP_ERROR_INVALID_STRING_LENGTH.AsInteger(): desc = "Invalid string length"; break; case CHIP_ERROR_INVALID_LIST_LENGTH.AsInteger(): - desc = "invalid list length"; + desc = "Invalid list length"; break; case CHIP_END_OF_TLV.AsInteger(): desc = "End of TLV"; diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 0bc63cb055f59c..acfb2cef9cd72f 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -666,22 +666,22 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_WRONG_KEY_TYPE CHIP_CORE_ERROR(0x1b) /** - * @def CHIP_ERROR_WELL_UNINITIALIZED + * @def CHIP_ERROR_UNINITIALIZED * * @brief * A requested object is uninitialized. * */ -#define CHIP_ERROR_WELL_UNINITIALIZED CHIP_CORE_ERROR(0x1c) +#define CHIP_ERROR_UNINITIALIZED CHIP_CORE_ERROR(0x1c) /** - * @def CHIP_ERROR_WELL_EMPTY + * @def CHIP_ERROR_EMPTY * * @brief * A requested object is empty. * */ -#define CHIP_ERROR_WELL_EMPTY CHIP_CORE_ERROR(0x1d) +#define CHIP_ERROR_EMPTY CHIP_CORE_ERROR(0x1d) /** * @def CHIP_ERROR_INVALID_STRING_LENGTH diff --git a/src/lib/core/tests/TestCHIPErrorStr.cpp b/src/lib/core/tests/TestCHIPErrorStr.cpp index fec35d773d55bf..cb94abe6589988 100644 --- a/src/lib/core/tests/TestCHIPErrorStr.cpp +++ b/src/lib/core/tests/TestCHIPErrorStr.cpp @@ -76,8 +76,8 @@ static const CHIP_ERROR kTestElements[] = CHIP_ERROR_BUFFER_TOO_SMALL, CHIP_ERROR_DUPLICATE_KEY_ID, CHIP_ERROR_WRONG_KEY_TYPE, - CHIP_ERROR_WELL_UNINITIALIZED, - CHIP_ERROR_WELL_EMPTY, + CHIP_ERROR_UNINITIALIZED, + CHIP_ERROR_EMPTY, CHIP_ERROR_INVALID_STRING_LENGTH, CHIP_ERROR_INVALID_LIST_LENGTH, CHIP_END_OF_TLV, diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index 1dafdf018cbd48..55debe8eb85e8b 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -163,13 +163,13 @@ CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, CommissioningMod template CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, chip::Optional value) { - VerifyOrReturnError(value.HasValue(), CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(value.HasValue(), CHIP_ERROR_UNINITIALIZED); return CopyTextRecordValue(buffer, bufferLen, value.Value()); } CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, chip::Optional value1, chip::Optional value2) { - VerifyOrReturnError(value1.HasValue(), CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(value1.HasValue(), CHIP_ERROR_UNINITIALIZED); return value2.HasValue() ? CopyTextRecordValue(buffer, bufferLen, value1.Value(), value2.Value()) : CopyTextRecordValue(buffer, bufferLen, value1.Value()); } @@ -180,7 +180,7 @@ CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, const chip::Opti VerifyOrReturnError((key == TxtFieldKey::kSessionIdleInterval || key == TxtFieldKey::kSessionActiveInterval || key == TxtFieldKey::kSessionActiveThreshold), CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(optional.HasValue(), CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(optional.HasValue(), CHIP_ERROR_UNINITIALIZED); CHIP_ERROR err; if (key == TxtFieldKey::kSessionActiveThreshold) @@ -215,9 +215,9 @@ CHIP_ERROR CopyTxtRecord(TxtFieldKey key, char * buffer, size_t bufferLen, const // A ICD operating as a LIT should not advertise its slow polling interval if (params.GetICDOperatingAsLIT().HasValue() && params.GetICDOperatingAsLIT().Value()) { - // returning WELL_UNINITIALIZED ensures that the SII string isn't added by the AddTxtRecord + // Returning UNINITIALIZED ensures that the SII string isn't added by the AddTxtRecord // without erroring out the action. - return CHIP_ERROR_WELL_UNINITIALIZED; + return CHIP_ERROR_UNINITIALIZED; } FALLTHROUGH; #endif @@ -261,7 +261,7 @@ CHIP_ERROR AddTxtRecord(TxtFieldKey key, TextEntry * entries, size_t & entriesCo const T & params) { CHIP_ERROR error = CopyTxtRecord(key, buffer, bufferLen, params); - VerifyOrReturnError(CHIP_ERROR_WELL_UNINITIALIZED != error, CHIP_NO_ERROR); + VerifyOrReturnError(CHIP_ERROR_UNINITIALIZED != error, CHIP_NO_ERROR); VerifyOrReturnError(CHIP_NO_ERROR == error, error); entries[entriesCount++] = { Internal::txtFieldInfo[static_cast(key)].keyStr, reinterpret_cast(buffer), diff --git a/src/lib/shell/commands/Dns.cpp b/src/lib/shell/commands/Dns.cpp index 69d1b478523893..5ae2ddc484e5cf 100644 --- a/src/lib/shell/commands/Dns.cpp +++ b/src/lib/shell/commands/Dns.cpp @@ -67,7 +67,7 @@ class DnsShellResolverDelegate : public Dnssd::CommissioningResolveDelegate, pub // Schedule a retry. Not called directly so we do not recurse in OnNodeAddressResolved DeviceLayer::SystemLayer().ScheduleLambda([this] { CHIP_ERROR err = AddressResolve::Resolver::Instance().TryNextResult(Handle()); - if (err != CHIP_NO_ERROR && err != CHIP_ERROR_WELL_EMPTY) + if (err != CHIP_NO_ERROR && err != CHIP_ERROR_EMPTY) { ChipLogError(Discovery, "Failed to list next result: %" CHIP_ERROR_FORMAT, err.Format()); } diff --git a/src/platform/Darwin/KeyValueStoreManagerImpl.mm b/src/platform/Darwin/KeyValueStoreManagerImpl.mm index ddd545bf69d229..b0ea2591c371b4 100644 --- a/src/platform/Darwin/KeyValueStoreManagerImpl.mm +++ b/src/platform/Darwin/KeyValueStoreManagerImpl.mm @@ -219,7 +219,7 @@ - (instancetype)initWithContext:(nonnull NSManagedObjectContext *)context key:(n { ReturnErrorCodeIf(key == nullptr, CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorCodeIf(offset != 0, CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorCodeIf(gContext == nullptr, CHIP_ERROR_WELL_UNINITIALIZED); + ReturnErrorCodeIf(gContext == nullptr, CHIP_ERROR_UNINITIALIZED); KeyValueItem * item = FindItemForKey([[NSString alloc] initWithUTF8String:key], nil, true); if (!item) { @@ -257,7 +257,7 @@ - (instancetype)initWithContext:(nonnull NSManagedObjectContext *)context key:(n CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) { ReturnErrorCodeIf(key == nullptr, CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorCodeIf(gContext == nullptr, CHIP_ERROR_WELL_UNINITIALIZED); + ReturnErrorCodeIf(gContext == nullptr, CHIP_ERROR_UNINITIALIZED); KeyValueItem * item = FindItemForKey([[NSString alloc] initWithUTF8String:key], nil); if (!item) { @@ -282,7 +282,7 @@ - (instancetype)initWithContext:(nonnull NSManagedObjectContext *)context key:(n CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size) { ReturnErrorCodeIf(key == nullptr, CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorCodeIf(gContext == nullptr, CHIP_ERROR_WELL_UNINITIALIZED); + ReturnErrorCodeIf(gContext == nullptr, CHIP_ERROR_UNINITIALIZED); NSData * data = [[NSData alloc] initWithBytes:value length:value_size]; diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index 562c729b6f55e2..ae88aef23c5918 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -311,7 +311,7 @@ CHIP_ERROR ConfigurationManagerImpl::MapConfigError(esp_err_t error) case ESP_OK: return CHIP_NO_ERROR; case ESP_ERR_WIFI_NOT_INIT: - return CHIP_ERROR_WELL_UNINITIALIZED; + return CHIP_ERROR_UNINITIALIZED; case ESP_ERR_INVALID_ARG: case ESP_ERR_WIFI_IF: return CHIP_ERROR_INVALID_ARGUMENT; diff --git a/src/platform/ESP32/ESP32CHIPCryptoPAL.cpp b/src/platform/ESP32/ESP32CHIPCryptoPAL.cpp index 8efc2e56d3c154..4bac5b9fc2968d 100644 --- a/src/platform/ESP32/ESP32CHIPCryptoPAL.cpp +++ b/src/platform/ESP32/ESP32CHIPCryptoPAL.cpp @@ -99,7 +99,7 @@ CHIP_ERROR ESP32P256Keypair::Initialize(ECPKeyTarget keyTarget, int efuseBlock) CHIP_ERROR ESP32P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; diff --git a/src/platform/Infineon/PSOC6/KeyValueStoreManagerImpl.cpp b/src/platform/Infineon/PSOC6/KeyValueStoreManagerImpl.cpp index 40555fa42fea40..e38d41e47fc61a 100644 --- a/src/platform/Infineon/PSOC6/KeyValueStoreManagerImpl.cpp +++ b/src/platform/Infineon/PSOC6/KeyValueStoreManagerImpl.cpp @@ -52,7 +52,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t if (!init_success) { - return CHIP_ERROR_WELL_UNINITIALIZED; + return CHIP_ERROR_UNINITIALIZED; } // Get the value size @@ -152,7 +152,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, { if (!init_success) { - return CHIP_ERROR_WELL_UNINITIALIZED; + return CHIP_ERROR_UNINITIALIZED; } cy_rslt_t result; @@ -179,7 +179,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) { if (!init_success) { - return CHIP_ERROR_WELL_UNINITIALIZED; + return CHIP_ERROR_UNINITIALIZED; } // Matter KVStore requires that a delete called on a key that doesn't exist return an error @@ -223,7 +223,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::Erase(void) { if (!init_success) { - return CHIP_ERROR_WELL_UNINITIALIZED; + return CHIP_ERROR_UNINITIALIZED; } cy_rslt_t result = mtb_kvstore_reset(&kvstore_obj); diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index 7bc357f0705cc9..4c4360822029cf 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -2078,7 +2078,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_AddSrpService(c size_t entryId = 0; FixedBufferAllocator alloc; - VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(aInstanceName, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aName, CHIP_ERROR_INVALID_ARGUMENT); @@ -2178,7 +2178,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_RemoveSrpServic CHIP_ERROR error = CHIP_NO_ERROR; typename SrpClient::Service * srpService = nullptr; - VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(aInstanceName, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aName, CHIP_ERROR_INVALID_ARGUMENT); @@ -2227,7 +2227,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_RemoveInvalidSr { CHIP_ERROR error = CHIP_NO_ERROR; - VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_UNINITIALIZED); Impl()->LockThreadStack(); @@ -2252,7 +2252,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetupSrpHost(co { CHIP_ERROR error = CHIP_NO_ERROR; - VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mSrpClient.mIsInitialized, CHIP_ERROR_UNINITIALIZED); Impl()->LockThreadStack(); diff --git a/src/platform/Tizen/ThreadStackManagerImpl.cpp b/src/platform/Tizen/ThreadStackManagerImpl.cpp index 10d0a56b1ebae3..067a5b16d4df7c 100644 --- a/src/platform/Tizen/ThreadStackManagerImpl.cpp +++ b/src/platform/Tizen/ThreadStackManagerImpl.cpp @@ -230,7 +230,7 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadProvision(ByteSpan netInfo) { int threadErr = THREAD_ERROR_NONE; - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(Thread::OperationalDataset::IsValid(netInfo), CHIP_ERROR_INVALID_ARGUMENT); threadErr = thread_network_set_active_dataset_tlvs(mThreadInstance, netInfo.data(), netInfo.size()); @@ -257,7 +257,7 @@ CHIP_ERROR ThreadStackManagerImpl::_GetThreadProvision(Thread::OperationalDatase uint8_t * tlvsData = nullptr; int tlvsLen; - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); threadErr = thread_network_get_active_dataset_tlvs(mThreadInstance, &tlvsData, &tlvsLen); VerifyOrExit(threadErr == THREAD_ERROR_NONE, ChipLogError(DeviceLayer, "FAIL: get active dataset tlvs")); @@ -306,7 +306,7 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadEnabled(bool val) { int threadErr = THREAD_ERROR_NONE; - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); bool isEnabled = sInstance._IsThreadEnabled(); if (val && !isEnabled) @@ -400,7 +400,7 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadDeviceType(ConnectivityManager::Thr int threadErr = THREAD_ERROR_NONE; thread_device_type_e devType; - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); switch (deviceType) { @@ -540,7 +540,7 @@ CHIP_ERROR ThreadStackManagerImpl::_AddSrpService(const char * aInstanceName, co const Span & aTxtEntries, uint32_t aLeaseInterval, uint32_t aKeyLeaseInterval) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(aInstanceName != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aName != nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -576,7 +576,7 @@ CHIP_ERROR ThreadStackManagerImpl::_AddSrpService(const char * aInstanceName, co CHIP_ERROR ThreadStackManagerImpl::_RemoveSrpService(const char * aInstanceName, const char * aName) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(aInstanceName != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aName != nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -640,7 +640,7 @@ void ThreadStackManagerImpl::_ThreadIpAddressCb(int index, char * ipAddr, thread CHIP_ERROR ThreadStackManagerImpl::_SetupSrpHost(const char * aHostName) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(aHostName != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(strlen(aHostName) <= Dnssd::kHostNameMaxLength, CHIP_ERROR_INVALID_STRING_LENGTH); diff --git a/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp b/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp index e53d793f2ee770..b8e0101cdacea9 100644 --- a/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp +++ b/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp @@ -525,7 +525,7 @@ static inline const mbedtls_uecc_keypair * to_const_keypair(const P256KeypairCon CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; @@ -593,7 +593,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed result = uECC_shared_secret(remote_public_key.ConstBytes() + 1, keypair->private_key, out_secret.Bytes()); diff --git a/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_p256.cpp b/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_p256.cpp index 4ec19deed47ac8..96802c5ea1fe60 100644 --- a/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_p256.cpp +++ b/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_p256.cpp @@ -167,7 +167,7 @@ CHIP_ERROR P256Keypair::Initialize(ECPKeyTarget key_target) CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, size_t msg_length, P256ECDSASignature & out_signature) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); #if !ENABLE_SE05X_GENERATE_EC_KEY return ECDSA_sign_msg_H(&mKeypair, msg, msg_length, out_signature); @@ -236,7 +236,7 @@ CHIP_ERROR P256Keypair::Serialize(P256SerializedKeypair & output) const if (0 != memcmp(&mKeypair.mBytes[0], se05x_magic_no, sizeof(se05x_magic_no))) { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); return Serialize_H(mKeypair, mPublicKey, output); } @@ -338,7 +338,7 @@ CHIP_ERROR P256Keypair::Deserialize(P256SerializedKeypair & input) CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_key, P256ECDHDerivedSecret & out_secret) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); #if !ENABLE_SE05X_GENERATE_EC_KEY return ECDH_derive_secret_H(&mKeypair, remote_public_key, out_secret); @@ -603,7 +603,7 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * csr, size_t & csr uint8_t nist256_header[] = { 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00 }; - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); if (CHIP_NO_ERROR != parse_se05x_keyid_from_keypair(mKeypair, &keyid)) { diff --git a/src/platform/nxp/crypto/se05x/CHIPCryptoPAL_HostFallBack.cpp b/src/platform/nxp/crypto/se05x/CHIPCryptoPAL_HostFallBack.cpp index c1e8d366656722..075453024a90e0 100644 --- a/src/platform/nxp/crypto/se05x/CHIPCryptoPAL_HostFallBack.cpp +++ b/src/platform/nxp/crypto/se05x/CHIPCryptoPAL_HostFallBack.cpp @@ -161,7 +161,7 @@ CHIP_ERROR ECDSA_sign_msg_H(P256KeypairContext * mKeypair, const uint8_t * msg, P256ECDSASignature & out_signature) { // To be checked by the caller - // VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + // VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; @@ -233,7 +233,7 @@ CHIP_ERROR ECDH_derive_secret_H(P256KeypairContext * mKeypair, const P256PublicK const mbedtls_ecp_keypair * keypair = to_const_keypair(mKeypair); // To be checked by the caller - // VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + // VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); result = mbedtls_ecp_group_load(&ecp_grp, MapECPGroupId(remote_public_key.Type())); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); @@ -352,7 +352,7 @@ CHIP_ERROR NewCertificateSigningRequest_H(P256KeypairContext * mKeypair, uint8_t VerifyOrExit(pk.CHIP_CRYPTO_PAL_PRIVATE(pk_info) != nullptr, error = CHIP_ERROR_INTERNAL); // To be checked by the caller - // VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + // VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); mbedtls_x509write_csr_set_key(&csr, &pk); diff --git a/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp b/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp index 378cbb7e408914..68ae897de2917e 100644 --- a/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp +++ b/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp @@ -517,7 +517,7 @@ static inline const ecp256KeyPair_t * to_const_keypair(const P256KeypairContext CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const { #if defined(MBEDTLS_ECDSA_C) - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; diff --git a/src/platform/nxp/k32w/k32w1/CHIPCryptoPalK32W1.cpp b/src/platform/nxp/k32w/k32w1/CHIPCryptoPalK32W1.cpp index 6aad4ae85ea0fc..609c0efa8d6e47 100644 --- a/src/platform/nxp/k32w/k32w1/CHIPCryptoPalK32W1.cpp +++ b/src/platform/nxp/k32w/k32w1/CHIPCryptoPalK32W1.cpp @@ -507,7 +507,7 @@ CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_len sss_sscp_asymmetric_t asyc; size_t signatureSize = kP256_ECDSA_Signature_Length_Raw; - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; @@ -610,7 +610,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k bool bFreeSharedSecret = false; bool bFreeDeriveContex = false; - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); /* Remote public key */ VerifyOrReturnError(sss_sscp_key_object_init(&pEcdhPubKey, &g_keyStore) == kStatus_SSS_Success, CHIP_ERROR_INTERNAL); @@ -782,7 +782,7 @@ P256Keypair::~P256Keypair() CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); MutableByteSpan csr(out_csr, csr_length); CHIP_ERROR err = GenerateCertificateSigningRequest(this, csr); diff --git a/src/platform/nxp/k32w/k32w1/K32W1PersistentStorageOpKeystore.cpp b/src/platform/nxp/k32w/k32w1/K32W1PersistentStorageOpKeystore.cpp index 18c1ff41a79963..43560f549ff951 100644 --- a/src/platform/nxp/k32w/k32w1/K32W1PersistentStorageOpKeystore.cpp +++ b/src/platform/nxp/k32w/k32w1/K32W1PersistentStorageOpKeystore.cpp @@ -72,7 +72,7 @@ CHIP_ERROR P256KeypairSSS::Initialize(Crypto::ECPKeyTarget key_target) CHIP_ERROR P256KeypairSSS::ExportBlob(P256SerializedKeypairSSS & output) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); size_t keyBlobLen = output.Capacity(); VerifyOrReturnError(sss_sscp_key_store_export_key(&g_keyStore, &mKeyObj, output.Bytes(), &keyBlobLen, @@ -114,7 +114,7 @@ CHIP_ERROR P256KeypairSSS::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_ sss_sscp_asymmetric_t asyc; size_t signatureSize = kP256_ECDSA_Signature_Length_Raw; - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; @@ -136,7 +136,7 @@ CHIP_ERROR P256KeypairSSS::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_ CHIP_ERROR P256KeypairSSS::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); MutableByteSpan csr(out_csr, csr_length); CHIP_ERROR err = GenerateCertificateSigningRequest(this, csr); diff --git a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp index 15e8abf27ea76d..e15237b042285d 100644 --- a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp +++ b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp @@ -495,7 +495,7 @@ static inline const mbedtls_uecc_keypair * to_const_keypair(const P256KeypairCon CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const { - VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError((msg != nullptr) && (msg_length > 0), CHIP_ERROR_INVALID_ARGUMENT); uint8_t digest[kSHA256_Hash_Length]; @@ -563,7 +563,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k const mbedtls_uecc_keypair * keypair = to_const_keypair(&mKeypair); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); // Fully padded raw uncompressed points expected, first byte is always 0x04 i.e uncompressed result = uECC_shared_secret(remote_public_key.ConstBytes() + 1, keypair->private_key, out_secret.Bytes()); @@ -719,7 +719,7 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & pk.CHIP_CRYPTO_PAL_PRIVATE(pk_ctx) = to_keypair(&mKeypair); VerifyOrExit(pk.CHIP_CRYPTO_PAL_PRIVATE(pk_info) != nullptr, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); mbedtls_x509write_csr_set_key(&csr, &pk); diff --git a/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp b/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp index 9948017c4d3f94..0ad35de132f940 100644 --- a/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp +++ b/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp @@ -659,7 +659,7 @@ CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_len size_t output_length = 0; const psa_plaintext_ecp_keypair * keypair = to_const_keypair(&mKeypair); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); VerifyOrExit((msg != nullptr) && (msg_length > 0), error = CHIP_ERROR_INVALID_ARGUMENT); psa_crypto_init(); @@ -753,7 +753,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k size_t output_length = 0; const psa_plaintext_ecp_keypair * keypair = to_const_keypair(&mKeypair); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); // Step 1: import plaintext key as volatile for ECDH psa_crypto_init(); @@ -870,7 +870,7 @@ CHIP_ERROR P256Keypair::Serialize(P256SerializedKeypair & output) const size_t len = output.Length() == 0 ? output.Capacity() : output.Length(); Encoding::BufferWriter bbuf(output.Bytes(), len); - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrExit(mInitialized, error = CHIP_ERROR_UNINITIALIZED); bbuf.Put(mPublicKey, mPublicKey.Length()); diff --git a/src/platform/silabs/efr32/Efr32PsaOperationalKeystore.cpp b/src/platform/silabs/efr32/Efr32PsaOperationalKeystore.cpp index 67b7c5e7d48fcc..8f7b54430c7c7e 100644 --- a/src/platform/silabs/efr32/Efr32PsaOperationalKeystore.cpp +++ b/src/platform/silabs/efr32/Efr32PsaOperationalKeystore.cpp @@ -185,7 +185,7 @@ CHIP_ERROR Efr32PsaOperationalKeystore::NewOpKeypairForFabric(FabricIndex fabric MutableByteSpan & outCertificateSigningRequest) { CHIP_ERROR error = CHIP_NO_ERROR; - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); // If a key is pending, we cannot generate for a different fabric index until we commit or revert. @@ -260,7 +260,7 @@ CHIP_ERROR Efr32PsaOperationalKeystore::NewOpKeypairForFabric(FabricIndex fabric CHIP_ERROR Efr32PsaOperationalKeystore::ActivateOpKeypairForFabric(FabricIndex fabricIndex, const Crypto::P256PublicKey & nocPublicKey) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX); VerifyOrReturnError(IsValidFabricIndex(fabricIndex) && (fabricIndex == mPendingFabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); @@ -274,7 +274,7 @@ CHIP_ERROR Efr32PsaOperationalKeystore::ActivateOpKeypairForFabric(FabricIndex f CHIP_ERROR Efr32PsaOperationalKeystore::CommitOpKeypairForFabric(FabricIndex fabricIndex) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX); VerifyOrReturnError(IsValidFabricIndex(fabricIndex) && (fabricIndex == mPendingFabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); VerifyOrReturnError(mIsPendingKeypairActive == true, CHIP_ERROR_INCORRECT_STATE); @@ -320,7 +320,7 @@ CHIP_ERROR Efr32PsaOperationalKeystore::CommitOpKeypairForFabric(FabricIndex fab CHIP_ERROR Efr32PsaOperationalKeystore::RemoveOpKeypairForFabric(FabricIndex fabricIndex) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); // Remove pending keypair if we have it and the fabric ID matches @@ -387,7 +387,7 @@ void Efr32PsaOperationalKeystore::RevertPendingKeypair() CHIP_ERROR Efr32PsaOperationalKeystore::SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message, Crypto::P256ECDSASignature & outSignature) const { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_UNINITIALIZED); VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); // Check to see whether the key is an activated pending key