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

crypto: Check for invalid characters in Monero Base58 decode.

This commit is contained in:
Andrew Kozlik 2020-04-14 17:03:40 +02:00 committed by Tomas Susanka
parent 20dd1ddc60
commit 3843f917e9

View File

@ -102,6 +102,8 @@ bool decode_block(const char* block, size_t size, char* res)
uint64_t order = 1;
for (size_t i = size - 1; i < size; --i)
{
if (block[i] & 0x80)
return false; // Invalid symbol
int digit = reverse_alphabet(block[i]);
if (digit < 0)
return false; // Invalid symbol