Add switch for openssl patch in segatools.ini

This commit is contained in:
2024-10-18 13:34:25 +07:00
parent 97d2d6b9bc
commit cef3406691
6 changed files with 41 additions and 5 deletions

View File

@ -79,16 +79,25 @@ static void openssl_patch(void) {
}
}
int openssl_patch_apply(void) {
HRESULT openssl_patch_apply(const struct openssl_patch_config *cfg) {
HRESULT hr;
assert(cfg != NULL);
if (!cfg->enable) {
return S_FALSE;
}
char* cpuname = get_cpu_name();
if (cpuname == NULL) {
dprintf("OpenSSL Patch: Error: Unable to detect CPU.\n");
return 1;
return S_FALSE;
}
if (check_cpu(cpuname)) {
openssl_patch();
}
free(cpuname);
return 0;
return S_OK;
}