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:
parent
20dd1ddc60
commit
3843f917e9
@ -102,6 +102,8 @@ bool decode_block(const char* block, size_t size, char* res)
|
|||||||
uint64_t order = 1;
|
uint64_t order = 1;
|
||||||
for (size_t i = size - 1; i < size; --i)
|
for (size_t i = size - 1; i < size; --i)
|
||||||
{
|
{
|
||||||
|
if (block[i] & 0x80)
|
||||||
|
return false; // Invalid symbol
|
||||||
int digit = reverse_alphabet(block[i]);
|
int digit = reverse_alphabet(block[i]);
|
||||||
if (digit < 0)
|
if (digit < 0)
|
||||||
return false; // Invalid symbol
|
return false; // Invalid symbol
|
||||||
|
Loading…
Reference in New Issue
Block a user