aboutsummaryrefslogtreecommitdiff
path: root/src/auditor/report-lib.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-28 16:13:24 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-28 16:13:30 +0100
commit8f77bda2e0297185c98694edf0d752cc925bf9a2 (patch)
tree8e48fa7ac850c0f570ced50f2113012ad25ee1f9 /src/auditor/report-lib.c
parentd7bbf934a042b84193fd7092b8632536f3279631 (diff)
-towards getting auditor tests to pass again with new logic
Diffstat (limited to 'src/auditor/report-lib.c')
-rw-r--r--src/auditor/report-lib.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c
index 03307aaeb..0888f47ae 100644
--- a/src/auditor/report-lib.c
+++ b/src/auditor/report-lib.c
@@ -558,7 +558,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
"BASE_URL");
return GNUNET_SYSERR;
}
- if (GNUNET_YES == GNUNET_is_zero (&TALER_ARL_master_pub))
+ if (GNUNET_is_zero (&TALER_ARL_master_pub))
{
/* -m option not given, try configuration */
char *master_public_key_str;
@@ -596,32 +596,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
"Taler auditor running for exchange master public key %s\n",
TALER_B2S (&TALER_ARL_master_pub));
- if (GNUNET_YES == GNUNET_is_zero (&TALER_ARL_auditor_pub))
- {
- /* try loading private key and deriving public key */
- char *fn;
-
- if (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_filename (c,
- "auditor",
- "AUDITOR_PRIV_FILE",
- &fn))
- {
- struct TALER_AuditorPrivateKeyP auditor_priv;
-
- if (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_key_from_file (fn,
- GNUNET_NO, /* do NOT create it! */
- &auditor_priv.eddsa_priv))
- {
- GNUNET_CRYPTO_eddsa_key_get_public (&auditor_priv.eddsa_priv,
- &TALER_ARL_auditor_pub.eddsa_pub);
- }
- GNUNET_free (fn);
- }
- }
-
- if (GNUNET_YES == GNUNET_is_zero (&TALER_ARL_auditor_pub))
+ if (GNUNET_is_zero (&TALER_ARL_auditor_pub))
{
/* private key not available, try configuration for public key */
char *auditor_public_key_str;
@@ -653,6 +628,34 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
GNUNET_free (auditor_public_key_str);
}
+ if (GNUNET_is_zero (&TALER_ARL_auditor_pub))
+ {
+ /* try loading private key and deriving public key */
+ char *fn;
+
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_filename (c,
+ "auditor",
+ "AUDITOR_PRIV_FILE",
+ &fn))
+ {
+ struct TALER_AuditorPrivateKeyP auditor_priv;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Loading offline private key from `%s' to get auditor public key\n",
+ fn);
+ if (GNUNET_OK ==
+ GNUNET_CRYPTO_eddsa_key_from_file (fn,
+ GNUNET_NO, /* do NOT create it! */
+ &auditor_priv.eddsa_priv))
+ {
+ GNUNET_CRYPTO_eddsa_key_get_public (&auditor_priv.eddsa_priv,
+ &TALER_ARL_auditor_pub.eddsa_pub);
+ }
+ GNUNET_free (fn);
+ }
+ }
+
if (GNUNET_OK !=
TALER_config_get_currency (TALER_ARL_cfg,
&TALER_ARL_currency))