gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated (009658d -> 5fafda8)


From: gnunet
Subject: [taler-anastasis] branch master updated (009658d -> 5fafda8)
Date: Wed, 08 Apr 2020 23:19:15 +0200

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

dennis-neufeld pushed a change to branch master
in repository anastasis.

    from 009658d  adaptations for signing API change in GNUnet (#6164)
     new 59129aa  modified truth upload
     new 5fafda8  worked on truth upload

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/backend/anastasis-httpd_policy.c        |  9 +++--
 src/backend/anastasis-httpd_policy_upload.c |  3 +-
 src/backend/anastasis-httpd_truth_upload.c  | 33 +++++++++++++-----
 src/include/anastasis_database_plugin.h     | 14 ++++----
 src/include/anastasis_service.h             |  4 +--
 src/include/anastasis_testing_lib.h         |  2 +-
 src/lib/anastasis_api_policy_lookup.c       | 20 ++++++-----
 src/lib/anastasis_api_policy_store.c        |  8 +++--
 src/lib/anastasis_api_truth_store.c         | 39 +++++++++++++++------
 src/lib/test_anastasis_api.c                | 53 +++++++++++++++++++++++++++--
 src/lib/testing_api_cmd_truth_store.c       | 11 ++----
 src/stasis/plugin_anastasis_postgres.c      |  4 +--
 src/stasis/test_anastasis_db.c              |  9 ++---
 13 files changed, 148 insertions(+), 61 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy.c 
b/src/backend/anastasis-httpd_policy.c
index 146b1ba..23d41a0 100644
--- a/src/backend/anastasis-httpd_policy.c
+++ b/src/backend/anastasis-httpd_policy.c
@@ -143,30 +143,33 @@ AH_return_policy (struct MHD_Connection *connection,
   TALER_MHD_add_global_headers (resp);
   {
     char *sig_s;
-    char *prev_s;
+    // char *prev_s;
     char *etag;
 
     sig_s = GNUNET_STRINGS_data_to_string_alloc (&account_sig,
                                                  sizeof (account_sig));
+    /*
     prev_s = GNUNET_STRINGS_data_to_string_alloc (&prev_hash,
                                                   sizeof (prev_hash));
+    */
     etag = GNUNET_STRINGS_data_to_string_alloc (&recovery_data_hash,
                                                 sizeof (recovery_data_hash));
     GNUNET_break (MHD_YES ==
                   MHD_add_response_header (resp,
                                            "Anastasis-Policy-Signature",
                                            sig_s));
-    // FIXME: reasonable?
+    /*
     GNUNET_break (MHD_YES ==
                   MHD_add_response_header (resp,
                                            "Anastasis-Previous",
                                            prev_s));
+    */
     GNUNET_break (MHD_YES ==
                   MHD_add_response_header (resp,
                                            MHD_HTTP_HEADER_ETAG,
                                            etag));
     GNUNET_free (etag);
-    GNUNET_free (prev_s);
+    // GNUNET_free (prev_s);
     GNUNET_free (sig_s);
   }
   ret = MHD_queue_response (connection,
diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index 1a8ec67..9b28af0 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -794,10 +794,9 @@ AH_handler_policy_post (struct MHD_Connection *connection,
       struct ANASTASIS_UploadSignaturePS usp = {
         .purpose.size = htonl (sizeof (usp)),
         .purpose.purpose = htonl (TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD),
-        .old_recovery_data_hash = puc->old_policy_upload_hash,
+        // .old_recovery_data_hash = puc->old_policy_upload_hash,
         .new_recovery_data_hash = puc->new_policy_upload_hash
       };
-
       if (GNUNET_OK !=
           GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD,
                                       &usp,
diff --git a/src/backend/anastasis-httpd_truth_upload.c 
b/src/backend/anastasis-httpd_truth_upload.c
index e1282e0..4a48517 100644
--- a/src/backend/anastasis-httpd_truth_upload.c
+++ b/src/backend/anastasis-httpd_truth_upload.c
@@ -42,7 +42,6 @@ verify_and_execute_truth (struct MHD_Connection *connection,
                           const uuid_t *uuid)
 {
   enum ANASTASIS_DB_QueryStatus qs;
-
   qs = db->store_truth (db->cls,
                         uuid,
                         truth->keyshare_data,
@@ -50,11 +49,14 @@ verify_and_execute_truth (struct MHD_Connection *connection,
                         truth->truth_mime,
                         truth->encrypted_truth,
                         sizeof (&truth->encrypted_truth),
-                        truth->truth_hash,
-                        truth->aes_gcm_tag,
+                        &truth->truth_hash,
+                        &truth->aes_gcm_tag,
                         &truth->nonce,
                         truth->method,
                         AH_truth_expiration);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Store truth db status: %i\n",
+              qs);
   return qs;
 }
 
@@ -88,22 +90,28 @@ AH_handler_truth_post (struct MHD_Connection *connection,
 
     uuid_str = &url[strlen ("/truth/")];
     uuid_parse (uuid_str, uuid);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Uuid from Url: %s\n",
+                uuid_str);
   }
   {
+    const char *encrypted_truth_str;
 
-  }
-  {
     struct GNUNET_JSON_Specification spec[] = {
       GNUNET_JSON_spec_fixed_auto ("keyshare_data", &truth.keyshare_data),
       GNUNET_JSON_spec_string ("method", &truth.method),
-      GNUNET_JSON_spec_uint32 ("nonce", &truth.nonce),
+      GNUNET_JSON_spec_fixed_auto ("nonce", &truth.nonce),
       GNUNET_JSON_spec_fixed_auto ("aes_gcm_tag", &truth.aes_gcm_tag),
       GNUNET_JSON_spec_fixed_auto ("truth_hash", &truth.truth_hash),
-      GNUNET_JSON_spec_fixed_auto ("encrypted_truth", &truth.encrypted_truth),
+      GNUNET_JSON_spec_string ("encrypted_truth", &encrypted_truth_str),
       GNUNET_JSON_spec_string ("truth_mime", &truth.truth_mime),
       GNUNET_JSON_spec_end ()
     };
 
+    (void) con_cls;
+    (void) truth_data;
+    (void) truth_data_size;
+
     res = TALER_MHD_parse_post_json (connection,
                                      con_cls,
                                      truth_data,
@@ -111,11 +119,20 @@ AH_handler_truth_post (struct MHD_Connection *connection,
                                      &json);
     if (GNUNET_SYSERR == res)
       return MHD_NO;
-    if ( (GNUNET_NO == res) || (NULL == json) )
+    if ( (GNUNET_NO == res) ||
+         (NULL == json) )
       return MHD_YES;
     res = TALER_MHD_parse_json_data (connection,
                                      json,
                                      spec);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Truth json from upload: %s\nResult: %i\n",
+                json_dumps (json, JSON_COMPACT),
+                res);
+    GNUNET_STRINGS_string_to_data (encrypted_truth_str,
+                                   strlen (encrypted_truth_str),
+                                   truth.encrypted_truth,
+                                   truth.encrypted_truth_size);
     json_decref (json);
     if (GNUNET_SYSERR == res)
       return MHD_NO; /* hard failure */
diff --git a/src/include/anastasis_database_plugin.h 
b/src/include/anastasis_database_plugin.h
index dd9df56..163d284 100644
--- a/src/include/anastasis_database_plugin.h
+++ b/src/include/anastasis_database_plugin.h
@@ -33,17 +33,19 @@
  */
 struct ANASTASIS_DB_Truth
 {
-  const void *keyshare_data;
+  const struct ANASTASIS_CRYPTO_EncryptedKeyShare *keyshare_data;
 
-  uint32_t nonce;
+  struct ANASTASIS_CRYPTO_Nonce nonce;
 
   // AES_GCM_Tag
-  unsigned char aes_gcm_tag[16];
+  struct ANASTASIS_CRYPTO_AesTag aes_gcm_tag;
 
-  struct GNUNET_HashCode *truth_hash;
+  struct GNUNET_HashCode truth_hash;
 
   void *encrypted_truth;
 
+  size_t encrypted_truth_size;
+
   const char *truth_mime;
 
   const char *method;
@@ -264,8 +266,8 @@ struct ANASTASIS_DatabasePlugin
                  size_t encrypted_truth_size,
                  const struct
                  GNUNET_HashCode *truth_data_hash,
-                 const unsigned char aes_gcm_tag[16],
-                 const uint32_t *nonce,
+                 const struct ANASTASIS_CRYPTO_AesTag *aes_gcm_tag,
+                 const struct ANASTASIS_CRYPTO_Nonce *nonce,
                  const char *method,
                  struct
                  GNUNET_TIME_Relative truth_expiration);
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index f94fae4..7916ed8 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -65,7 +65,7 @@ struct ANASTASIS_UploadSignaturePS
   /**
    * Hash of the previous backup, all zeros for none.
    */
-  struct GNUNET_HashCode old_recovery_data_hash;
+  // struct GNUNET_HashCode old_recovery_data_hash;
 
   /**
    * Hash of the new backup.
@@ -483,7 +483,7 @@ ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
                        const uuid_t truth_uuid,
                        const struct
                        GNUNET_HashCode *prev_truth_data_hash,
-                       const json_t *truth_data,
+                       json_t *truth_data,
                        int payment_requested,
                        const char *paid_order_id,
                        ANASTASIS_TruthStoreCallback cb,
diff --git a/src/include/anastasis_testing_lib.h 
b/src/include/anastasis_testing_lib.h
index bb994c6..5bdb601 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -338,7 +338,7 @@ ANASTASIS_TESTING_cmd_truth_store (const char *label,
                                    unsigned int http_status,
                                    enum
                                    ANASTASIS_TESTING_TruthStoreOption tso,
-                                   const void *truth_data,
+                                   json_t *truth_data,
                                    size_t truth_data_size);
 
 /**
diff --git a/src/lib/anastasis_api_policy_lookup.c 
b/src/lib/anastasis_api_policy_lookup.c
index 48c5dd5..1654637 100644
--- a/src/lib/anastasis_api_policy_lookup.c
+++ b/src/lib/anastasis_api_policy_lookup.c
@@ -134,25 +134,28 @@ handle_policy_lookup_finished (void *cls,
       struct ANASTASIS_UploadSignaturePS usp = {
         .purpose.purpose = htonl (TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD),
         .purpose.size = htonl (sizeof (usp)),
-        .old_recovery_data_hash = plo->anastasis_previous
+        // .old_recovery_data_hash = plo->anastasis_previous
       };
 
       GNUNET_CRYPTO_hash (data,
                           data_size,
                           &usp.new_recovery_data_hash);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Account Signature to verify download: %s\n",
-                  TALER_B2S (&plo->account_sig));
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Account Public Key for verification of signature: %s\n",
-                  TALER_B2S (&plo->account_pub));
-
       if (GNUNET_OK !=
           GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD,
                                       &usp,
                                       &plo->account_sig.eddsa_sig,
                                       &plo->account_pub.pub))
       {
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                    "Hash of new recovery data (download): %s\n",
+                    TALER_B2S (&usp.new_recovery_data_hash));
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                    "Account Signature to verify download: %s\n",
+                    TALER_B2S (&plo->account_sig));
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                    "Account Public Key for verification of signature: %s\n",
+                    TALER_B2S (&plo->account_pub));
+
         GNUNET_break_op (0);
         response_code = 0;
         break;
@@ -259,7 +262,6 @@ handle_header (char *buffer,
       return 0;
     }
   }
-  /* FIXME: reasonable?*/
   if (0 == strcasecmp (hdr_type,
                        "Anastasis-Previous"))
   {
diff --git a/src/lib/anastasis_api_policy_store.c 
b/src/lib/anastasis_api_policy_store.c
index fb1738a..df6e1ec 100644
--- a/src/lib/anastasis_api_policy_store.c
+++ b/src/lib/anastasis_api_policy_store.c
@@ -259,7 +259,6 @@ handle_header (char *buffer,
  *
  * @param ctx the CURL context used to connect to the backend
  * @param backend_url backend's base URL, including final "/"
- * @param anastasis_pub public key of the user's account
  * @param anastasis_priv private key of the user's account
  * @param prev_recovery_data_hash hash of the previous uploaded recovery 
document
  * @param recovery_data policy data to be stored
@@ -293,8 +292,10 @@ ANASTASIS_policy_store (struct GNUNET_CURL_Context *ctx,
     .purpose.size = htonl (sizeof (usp))
   };
 
+  /*
   if (NULL != prev_recovery_data_hash)
     usp.old_recovery_data_hash = *prev_recovery_data_hash;
+  */
 
   GNUNET_CRYPTO_hash (recovery_data,
                       recovery_data_size,
@@ -349,7 +350,7 @@ ANASTASIS_policy_store (struct GNUNET_CURL_Context *ctx,
     /* Setup If-Match header */
     if (NULL != prev_recovery_data_hash)
     {
-      val = GNUNET_STRINGS_data_to_string_alloc (&usp.old_recovery_data_hash,
+      val = GNUNET_STRINGS_data_to_string_alloc (prev_recovery_data_hash,
                                                  sizeof (struct
                                                          GNUNET_HashCode));
       GNUNET_asprintf (&hdr,
@@ -397,6 +398,9 @@ ANASTASIS_policy_store (struct GNUNET_CURL_Context *ctx,
 
     GNUNET_CRYPTO_eddsa_key_get_public (&anastasis_priv->priv,
                                         &pub.pub);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Account public key created: %s\n",
+                TALER_B2S (&pub));
     acc_pub_str = GNUNET_STRINGS_data_to_string_alloc (&pub,
                                                        sizeof (pub));
     GNUNET_asprintf (&path,
diff --git a/src/lib/anastasis_api_truth_store.c 
b/src/lib/anastasis_api_truth_store.c
index 12bc30c..dc9abf6 100644
--- a/src/lib/anastasis_api_truth_store.c
+++ b/src/lib/anastasis_api_truth_store.c
@@ -90,6 +90,7 @@ ANASTASIS_truth_store_cancel (struct
     GNUNET_CURL_job_cancel (tso->job);
     tso->job = NULL;
   }
+  GNUNET_free_non_null (tso->pay_uri);
   GNUNET_free (tso->url);
   GNUNET_free (tso);
 }
@@ -117,6 +118,7 @@ handle_truth_store_finished (void *cls,
   tso->job = NULL;
   udp = NULL;
   memset (&ud, 0, sizeof (ud));
+
   switch (response_code)
   {
   case 0:
@@ -209,18 +211,21 @@ handle_header (char *buffer,
   char *ndup;
   const char *hdr_type;
   char *hdr_val;
+  char *sp;
 
   ndup = GNUNET_strndup (buffer,
                          total);
-  hdr_type = strtok (ndup,
-                     ":");
+  hdr_type = strtok_r (ndup,
+                       ":",
+                       &sp);
   if (NULL == hdr_type)
   {
     GNUNET_free (ndup);
     return total;
   }
-  hdr_val = strtok (NULL,
-                    "");
+  hdr_val = strtok_r (NULL,
+                      "",
+                      &sp);
   if (NULL == hdr_val)
   {
     GNUNET_free (ndup);
@@ -231,8 +236,18 @@ handle_header (char *buffer,
   if (0 == strcasecmp (hdr_type,
                        "Taler"))
   {
+    size_t len;
+
     /* found payment URI we care about! */
     tso->pay_uri = GNUNET_strdup (hdr_val);
+    len = strlen (tso->pay_uri);
+    while ( (len > 0) &&
+            ( ('\n' == tso->pay_uri[len - 1]) ||
+              ('\r' == tso->pay_uri[len - 1]) ) )
+    {
+      len--;
+      tso->pay_uri[len] = '\0';
+    }
   }
   GNUNET_free (ndup);
   return total;
@@ -259,7 +274,7 @@ ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
                        const uuid_t truth_uuid,
                        const struct
                        GNUNET_HashCode *prev_truth_data_hash,
-                       const json_t *truth_data,
+                       json_t *truth_data,
                        int payment_requested,
                        const char *paid_order_id,
                        ANASTASIS_TruthStoreCallback cb,
@@ -268,8 +283,11 @@ ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
   struct ANASTASIS_TruthStoreOperation *tso;
   CURL *eh;
   struct curl_slist *job_headers;
-  struct GNUNET_HashCode old_truth_data_hash;
   struct GNUNET_HashCode new_truth_data_hash;
+  char *json_str;
+
+  json_str = json_dumps (truth_data,
+                         JSON_COMPACT);
 
   /* setup our HTTP headers */
   job_headers = NULL;
@@ -278,8 +296,6 @@ ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
     char *val;
     char *hdr;
 
-    if (NULL != prev_truth_data_hash)
-      old_truth_data_hash = *prev_truth_data_hash;
     GNUNET_CRYPTO_hash (truth_data,
                         sizeof(truth_data),
                         &new_truth_data_hash);
@@ -305,7 +321,7 @@ ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
     /* Setup If-Match header */
     if (NULL != prev_truth_data_hash)
     {
-      val = GNUNET_STRINGS_data_to_string_alloc (&old_truth_data_hash,
+      val = GNUNET_STRINGS_data_to_string_alloc (prev_truth_data_hash,
                                                  sizeof (struct
                                                          GNUNET_HashCode));
       GNUNET_asprintf (&hdr,
@@ -371,14 +387,15 @@ ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
   tso->cb = cb;
   tso->cb_cls = cb_cls;
   eh = ANASTASIS_curl_easy_get_ (tso->url);
+
   GNUNET_assert (CURLE_OK ==
                  curl_easy_setopt (eh,
                                    CURLOPT_POSTFIELDS,
-                                   truth_data));
+                                   json_str));
   GNUNET_assert (CURLE_OK ==
                  curl_easy_setopt (eh,
                                    CURLOPT_POSTFIELDSIZE,
-                                   sizeof(truth_data)));
+                                   strlen (json_str)));
   GNUNET_assert (CURLE_OK ==
                  curl_easy_setopt (eh,
                                    CURLOPT_HEADERFUNCTION,
diff --git a/src/lib/test_anastasis_api.c b/src/lib/test_anastasis_api.c
index 62c5a58..25d415b 100644
--- a/src/lib/test_anastasis_api.c
+++ b/src/lib/test_anastasis_api.c
@@ -234,6 +234,55 @@ run (void *cls,
     TALER_TESTING_cmd_end ()
   };
 
+  json_t *truth_data;
+  struct ANASTASIS_CRYPTO_EncryptedKeyShare keyshare_data;
+  struct ANASTASIS_CRYPTO_Nonce nonce;
+  struct ANASTASIS_CRYPTO_AesTag aes_gcm_tag;
+  struct GNUNET_HashCode truth_hash;
+  const char *encrypted_truth;
+
+  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+                              &nonce,
+                              sizeof (struct ANASTASIS_CRYPTO_Nonce));
+  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+                              &aes_gcm_tag,
+                              sizeof (struct ANASTASIS_CRYPTO_AesTag));
+  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+                              &keyshare_data,
+                              sizeof (struct
+                                      ANASTASIS_CRYPTO_EncryptedKeyShare));
+  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+                              &truth_hash,
+                              sizeof (struct GNUNET_HashCode));
+  encrypted_truth = "Truth test (et)";
+
+  truth_data = json_pack ("{s:o," /* keyshare_data */
+                          " s:s," /* method */
+                          " s:o," /* nonce */
+                          " s:o," /* aes_gcm_tag */
+                          " s:o," /* truth_hash */
+                          " s:o," /* encrypted_truth */
+                          " s:s}", /* truth_mime */
+                          "keyshare_data", GNUNET_JSON_from_data_auto (
+                            &keyshare_data),
+                          "method", "Truth test (method)",
+                          "nonce", GNUNET_JSON_from_data_auto (&nonce),
+                          "aes_gcm_tag", GNUNET_JSON_from_data_auto (
+                            &aes_gcm_tag),
+                          "truth_hash", GNUNET_JSON_from_data_auto (
+                            &truth_hash),
+                          "encrypted_truth", GNUNET_JSON_from_data (
+                            encrypted_truth, strlen (encrypted_truth)),
+                          "truth_mime", "Truth test (mime)"
+                          );
+  if (NULL == truth_data)
+  {
+    GNUNET_break (0);
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Truth json before upload: %s\n",
+              json_dumps (truth_data, JSON_COMPACT));
+
   struct TALER_TESTING_Command truth[] = {
     // FIXME: Code for truth handling
 
@@ -242,8 +291,8 @@ run (void *cls,
                                        NULL,
                                        MHD_HTTP_NO_CONTENT,
                                        ANASTASIS_TESTING_TSO_NONE,
-                                       "Test-2",
-                                       strlen ("Test-2")),
+                                       truth_data,
+                                       sizeof (truth_data)),
     TALER_TESTING_cmd_end ()
   };
 
diff --git a/src/lib/testing_api_cmd_truth_store.c 
b/src/lib/testing_api_cmd_truth_store.c
index c7e6b2a..2f3286f 100644
--- a/src/lib/testing_api_cmd_truth_store.c
+++ b/src/lib/testing_api_cmd_truth_store.c
@@ -38,7 +38,7 @@ struct TruthStoreState
   /**
    * The policy data.
    */
-  const json_t *truth_data;
+  json_t *truth_data;
 
   /**
    * Expected status code.
@@ -293,13 +293,6 @@ truth_store_run (void *cls,
       }
     }
   }
-  {
-    // create json
-    // FIXME: create an example TruthUploadRequest-Json-Object
-    json_t *truth_json;
-    truth_json = json_pack ("");
-    tss->truth_data = truth_json;
-  }
   // Create an uuid
   uuid_t truth_uuid;
   uuid_generate (truth_uuid);
@@ -407,7 +400,7 @@ ANASTASIS_TESTING_cmd_truth_store (const char *label,
                                    unsigned int http_status,
                                    enum
                                    ANASTASIS_TESTING_TruthStoreOption tso,
-                                   const void *truth_data,
+                                   json_t *truth_data,
                                    size_t truth_data_size)
 {
   struct TruthStoreState *tss;
diff --git a/src/stasis/plugin_anastasis_postgres.c 
b/src/stasis/plugin_anastasis_postgres.c
index 1884619..fc8319b 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -986,8 +986,8 @@ postgres_store_truth (void *cls,
                       size_t encrypted_truth_size,
                       const struct
                       GNUNET_HashCode *truth_data_hash,
-                      const unsigned char aes_gcm_tag[16],
-                      const uint32_t *nonce,
+                      const struct ANASTASIS_CRYPTO_AesTag *aes_gcm_tag,
+                      const struct ANASTASIS_CRYPTO_Nonce *nonce,
                       const char *method,
                       struct
                       GNUNET_TIME_Relative truth_expiration)
diff --git a/src/stasis/test_anastasis_db.c b/src/stasis/test_anastasis_db.c
index 5b2f535..1e6f959 100644
--- a/src/stasis/test_anastasis_db.c
+++ b/src/stasis/test_anastasis_db.c
@@ -192,8 +192,11 @@ run (void *cls)
   size_t recoverydatasize;
   size_t keysharesize;
   const char *str = "AHV123456789";
-  struct GNUNET_CRYPTO_EccSignaturePurpose purp;
   struct GNUNET_HashCode r;
+  struct ANASTASIS_UploadSignaturePS usp = {
+    .purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST),
+    .purpose.size = htonl (sizeof (usp))
+  };
 
   GNUNET_CRYPTO_eddsa_private_key_from_string (str,
                                                sizeof (str),
@@ -214,10 +217,8 @@ run (void *cls)
                       sizeof ("key_share_data"),
                       &truthDataHash);
 
-  purp.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose));
-  purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
   GNUNET_CRYPTO_eddsa_sign (&accountPrivP.priv,
-                            &purp,
+                            &usp,
                             &accountSig.eddsa_sig);
   RND_BLK (&paymentSecretP);
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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