mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-16 15:52:34 +00:00
Warn users about low entropy keys (#7003)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -548,6 +548,19 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
||||
numbytes += MESHTASTIC_PKC_OVERHEAD;
|
||||
p->channel = 0;
|
||||
p->pki_encrypted = true;
|
||||
|
||||
// warn the user about a low entropy key
|
||||
if (nodeDB->keyIsLowEntropy) {
|
||||
LOG_WARN(LOW_ENTROPY_WARNING);
|
||||
if (!nodeDB->hasWarned) {
|
||||
meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed();
|
||||
cn->level = meshtastic_LogRecord_Level_WARNING;
|
||||
cn->time = getValidTime(RTCQualityFromNet);
|
||||
sprintf(cn->message, LOW_ENTROPY_WARNING);
|
||||
service->sendClientNotification(cn);
|
||||
nodeDB->hasWarned = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (p->pki_encrypted == true) {
|
||||
// Client specifically requested PKI encryption
|
||||
|
||||
Reference in New Issue
Block a user