Fix sahara connect for msm89xx

This commit is contained in:
Bjoern Kerler 2023-04-03 13:13:28 +02:00
parent 1d3e89a2af
commit 571ee4ed89
No known key found for this signature in database
GPG key ID: 52E823BB96A55380
3 changed files with 7 additions and 6 deletions

@ -1 +1 @@
Subproject commit b39741a9b96160755b963819d52dfe589f7a3a62
Subproject commit bbb3e075515806ac7bd2551c65476e33bb40eba2

View file

@ -3,10 +3,10 @@
# (c) B.Kerler 2018-2019
import hashlib
from Crypto.Cipher import AES
from Crypto.Util import Counter
from Crypto.Hash import CMAC
from Crypto.Util.number import long_to_bytes, bytes_to_long
from Cryptodome.Cipher import AES
from Cryptodome.Util import Counter
from Cryptodome.Hash import CMAC
from Cryptodome.Util.number import long_to_bytes, bytes_to_long
from binascii import hexlify, unhexlify

View file

@ -515,7 +515,7 @@ class sahara(metaclass=LogBase):
datalen = len(programmer)
done = False
loop = 0
while datalen > 0 or done:
while datalen >= 0 or done:
resp = self.get_rsp()
if "cmd" in resp:
cmd = resp["cmd"]
@ -580,6 +580,7 @@ class sahara(metaclass=LogBase):
except Exception as e: # pylint: disable=broad-except
self.error("Unexpected error on uploading, maybe signature of loader wasn't accepted ?\n" + str(e))
return ""
return self.mode
def cmd_modeswitch(self, mode):
data = pack("<III", cmd_t.SAHARA_SWITCH_MODE, 0xC, mode)