aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/gnunet-service-revocation.c
diff options
context:
space:
mode:
authorElias Summermatter <elias.summermatter@seccom.ch>2021-03-31 11:17:24 +0200
committerElias Summermatter <elias.summermatter@seccom.ch>2021-03-31 11:17:24 +0200
commit26d2c0d58612fb233cc25b2739bcf96693f5cd85 (patch)
tree16baec844f4a5d9b5383d91589fe4c8f74eec725 /src/revocation/gnunet-service-revocation.c
parentb5660e0a33f4c7a819de0b5056172f78f912e352 (diff)
parentca4c9eae269c34765df26699fe756860c7827693 (diff)
downloadgnunet-26d2c0d58612fb233cc25b2739bcf96693f5cd85.tar.gz
gnunet-26d2c0d58612fb233cc25b2739bcf96693f5cd85.zip
Merge branch 'master' of ssh://gnunet.org/gnunet
Diffstat (limited to 'src/revocation/gnunet-service-revocation.c')
-rw-r--r--src/revocation/gnunet-service-revocation.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 863289aae..6f70720ba 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -306,12 +306,19 @@ publicize_rm (const struct RevokeMessage *rm)
306 struct RevokeMessage *cp; 306 struct RevokeMessage *cp;
307 struct GNUNET_HashCode hc; 307 struct GNUNET_HashCode hc;
308 struct GNUNET_SETU_Element e; 308 struct GNUNET_SETU_Element e;
309 ssize_t pklen;
309 const struct GNUNET_IDENTITY_PublicKey *pk; 310 const struct GNUNET_IDENTITY_PublicKey *pk;
310 311
311 struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1]; 312 struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) &rm[1];
312 pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; 313 pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
314 pklen = GNUNET_IDENTITY_key_get_length (pk);
315 if (0 > pklen)
316 {
317 GNUNET_break_op (0);
318 return GNUNET_SYSERR;
319 }
313 GNUNET_CRYPTO_hash (pk, 320 GNUNET_CRYPTO_hash (pk,
314 GNUNET_IDENTITY_key_get_length (pk), 321 pklen,
315 &hc); 322 &hc);
316 if (GNUNET_YES == 323 if (GNUNET_YES ==
317 GNUNET_CONTAINER_multihashmap_contains (revocation_map, 324 GNUNET_CONTAINER_multihashmap_contains (revocation_map,
@@ -384,7 +391,8 @@ check_revoke_message (void *cls,
384 uint16_t size; 391 uint16_t size;
385 392
386 size = ntohs (rm->header.size); 393 size = ntohs (rm->header.size);
387 if (size <= sizeof(struct RevokeMessage)) 394 if (size <= sizeof(struct RevokeMessage) ||
395 (size > UINT16_MAX))
388 { 396 {
389 GNUNET_break (0); 397 GNUNET_break (0);
390 return GNUNET_SYSERR; 398 return GNUNET_SYSERR;