diff options
| author | Christian Grothoff <christian@grothoff.org> | 2020-04-11 21:42:52 +0200 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2020-04-11 21:42:52 +0200 | 
| commit | 4b60d2540f48e2b9bfd17898dcdac2705603fde3 (patch) | |
| tree | cc28590d021c1e227bc21f6421e08aed5fcc9898 /src/exchange-tools/key-helper.c | |
| parent | 44272bf1cee4312d8d9c83eedc34dbb63fa1c0a4 (diff) | |
adapations related to GNUnet fixing #6149
Diffstat (limited to 'src/exchange-tools/key-helper.c')
| -rw-r--r-- | src/exchange-tools/key-helper.c | 19 | 
1 files changed, 11 insertions, 8 deletions
diff --git a/src/exchange-tools/key-helper.c b/src/exchange-tools/key-helper.c index 281202bd..0e3c0a2b 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 */  | 
