From 5e2df6c9986cd75f0af4eab1ba0d2aacf258aaab Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 9 May 2020 19:06:45 -0700 Subject: [PATCH] We now allow sending encrypted message payloads --- mesh.options | 4 ++-- mesh.proto | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mesh.options b/mesh.options index ab62650..81fd1be 100644 --- a/mesh.options +++ b/mesh.options @@ -15,8 +15,8 @@ # note: this payload length is ONLY the bytes that are sent inside of the radiohead packet *Data.payload max_size:251 -# 128 bit psk key (we don't use 256 bit yet because we want to keep our QR code small) -*ChannelSettings.psk max_size:16 fixed_length:true +# 256 bit or 128 bit psk key +*ChannelSettings.psk max_size:32 *ChannelSettings.name max_size:12 # The device code doesn't use this legacy field - though the apps still might diff --git a/mesh.proto b/mesh.proto index 7775581..73d64e8 100644 --- a/mesh.proto +++ b/mesh.proto @@ -229,21 +229,22 @@ message MeshPacket { int32 to = 2; /** - Internally to the mesh radios we will route SubPackets encrypted per + Internally to the mesh radios we will route SubPackets encrypted per docs/software/crypto.md. However, when a particular node has the correct key to decode a particular packet, it will decode the payload into a SubPacket - protobuf structure. + protobuf structure. - Software outside of the device nodes will never encounter a packet where "decoded" - is not populated (i.e. any encryption/decryption happens before reaching the applications) + Software outside of the device nodes will never encounter a packet where + "decoded" is not populated (i.e. any encryption/decryption happens before + reaching the applications) - The numeric IDs for these fields were selected to keep backwards compatibility with old - applications. + The numeric IDs for these fields were selected to keep backwards compatibility + with old applications. */ - oneof payload { + oneof payload { SubPacket decoded = 3; bytes encrypted = 8; - } + } /// The time this message was received by the esp32 (secs since 1970). Note: /// this field is _never_ sent on the radio link itself (to save space) Times @@ -309,9 +310,8 @@ message ChannelSettings { // int32 spread_factor = 6; // int32 coding_rate = 7; - /// A simple preshared key for now for crypto. At first I'm using 128 bit (16 - /// byte) block for the Speck crypto but for beta we'll want something more - /// carefully thought through. I want to keep the QR code small + /// A simple preshared key for now for crypto. Must be either 0 bytes (no + /// crypto), 16 bytes (AES128), or 32 bytes (AES256) bytes psk = 4; /// A SHORT name that will be packed into the URL. Less than 12 bytes.