Add xap cli functions to test secure

This commit is contained in:
zvecr
2022-07-07 01:57:41 +01:00
parent 6ec0ff387b
commit ced7094ddd
4 changed files with 34 additions and 8 deletions
+14
View File
@@ -148,9 +148,23 @@ class XAPDevice:
data['xap'] = self.version()['xap']
return data
def status(self):
lock = int.from_bytes(self.transaction(b'\x00\x03') or bytes(0), 'little')
data = {}
data['lock'] = XAPSecureStatus(lock).name
return data
def unlock(self):
self.transaction(b'\x00\x04')
def lock(self):
self.transaction(b'\x00\x05')
def reset(self):
status = int.from_bytes(self.transaction(b'\x01\x07') or bytes(0), 'little')
return status == 1
class XAPClient:
@staticmethod