gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 06/07: - fix revocation


From: gnunet
Subject: [gnunet] 06/07: - fix revocation
Date: Thu, 15 Oct 2020 12:19:00 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit 5d498b8e1b50373636126956d1c6addfd11ade5e
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Thu Oct 15 11:57:30 2020 +0200

    - fix revocation
---
 src/include/gnunet_revocation_service.h    | 32 ++++++-----
 src/revocation/gnunet-revocation.c         | 58 +++++++++++++-------
 src/revocation/gnunet-service-revocation.c | 12 +++--
 src/revocation/plugin_block_revocation.c   | 12 +++--
 src/revocation/revocation_api.c            | 87 +++++++++++++++++++++++-------
 src/revocation/test_revocation.c           |  3 +-
 6 files changed, 142 insertions(+), 62 deletions(-)

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
diff --git a/src/revocation/gnunet-revocation.c 
b/src/revocation/gnunet-revocation.c
index 2ba5d0420..d59ea7c81 100644
--- a/src/revocation/gnunet-revocation.c
+++ b/src/revocation/gnunet-revocation.c
@@ -213,7 +213,7 @@ static void
 perform_revocation ()
 {
   h = GNUNET_REVOCATION_revoke (cfg,
-                                &proof_of_work,
+                                proof_of_work,
                                 &print_revocation_result,
                                 NULL);
 }
@@ -228,11 +228,12 @@ perform_revocation ()
 static void
 sync_pow ()
 {
+  size_t psize = GNUNET_REVOCATION_proof_get_size (proof_of_work);
   if ((NULL != filename) &&
-      (sizeof(struct GNUNET_REVOCATION_PowP) !=
+      (psize !=
        GNUNET_DISK_fn_write (filename,
-                             &proof_of_work,
-                             sizeof(struct GNUNET_REVOCATION_PowP),
+                             proof_of_work,
+                             psize,
                              GNUNET_DISK_PERM_USER_READ
                              | GNUNET_DISK_PERM_USER_WRITE)))
     GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "write", filename);
@@ -269,6 +270,7 @@ static void
 calculate_pow (void *cls)
 {
   struct GNUNET_REVOCATION_PowCalculationHandle *ph = cls;
+  size_t psize;
 
   /* store temporary results */
   pow_task = NULL;
@@ -277,11 +279,12 @@ calculate_pow (void *cls)
   /* actually do POW calculation */
   if (GNUNET_OK == GNUNET_REVOCATION_pow_round (ph))
   {
+    psize = GNUNET_REVOCATION_proof_get_size (proof_of_work);
     if ((NULL != filename) &&
-        (sizeof(struct GNUNET_REVOCATION_PowP) !=
+        (psize !=
          GNUNET_DISK_fn_write (filename,
-                               &proof_of_work,
-                               sizeof(struct GNUNET_REVOCATION_PowP),
+                               proof_of_work,
+                               psize,
                                GNUNET_DISK_PERM_USER_READ
                                | GNUNET_DISK_PERM_USER_WRITE)))
       GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "write", filename);
@@ -328,6 +331,7 @@ ego_callback (void *cls, struct GNUNET_IDENTITY_Ego *ego)
   struct GNUNET_IDENTITY_PublicKey key;
   const struct GNUNET_IDENTITY_PrivateKey *privkey;
   struct GNUNET_REVOCATION_PowCalculationHandle *ph = NULL;
+  size_t psize;
 
   el = NULL;
   if (NULL == ego)
@@ -338,12 +342,15 @@ ego_callback (void *cls, struct GNUNET_IDENTITY_Ego *ego)
   }
   GNUNET_IDENTITY_ego_get_public_key (ego, &key);
   privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
-  memset (&proof_of_work, 0, sizeof (proof_of_work));
+  proof_of_work = GNUNET_malloc (GNUNET_REVOCATION_MAX_PROOF_SIZE);
   if ((NULL != filename) && (GNUNET_YES == GNUNET_DISK_file_test (filename)) &&
-      (sizeof(proof_of_work) ==
-       GNUNET_DISK_fn_read (filename, &proof_of_work, sizeof(proof_of_work))))
+      (0 < (psize =
+              GNUNET_DISK_fn_read (filename, proof_of_work,
+                                   GNUNET_REVOCATION_MAX_PROOF_SIZE))))
   {
-    if (0 != GNUNET_memcmp (&proof_of_work.key, &key))
+    size_t ksize = GNUNET_IDENTITY_key_get_length (&key);
+    if (((psize - sizeof (*proof_of_work)) < ksize) || // Key too small
+        (0 != memcmp (&proof_of_work[1], &key, ksize))) // Keys do not match
     {
       fprintf (stderr,
                _ ("Error: revocation certificate in `%s' is not for `%s'\n"),
@@ -352,7 +359,7 @@ ego_callback (void *cls, struct GNUNET_IDENTITY_Ego *ego)
       return;
     }
     if (GNUNET_YES ==
-        GNUNET_REVOCATION_check_pow (&proof_of_work,
+        GNUNET_REVOCATION_check_pow (proof_of_work,
                                      (unsigned int) matching_bits,
                                      epoch_duration))
     {
@@ -369,7 +376,7 @@ ego_callback (void *cls, struct GNUNET_IDENTITY_Ego *ego)
     fprintf (stderr,
              "%s",
              _ ("Continuing calculation where left off...\n"));
-    ph = GNUNET_REVOCATION_pow_start (&proof_of_work,
+    ph = GNUNET_REVOCATION_pow_start (proof_of_work,
                                       epochs,
                                       matching_bits);
   }
@@ -379,8 +386,8 @@ ego_callback (void *cls, struct GNUNET_IDENTITY_Ego *ego)
   if (NULL == ph)
   {
     GNUNET_REVOCATION_pow_init (privkey,
-                                &proof_of_work);
-    ph = GNUNET_REVOCATION_pow_start (&proof_of_work,
+                                proof_of_work);
+    ph = GNUNET_REVOCATION_pow_start (proof_of_work,
                                       epochs, /* Epochs */
                                       matching_bits);
   }
@@ -404,6 +411,7 @@ run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   struct GNUNET_IDENTITY_PublicKey pk;
+  size_t psize;
 
   cfg = c;
   if (NULL != test_ego)
@@ -462,23 +470,33 @@ run (void *cls,
   }
   if ((NULL != filename) && (perform))
   {
-    if (sizeof(proof_of_work) != GNUNET_DISK_fn_read (filename,
-                                                      &proof_of_work,
-                                                      sizeof(proof_of_work)))
+    size_t bread;
+    proof_of_work = GNUNET_malloc (GNUNET_REVOCATION_MAX_PROOF_SIZE);
+    if (0 < (bread = GNUNET_DISK_fn_read (filename,
+                                          proof_of_work,
+                                          GNUNET_REVOCATION_MAX_PROOF_SIZE)))
     {
       fprintf (stderr,
                _ ("Failed to read revocation certificate from `%s'\n"),
                filename);
       return;
     }
+    psize = GNUNET_REVOCATION_proof_get_size (proof_of_work);
+    if (bread != psize)
+    {
+      fprintf (stderr,
+               _ ("Revocation certificate corrupted in `%s'\n"),
+               filename);
+      return;
+    }
     GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
     if (GNUNET_YES !=
-        GNUNET_REVOCATION_check_pow (&proof_of_work,
+        GNUNET_REVOCATION_check_pow (proof_of_work,
                                      (unsigned int) matching_bits,
                                      epoch_duration))
     {
       struct GNUNET_REVOCATION_PowCalculationHandle *ph;
-      ph = GNUNET_REVOCATION_pow_start (&proof_of_work,
+      ph = GNUNET_REVOCATION_pow_start (proof_of_work,
                                         epochs, /* Epochs */
                                         matching_bits);
 
diff --git a/src/revocation/gnunet-service-revocation.c 
b/src/revocation/gnunet-service-revocation.c
index 56ec9f489..0fa92f4a6 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -306,10 +306,12 @@ publicize_rm (const struct RevokeMessage *rm)
   struct RevokeMessage *cp;
   struct GNUNET_HashCode hc;
   struct GNUNET_SETU_Element e;
+  const struct GNUNET_IDENTITY_PublicKey *pk;
 
   struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) 
&rm[1];
-  GNUNET_CRYPTO_hash (&pow->key,
-                      sizeof(struct GNUNET_IDENTITY_PublicKey),
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+  GNUNET_CRYPTO_hash (pk,
+                      GNUNET_IDENTITY_key_get_length (pk),
                       &hc);
   if (GNUNET_YES ==
       GNUNET_CONTAINER_multihashmap_contains (revocation_map,
@@ -832,6 +834,7 @@ run (void *cls,
   uint64_t left;
   struct RevokeMessage *rm;
   struct GNUNET_HashCode hc;
+  const struct GNUNET_IDENTITY_PublicKey *pk;
 
   GNUNET_CRYPTO_hash ("revocation-set-union-application-id",
                       strlen ("revocation-set-union-application-id"),
@@ -932,8 +935,9 @@ run (void *cls,
     }
     struct GNUNET_REVOCATION_PowP *pow = (struct
                                           GNUNET_REVOCATION_PowP *) &rm[1];
-    GNUNET_CRYPTO_hash (&pow->key,
-                        sizeof(struct GNUNET_IDENTITY_PublicKey),
+    pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+    GNUNET_CRYPTO_hash (pk,
+                        GNUNET_IDENTITY_key_get_length (pk),
                         &hc);
     GNUNET_break (GNUNET_OK ==
                   GNUNET_CONTAINER_multihashmap_put (revocation_map,
diff --git a/src/revocation/plugin_block_revocation.c 
b/src/revocation/plugin_block_revocation.c
index ba3c33b6f..3c9344a49 100644
--- a/src/revocation/plugin_block_revocation.c
+++ b/src/revocation/plugin_block_revocation.c
@@ -144,6 +144,8 @@ block_plugin_revocation_evaluate (void *cls,
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
   }
   struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) 
&rm[1];
+  const struct GNUNET_IDENTITY_PublicKey *pk;
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
   if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow,
                                                  ic->matching_bits,
                                                  ic->epoch_duration))
@@ -151,8 +153,8 @@ block_plugin_revocation_evaluate (void *cls,
     GNUNET_break_op (0);
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
   }
-  GNUNET_CRYPTO_hash (&pow->key,
-                      sizeof(struct GNUNET_IDENTITY_PublicKey),
+  GNUNET_CRYPTO_hash (pk,
+                      GNUNET_IDENTITY_key_get_length (pk),
                       &chash);
   if (GNUNET_YES ==
       GNUNET_BLOCK_GROUP_bf_test_and_set (group,
@@ -188,8 +190,10 @@ block_plugin_revocation_get_key (void *cls,
     return GNUNET_SYSERR;
   }
   struct GNUNET_REVOCATION_PowP *pow = (struct GNUNET_REVOCATION_PowP *) 
&rm[1];
-  GNUNET_CRYPTO_hash (&pow->key,
-                      sizeof(struct GNUNET_IDENTITY_PublicKey),
+  const struct GNUNET_IDENTITY_PublicKey *pk;
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+  GNUNET_CRYPTO_hash (pk,
+                      GNUNET_IDENTITY_key_get_length (pk),
                       key);
   return GNUNET_OK;
 }
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 34529df35..94fbc7022 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -359,7 +359,7 @@ GNUNET_REVOCATION_revoke (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
   }
   h->func = func;
   h->func_cls = func_cls;
-  size_t extra_len = ntohl (pow->sig_len) + sizeof (*pow);
+  size_t extra_len = GNUNET_REVOCATION_proof_get_size (pow);
   env = GNUNET_MQ_msg_extra (rm,
                              extra_len,
                              GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE);
@@ -426,16 +426,25 @@ enum GNUNET_GenericReturnValue
 check_signature_ecdsa (const struct GNUNET_REVOCATION_PowP *pow,
                        const struct GNUNET_CRYPTO_EcdsaPublicKey *key)
 {
-  struct GNUNET_REVOCATION_SignaturePurposePS spurp;
+  struct GNUNET_REVOCATION_EcdsaSignaturePurposePS spurp;
   struct GNUNET_CRYPTO_EcdsaSignature *sig;
+  const struct GNUNET_IDENTITY_PublicKey *pk;
+  size_t ksize;
 
-  spurp.key = pow->key;
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+  ksize = GNUNET_IDENTITY_key_get_length (pk);
+
+  spurp.ktype = pk->type;
+  spurp.key = pk->ecdsa_key;
   spurp.timestamp = pow->timestamp;
   spurp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
   spurp.purpose.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)
-                              + sizeof(struct GNUNET_IDENTITY_PublicKey)
+                              + GNUNET_IDENTITY_key_get_length (pk)
                               + sizeof (struct GNUNET_TIME_AbsoluteNBO));
-  sig = (struct GNUNET_CRYPTO_EcdsaSignature *) &pow[1];
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Expected signature payload len: %u\n",
+              ntohl (spurp.purpose.size));
+  sig = (struct GNUNET_CRYPTO_EcdsaSignature *) ((char*)&pow[1] + ksize);
   if (GNUNET_OK !=
       GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
                                    &spurp.purpose,
@@ -451,10 +460,13 @@ check_signature_ecdsa (const struct 
GNUNET_REVOCATION_PowP *pow,
 enum GNUNET_GenericReturnValue
 check_signature (const struct GNUNET_REVOCATION_PowP *pow)
 {
-  switch (ntohl (pow->key.type))
+  const struct GNUNET_IDENTITY_PublicKey *pk;
+
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+  switch (ntohl (pk->type))
   {
   case GNUNET_IDENTITY_TYPE_ECDSA:
-    return check_signature_ecdsa (pow, &pow->key.ecdsa_key);
+    return check_signature_ecdsa (pow, &pk->ecdsa_key);
   default:
     return GNUNET_SYSERR;
   }
@@ -487,6 +499,9 @@ GNUNET_REVOCATION_check_pow (const struct 
GNUNET_REVOCATION_PowP *pow,
   unsigned int tmp_score = 0;
   unsigned int epochs;
   uint64_t pow_val;
+  const struct GNUNET_IDENTITY_PublicKey *pk;
+
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
 
   /**
    * Check if signature valid
@@ -510,8 +525,8 @@ GNUNET_REVOCATION_check_pow (const struct 
GNUNET_REVOCATION_PowP *pow,
                  &pow->timestamp,
                  sizeof (uint64_t));
   GNUNET_memcpy (&buf[sizeof(uint64_t) * 2],
-                 &pow->key,
-                 sizeof(struct GNUNET_IDENTITY_PublicKey));
+                 pk,
+                 GNUNET_IDENTITY_key_get_length (pk));
   for (unsigned int i = 0; i < POW_COUNT; i++)
   {
     pow_val = GNUNET_ntohll (pow->pow[i]);
@@ -565,7 +580,10 @@ sign_pow_ecdsa (const struct GNUNET_CRYPTO_EcdsaPrivateKey 
*key,
                 struct GNUNET_REVOCATION_PowP *pow)
 {
   struct GNUNET_TIME_Absolute ts = GNUNET_TIME_absolute_get ();
-  struct GNUNET_REVOCATION_SignaturePurposePS rp;
+  struct GNUNET_REVOCATION_EcdsaSignaturePurposePS rp;
+  const struct GNUNET_IDENTITY_PublicKey *pk;
+  size_t ksize;
+  char *sig;
 
   /**
    * Predate the validity period to prevent rejections due to
@@ -573,18 +591,23 @@ sign_pow_ecdsa (const struct 
GNUNET_CRYPTO_EcdsaPrivateKey *key,
    */
   ts = GNUNET_TIME_absolute_subtract (ts,
                                       GNUNET_TIME_UNIT_WEEKS);
-
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+  ksize = GNUNET_IDENTITY_key_get_length (pk);
   pow->timestamp = GNUNET_TIME_absolute_hton (ts);
   rp.timestamp = pow->timestamp;
   rp.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_REVOCATION);
   rp.purpose.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)
-                           + sizeof(struct GNUNET_IDENTITY_PublicKey)
+                           + ksize
                            + sizeof (struct GNUNET_TIME_AbsoluteNBO));
-  rp.key = pow->key;
-  pow->sig_len = htonl (sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Signature payload len: %u\n",
+              ntohl (rp.purpose.size));
+  rp.ktype = pk->type;
+  rp.key = pk->ecdsa_key;
+  sig = ((char*)&pow[1]) + ksize;
   return GNUNET_CRYPTO_ecdsa_sign_ (key,
                                     &rp.purpose,
-                                    (void*) &pow[1]);
+                                    (void*) sig);
 
 }
 
@@ -593,8 +616,11 @@ enum GNUNET_GenericReturnValue
 sign_pow (const struct GNUNET_IDENTITY_PrivateKey *key,
           struct GNUNET_REVOCATION_PowP *pow)
 {
-  GNUNET_IDENTITY_key_get_public (key, &pow->key);
-  switch (ntohl (pow->key.type))
+  struct GNUNET_IDENTITY_PublicKey *pk;
+
+  pk = (struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+  GNUNET_IDENTITY_key_get_public (key, pk);
+  switch (ntohl (pk->type))
   {
   case GNUNET_IDENTITY_TYPE_ECDSA:
     return sign_pow_ecdsa (&key->ecdsa_key, pow);
@@ -681,11 +707,13 @@ GNUNET_REVOCATION_pow_round (struct 
GNUNET_REVOCATION_PowCalculationHandle *pc)
            + sizeof (uint64_t)
            + sizeof (uint64_t)] GNUNET_ALIGN;
   struct GNUNET_HashCode result;
+  const struct GNUNET_IDENTITY_PublicKey *pk;
   unsigned int zeros;
   int ret;
   uint64_t pow_nbo;
 
   pc->current_pow++;
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &(pc->pow[1]);
 
   /**
    * Do not try duplicates
@@ -699,8 +727,8 @@ GNUNET_REVOCATION_pow_round (struct 
GNUNET_REVOCATION_PowCalculationHandle *pc)
                  &pc->pow->timestamp,
                  sizeof (uint64_t));
   GNUNET_memcpy (&buf[sizeof(uint64_t) * 2],
-                 &pc->pow->key,
-                 sizeof(struct GNUNET_IDENTITY_PublicKey));
+                 pk,
+                 GNUNET_IDENTITY_key_get_length (pk));
   GNUNET_CRYPTO_pow_hash (&salt,
                           buf,
                           sizeof(buf),
@@ -745,4 +773,25 @@ GNUNET_REVOCATION_pow_stop (struct 
GNUNET_REVOCATION_PowCalculationHandle *pc)
 }
 
 
+size_t
+GNUNET_REVOCATION_proof_get_size (const struct GNUNET_REVOCATION_PowP *pow)
+{
+  size_t size;
+  const struct GNUNET_IDENTITY_PublicKey *pk;
+
+  size = sizeof (struct GNUNET_REVOCATION_PowP);
+  pk = (const struct GNUNET_IDENTITY_PublicKey *) &pow[1];
+  size += GNUNET_IDENTITY_key_get_length (pk);
+
+  switch (ntohl (pk->type))
+  {
+  case GNUNET_IDENTITY_TYPE_ECDSA:
+    return size + sizeof (struct GNUNET_CRYPTO_EcdsaSignature);
+  default:
+    return 0;
+  }
+  return 0;
+}
+
+
 /* end of revocation_api.c */
diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c
index 58fcf2e76..c6457016f 100644
--- a/src/revocation/test_revocation.c
+++ b/src/revocation/test_revocation.c
@@ -164,8 +164,7 @@ ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
     GNUNET_IDENTITY_ego_get_public_key (ego, &testpeers[1].pubkey);
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Calculating proof of work...\n");
     privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
-    proof_of_work = GNUNET_malloc (sizeof (struct GNUNET_REVOCATION_PowP) +
-                                   sizeof (struct 
GNUNET_CRYPTO_EcdsaSignature));
+    proof_of_work = GNUNET_malloc (GNUNET_REVOCATION_MAX_PROOF_SIZE);
     GNUNET_REVOCATION_pow_init (privkey,
                                 proof_of_work);
     testpeers[1].pow = GNUNET_REVOCATION_pow_start (proof_of_work,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]