From 1d8f443f68455d08a29d466c76f35d387f3d8dde Mon Sep 17 00:00:00 2001 From: Mat M Date: Thu, 22 Feb 2018 21:44:27 -0500 Subject: [PATCH] gcm: Convert source data to a uint8_t pointer before subscripting it (#29) It's not well-formed to subscript a pointer to void --- exosphere/gcm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exosphere/gcm.c b/exosphere/gcm.c index d89b9ad1d..dbded44ab 100644 --- a/exosphere/gcm.c +++ b/exosphere/gcm.c @@ -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;