diff options
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r-- | src/revocation/revocation_api.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index 327b03494..819c34b71 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c | |||
@@ -401,6 +401,7 @@ calculate_score (const struct GNUNET_REVOCATION_PowCalculationHandle *ph) | |||
401 | return avg; | 401 | return avg; |
402 | } | 402 | } |
403 | 403 | ||
404 | |||
404 | struct GNUNET_REVOCATION_SignaturePurposePS * | 405 | struct GNUNET_REVOCATION_SignaturePurposePS * |
405 | REV_create_signature_message (const struct GNUNET_REVOCATION_PowP *pow) | 406 | REV_create_signature_message (const struct GNUNET_REVOCATION_PowP *pow) |
406 | { | 407 | { |
@@ -412,7 +413,7 @@ REV_create_signature_message (const struct GNUNET_REVOCATION_PowP *pow) | |||
412 | ksize = GNUNET_IDENTITY_public_key_get_length (pk); | 413 | ksize = GNUNET_IDENTITY_public_key_get_length (pk); |
413 | spurp = GNUNET_malloc (sizeof (*spurp) + ksize); | 414 | spurp = GNUNET_malloc (sizeof (*spurp) + ksize); |
414 | spurp->timestamp = pow->timestamp; | 415 | spurp->timestamp = pow->timestamp; |
415 | spurp->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION); | 416 | spurp->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_REVOCATION); |
416 | spurp->purpose.size = htonl (sizeof(*spurp) + ksize); | 417 | spurp->purpose.size = htonl (sizeof(*spurp) + ksize); |
417 | GNUNET_IDENTITY_write_public_key_to_buffer (pk, | 418 | GNUNET_IDENTITY_write_public_key_to_buffer (pk, |
418 | (char*) &spurp[1], | 419 | (char*) &spurp[1], |
@@ -420,6 +421,7 @@ REV_create_signature_message (const struct GNUNET_REVOCATION_PowP *pow) | |||
420 | return spurp; | 421 | return spurp; |
421 | } | 422 | } |
422 | 423 | ||
424 | |||
423 | enum GNUNET_GenericReturnValue | 425 | enum GNUNET_GenericReturnValue |
424 | check_signature_identity (const struct GNUNET_REVOCATION_PowP *pow, | 426 | check_signature_identity (const struct GNUNET_REVOCATION_PowP *pow, |
425 | const struct GNUNET_IDENTITY_PublicKey *key) | 427 | const struct GNUNET_IDENTITY_PublicKey *key) |
@@ -433,10 +435,11 @@ check_signature_identity (const struct GNUNET_REVOCATION_PowP *pow, | |||
433 | spurp = REV_create_signature_message (pow); | 435 | spurp = REV_create_signature_message (pow); |
434 | sig = ((unsigned char*) &pow[1] + ksize); | 436 | sig = ((unsigned char*) &pow[1] + ksize); |
435 | ret = | 437 | ret = |
436 | GNUNET_IDENTITY_signature_verify_raw_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION, | 438 | GNUNET_IDENTITY_signature_verify_raw_ ( |
437 | &spurp->purpose, | 439 | GNUNET_SIGNATURE_PURPOSE_GNS_REVOCATION, |
438 | sig, | 440 | &spurp->purpose, |
439 | key); | 441 | sig, |
442 | key); | ||
440 | GNUNET_free (spurp); | 443 | GNUNET_free (spurp); |
441 | return ret == GNUNET_OK ? GNUNET_OK : GNUNET_SYSERR; | 444 | return ret == GNUNET_OK ? GNUNET_OK : GNUNET_SYSERR; |
442 | } | 445 | } |