diff --git a/src/main.cpp b/src/main.cpp index fd376ea51..8fc2c097b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -963,6 +963,7 @@ void setup() i2cScanner.reset(); #endif +#if !defined(MESHTASTIC_EXCLUDE_PKI) // warn the user about a low entropy key if (nodeDB->keyIsLowEntropy && !nodeDB->hasWarned) { LOG_WARN(LOW_ENTROPY_WARNING); @@ -973,6 +974,7 @@ void setup() service->sendClientNotification(cn); nodeDB->hasWarned = true; } +#endif // buttons are now inputBroker, so have to come after setupModules #if HAS_BUTTON diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index d8146c4a3..bb3fc6dca 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -2008,6 +2008,7 @@ UserLicenseStatus NodeDB::getLicenseStatus(uint32_t nodeNum) return info->user.is_licensed ? UserLicenseStatus::Licensed : UserLicenseStatus::NotLicensed; } +#if !defined(MESHTASTIC_EXCLUDE_PKI) bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest) { if (keyToTest.size == 32) { @@ -2022,6 +2023,7 @@ bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_pub } return false; } +#endif bool NodeDB::backupPreferences(meshtastic_AdminMessage_BackupLocation location) { diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 444ac13e4..306acc0a5 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -283,7 +283,9 @@ class NodeDB bool hasValidPosition(const meshtastic_NodeInfoLite *n); +#if !defined(MESHTASTIC_EXCLUDE_PKI) bool checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest); +#endif bool backupPreferences(meshtastic_AdminMessage_BackupLocation location); bool restorePreferences(meshtastic_AdminMessage_BackupLocation location, @@ -373,4 +375,4 @@ extern uint32_t error_address; ModuleConfig_RangeTestConfig_size + ModuleConfig_SerialConfig_size + ModuleConfig_StoreForwardConfig_size + \ ModuleConfig_TelemetryConfig_size + ModuleConfig_size) -// Please do not remove this comment, it makes trunk and compiler happy at the same time. \ No newline at end of file +// Please do not remove this comment, it makes trunk and compiler happy at the same time. diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index a98515059..aa510a86d 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -773,6 +773,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) config.lora = validatedLora; // If we're setting region for the first time, init the region and regenerate the keys if (isRegionUnset && config.lora.region > meshtastic_Config_LoRaConfig_RegionCode_UNSET) { +#if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN || MESHTASTIC_EXCLUDE_PKI) if (!owner.is_licensed) { bool keygenSuccess = false; if (config.security.private_key.size == 32) { @@ -791,6 +792,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); } } +#endif config.lora.tx_enabled = true; initRegion(); if (myRegion->dutyCycle < 100) {