aboutsummaryrefslogtreecommitdiff
path: root/src/identity/identity_api.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2020-05-18 08:52:32 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2020-05-18 08:52:32 +0200
commit3be730446ba439170a67798dca8c634625c82cea (patch)
tree7507895cab33c0fedbaef6f265a1a41482ce8bb8 /src/identity/identity_api.c
parentd89a4c1ee6f00924233c799e50777ea985d5b213 (diff)
downloadgnunet-3be730446ba439170a67798dca8c634625c82cea.tar.gz
gnunet-3be730446ba439170a67798dca8c634625c82cea.zip
fix api for lazy pubkey loading
Diffstat (limited to 'src/identity/identity_api.c')
-rw-r--r--src/identity/identity_api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 693d4392e..c2fcc5075 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -392,6 +392,7 @@ handle_identity_update (void *cls,
392 return; 392 return;
393 } 393 }
394 ego = GNUNET_new (struct GNUNET_IDENTITY_Ego); 394 ego = GNUNET_new (struct GNUNET_IDENTITY_Ego);
395 ego->pub_initialized = GNUNET_NO;
395 ego->pk = um->private_key; 396 ego->pk = um->private_key;
396 ego->name = GNUNET_strdup (str); 397 ego->name = GNUNET_strdup (str);
397 ego->id = id; 398 ego->id = id;
@@ -607,11 +608,11 @@ void
607GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego, 608GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego,
608 struct GNUNET_CRYPTO_EcdsaPublicKey *pk) 609 struct GNUNET_CRYPTO_EcdsaPublicKey *pk)
609{ 610{
610 if (! ego->pub_initialized) 611 if (GNUNET_NO == ego->pub_initialized)
611 { 612 {
612 GNUNET_CRYPTO_ecdsa_key_get_public (&ego->pk, 613 GNUNET_CRYPTO_ecdsa_key_get_public (&ego->pk,
613 &ego->pub); 614 &ego->pub);
614 ego->pub_initialized = true; 615 ego->pub_initialized = GNUNET_YES;
615 } 616 }
616 *pk = ego->pub; 617 *pk = ego->pub;
617} 618}