From b9310f147386aecffc6b25528fbee2ef12ff9226 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 29 May 2022 13:23:16 -0700 Subject: [PATCH] Savedata: Allow no key when not using SECURE modes. For example, MAKEDATA with no key but explicit secureVersion is fine and does create data. However, it should still mark the version in SAVEDATA_PARAMS, which currently we're failing to do. Load then does some form of validation of this version (but it's not an exact check weirdly.) See #15068. --- Core/Dialog/SavedataParam.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 27b545326b..f4ba47a20e 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -403,7 +403,7 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD ERROR_LOG_REPORT(SCEUTILITY, "Savedata version requested on save: %d", param->secureVersion); return SCE_UTILITY_SAVEDATA_ERROR_SAVE_PARAM; } else if (param->secureVersion != 0) { - if (param->secureVersion != 1 && !HasKey(param)) { + if (param->secureVersion != 1 && !HasKey(param) && secureMode) { ERROR_LOG_REPORT(SCEUTILITY, "Savedata version with missing key on save: %d", param->secureVersion); return SCE_UTILITY_SAVEDATA_ERROR_SAVE_PARAM; } @@ -638,7 +638,7 @@ int SavedataParam::LoadSaveData(SceUtilitySavedataParam *param, const std::strin ERROR_LOG_REPORT(SCEUTILITY, "Savedata version requested: %d", param->secureVersion); return SCE_UTILITY_SAVEDATA_ERROR_LOAD_PARAM; } else if (param->secureVersion != 0) { - if (param->secureVersion != 1 && !HasKey(param)) { + if (param->secureVersion != 1 && !HasKey(param) && secureMode) { ERROR_LOG_REPORT(SCEUTILITY, "Savedata version with missing key: %d", param->secureVersion); return SCE_UTILITY_SAVEDATA_ERROR_LOAD_PARAM; }