Add seccfg V3 check if already locked / unlocked

This commit is contained in:
Bjoern Kerler 2023-06-14 23:56:34 +02:00
parent 4290a5c436
commit 416eba82b4
No known key found for this signature in database
GPG key ID: 52E823BB96A55380

View file

@ -243,7 +243,6 @@ class seccfgV3(metaclass=LogBase):
self.seccfg_enc_len = 0x01000000 self.seccfg_enc_len = 0x01000000
seccfg_attr_new = SECCFG_ATTR.ATTR_DEFAULT seccfg_attr_new = SECCFG_ATTR.ATTR_DEFAULT
"""
if lockflag == "lock" and self.seccfg_attr != SECCFG_ATTR.ATTR_UNLOCK: if lockflag == "lock" and self.seccfg_attr != SECCFG_ATTR.ATTR_UNLOCK:
return False, ("Can't find lock state, current (%#x)" % self.seccfg_attr) return False, ("Can't find lock state, current (%#x)" % self.seccfg_attr)
elif lockflag == "unlock" and self.seccfg_attr != SECCFG_ATTR.ATTR_DEFAULT \ elif lockflag == "unlock" and self.seccfg_attr != SECCFG_ATTR.ATTR_DEFAULT \
@ -252,7 +251,7 @@ class seccfgV3(metaclass=LogBase):
and self.seccfg_attr != SECCFG_ATTR.ATTR_VERIFIED \ and self.seccfg_attr != SECCFG_ATTR.ATTR_VERIFIED \
and self.seccfg_attr != SECCFG_ATTR.ATTR_LOCK: and self.seccfg_attr != SECCFG_ATTR.ATTR_LOCK:
return False, ("Can't find unlock state, current (%#x)" % self.seccfg_attr) return False, ("Can't find unlock state, current (%#x)" % self.seccfg_attr)
"""
data = bytearray() data = bytearray()
wf = BytesIO(data) wf = BytesIO(data)
wf.write(self.info) wf.write(self.info)