mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-14 09:20:55 +00:00
refactor path validation
This commit is contained in:
parent
da7bb8abf8
commit
2dd1ae6491
@ -54,10 +54,14 @@ def validate_full_path(path: list) -> bool:
|
|||||||
return False
|
return False
|
||||||
if path[1] != 1729 | HARDENED:
|
if path[1] != 1729 | HARDENED:
|
||||||
return False
|
return False
|
||||||
if length == 3 and (path[2] < HARDENED or path[2] > 1000000 | HARDENED):
|
if length == 3:
|
||||||
return False
|
if path[2] < HARDENED or path[2] > 1000000 | HARDENED:
|
||||||
if length == 4 and (path[2] != 0 | HARDENED or path[3] < HARDENED or path[3] > 1000000 | HARDENED):
|
return False
|
||||||
return False
|
if length == 4:
|
||||||
|
if path[2] != 0 | HARDENED:
|
||||||
|
return False
|
||||||
|
if path[3] < HARDENED or path[3] > 1000000 | HARDENED:
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user