summaryrefslogtreecommitdiffstats
path: root/samloader/crypt.py
diff options
context:
space:
mode:
Diffstat (limited to 'samloader/crypt.py')
-rw-r--r--samloader/crypt.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/samloader/crypt.py b/samloader/crypt.py
index 0b57c5a..29611a6 100644
--- a/samloader/crypt.py
+++ b/samloader/crypt.py
@@ -8,8 +8,9 @@ import xml.etree.ElementTree as ET
from Cryptodome.Cipher import AES
from clint.textui import progress
-from . import request
from . import fusclient
+from . import request
+from . import versionfetch
# PKCS#7 unpad
unpad = lambda d: d[:-d[-1]]
@@ -17,6 +18,7 @@ unpad = lambda d: d[:-d[-1]]
def getv4key(version, model, region):
""" Retrieve the AES key for V4 encryption. """
client = fusclient.FUSClient()
+ version = versionfetch.normalizevercode(version)
req = request.binaryinform(version, model, region, client.nonce)
resp = client.makereq("NF_DownloadBinaryInform.do", req)
root = ET.fromstring(resp)