aboutsummaryrefslogtreecommitdiff
path: root/src/identity/identity_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-06 20:46:22 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-06 20:46:22 +0000
commit303ab4dafbc680b1b362f95df5b12dae831b1593 (patch)
tree8b2f411b0b31e500ce2988404b2501db03bed945 /src/identity/identity_api.c
parent1360f8a1e5877a8796dc8e7d0c55d78481382e80 (diff)
-fixing main FS build, updating man page of gnunet-pseudonym
Diffstat (limited to 'src/identity/identity_api.c')
-rw-r--r--src/identity/identity_api.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 2062ddc637..84ecb8765b 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -175,6 +175,24 @@ struct GNUNET_IDENTITY_Handle
};
+/**
+ * Obtain the ego representing 'anonymous' users.
+ */
+const struct GNUNET_IDENTITY_Ego *
+GNUNET_IDENTITY_ego_get_anonymous ()
+{
+ static struct GNUNET_IDENTITY_Ego anon;
+ struct GNUNET_CRYPTO_EccPublicKey pub;
+
+ if (NULL != anon.pk)
+ return &anon;
+ anon.pk = GNUNET_CRYPTO_ecc_key_get_anonymous ();
+ GNUNET_CRYPTO_ecc_key_get_public (anon.pk,
+ &pub);
+ GNUNET_CRYPTO_hash (&pub, sizeof (pub), &anon.id);
+ return &anon;
+}
+
/**
* Try again to connect to network size estimation service.
@@ -566,7 +584,7 @@ GNUNET_IDENTITY_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
* @return associated ECC key, valid as long as the ego is valid
*/
const struct GNUNET_CRYPTO_EccPrivateKey *
-GNUNET_IDENTITY_ego_get_private_key (struct GNUNET_IDENTITY_Ego *ego)
+GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego)
{
return ego->pk;
}
@@ -579,10 +597,11 @@ GNUNET_IDENTITY_ego_get_private_key (struct GNUNET_IDENTITY_Ego *ego)
* @param pk set to ego's public key
*/
void
-GNUNET_IDENTITY_ego_get_public_key (struct GNUNET_IDENTITY_Ego *ego,
+GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego,
struct GNUNET_CRYPTO_EccPublicKey *pk)
{
- GNUNET_assert (0);
+ GNUNET_CRYPTO_ecc_key_get_public (ego->pk,
+ pk);
}