aboutsummaryrefslogtreecommitdiff
path: root/src/identity/identity_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-01 00:52:06 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-01 00:52:13 +0200
commit47a7c12c47fa10728494623ea8f89beab8e5cd77 (patch)
tree2e37a6a55d169c96e9927c608a12f540e5cd0123 /src/identity/identity_api.c
parent09d0b535d3b5dc8798b18a4791d45b4a9c8ab529 (diff)
downloadgnunet-47a7c12c47fa10728494623ea8f89beab8e5cd77.tar.gz
gnunet-47a7c12c47fa10728494623ea8f89beab8e5cd77.zip
stash
Diffstat (limited to 'src/identity/identity_api.c')
-rw-r--r--src/identity/identity_api.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 6cf1b65ca..fa7c8b023 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -32,32 +32,6 @@
32 32
33#define LOG(kind, ...) GNUNET_log_from (kind, "identity-api", __VA_ARGS__) 33#define LOG(kind, ...) GNUNET_log_from (kind, "identity-api", __VA_ARGS__)
34 34
35/**
36 * Handle for an ego.
37 */
38struct GNUNET_IDENTITY_Ego
39{
40 /**
41 * Private key associated with this ego.
42 */
43 struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
44
45 /**
46 * Current name associated with this ego.
47 */
48 char *name;
49
50 /**
51 * Client context associated with this ego.
52 */
53 void *ctx;
54
55 /**
56 * Hash of the public key of this ego.
57 */
58 struct GNUNET_HashCode id;
59};
60
61 35
62/** 36/**
63 * Handle for an operation with the identity service. 37 * Handle for an operation with the identity service.
@@ -298,16 +272,8 @@ mq_error_handler (void *cls, enum GNUNET_MQ_Error error)
298static int 272static int
299check_identity_result_code (void *cls, const struct ResultCodeMessage *rcm) 273check_identity_result_code (void *cls, const struct ResultCodeMessage *rcm)
300{ 274{
301 uint16_t size = ntohs (rcm->header.size) - sizeof (*rcm); 275 if (sizeof (*rcm) != htons (rcm->header.size))
302 const char *str = (const char *) &rcm[1]; 276 GNUNET_MQ_check_zero_termination (rcm);
303
304 if (0 == size)
305 return GNUNET_OK;
306 if ('\0' != str[size - 1])
307 {
308 GNUNET_break (0);
309 return GNUNET_SYSERR;
310 }
311 return GNUNET_OK; 277 return GNUNET_OK;
312} 278}
313 279