fix secure1 secondary key calc (#6149)

This commit is contained in:
Sam Kenny 2022-10-06 14:52:01 +11:00 committed by GitHub
parent 76f8d08d66
commit bc6e45ab3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,7 +247,12 @@ Loader::ResultStatus NCCHContainer::Load() {
switch (ncch_header.secondary_key_slot) {
case 0:
LOG_DEBUG(Service_FS, "Secure1 crypto");
secondary_key = primary_key;
SetKeyY(KeySlotID::NCCHSecure1, key_y_secondary);
if (!IsNormalKeyAvailable(KeySlotID::NCCHSecure1)) {
LOG_ERROR(Service_FS, "Secure1 KeyX missing");
failed_to_decrypt = true;
}
secondary_key = GetNormalKey(KeySlotID::NCCHSecure1);
break;
case 1:
LOG_DEBUG(Service_FS, "Secure2 crypto");