gcm: Convert source data to a uint8_t pointer before subscripting it (#29)

It's not well-formed to subscript a pointer to void
This commit is contained in:
Mat M 2018-02-22 21:44:27 -05:00 committed by SciresM
parent 3020faf8a2
commit 1d8f443f68

View file

@ -148,9 +148,10 @@ size_t gcm_decrypt_key(void *dst, size_t dst_size, const void *src, size_t src_s
ghash(calc_mac, dst, src_size - 0x20, j_block, 1);
/* Const-time memcmp. */
const uint8_t *src_bytes = src;
int different = 0;
for (unsigned int i = 0; i < 0x10; i++) {
different |= src[src_size - 0x10 + i] ^ calc_mac[i];
different |= src_bytes[src_size - 0x10 + i] ^ calc_mac[i];
}
if (different) {
return 0;