summaryrefslogtreecommitdiff
path: root/src/auditor/report-lib.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-28 20:37:19 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-28 20:37:19 +0100
commit23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4 (patch)
tree6a9dc253ce596c247a3aac6095205f195198b8d7 /src/auditor/report-lib.c
parent8f77bda2e0297185c98694edf0d752cc925bf9a2 (diff)
downloadexchange-23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4.tar.gz
exchange-23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4.tar.bz2
exchange-23bc09fe3c2ca08ce209fffc0ad0ae3e51b06ef4.zip
get test-auditor and #7181 to pass
Diffstat (limited to 'src/auditor/report-lib.c')
-rw-r--r--src/auditor/report-lib.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c
index 0888f47ae..5337b17b4 100644
--- a/src/auditor/report-lib.c
+++ b/src/auditor/report-lib.c
@@ -186,6 +186,7 @@ TALER_ARL_get_denomination_info_by_hash (
NULL);
if (0 > qs)
{
+ GNUNET_break (0);
*issue = NULL;
return qs;
}
@@ -211,6 +212,7 @@ TALER_ARL_get_denomination_info_by_hash (
&issue);
if (qs <= 0)
{
+ GNUNET_break (qs >= 0);
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Denomination %s not found\n",
@@ -598,38 +600,34 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
if (GNUNET_is_zero (&TALER_ARL_auditor_pub))
{
- /* private key not available, try configuration for public key */
char *auditor_public_key_str;
- if (GNUNET_OK !=
+ if (GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_string (c,
"auditor",
"PUBLIC_KEY",
&auditor_public_key_str))
{
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "auditor",
- "PUBLIC_KEY");
- return GNUNET_SYSERR;
- }
- if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_public_key_from_string (
- auditor_public_key_str,
- strlen (auditor_public_key_str),
- &TALER_ARL_auditor_pub.eddsa_pub))
- {
- GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "auditor",
- "PUBLIC_KEY",
- "invalid key");
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_eddsa_public_key_from_string (
+ auditor_public_key_str,
+ strlen (auditor_public_key_str),
+ &TALER_ARL_auditor_pub.eddsa_pub))
+ {
+ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
+ "auditor",
+ "PUBLIC_KEY",
+ "invalid key");
+ GNUNET_free (auditor_public_key_str);
+ return GNUNET_SYSERR;
+ }
GNUNET_free (auditor_public_key_str);
- return GNUNET_SYSERR;
}
- GNUNET_free (auditor_public_key_str);
}
if (GNUNET_is_zero (&TALER_ARL_auditor_pub))
{
+ /* public key not configured */
/* try loading private key and deriving public key */
char *fn;
@@ -656,6 +654,14 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
}
}
+ if (GNUNET_is_zero (&TALER_ARL_auditor_pub))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_INFO,
+ "auditor",
+ "PUBLIC_KEY/AUDITOR_PRIV_FILE");
+ return GNUNET_SYSERR;
+ }
+
if (GNUNET_OK !=
TALER_config_get_currency (TALER_ARL_cfg,
&TALER_ARL_currency))