summaryrefslogtreecommitdiff
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
parentd89a4c1ee6f00924233c799e50777ea985d5b213 (diff)
fix api for lazy pubkey loading
-rw-r--r--src/identity/identity_api.c5
-rw-r--r--src/identity/identity_api_lookup.c1
2 files changed, 4 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,
return;
}
ego = GNUNET_new (struct GNUNET_IDENTITY_Ego);
+ ego->pub_initialized = GNUNET_NO;
ego->pk = um->private_key;
ego->name = GNUNET_strdup (str);
ego->id = id;
@@ -607,11 +608,11 @@ void
GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego,
struct GNUNET_CRYPTO_EcdsaPublicKey *pk)
{
- if (! ego->pub_initialized)
+ if (GNUNET_NO == ego->pub_initialized)
{
GNUNET_CRYPTO_ecdsa_key_get_public (&ego->pk,
&ego->pub);
- ego->pub_initialized = true;
+ ego->pub_initialized = GNUNET_YES;
}
*pk = ego->pub;
}
diff --git a/src/identity/identity_api_lookup.c b/src/identity/identity_api_lookup.c
index 6c61d3977..26b1eacd7 100644
--- a/src/identity/identity_api_lookup.c
+++ b/src/identity/identity_api_lookup.c
@@ -130,6 +130,7 @@ handle_identity_update (void *cls, const struct UpdateMessage *um)
struct GNUNET_CRYPTO_EcdsaPublicKey pub;
struct GNUNET_HashCode id;
struct GNUNET_IDENTITY_Ego ego;
+ memset (&ego, 0, sizeof (ego));
GNUNET_break (GNUNET_YES != ntohs (um->end_of_list));
GNUNET_CRYPTO_ecdsa_key_get_public (&um->private_key, &pub);