From 5d498b8e1b50373636126956d1c6addfd11ade5e Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 15 Oct 2020 11:57:30 +0200 Subject: - fix revocation --- src/include/gnunet_revocation_service.h | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'src/include/gnunet_revocation_service.h') diff --git a/src/include/gnunet_revocation_service.h b/src/include/gnunet_revocation_service.h index 479cc61d7..18c1f2674 100644 --- a/src/include/gnunet_revocation_service.h +++ b/src/include/gnunet_revocation_service.h @@ -52,6 +52,13 @@ extern "C" */ #define GNUNET_REVOCATION_VERSION 0x00000001 +/** + * Maximum length of a revocation + */ +#define GNUNET_REVOCATION_MAX_PROOF_SIZE sizeof(struct GNUNET_REVOCATION_PowP) +\ + sizeof(struct GNUNET_IDENTITY_PublicKey) +\ + 1024 //FIXME max sig_len + /** * The proof-of-work narrowing factor. * The number of PoWs that are calculates as part of revocation. @@ -81,34 +88,29 @@ struct GNUNET_REVOCATION_PowP */ uint64_t pow[POW_COUNT] GNUNET_PACKED; - /** - * The revoked public key - */ - struct GNUNET_IDENTITY_PublicKey key; - - /** - * Length of the signature - */ - uint32_t sig_len; - - /** followed by a signature **/ + /** followed by the public key type, the key and a signature **/ }; /** * The signature object we use for the PoW */ -struct GNUNET_REVOCATION_SignaturePurposePS +struct GNUNET_REVOCATION_EcdsaSignaturePurposePS { /** * The signature purpose */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + /** + * Type of the key + */ + uint32_t ktype; + /** * The revoked public key */ - struct GNUNET_IDENTITY_PublicKey key; + struct GNUNET_CRYPTO_EcdsaPublicKey key; /** * The timestamp of the revocation @@ -260,6 +262,10 @@ GNUNET_REVOCATION_pow_round (struct GNUNET_REVOCATION_PowCalculationHandle *pc); void GNUNET_REVOCATION_pow_stop (struct GNUNET_REVOCATION_PowCalculationHandle *pc); +size_t +GNUNET_REVOCATION_proof_get_size (const struct GNUNET_REVOCATION_PowP *pow); + + #if 0 /* keep Emacsens' auto-indent happy */ { #endif -- cgit v1.2.3