diff --git a/.github/workflows/stale_bot.yml b/.github/workflows/stale_bot.yml deleted file mode 100644 index 0fd2cd5..0000000 --- a/.github/workflows/stale_bot.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: process stale Issues and PR's -on: - schedule: - - cron: 0 6 * * * - workflow_dispatch: {} - -permissions: - issues: write - pull-requests: write - -jobs: - stale_issues: - name: Close Stale Issues - runs-on: ubuntu-latest - - steps: - - name: Stale PR+Issues - uses: actions/stale@v9.0.0 - with: - exempt-issue-labels: pinned,3.0 - exempt-pr-labels: pinned,3.0 diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 2fa237d..ad8864a 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - trufflehog@3.82.13 + - trufflehog@3.82.12 - yamllint@1.35.1 - bandit@1.7.10 - - checkov@3.2.269 + - checkov@3.2.256 - terrascan@1.19.9 - - trivy@0.56.2 + - trivy@0.55.2 #- trufflehog@3.63.2-rc0 - taplo@0.9.3 - - ruff@0.7.1 + - ruff@0.7.0 - isort@5.13.2 - markdownlint@0.42.0 - oxipng@9.1.2 diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 382975e..36d8b95 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -31,7 +31,7 @@ build_flags = -DCONFIG_BT_NIMBLE_ENABLED -DCONFIG_NIMBLE_CPP_LOG_LEVEL=2 -DCONFIG_BT_NIMBLE_MAX_CCCDS=20 - -DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 + -DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=5120 -DESP_OPENSSL_SUPPRESS_LEGACY_WARNING -DSERIAL_BUFFER_SIZE=4096 -DLIBPAX_ARDUINO diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 1e9e212..e813317 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -421,7 +421,7 @@ bool GPS::setup() if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) { // if GPS_BAUDRATE is specified in variant (i.e. not 9600), skip to the specified rate. - if (speedSelect == 0 && probeTries == 2 && GPS_BAUDRATE != serialSpeeds[speedSelect]) { + if (speedSelect == 0 && GPS_BAUDRATE != serialSpeeds[speedSelect]) { speedSelect = std::find(serialSpeeds, std::end(serialSpeeds), GPS_BAUDRATE) - serialSpeeds; } @@ -431,7 +431,7 @@ bool GPS::setup() if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) { speedSelect = 0; if (--probeTries == 0) { - LOG_WARN("Giving up on GPS probe and setting to %d", GPS_BAUDRATE); + LOG_WARN("Giving up on GPS probe and setting to 9600."); return true; } } diff --git a/src/gps/GPS.h b/src/gps/GPS.h index 240d087..533f6b5 100644 --- a/src/gps/GPS.h +++ b/src/gps/GPS.h @@ -76,7 +76,7 @@ class GPS : private concurrency::OSThread uint8_t fixType = 0; // fix type from GPGSA #endif private: - const int serialSpeeds[6] = {9600, 115200, 38400, 4800, 57600, GPS_BAUDRATE}; + const int serialSpeeds[6] = {9600, 115200, 38400, 4800, 57600, 9600}; uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0; uint32_t rx_gpio = 0; uint32_t tx_gpio = 0; diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 6b29919..b842420 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -174,23 +174,21 @@ NodeDB::NodeDB() } #if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN || MESHTASTIC_EXCLUDE_PKI) - if (!owner.is_licensed) { - bool keygenSuccess = false; - if (config.security.private_key.size == 32) { - if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { - keygenSuccess = true; - } - } else { - LOG_INFO("Generating new PKI keys"); - crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + bool keygenSuccess = false; + if (config.security.private_key.size == 32) { + if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { keygenSuccess = true; } - if (keygenSuccess) { - config.security.public_key.size = 32; - config.security.private_key.size = 32; - owner.public_key.size = 32; - memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); - } + } else { + LOG_INFO("Generating new PKI keys"); + crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); + keygenSuccess = true; + } + if (keygenSuccess) { + config.security.public_key.size = 32; + config.security.private_key.size = 32; + owner.public_key.size = 32; + memcpy(owner.public_key.bytes, config.security.public_key.bytes, 32); } #elif !(MESHTASTIC_EXCLUDE_PKI) // Calculate Curve25519 public and private keys @@ -1278,4 +1276,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co LOG_ERROR("A critical failure occurred, portduino is exiting..."); exit(2); #endif -} \ No newline at end of file +} diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index e8f6d1c..f51c9bc 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -271,7 +271,7 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr) if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER || config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) { delay = random(0, 2 * CWsize) * slotTimeMsec; - LOG_DEBUG("rx_snr found in packet. Router: setting tx delay:%d", delay); + LOG_DEBUG("rx_snr found in packet. As a router, setting tx delay:%d", delay); } else { // offset the maximum delay for routers: (2 * CWmax * slotTimeMsec) delay = (2 * CWmax * slotTimeMsec) + random(0, pow(2, CWsize)) * slotTimeMsec; diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index 855cf44..8437118 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -81,12 +81,6 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply() ignoreRequest = false; // Don't ignore requests anymore meshtastic_User &u = owner; - // Strip the public key if the user is licensed - if (u.is_licensed && u.public_key.size > 0) { - u.public_key.bytes[0] = 0; - u.public_key.size = 0; - } - LOG_INFO("sending owner %s/%s/%s", u.id, u.long_name, u.short_name); lastSentToMesh = millis(); return allocDataProtobuf(u); diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index 1c45a1d..dc9c8aa 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -315,7 +315,7 @@ ProcessMessage SerialModuleRadio::handleReceived(const meshtastic_MeshPacket &mp // LOG_DEBUG("Received text msg self=0x%0x, from=0x%0x, to=0x%0x, id=%d, msg=%.*s", // nodeDB->getNodeNum(), mp.from, mp.to, mp.id, p.payload.size, p.payload.bytes); - if (isFromUs(&mp)) { + if (!isFromUs(&mp)) { /* * If moduleConfig.serial.echo is true, then echo the packets that are sent out diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index b1185e2..7b3493f 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -51,11 +51,7 @@ void updateBatteryLevel(uint8_t level) {} void getMacAddr(uint8_t *dmac) { -#if defined(CONFIG_IDF_TARGET_ESP32C6) && defined(CONFIG_SOC_IEEE802154_SUPPORTED) - assert(esp_base_mac_addr_get(dmac) == ESP_OK); -#else assert(esp_efuse_mac_get_default(dmac) == ESP_OK); -#endif } #ifdef HAS_32768HZ