From f6aa6a2ac79627d390fc7978d5ebc3f2aa71ebab Mon Sep 17 00:00:00 2001 From: Bjoern Kerler Date: Tue, 11 Jan 2022 11:52:22 +0100 Subject: [PATCH] Fix stage2 --- mtkclient/Library/hwcrypto_sej.py | 24 +++++-- stage2 | 100 +++++++++++++++++++----------- 2 files changed, 83 insertions(+), 41 deletions(-) diff --git a/mtkclient/Library/hwcrypto_sej.py b/mtkclient/Library/hwcrypto_sej.py index e03d93c..79d6976 100755 --- a/mtkclient/Library/hwcrypto_sej.py +++ b/mtkclient/Library/hwcrypto_sej.py @@ -301,9 +301,13 @@ class sej(metaclass=LogBase): self.reg.HACC_ASRC2 = psrc[pos + 2] self.reg.HACC_ASRC3 = psrc[pos + 3] self.reg.HACC_ACON2 = self.HACC_AES_START - while True: + i = 0 + while i < 20: if self.reg.HACC_ACON2 & self.HACC_AES_RDY != 0: break + i += 1 + if i == 20: + self.error("SEJ Hardware seems not to be configured correctly. Results may be wrong.") pdst.extend(pack("