1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

Fix undefined integer shift.

This commit is contained in:
Andrew Kozlik 2019-02-22 11:26:28 +01:00
parent e55737c4b1
commit 1b9329b6fa

View File

@ -259,7 +259,7 @@ static secbool auth_get(uint16_t key, const void **val, uint16_t *len)
}
continue;
}
g[0] = ((k & 0xff) << 24) | ((k & 0xff00) << 8) | 0x8000; // Add SHA message padding.
g[0] = (((uint32_t)k & 0xff) << 24) | (((uint32_t)k & 0xff00) << 8) | 0x8000; // Add SHA message padding.
sha256_Transform(idig, g, h);
sha256_Transform(odig, h, h);
for (uint32_t i = 0; i < SHA256_DIGEST_LENGTH/sizeof(uint32_t); i++) {