Skip to content

Commit

Permalink
add check for valid sender to key exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
jp112sdl committed Jan 23, 2024
1 parent 52ed47c commit 4636714
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MultiChannelDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@ class ChannelDevice : public Device<HalType,List0Type> {
#endif
#ifdef USE_AES
else if (mtype == AS_MESSAGE_KEY_EXCHANGE ) {
if( isPaired==true && msgIsFromMaster==false ) {
//DPRINTLN(F("-> message for us, but from wrong master address."));
return false;
}
if( validSignature(msg) == true ) {
if( this->keystore().exchange(msg.aesExchange())==true ) answer = REPLAY_ACK;
else answer = REPLAY_NACK;
Expand Down

0 comments on commit 4636714

Please sign in to comment.