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];
|
||||
|
||||
uint32_t const meshkey[4] = {
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
0x00000042, 0x000005ec, 0x00000023, 0x00000005
|
||||
};
|
||||
|
||||
struct NRF_CFG oldconfig;
|
||||
|
|
|
@ -153,13 +153,12 @@ int nrf_rcv_pkt_poll_dec(int maxsize, uint8_t * pkt, uint32_t const key[4]){
|
|||
return len;
|
||||
|
||||
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);
|
||||
|
||||
cmpcrc=crc16(pkt,len-2);
|
||||
if(cmpcrc != (pkt[len-2] <<8 | pkt[len-1])) {
|
||||
return -3; // CRC failed
|
||||
};
|
||||
cmpcrc=crc16(pkt,len-2);
|
||||
if(cmpcrc != (pkt[len-2] <<8 | pkt[len-1])) {
|
||||
return -3; // CRC failed
|
||||
};
|
||||
return len;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue