You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/storage/tests/python/tests/test_pin.py

29 lines
554 B

from ..src.storage import Storage
def test_set_pin_success():
s = Storage()
hw_salt = b"\x00\x00\x00\x00\x00\x00"
s.init(hw_salt)
s._set_pin(1)
assert s.unlock(1)
s = Storage()
s.init(hw_salt)
s._set_pin(229922)
assert s.unlock(229922)
def test_set_pin_failure():
s = Storage()
hw_salt = b"\x00\x00\x00\x00\x00\x00"
s.init(hw_salt)
s._set_pin(1)
assert s.unlock(1)
assert not s.unlock(1234)
s = Storage()
s.init(hw_salt)
s._set_pin(229922)
assert not s.unlock(1122992211)