Fix payload length verification (#680)

This commit is contained in:
Olivier
2016-12-06 15:45:27 +01:00
committed by Patrick Fallberg
parent f59be0aa2a
commit fdbb285dee
2 changed files with 9 additions and 2 deletions
+3 -1
View File
@@ -141,7 +141,9 @@ uint8_t transportReceive(void* data)
// has to be adjusted, WIP!
_aes.set_IV(0);
// decrypt data
_aes.cbc_decrypt((byte*)(data), (byte*)(data), len>16?2:1);
if (_aes.cbc_decrypt((uint8_t*)(data), (uint8_t*)(data), len > 16 ? 2 : 1) != AES_SUCCESS) {
len = 0;
}
#endif
return len;
}