Fix sla issue

This commit is contained in:
Bjoern Kerler 2024-09-19 18:04:49 +02:00
parent 8fff2aba85
commit 2a8131d881
No known key found for this signature in database
GPG key ID: A3E0FAF79F2F4578
2 changed files with 5 additions and 2 deletions

View file

@ -8,6 +8,8 @@ import sys
from binascii import hexlify
from struct import pack, unpack
from Cryptodome.Util.number import long_to_bytes
from mtkclient.Library.Auth.sla import generate_da_sla_signature
from mtkclient.Library.DA.xflash.xflash_flash_param import NandExtension
from mtkclient.Library.DA.xflash.xflash_param import Cmd, ChecksumAlgorithm, FtSystemOSE, DataType
@ -1142,7 +1144,7 @@ class DAXFlash(metaclass=LogBase):
rsakey = None
from mtkclient.Library.Auth.sla_keys import da_sla_keys
for key in da_sla_keys:
if da2.find(bytes.fromhex(key.n)) != -1:
if da2.find(long_to_bytes(key.n)) != -1:
rsakey = key
break
if rsakey is None:

View file

@ -7,6 +7,7 @@ from struct import pack, unpack
from queue import Queue
from threading import Thread
from Cryptodome.Util.number import long_to_bytes
from Cryptodome.Cipher import PKCS1_OAEP
from Cryptodome.Hash import SHA256
from Cryptodome.PublicKey import RSA
@ -624,7 +625,7 @@ class DAXML(metaclass=LogBase):
from mtkclient.Library.Auth.sla_keys import da_sla_keys, SlaKey
for key in da_sla_keys:
if isinstance(key, SlaKey):
if da2.find(bytes.fromhex(key.n)) != -1:
if da2.find(long_to_bytes(key.n)) != -1:
rsakey = key
if rsakey is None:
print("No valid sla key found, using dummy auth ....")