postPairingsURL - fix controller update

ensure updating existing controller set up proper permissions
by actually reading the request (previous "fix" was getting it from
the caller controller data)
This commit is contained in:
Daniel Skowroński 2022-10-26 21:39:52 +02:00
parent cb0b722bb1
commit f0c1fdc990
No known key found for this signature in database
GPG Key ID: E33828259A4A062D
1 changed files with 1 additions and 1 deletions

View File

@ -931,7 +931,7 @@ int HAPClient::postPairingsURL(){
}
if((newCont=findController(tlv8.buf(kTLVType_Identifier)))){
int originalPermissions=tlv8.val(kTLVType_Permissions);
int originalPermissions=*tlv8.buf(kTLVType_Permissions);
tlv8.clear(); // clear TLV records
tlv8.val(kTLVType_State,pairState_M2); // set State=<M2>
if(!memcmp(cPair->LTPK,newCont->LTPK,32)){ // requested Controller already exists and LTPK matches