mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
Fix build when MESHTASTIC_EXCLUDE_PKI is defined
This commit is contained in:
@@ -963,6 +963,7 @@ void setup()
|
|||||||
i2cScanner.reset();
|
i2cScanner.reset();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_PKI)
|
||||||
// warn the user about a low entropy key
|
// warn the user about a low entropy key
|
||||||
if (nodeDB->keyIsLowEntropy && !nodeDB->hasWarned) {
|
if (nodeDB->keyIsLowEntropy && !nodeDB->hasWarned) {
|
||||||
LOG_WARN(LOW_ENTROPY_WARNING);
|
LOG_WARN(LOW_ENTROPY_WARNING);
|
||||||
@@ -973,6 +974,7 @@ void setup()
|
|||||||
service->sendClientNotification(cn);
|
service->sendClientNotification(cn);
|
||||||
nodeDB->hasWarned = true;
|
nodeDB->hasWarned = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// buttons are now inputBroker, so have to come after setupModules
|
// buttons are now inputBroker, so have to come after setupModules
|
||||||
#if HAS_BUTTON
|
#if HAS_BUTTON
|
||||||
|
|||||||
@@ -2008,6 +2008,7 @@ UserLicenseStatus NodeDB::getLicenseStatus(uint32_t nodeNum)
|
|||||||
return info->user.is_licensed ? UserLicenseStatus::Licensed : UserLicenseStatus::NotLicensed;
|
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)
|
bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest)
|
||||||
{
|
{
|
||||||
if (keyToTest.size == 32) {
|
if (keyToTest.size == 32) {
|
||||||
@@ -2022,6 +2023,7 @@ bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_pub
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool NodeDB::backupPreferences(meshtastic_AdminMessage_BackupLocation location)
|
bool NodeDB::backupPreferences(meshtastic_AdminMessage_BackupLocation location)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -283,7 +283,9 @@ class NodeDB
|
|||||||
|
|
||||||
bool hasValidPosition(const meshtastic_NodeInfoLite *n);
|
bool hasValidPosition(const meshtastic_NodeInfoLite *n);
|
||||||
|
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_PKI)
|
||||||
bool checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest);
|
bool checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool backupPreferences(meshtastic_AdminMessage_BackupLocation location);
|
bool backupPreferences(meshtastic_AdminMessage_BackupLocation location);
|
||||||
bool restorePreferences(meshtastic_AdminMessage_BackupLocation location,
|
bool restorePreferences(meshtastic_AdminMessage_BackupLocation location,
|
||||||
|
|||||||
@@ -773,6 +773,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
|||||||
config.lora = validatedLora;
|
config.lora = validatedLora;
|
||||||
// If we're setting region for the first time, init the region and regenerate the keys
|
// 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 (isRegionUnset && config.lora.region > meshtastic_Config_LoRaConfig_RegionCode_UNSET) {
|
||||||
|
#if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN || MESHTASTIC_EXCLUDE_PKI)
|
||||||
if (!owner.is_licensed) {
|
if (!owner.is_licensed) {
|
||||||
bool keygenSuccess = false;
|
bool keygenSuccess = false;
|
||||||
if (config.security.private_key.size == 32) {
|
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);
|
memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
config.lora.tx_enabled = true;
|
config.lora.tx_enabled = true;
|
||||||
initRegion();
|
initRegion();
|
||||||
if (myRegion->dutyCycle < 100) {
|
if (myRegion->dutyCycle < 100) {
|
||||||
|
|||||||
Reference in New Issue
Block a user