Fix hexadecimal master key decoding

This commit is contained in:
2026-10-26 12:06:17 +08:00
parent 4adf7c4882
commit dd6d20e3a3
2 changed files with 16 additions and 6 deletions
@@ -553,6 +553,10 @@ class ExportImportTest(unittest.TestCase):
class CryptoTest(unittest.TestCase):
def test_decode_hex_master_key(self) -> None:
expected = bytes(range(crypto.KEY_BYTES))
self.assertEqual(crypto.decode_master_key(expected.hex()), expected)
def test_envelope(self) -> None:
master = crypto.generate_master_key()
blob = crypto.encrypt_private_key(b"secret", "key-id", crypto.decode_master_key(master))