Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.5 Changes #4431

Merged
merged 83 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
3513d88
Protobufs
thebentern Aug 10, 2024
2012a0a
Protos
thebentern Aug 10, 2024
861f0b6
Add ClientNotification hello world
thebentern Aug 10, 2024
a767997
Get in the trunk!
thebentern Aug 10, 2024
74afd13
Re-implement PKI from #1509 (#4379)
jp-bennett Aug 10, 2024
864b793
Merge branch 'master' into 2.5-changes
thebentern Aug 10, 2024
8ca884b
Add DH25519 unit test
jp-bennett Aug 10, 2024
b573e0e
Fix compile on STM32
jp-bennett Aug 11, 2024
1cfd5d1
Refactor platform cryptography, add tests
jp-bennett Aug 11, 2024
54a2e14
Add missed function rename. (Thanks VSCode)
jp-bennett Aug 11, 2024
e1b4b22
Manual protobuf update
jp-bennett Aug 11, 2024
9bc2224
Exclude position packets from PKI (at least for now)
jp-bennett Aug 11, 2024
0bd17e6
Merge branch 'master' into 2.5-changes
jp-bennett Aug 11, 2024
a28f10e
User to UserLite in NodeDB (#4438)
thebentern Aug 11, 2024
48eee74
protos
thebentern Aug 11, 2024
bee9591
Add logic to nodeDB to prefer evicting boring nodes (#4441)
jp-bennett Aug 12, 2024
2ee53d1
Don't goober public_key in Userlite conversion
jp-bennett Aug 12, 2024
bc69621
Ungoober oldestBoring
jp-bennett Aug 12, 2024
9bd293a
Don't forget public_key.size in converting back
jp-bennett Aug 12, 2024
8d1a34a
Protobufs
thebentern Aug 10, 2024
da53b81
Protos
thebentern Aug 10, 2024
95682c9
Add ClientNotification hello world
thebentern Aug 10, 2024
c451db3
Get in the trunk!
thebentern Aug 10, 2024
b726792
Re-implement PKI from #1509 (#4379)
jp-bennett Aug 10, 2024
26d0b2b
Add DH25519 unit test
jp-bennett Aug 10, 2024
192af05
Fix compile on STM32
jp-bennett Aug 11, 2024
c3aa56e
Refactor platform cryptography, add tests
jp-bennett Aug 11, 2024
c86a320
Add missed function rename. (Thanks VSCode)
jp-bennett Aug 11, 2024
185eb31
Manual protobuf update
jp-bennett Aug 11, 2024
e7dfabc
Exclude position packets from PKI (at least for now)
jp-bennett Aug 11, 2024
8f3614d
User to UserLite in NodeDB (#4438)
thebentern Aug 11, 2024
884bc52
protos
thebentern Aug 11, 2024
67ddae2
Add logic to nodeDB to prefer evicting boring nodes (#4441)
jp-bennett Aug 12, 2024
2d18130
Don't goober public_key in Userlite conversion
jp-bennett Aug 12, 2024
7537b55
Ungoober oldestBoring
jp-bennett Aug 12, 2024
b91d66b
Don't forget public_key.size in converting back
jp-bennett Aug 12, 2024
0e7253d
Protos
thebentern Aug 13, 2024
b4cbea1
Move security migrate to if has_security
jp-bennett Aug 13, 2024
c16f20d
Make "Alloc an error" a LOG_WARN
jp-bennett Aug 13, 2024
754db3f
Finish fixing config migrate
jp-bennett Aug 13, 2024
308c0a6
Add Routing_Error_NONE
jp-bennett Aug 13, 2024
bcd77c4
Cleanup public_keys (#4450)
jp-bennett Aug 13, 2024
f3fa8da
Revert "Add Routing_Error_NONE"
jp-bennett Aug 13, 2024
80fd121
Add meshtastic_Routing_Error_NO_CHANNEL
jp-bennett Aug 13, 2024
ff89dca
Add PKI indicator to printPacket
jp-bennett Aug 13, 2024
b528290
Failure returns PKI_FAILED message if client requested PKI
jp-bennett Aug 13, 2024
2661fc6
sync protobufs
jp-bennett Aug 14, 2024
8ce1c07
Check for blank key coming from client
jp-bennett Aug 14, 2024
8ef72a5
Shorter nodeinfo timeout redux (#4458)
jp-bennett Aug 14, 2024
36f1a62
Merge remote-tracking branch 'origin/2.5-changes' into 2.5-changes
jp-bennett Aug 14, 2024
1be635a
Merge remote-tracking branch 'origin/master' into 2.5-changes
jp-bennett Aug 15, 2024
ced8759
Add PKI channel for MQTT (#4464)
jp-bennett Aug 15, 2024
96cf78a
Short turbo preset (#4465)
thebentern Aug 15, 2024
ef56fae
Merge branch 'master' into 2.5-changes
jp-bennett Aug 15, 2024
6f1dae1
Re-compute correct timeslot on applyModemConfig (#4469)
thebentern Aug 15, 2024
390de72
Update 2.5 protos
thebentern Aug 16, 2024
eefe9ef
Adds ASCII log option needed by portudino (#4443) (#4474)
thebentern Aug 16, 2024
b0c1b7b
MQTT PKI fixes
jp-bennett Aug 16, 2024
e61bd84
Send local stats telemetry to phone every 15 minutes (#4475)
thebentern Aug 16, 2024
cec8233
Don't attempt PKI decryption on broadcast packets
jp-bennett Aug 17, 2024
6eabbaf
Add PKI logiv to KNOWN_ONLY and LOCAL_ONLY routing modes.
jp-bennett Aug 17, 2024
7cbae56
Merge branch 'master' into 2.5-changes
jp-bennett Aug 17, 2024
9dad62e
Set time-only admin command (#4479)
thebentern Aug 17, 2024
fdaaf71
Merge branch 'master' into 2.5-changes
thebentern Aug 17, 2024
f86dde3
AdminModule session_passkey (#4478)
jp-bennett Aug 17, 2024
0b010b4
Get STM32 building again by disabling admin module
jp-bennett Aug 17, 2024
daddaf7
Merge branch 'master' into 2.5-changes
jp-bennett Aug 17, 2024
578ac67
Merge branch 'master' into 2.5-changes
jp-bennett Aug 17, 2024
33ced7e
Add two-way traceroute result with SNR per hop (#4485)
GUVWAF Aug 17, 2024
c7c620a
Merge branch 'master' into 2.5-changes
jp-bennett Aug 17, 2024
23e3e6d
Add 4 bytes of random nonce to PKI (#4493)
jp-bennett Aug 18, 2024
e3e36e2
add admin getter for `SECURITY_CONFIG` (#4499)
andrekir Aug 18, 2024
7a65c88
Fall back to default modem preset if requested bandwidth is too large…
GUVWAF Aug 18, 2024
a85df19
Only accept PKI messages for MQTT downlink if we know transmitter and…
GUVWAF Aug 18, 2024
22e129e
bluetooth != security; security = security
jp-bennett Aug 18, 2024
bfbc4bf
Set the private_key in crypto when changed by admin
jp-bennett Aug 18, 2024
f439081
Don't segfault on PKI from unknown nodes
jp-bennett Aug 18, 2024
ecb4fb7
Don't break EXCLUDE_PKI
jp-bennett Aug 18, 2024
7b64c4a
Merge branch 'master' into 2.5-changes
jp-bennett Aug 19, 2024
94d5ee9
Deal with adminModule session_time of 0
jp-bennett Aug 19, 2024
273beef
Re-set the extra-nonce value
jp-bennett Aug 19, 2024
ab9268c
Admin session key debugging messages
jp-bennett Aug 19, 2024
48dc222
Merge branch 'master' into 2.5-changes
jp-bennett Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/esp32/esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ lib_deps =
https://github.com/dbSuS/libpax.git#7bcd3fcab75037505be9b122ab2b24cc5176b587
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
rweather/Crypto@^0.4.0

lib_ignore =
segger_rtt
Expand Down
1 change: 1 addition & 0 deletions arch/nrf52/nrf52.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build_src_filter =

lib_deps=
${arduino_base.lib_deps}
rweather/Crypto@^0.4.0

lib_ignore =
BluetoothOTA
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extra_configs =
variants/*/platformio.ini

[env]
test_build_src = true
extra_scripts = bin/platformio-custom.py

; note: we add src to our include search path so that lmic_project_config can override
Expand Down
2 changes: 1 addition & 1 deletion src/DebugConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#define LOG_CRIT(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#define LOG_TRACE(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#else
#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE)
#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) && !defined(PIO_UNIT_TESTING)
#define LOG_DEBUG(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_DEBUG, __VA_ARGS__)
#define LOG_INFO(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_INFO, __VA_ARGS__)
#define LOG_WARN(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_WARN, __VA_ARGS__)
Expand Down
3 changes: 3 additions & 0 deletions src/DisplayFormatters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const char *DisplayFormatters::getModemPresetDisplayName(meshtastic_Config_LoRaConfig_ModemPreset preset, bool useShortName)
{
switch (preset) {
case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO:
return useShortName ? "ShortT" : "ShortTurbo";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW:
return useShortName ? "ShortS" : "ShortSlow";
break;
Expand Down
7 changes: 4 additions & 3 deletions src/RedirectablePrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ size_t RedirectablePrint::write(uint8_t c)
#ifdef USE_SEGGER
SEGGER_RTT_PutChar(SEGGER_STDOUT_CH, c);
#endif

if (!config.has_lora || config.device.serial_enabled)
// Account for legacy config transition
bool serialEnabled = config.has_security ? config.security.serial_enabled : config.device.serial_enabled;
if (!config.has_lora || serialEnabled)
dest->write(c);

return 1; // We always claim one was written, rather than trusting what the
Expand Down Expand Up @@ -212,7 +213,7 @@ void RedirectablePrint::log_to_syslog(const char *logLevel, const char *format,
void RedirectablePrint::log_to_ble(const char *logLevel, const char *format, va_list arg)
{
#if !MESHTASTIC_EXCLUDE_BLUETOOTH
if (config.bluetooth.device_logging_enabled && !pauseBluetoothLogging) {
if (config.security.bluetooth_logging_enabled && !pauseBluetoothLogging) {
bool isBleConnected = false;
#ifdef ARCH_ESP32
isBleConnected = nimbleBluetooth && nimbleBluetooth->isActive() && nimbleBluetooth->isConnected();
Expand Down
4 changes: 2 additions & 2 deletions src/SerialConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool SerialConsole::checkIsConnected()
bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)
{
// only talk to the API once the configuration has been loaded and we're sure the serial port is not disabled.
if (config.has_lora && config.device.serial_enabled) {
if (config.has_lora && config.security.serial_enabled) {
// Switch to protobufs for log messages
usingProtobufs = true;
canWrite = true;
Expand All @@ -96,7 +96,7 @@ bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)

void SerialConsole::log_to_serial(const char *logLevel, const char *format, va_list arg)
{
if (usingProtobufs && config.device.debug_log_enabled) {
if (usingProtobufs && config.security.debug_log_api_enabled) {
meshtastic_LogRecord_Level ll = meshtastic_LogRecord_Level_UNSET; // default to unset
switch (logLevel[0]) {
case 'D':
Expand Down
6 changes: 6 additions & 0 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEFAULT_SHUTDOWN_SECONDS 2
#endif

#ifndef MINIMUM_SAFE_FREE_HEAP
#define MINIMUM_SAFE_FREE_HEAP 1500
#endif

/* Step #3: mop up with disabled values for HAS_ options not handled by the above two */

#ifndef HAS_WIFI
Expand Down Expand Up @@ -256,6 +260,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MESHTASTIC_EXCLUDE_MQTT 1
#define MESHTASTIC_EXCLUDE_POWERMON 1
#define MESHTASTIC_EXCLUDE_I2C 1
#define MESHTASTIC_EXCLUDE_PKI 1
#define MESHTASTIC_EXCLUDE_POWER_FSM 1
#define MESHTASTIC_EXCLUDE_TZ 1
#endif
Expand All @@ -280,6 +285,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MESHTASTIC_EXCLUDE_INPUTBROKER 1
#define MESHTASTIC_EXCLUDE_SERIAL 1
#define MESHTASTIC_EXCLUDE_POWERSTRESS 1
#define MESHTASTIC_EXCLUDE_ADMIN 1
#endif

// // Turn off wifi even if HW supports wifi (webserver relies on wifi and is also disabled)
Expand Down
9 changes: 5 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void printInfo()
{
LOG_INFO("S:B:%d,%s\n", HW_VENDOR, optstr(APP_VERSION));
}

#ifndef PIO_UNIT_TESTING
void setup()
{
concurrency::hasBeenSetup = true;
Expand Down Expand Up @@ -1052,7 +1052,7 @@ void setup()
powerFSMthread = new PowerFSMThread();
setCPUFast(false); // 80MHz is fine for our slow peripherals
}

#endif
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client)

Expand All @@ -1075,7 +1075,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata()
deviceMetadata.hasRemoteHardware = moduleConfig.remote_hardware.enabled;
return deviceMetadata;
}

#ifndef PIO_UNIT_TESTING
void loop()
{
runASAP = false;
Expand Down Expand Up @@ -1120,4 +1120,5 @@ void loop()
mainDelay.delay(delayMsec);
}
// if (didWake) LOG_DEBUG("wake!\n");
}
}
#endif
Loading
Loading