diff --git a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_Spake2p.cpp b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_Spake2p.cpp index 662d3a7b46411e..005e90c8e9bd22 100644 --- a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_Spake2p.cpp +++ b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_Spake2p.cpp @@ -314,18 +314,18 @@ CHIP_ERROR Spake2pHSM_P256_SHA256_HKDF_HMAC::BeginVerifier(const uint8_t * my_id #if SSS_HAVE_SE05X_VER_GTE_16_02 smstatus = Se05x_API_PAKEConfigDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, SE05x_SPAKEDevice_B, hsm_pake_context.spake_objId); - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); smstatus = Se05x_API_PAKEInitDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, hsm_pake_context.spake_objId, (uint8_t *) hsm_pake_context.spake_context, hsm_pake_context.spake_context_len, (uint8_t *) peer_identity, peer_identity_len, (uint8_t *) my_identity, my_identity_len); - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); #else smstatus = Se05x_API_PAKEConfigDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, SE05x_SPAKEDevice_B, hsm_pake_context.spake_objId, (uint8_t *) hsm_pake_context.spake_context, hsm_pake_context.spake_context_len, (uint8_t *) peer_identity, peer_identity_len, (uint8_t *) my_identity, my_identity_len); - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); #endif ReturnErrorOnFailure(se05x_set_key(w0in_id_v, w0in_mod, w0in_mod_len, kSSS_KeyPart_Default, kSSS_CipherType_AES)); @@ -338,7 +338,7 @@ CHIP_ERROR Spake2pHSM_P256_SHA256_HKDF_HMAC::BeginVerifier(const uint8_t * my_id smstatus = Se05x_API_PAKEInitDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, hsm_pake_context.spake_objId, w0in_id_v, 0, Lin_id_v); #endif - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); state = CHIP_SPAKE2P_STATE::STARTED; role = CHIP_SPAKE2P_ROLE::VERIFIER; @@ -388,18 +388,18 @@ CHIP_ERROR Spake2pHSM_P256_SHA256_HKDF_HMAC::BeginProver(const uint8_t * my_iden #if SSS_HAVE_SE05X_VER_GTE_16_02 smstatus = Se05x_API_PAKEConfigDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, SE05x_SPAKEDevice_A, hsm_pake_context.spake_objId); - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); smstatus = Se05x_API_PAKEInitDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, hsm_pake_context.spake_objId, (uint8_t *) hsm_pake_context.spake_context, hsm_pake_context.spake_context_len, (uint8_t *) my_identity, my_identity_len, (uint8_t *) peer_identity, peer_identity_len); - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); #else smstatus = Se05x_API_PAKEConfigDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, SE05x_SPAKEDevice_A, hsm_pake_context.spake_objId, (uint8_t *) hsm_pake_context.spake_context, hsm_pake_context.spake_context_len, (uint8_t *) peer_identity, peer_identity_len, (uint8_t *) my_identity, my_identity_len); - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); #endif ReturnErrorOnFailure(se05x_set_key(w0in_id_p, w0in_mod, w0in_mod_len, kSSS_KeyPart_Default, kSSS_CipherType_AES)); @@ -412,7 +412,7 @@ CHIP_ERROR Spake2pHSM_P256_SHA256_HKDF_HMAC::BeginProver(const uint8_t * my_iden smstatus = Se05x_API_PAKEInitDevice(&((sss_se05x_session_t *) &gex_sss_chip_ctx.session)->s_ctx, hsm_pake_context.spake_objId, w0in_id_p, w1in_id_p, 0); #endif - VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::kSe05x, smstatus)); + VerifyOrReturnError(smstatus == SM_OK, chip::ChipError::Encapsulate(chip::ChipError::Range::Platform, smstatus)); state = CHIP_SPAKE2P_STATE::STARTED; role = CHIP_SPAKE2P_ROLE::PROVER; diff --git a/src/platform/mbed/BLEManagerImpl.cpp b/src/platform/mbed/BLEManagerImpl.cpp index 2018c1792ef60a..8cdbeb3ab1e539 100644 --- a/src/platform/mbed/BLEManagerImpl.cpp +++ b/src/platform/mbed/BLEManagerImpl.cpp @@ -580,7 +580,7 @@ CHIP_ERROR BLEManagerImpl::_Init() mbed_err = ble_interface.init([](ble::BLE::InitializationCompleteCallbackContext * context) { BLEMgrImpl().HandleInitComplete(context->error == BLE_ERROR_NONE); }); - VerifyOrReturnError(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrReturnError(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); return CHIP_NO_ERROR; } @@ -621,10 +621,10 @@ void BLEManagerImpl::HandleInitComplete(bool no_error) /*const Passkey_t passkey */ nullptr, /*bool signing */ true, /*const char *dbFilepath */ nullptr); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); mbed_err = security_mgr.setPairingRequestAuthorisation(true); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); security_mgr.setSecurityManagerEventHandler(&sSecurityManagerEventHandler); err = BleLayer::Init(this, this, &SystemLayer); @@ -751,16 +751,16 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) if (gap.isAdvertisingActive(ble::LEGACY_ADVERTISING_HANDLE)) { mbed_err = gap.stopAdvertising(ble::LEGACY_ADVERTISING_HANDLE); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); ChipLogDetail(DeviceLayer, "Advertising already active. Restarting."); } mbed_err = gap.setAdvertisingParameters(ble::LEGACY_ADVERTISING_HANDLE, adv_params); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); mbed_err = adv_data_builder.setFlags(ble::adv_data_flags_t::BREDR_NOT_SUPPORTED | ble::adv_data_flags_t::LE_GENERAL_DISCOVERABLE); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); if (!mFlags.Has(kFlag_UseCustomDeviceName)) { @@ -770,24 +770,24 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) snprintf(mDeviceName, kMaxDeviceNameLength, "%s%04u", CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX, discriminator); } mbed_err = adv_data_builder.setName(mDeviceName); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); dev_id_info.Init(); SuccessOrExit(ConfigurationMgr().GetBLEDeviceIdentificationInfo(dev_id_info)); mbed_err = adv_data_builder.setServiceData( ShortUUID_CHIPoBLEService, mbed::make_Span(reinterpret_cast(&dev_id_info), sizeof dev_id_info)); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); mbed_err = gap.setAdvertisingPayload(ble::LEGACY_ADVERTISING_HANDLE, adv_data_builder.getAdvertisingData()); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); adv_data_builder.clear(); adv_data_builder.setLocalServiceList(mbed::make_Span(&ShortUUID_CHIPoBLEService, 1)); mbed_err = gap.setAdvertisingScanResponse(ble::LEGACY_ADVERTISING_HANDLE, adv_data_builder.getAdvertisingData()); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); mbed_err = gap.startAdvertising(ble::LEGACY_ADVERTISING_HANDLE); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); ChipLogDetail(DeviceLayer, "Advertising started, type: 0x%x (%sconnectable), interval: [%lu:%lu] ms, device name: %s)", adv_params.getType().value(), connectable ? "" : "non-", adv_params.getMinPrimaryInterval().valueInMs(), @@ -814,7 +814,7 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) return err; } mbed_err = gap.stopAdvertising(ble::LEGACY_ADVERTISING_HANDLE); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); exit: if (mbed_err != BLE_ERROR_NONE) @@ -1028,7 +1028,7 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU conId, att_handle, pBuf->DataLength()); mbed_err = gatt_server.write(att_handle, pBuf->Start(), pBuf->DataLength(), false); - VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::OS, mbed_err)); + VerifyOrExit(mbed_err == BLE_ERROR_NONE, chip::ChipError::Encapsulate(chip::ChipError::Range::kOS, mbed_err)); exit: if (mbed_err != BLE_ERROR_NONE)