Disable unencrypted receive by default. also add meshkey
This commit is contained in:
parent
7170789b3e
commit
0c7afe0eb1
|
@ -12,7 +12,7 @@ char meshincctr=0; // Generation
|
||||||
MPKT meshbuffer[MESHBUFSIZE];
|
MPKT meshbuffer[MESHBUFSIZE];
|
||||||
|
|
||||||
uint32_t const meshkey[4] = {
|
uint32_t const meshkey[4] = {
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000000
|
0x00000042, 0x000005ec, 0x00000023, 0x00000005
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NRF_CFG oldconfig;
|
struct NRF_CFG oldconfig;
|
||||||
|
|
|
@ -153,14 +153,13 @@ int nrf_rcv_pkt_poll_dec(int maxsize, uint8_t * pkt, uint32_t const key[4]){
|
||||||
return len;
|
return len;
|
||||||
|
|
||||||
cmpcrc=crc16(pkt,len-2);
|
cmpcrc=crc16(pkt,len-2);
|
||||||
if(cmpcrc != (pkt[len-2] <<8 | pkt[len-1])) {
|
if(key!=NULL)
|
||||||
xxtea_decode_words((uint32_t*)pkt,len/4,key);
|
xxtea_decode_words((uint32_t*)pkt,len/4,key);
|
||||||
|
|
||||||
cmpcrc=crc16(pkt,len-2);
|
cmpcrc=crc16(pkt,len-2);
|
||||||
if(cmpcrc != (pkt[len-2] <<8 | pkt[len-1])) {
|
if(cmpcrc != (pkt[len-2] <<8 | pkt[len-1])) {
|
||||||
return -3; // CRC failed
|
return -3; // CRC failed
|
||||||
};
|
};
|
||||||
};
|
|
||||||
return len;
|
return len;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue