diff options
Diffstat (limited to 'src/identity/identity_api.c')
-rw-r--r-- | src/identity/identity_api.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 4abd62434..3fd052277 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c | |||
@@ -157,14 +157,17 @@ GNUNET_IDENTITY_ego_get_anonymous () | |||
157 | { | 157 | { |
158 | static struct GNUNET_IDENTITY_Ego anon; | 158 | static struct GNUNET_IDENTITY_Ego anon; |
159 | static int setup; | 159 | static int setup; |
160 | ssize_t key_len; | ||
160 | 161 | ||
161 | if (setup) | 162 | if (setup) |
162 | return &anon; | 163 | return &anon; |
163 | anon.pk.type = htonl (GNUNET_IDENTITY_TYPE_ECDSA); | 164 | anon.pk.type = htonl (GNUNET_IDENTITY_TYPE_ECDSA); |
164 | anon.pub.type = htonl (GNUNET_IDENTITY_TYPE_ECDSA); | 165 | anon.pub.type = htonl (GNUNET_IDENTITY_TYPE_ECDSA); |
165 | anon.pk.ecdsa_key = *GNUNET_CRYPTO_ecdsa_key_get_anonymous (); | 166 | anon.pk.ecdsa_key = *GNUNET_CRYPTO_ecdsa_key_get_anonymous (); |
167 | key_len = GNUNET_IDENTITY_private_key_get_length (&anon.pk); | ||
168 | GNUNET_assert (0 < key_len); | ||
166 | GNUNET_CRYPTO_hash (&anon.pk, | 169 | GNUNET_CRYPTO_hash (&anon.pk, |
167 | GNUNET_IDENTITY_private_key_get_length (&anon.pk), | 170 | key_len, |
168 | &anon.id); | 171 | &anon.id); |
169 | setup = 1; | 172 | setup = 1; |
170 | return &anon; | 173 | return &anon; |