minor fixups to get nrf52 building again

1.2-legacy
geeksville 2020-05-09 21:02:56 -07:00
rodzic 190a3c2d6b
commit 2fa595523f
6 zmienionych plików z 16 dodań i 6 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
# What is Meshtastic?
Meshtastic is a project that lets you use
inexpensive (\$30 ish) GPS radios as an extensible, super long battery life mesh GPS communicator. These radios are great for hiking, skiing, paragliding - essentially any hobby where you don't have reliable internet access. Each member of your private mesh can always see the location and distance of all other members and any text messages sent to your group chat.
inexpensive (\$30 ish) GPS radios as an extensible, long battery life, secure, mesh GPS communicator. These radios are great for hiking, skiing, paragliding - essentially any hobby where you don't have reliable internet access. Each member of your private mesh can always see the location and distance of all other members and any text messages sent to your group chat.
The radios automatically create a mesh to forward packets as needed, so everyone in the group can receive messages from even the furthest member. The radios will optionally work with your phone, but no phone is required.

Wyświetl plik

@ -4,8 +4,8 @@ Cryptography is tricky, so we've tried to 'simply' apply standard crypto solutio
the project developers are not cryptography experts. Therefore we ask two things:
- If you are a cryptography expert, please review these notes and our questions below. Can you help us by reviewing our
notes below and offering advice? We will happily give as much or as little credit as you wish as our thanks ;-).
- Consider our existing solution 'alpha' and probably fairly secure against an not very aggressive adversary. But until
notes below and offering advice? We will happily give as much or as little credit as you wish ;-).
- Consider our existing solution 'alpha' and probably fairly secure against a not particularly aggressive adversary. But until
it is reviewed by someone smarter than us, assume it might have flaws.
## Notes on implementation
@ -16,7 +16,7 @@ the project developers are not cryptography experts. Therefore we ask two things
Parameters for our CTR implementation:
- Our AES key is 256 bits, shared as part of the 'Channel' specification.
- Our AES key is 128 or 256 bits, shared as part of the 'Channel' specification.
- Each SubPacket will be sent as a series of 16 byte BLOCKS.
- The node number concatenated with the packet number is used as the NONCE. This counter will be stored in flash in the device and should essentially never repeat. If the user makes a new 'Channel' (i.e. picking a new random 256 bit key), the packet number will start at zero. The packet number is sent
in cleartext with each packet. The node number can be derived from the "from" field of each packet.
@ -35,4 +35,6 @@ Note that for both stategies, sizes are measured in blocks and that an AES block
## Remaining todo
- Make the packet numbers 32 bit
- Confirm the packet #s are stored in flash across deep sleep (and otherwise in in RAM)
- Have the app change the crypto key when the user generates a new channel
- Implement for NRF52 [NRF52](https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_crypto_aes.html#sub_aes_ctr)

Wyświetl plik

@ -116,7 +116,7 @@ bool FloodingRouter::wasSeenRecently(const MeshPacket *p)
}
uint32_t now = millis();
for (int i = 0; i < recentBroadcasts.size();) {
for (size_t i = 0; i < recentBroadcasts.size();) {
BroadcastRecord &r = recentBroadcasts[i];
if ((now - r.rxTimeMsec) >= FLOOD_EXPIRE_TIME) {

Wyświetl plik

@ -197,6 +197,9 @@ void RadioLibInterface::loop()
#ifndef NO_ESP32
#define USE_HW_TIMER
#else
// Not needed on NRF52
#define IRAM_ATTR
#endif
void IRAM_ATTR RadioLibInterface::timerCallback(void *p1, uint32_t p2)

Wyświetl plik

@ -31,7 +31,7 @@ void StreamAPI::readStream()
if (c != START2)
rxPtr = 0; // failed to find framing
} else if (ptr >= HEADER_LEN) { // we have at least read our 4 byte framing
uint16_t len = (rxBuf[2] << 8) + rxBuf[3]; // big endian 16 bit length follows framing
uint32_t len = (rxBuf[2] << 8) + rxBuf[3]; // big endian 16 bit length follows framing
if (ptr == HEADER_LEN) {
// we _just_ finished our 4 byte header, validate length now (note: a length of zero is a valid

Wyświetl plik

@ -0,0 +1,5 @@
#include "CryptoEngine.h"
// FIXME, do a NRF52 version
CryptoEngine *crypto = new CryptoEngine();