diff --git a/src/main.cpp b/src/main.cpp index c654822927..4a04483e56 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -960,6 +960,7 @@ void setup() #endif // warn the user about a low entropy key +#if !defined(MESHTASTIC_EXCLUDE_PKI) if (nodeDB->keyIsLowEntropy && !nodeDB->hasWarned) { LOG_WARN(LOW_ENTROPY_WARNING); meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); @@ -969,6 +970,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 df9aece0ad..88498da826 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1976,6 +1976,7 @@ UserLicenseStatus NodeDB::getLicenseStatus(uint32_t nodeNum) return info->user.is_licensed ? UserLicenseStatus::Licensed : UserLicenseStatus::NotLicensed; } +#if !(MESHTASTIC_EXCLUDE_PKI) bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest) { if (keyToTest.size == 32) { @@ -1990,6 +1991,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 e8724f2c95..dce68f8ce8 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -282,7 +282,9 @@ class NodeDB bool hasValidPosition(const meshtastic_NodeInfoLite *n); +#if !(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, diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index d300ff53b8..c6aa9600fd 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -759,6 +759,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) { @@ -777,6 +778,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) {