summaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-11 21:42:52 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-11 21:42:52 +0200
commit4b60d2540f48e2b9bfd17898dcdac2705603fde3 (patch)
treecc28590d021c1e227bc21f6421e08aed5fcc9898 /src/exchange-tools
parent44272bf1cee4312d8d9c83eedc34dbb63fa1c0a4 (diff)
downloadexchange-4b60d2540f48e2b9bfd17898dcdac2705603fde3.tar.gz
exchange-4b60d2540f48e2b9bfd17898dcdac2705603fde3.tar.bz2
exchange-4b60d2540f48e2b9bfd17898dcdac2705603fde3.zip
adapations related to GNUnet fixing #6149
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/key-helper.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/exchange-tools/key-helper.c b/src/exchange-tools/key-helper.c
index 281202bd7..0e3c0a2bb 100644
--- a/src/exchange-tools/key-helper.c
+++ b/src/exchange-tools/key-helper.c
@@ -60,21 +60,24 @@ get_and_check_master_key (const struct GNUNET_CONFIGURATION_Handle *cfg,
"Exchange master private key `%s' does not exist yet, creating it!\n",
fn);
{
- struct GNUNET_CRYPTO_EddsaPrivateKey *eddsa_priv;
+ int ret;
- eddsa_priv = GNUNET_CRYPTO_eddsa_key_create_from_file (fn);
- if (NULL == eddsa_priv)
+ ret = GNUNET_CRYPTO_eddsa_key_from_file (fn,
+ GNUNET_YES,
+ &master_priv->eddsa_priv);
+ if (GNUNET_OK != ret)
{
fprintf (stderr,
- "Failed to initialize master key from file `%s'\n",
- fn);
+ "Failed to initialize master key from file `%s': %s\n",
+ fn,
+ (GNUNET_NO == ret)
+ ? "file exists"
+ : "could not create file");
GNUNET_free (fn);
return GNUNET_SYSERR;
}
- master_priv->eddsa_priv = *eddsa_priv;
- GNUNET_CRYPTO_eddsa_key_get_public (eddsa_priv,
+ GNUNET_CRYPTO_eddsa_key_get_public (&master_priv->eddsa_priv,
&mpub);
- GNUNET_free (eddsa_priv);
}
/* Check our key matches that in the configuration */