From 820036087d4a10a9126648d029d92394df4faf25 Mon Sep 17 00:00:00 2001 From: Will Toohey Date: Mon, 14 Aug 2023 23:39:57 +1000 Subject: [PATCH] Revert "Make roundplug PCBID/EAMID verification fail a hard error" This reverts commit 67de6639ef474e1d0ad90bb521cb84cc3421f023. --- src/main/ddrhook1/config-eamuse.c | 25 +++++++++++++++++++++---- src/main/iidxhook-util/config-eamuse.c | 25 +++++++++++++++++++++---- src/main/jbhook1/config-eamuse.c | 24 ++++++++++++++++++++---- src/main/popnhook1/config-eamuse.c | 25 +++++++++++++++++++++---- 4 files changed, 83 insertions(+), 16 deletions(-) diff --git a/src/main/ddrhook1/config-eamuse.c b/src/main/ddrhook1/config-eamuse.c index f50fb36..260791d 100644 --- a/src/main/ddrhook1/config-eamuse.c +++ b/src/main/ddrhook1/config-eamuse.c @@ -56,6 +56,7 @@ void ddrhook1_config_eamuse_get( { char server_url[1024]; char *tmp; + char *tmp2; memset(config_eamuse, 0, sizeof(struct ddrhook1_config_eamuse)); @@ -101,8 +102,16 @@ void ddrhook1_config_eamuse_get( } if (!security_id_verify(&config_eamuse->pcbid)) { - log_fatal("PCBID verification failed"); - return; + tmp = security_id_to_str( + &DDRHOOK1_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->pcbid, false); + log_warning( + "PCBID verification of '%s' failed, fallback to default " + "PCBID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } if (!cconfig_util_get_data( @@ -121,7 +130,15 @@ void ddrhook1_config_eamuse_get( } if (!security_id_verify(&config_eamuse->eamid)) { - log_fatal("EAMID verification failed"); - return; + tmp = security_id_to_str( + &DDRHOOK1_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->eamid, false); + log_warning( + "EAMID verification of '%s' failed, fallback to default " + "EAMID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } } diff --git a/src/main/iidxhook-util/config-eamuse.c b/src/main/iidxhook-util/config-eamuse.c index adc3c35..f59b03e 100644 --- a/src/main/iidxhook-util/config-eamuse.c +++ b/src/main/iidxhook-util/config-eamuse.c @@ -68,6 +68,7 @@ void iidxhook_util_config_eamuse_get( { char server_url[1024]; char *tmp; + char *tmp2; memset(config_eamuse, 0, sizeof(struct iidxhook_util_config_eamuse)); @@ -126,8 +127,16 @@ void iidxhook_util_config_eamuse_get( } if (!security_id_verify(&config_eamuse->pcbid)) { - log_fatal("PCBID verification failed"); - return; + tmp = security_id_to_str( + &IIDXHOOK_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->pcbid, false); + log_warning( + "PCBID verification of '%s' failed, fallback to default " + "PCBID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } if (!cconfig_util_get_data( @@ -146,7 +155,15 @@ void iidxhook_util_config_eamuse_get( } if (!security_id_verify(&config_eamuse->eamid)) { - log_fatal("EAMID verification failed"); - return; + tmp = security_id_to_str( + &IIDXHOOK_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->eamid, false); + log_warning( + "EAMID verification of '%s' failed, fallback to default " + "EAMID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } } diff --git a/src/main/jbhook1/config-eamuse.c b/src/main/jbhook1/config-eamuse.c index 7ed941c..dba512e 100644 --- a/src/main/jbhook1/config-eamuse.c +++ b/src/main/jbhook1/config-eamuse.c @@ -102,8 +102,16 @@ void jbhook1_config_eamuse_get( } if (!security_id_verify(&config_eamuse->pcbid)) { - log_fatal("PCBID verification failed"); - return; + tmp = security_id_to_str( + &JBHOOK1_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->pcbid, false); + log_warning( + "PCBID verification of '%s' failed, fallback to default " + "PCBID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } if (!cconfig_util_get_data( @@ -122,7 +130,15 @@ void jbhook1_config_eamuse_get( } if (!security_id_verify(&config_eamuse->eamid)) { - log_fatal("EAMID verification failed"); - return; + tmp = security_id_to_str( + &JBHOOK1_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->eamid, false); + log_warning( + "EAMID verification of '%s' failed, fallback to default " + "EAMID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } } diff --git a/src/main/popnhook1/config-eamuse.c b/src/main/popnhook1/config-eamuse.c index 909911e..98e406b 100644 --- a/src/main/popnhook1/config-eamuse.c +++ b/src/main/popnhook1/config-eamuse.c @@ -57,6 +57,7 @@ void popnhook1_config_eamuse_get( { char server_url[1024]; char *tmp; + char *tmp2; memset(config_eamuse, 0, sizeof(struct popnhook1_config_eamuse)); @@ -102,8 +103,16 @@ void popnhook1_config_eamuse_get( } if (!security_id_verify(&config_eamuse->pcbid)) { - log_fatal("PCBID verification failed"); - return; + tmp = security_id_to_str( + &POPNHOOK1_CONFIG_EAMUSE_DEFAULT_PCBID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->pcbid, false); + log_warning( + "PCBID verification of '%s' failed, fallback to default " + "PCBID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } if (!cconfig_util_get_data( @@ -122,7 +131,15 @@ void popnhook1_config_eamuse_get( } if (!security_id_verify(&config_eamuse->eamid)) { - log_fatal("EAMID verification failed"); - return; + tmp = security_id_to_str( + &POPNHOOK1_CONFIG_EAMUSE_DEFAULT_EAMID_VALUE, false); + tmp2 = security_id_to_str(&config_eamuse->eamid, false); + log_warning( + "EAMID verification of '%s' failed, fallback to default " + "EAMID '%s'", + tmp2, + tmp); + free(tmp); + free(tmp2); } }