diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2020-11-10 19:44:32 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2020-11-10 19:44:32 +0900 |
commit | 82b5c638583860897fac1cab3dc1ebd2bed10949 (patch) | |
tree | 48c23cc69e11d71f463750b12f3465b31e5e0050 /src/revocation/revocation_api.c | |
parent | 10081ef560ef3e624d4dcadf5e19f0330b078d64 (diff) | |
download | gnunet-82b5c638583860897fac1cab3dc1ebd2bed10949.tar.gz gnunet-82b5c638583860897fac1cab3dc1ebd2bed10949.zip |
-minor API change
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r-- | src/revocation/revocation_api.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index 44c42ae49..791c3d008 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c | |||
@@ -444,12 +444,12 @@ check_signature_identity (const struct GNUNET_REVOCATION_PowP *pow, | |||
444 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 444 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
445 | "Expected signature payload len: %u\n", | 445 | "Expected signature payload len: %u\n", |
446 | ntohl (spurp->purpose.size)); | 446 | ntohl (spurp->purpose.size)); |
447 | sig = (struct GNUNET_IDENTITY_Signature *) ((char*)&pow[1] + ksize); | 447 | sig = (struct GNUNET_IDENTITY_Signature *) ((char*) &pow[1] + ksize); |
448 | if (GNUNET_OK != | 448 | if (GNUNET_OK != |
449 | GNUNET_IDENTITY_public_key_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION, | 449 | GNUNET_IDENTITY_signature_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION, |
450 | &spurp->purpose, | 450 | &spurp->purpose, |
451 | sig, | 451 | sig, |
452 | key)) | 452 | key)) |
453 | { | 453 | { |
454 | return GNUNET_SYSERR; | 454 | return GNUNET_SYSERR; |
455 | } | 455 | } |
@@ -570,7 +570,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow, | |||
570 | 570 | ||
571 | enum GNUNET_GenericReturnValue | 571 | enum GNUNET_GenericReturnValue |
572 | sign_pow_identity (const struct GNUNET_IDENTITY_PrivateKey *key, | 572 | sign_pow_identity (const struct GNUNET_IDENTITY_PrivateKey *key, |
573 | struct GNUNET_REVOCATION_PowP *pow) | 573 | struct GNUNET_REVOCATION_PowP *pow) |
574 | { | 574 | { |
575 | struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get (); | 575 | struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get (); |
576 | struct GNUNET_REVOCATION_SignaturePurposePS *rp; | 576 | struct GNUNET_REVOCATION_SignaturePurposePS *rp; |
@@ -595,14 +595,16 @@ sign_pow_identity (const struct GNUNET_IDENTITY_PrivateKey *key, | |||
595 | "Signature payload len: %u\n", | 595 | "Signature payload len: %u\n", |
596 | ntohl (rp->purpose.size)); | 596 | ntohl (rp->purpose.size)); |
597 | GNUNET_IDENTITY_write_key_to_buffer (pk, | 597 | GNUNET_IDENTITY_write_key_to_buffer (pk, |
598 | ((char*)&rp[1]), | 598 | ((char*) &rp[1]), |
599 | ksize); | 599 | ksize); |
600 | sig = ((char*)&pow[1]) + ksize; | 600 | sig = ((char*) &pow[1]) + ksize; |
601 | int result = GNUNET_IDENTITY_private_key_sign_ (key, | 601 | int result = GNUNET_IDENTITY_sign_ (key, |
602 | &rp->purpose, | 602 | &rp->purpose, |
603 | (void*) sig); | 603 | (void*) sig); |
604 | if (result == GNUNET_SYSERR) return GNUNET_NO; | 604 | if (result == GNUNET_SYSERR) |
605 | else return result; | 605 | return GNUNET_NO; |
606 | else | ||
607 | return result; | ||
606 | } | 608 | } |
607 | 609 | ||
608 | 610 | ||
@@ -772,7 +774,7 @@ GNUNET_REVOCATION_proof_get_size (const struct GNUNET_REVOCATION_PowP *pow) | |||
772 | pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; | 774 | pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1]; |
773 | ksize = GNUNET_IDENTITY_key_get_length (pk); | 775 | ksize = GNUNET_IDENTITY_key_get_length (pk); |
774 | size += ksize; | 776 | size += ksize; |
775 | sig = (struct GNUNET_IDENTITY_Signature *) ((char*)&pow[1] + ksize); | 777 | sig = (struct GNUNET_IDENTITY_Signature *) ((char*) &pow[1] + ksize); |
776 | size += GNUNET_IDENTITY_signature_get_length (sig); | 778 | size += GNUNET_IDENTITY_signature_get_length (sig); |
777 | return size; | 779 | return size; |
778 | } | 780 | } |