From 4b60d2540f48e2b9bfd17898dcdac2705603fde3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 11 Apr 2020 21:42:52 +0200 Subject: adapations related to GNUnet fixing #6149 --- src/exchange-tools/key-helper.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/exchange-tools') 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 */ -- cgit v1.2.3