diff options
Diffstat (limited to 'src/messenger/messenger_api_util.c')
-rw-r--r-- | src/messenger/messenger_api_util.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/messenger/messenger_api_util.c b/src/messenger/messenger_api_util.c index f56e2e201..2fc58ed75 100644 --- a/src/messenger/messenger_api_util.c +++ b/src/messenger/messenger_api_util.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2020--2021 GNUnet e.V. | 3 | Copyright (C) 2020--2023 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -70,6 +70,13 @@ generate_free_member_id (struct GNUNET_ShortHashCode *id, | |||
70 | return GNUNET_NO; | 70 | return GNUNET_NO; |
71 | } | 71 | } |
72 | 72 | ||
73 | const struct GNUNET_IDENTITY_PrivateKey* | ||
74 | get_anonymous_private_key () | ||
75 | { | ||
76 | const struct GNUNET_IDENTITY_Ego* ego = GNUNET_IDENTITY_ego_get_anonymous(); | ||
77 | return GNUNET_IDENTITY_ego_get_private_key(ego); | ||
78 | } | ||
79 | |||
73 | const struct GNUNET_IDENTITY_PublicKey* | 80 | const struct GNUNET_IDENTITY_PublicKey* |
74 | get_anonymous_public_key () | 81 | get_anonymous_public_key () |
75 | { | 82 | { |
@@ -101,3 +108,10 @@ convert_messenger_key_to_port(const struct GNUNET_HashCode *key, | |||
101 | 108 | ||
102 | GNUNET_CRYPTO_hash_sum(key, &version, port); | 109 | GNUNET_CRYPTO_hash_sum(key, &version, port); |
103 | } | 110 | } |
111 | |||
112 | void | ||
113 | convert_peer_identity_to_id(const struct GNUNET_PeerIdentity *identity, | ||
114 | struct GNUNET_ShortHashCode *id) | ||
115 | { | ||
116 | GNUNET_memcpy(id, identity, sizeof(struct GNUNET_ShortHashCode)); | ||
117 | } | ||