mirror of
https://github.com/arendst/Tasmota.git
synced 2026-10-26 22:11:22 +00:00
Fix ble eq3 bthome decryption regression
This commit is contained in:
1 parent
fb1929565f
commit
d1358faffc
1 file changed
+1
-4
@@ -756,9 +756,6 @@ void TaskEQ3ParseBTHome(BLE_ESP32::ble_advertisment_t* pStruct) {
|
|||||||
if (eq3->cryptState) {
|
if (eq3->cryptState) {
|
||||||
#ifdef USE_MI_ESP32
|
#ifdef USE_MI_ESP32
|
||||||
#define USE_MI_DECRYPTION // Just to be sure...
|
#define USE_MI_DECRYPTION // Just to be sure...
|
||||||
uint8_t addrRev[6];
|
|
||||||
memcpy(addrRev, addr, 6);
|
|
||||||
BLE_ESP32::ReverseMAC(addrRev);
|
|
||||||
uint8_t* bufPtr = (uint8_t*)ServiceDataStr.data();
|
uint8_t* bufPtr = (uint8_t*)ServiceDataStr.data();
|
||||||
uint32_t micTag = *(uint32_t*)(bufPtr + (ServiceDataLength - 4));
|
uint32_t micTag = *(uint32_t*)(bufPtr + (ServiceDataLength - 4));
|
||||||
uint8_t nonce[13];
|
uint8_t nonce[13];
|
||||||
@@ -769,7 +766,7 @@ void TaskEQ3ParseBTHome(BLE_ESP32::ble_advertisment_t* pStruct) {
|
|||||||
memcpy(&nonce[9], bufPtr + (ServiceDataLength - 8), 4);
|
memcpy(&nonce[9], bufPtr + (ServiceDataLength - 8), 4);
|
||||||
uint8_t* cipherText = bufPtr + 1;
|
uint8_t* cipherText = bufPtr + 1;
|
||||||
int cipherLen = ServiceDataLength - 9;
|
int cipherLen = ServiceDataLength - 9;
|
||||||
eq3->cryptState = MIDecryptPayload(addrRev, nonce, micTag, cipherText, cipherLen);
|
eq3->cryptState = MIDecryptPayload(addr, nonce, micTag, cipherText, cipherLen);
|
||||||
if (eq3->cryptState) return; // Decrypt failed on any reason
|
if (eq3->cryptState) return; // Decrypt failed on any reason
|
||||||
ServiceDataLength -= 8;
|
ServiceDataLength -= 8;
|
||||||
ServiceData = bufPtr;
|
ServiceData = bufPtr;
|
||||||
|
|||||||
Reference in new issue
Block a user