Update Keys.py
Fix
@@ -60,7 +60,12 @@ def unwrapAesWrappedTitlekey(wrappedKey, keyGeneration):
aes_kek_generation_source = uhx(keys['aes_kek_generation_source'])
aes_key_generation_source = uhx(keys['aes_key_generation_source'])
- kek = generateKek(uhx(keys['key_area_key_application_source']), uhx(keys['master_key_0' + str(keyGeneration)]), aes_kek_generation_source, aes_key_generation_source)
+ if keyGeneration<10:
+ mk = 'master_key_0'
+ else:
+ mk = 'master_key_'
+
+ kek = generateKek(uhx(keys['key_area_key_application_source']), uhx(keys[mk + str(keyGeneration)]), aes_kek_generation_source, aes_key_generation_source)
crypto = aes128.AESECB(kek)
return crypto.decrypt(wrappedKey)
