Whoops stupid decryption error %-)

This commit is contained in:
Stefan `Sec` Zehl 2011-07-17 00:59:05 +02:00
parent 4af33c9074
commit 42b6fa7a6b
1 changed files with 1 additions and 1 deletions

View File

@ -152,10 +152,10 @@ int nrf_rcv_pkt_time_encr(int maxtime, int maxsize, uint8_t * pkt, uint32_t cons
}; };
nrf_read_pkt(len,pkt); nrf_read_pkt(len,pkt);
cmpcrc=crc16(pkt,len-2);
if(key != NULL) 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);
if(cmpcrc != (pkt[len-2] <<8 | pkt[len-1])) { if(cmpcrc != (pkt[len-2] <<8 | pkt[len-1])) {
continue; continue;
return -3; // CRC failed return -3; // CRC failed