diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-11 21:43:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-11 21:43:34 +0200 |
commit | 90ff9edfa9c5fcfa3a36d1653ff105e89b888e21 (patch) | |
tree | 780a2071f5072c8e8e044db741eb295c3f3ea2a7 /src/fs/gnunet-service-fs.c | |
parent | 3bcfe59f1ce533246bda271f00b3ee957cae304d (diff) | |
download | gnunet-90ff9edfa9c5fcfa3a36d1653ff105e89b888e21.tar.gz gnunet-90ff9edfa9c5fcfa3a36d1653ff105e89b888e21.zip |
fixing #6149
Diffstat (limited to 'src/fs/gnunet-service-fs.c')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 29e6de9d5..cf9069918 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -315,7 +315,7 @@ static struct GNUNET_CONFIGURATION_Handle *block_cfg; | |||
315 | /** | 315 | /** |
316 | * Private key of this peer. Used to sign LOC URI requests. | 316 | * Private key of this peer. Used to sign LOC URI requests. |
317 | */ | 317 | */ |
318 | static struct GNUNET_CRYPTO_EddsaPrivateKey *pk; | 318 | static struct GNUNET_CRYPTO_EddsaPrivateKey pk; |
319 | 319 | ||
320 | /** | 320 | /** |
321 | * ID of our task that we use to age the cover counters. | 321 | * ID of our task that we use to age the cover counters. |
@@ -939,7 +939,7 @@ handle_client_loc_sign (void *cls, | |||
939 | base.data.chk.chk = msg->chk; | 939 | base.data.chk.chk = msg->chk; |
940 | base.data.chk.file_length = GNUNET_ntohll (msg->file_length); | 940 | base.data.chk.file_length = GNUNET_ntohll (msg->file_length); |
941 | loc = GNUNET_FS_uri_loc_create (&base, | 941 | loc = GNUNET_FS_uri_loc_create (&base, |
942 | pk, | 942 | &pk, |
943 | GNUNET_TIME_absolute_ntoh ( | 943 | GNUNET_TIME_absolute_ntoh ( |
944 | msg->expiration_time)); | 944 | msg->expiration_time)); |
945 | env = GNUNET_MQ_msg (resp, | 945 | env = GNUNET_MQ_msg (resp, |
@@ -1283,10 +1283,19 @@ main_init (const struct GNUNET_CONFIGURATION_Handle *c) | |||
1283 | GNUNET_SCHEDULER_shutdown (); | 1283 | GNUNET_SCHEDULER_shutdown (); |
1284 | return GNUNET_SYSERR; | 1284 | return GNUNET_SYSERR; |
1285 | } | 1285 | } |
1286 | pk = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile); | 1286 | if (GNUNET_SYSERR == |
1287 | GNUNET_CRYPTO_eddsa_key_from_file (keyfile, | ||
1288 | GNUNET_YES, | ||
1289 | &pk)) | ||
1290 | { | ||
1291 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1292 | "Failed to setup peer's private key\n"); | ||
1293 | GNUNET_SCHEDULER_shutdown (); | ||
1294 | GNUNET_free (keyfile); | ||
1295 | return GNUNET_SYSERR; | ||
1296 | } | ||
1287 | GNUNET_free (keyfile); | 1297 | GNUNET_free (keyfile); |
1288 | GNUNET_assert (NULL != pk); | 1298 | GNUNET_CRYPTO_eddsa_key_get_public (&pk, |
1289 | GNUNET_CRYPTO_eddsa_key_get_public (pk, | ||
1290 | &GSF_my_id.public_key); | 1299 | &GSF_my_id.public_key); |
1291 | 1300 | ||
1292 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1301 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |