Browse Source

fix(bridge): refuse to start ESPNowBridge with default secret

pull/2529/head
Stephen Waits 1 month ago
parent
commit
c02ef22e1d
No known key found for this signature in database GPG Key ID: 943ECEA0A1FD4EEC
  1. 9
      src/helpers/bridges/ESPNowBridge.cpp

9
src/helpers/bridges/ESPNowBridge.cpp

@ -27,6 +27,15 @@ ESPNowBridge::ESPNowBridge(NodePrefs *prefs, mesh::PacketManager *mgr, mesh::RTC
} }
void ESPNowBridge::begin() { void ESPNowBridge::begin() {
// Refuse to start with the published-in-source default secret, or an empty one.
// The repeating-key XOR used by xorCrypt() is already weak; combined with the
// default secret "LVSITANOS" it is no protection at all. Operator must set a
// non-default bridge_secret via CLI before this bridge will run.
if (_prefs->bridge_secret[0] == 0 || strcmp(_prefs->bridge_secret, "LVSITANOS") == 0) {
BRIDGE_DEBUG_PRINTLN("ESPNowBridge: refusing to start with default/empty bridge_secret\n");
return;
}
BRIDGE_DEBUG_PRINTLN("Initializing...\n"); BRIDGE_DEBUG_PRINTLN("Initializing...\n");
// Initialize WiFi in station mode // Initialize WiFi in station mode

Loading…
Cancel
Save