mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 22:52:07 +00:00
Admin session key debugging messages
This commit is contained in:
parent
273beef148
commit
ab9268cba9
@ -4,6 +4,7 @@
|
||||
#include "NodeDB.h"
|
||||
#include "PowerFSM.h"
|
||||
#include "RTC.h"
|
||||
#include "meshUtils.h"
|
||||
#include <FSCommon.h>
|
||||
#if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_BLUETOOTH
|
||||
#include "BleOta.h"
|
||||
@ -968,13 +969,16 @@ void AdminModule::setPassKey(meshtastic_AdminMessage *res)
|
||||
}
|
||||
memcpy(res->session_passkey.bytes, session_passkey, 8);
|
||||
res->session_passkey.size = 8;
|
||||
printBytes("Setting admin key to ", res->session_passkey.bytes, 8);
|
||||
// if halfway to session_expire, regenerate session_passkey, reset the timeout
|
||||
// set the key in the packet
|
||||
}
|
||||
|
||||
bool AdminModule::checkPassKey(meshtastic_AdminMessage *res)
|
||||
{ // check that the key in the packet is still valid
|
||||
return (session_time + 300 < millis() / 1000 && res->session_passkey.size == 8 &&
|
||||
printBytes("Incoming session key: ", res->session_passkey.bytes, 8);
|
||||
printBytes("Expected session key: ", session_passkey, 8);
|
||||
return (session_time + 300 > millis() / 1000 && res->session_passkey.size == 8 &&
|
||||
memcmp(res->session_passkey.bytes, session_passkey, 8) == 0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user