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.
This commit is contained in:
Unknown W. Brackets committed 2022-05-29 13:23:16 -07:00
1 parent 21bf41e6dd
commit b9310f1473
1 file changed
+2 -2
+2 -2
View File
@@ -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;
}