gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 03/10: Modified db table anastasis_truth


From: gnunet
Subject: [taler-anastasis] 03/10: Modified db table anastasis_truth
Date: Wed, 15 Jan 2020 23:42:27 +0100

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

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

commit b4c76be87dc73f66403e655bb24f4205f2f0bf54
Author: Dennis Neufeld <address@hidden>
AuthorDate: Fri Jan 3 15:45:45 2020 +0000

    Modified db table anastasis_truth
---
 src/backend/Makefile.am                |  3 ++-
 src/stasis/plugin_anastasis_postgres.c | 22 ++++++++++++++--------
 src/stasis/test_anastasis_db.c         | 18 ++++++++++++++----
 3 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 901a708..e4cb8d8 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -31,7 +31,8 @@ anastasis_httpd_LDADD = \
   -lgnunetcurl \
   -lgnunetrest \
   -lgnunetjson \
-  -lgnunetutil
+  -lgnunetutil \
+  -luuid
 
 EXTRA_DIST = \
   $(pkgcfg_DATA)
diff --git a/src/stasis/plugin_anastasis_postgres.c 
b/src/stasis/plugin_anastasis_postgres.c
index c51c1bf..eb5411d 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -822,10 +822,10 @@ postgres_get_escrow_challenge (void *cls,
     GNUNET_PQ_query_param_end
   };
   struct GNUNET_PQ_ResultSpec rs[] = {
-    GNUNET_PQ_result_spec_variable_size ("truth",
+    GNUNET_PQ_result_spec_variable_size ("encrypted_truth",
                                          truth,
                                          truth_size),
-    GNUNET_PQ_result_spec_string ("mime_type",
+    GNUNET_PQ_result_spec_string ("truth_mime",
                                   truth_mime),
     GNUNET_PQ_result_spec_end
   };
@@ -857,7 +857,7 @@ postgres_get_key_share (void *cls,
     GNUNET_PQ_query_param_end
   };
   struct GNUNET_PQ_ResultSpec rs[] = {
-    GNUNET_PQ_result_spec_variable_size ("key_share",
+    GNUNET_PQ_result_spec_variable_size ("key_share_data",
                                          key_share,
                                          key_share_size),
     GNUNET_PQ_result_spec_end
@@ -1059,7 +1059,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             "key_share_data BYTEA NOT NULL,"
                             "method VARCHAR,"
                             "nonce BYTEA NOT NULL,"
-                            "aes_gcm_tag BYTEA NOT NULL"
+                            "aes_gcm_tag BYTEA NOT NULL,"
                             "encrypted_truth BYTEA NOT NULL,"
                             "truth_mime VARCHAR,"
                             "expiration TIMESTAMP NOT NULL"
@@ -1130,7 +1130,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             ",truth_mime"
                             ",expiration"
                             ") VALUES "
-                            "($1, $2, $3, $4, $5, $6, $7);",
+                            "($1, $2, $3, $4, $5, $6, $7, $8);",
                             7),
     GNUNET_PQ_make_prepare ("recovery_document_insert",
                             "INSERT INTO anastasis_recoverydocument "
@@ -1144,8 +1144,14 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             5),
     GNUNET_PQ_make_prepare ("truth_select",
                             "SELECT "
-                            "truth,"
-                            "mime_type"
+                            "truth_id"
+                            ",key_share_data"
+                            ",method"
+                            ",nonce"
+                            ",aes_gcm_tag"
+                            ",encrypted_truth"
+                            ",truth_mime"
+                            ",expiration"
                             " FROM anastasis_truth"
                             " WHERE truth_id =$1;",
                             1),
@@ -1194,7 +1200,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             3),
     GNUNET_PQ_make_prepare ("key_share_select",
                             "SELECT "
-                            "key_share "
+                            "key_share_data "
                             "FROM "
                             "anastasis_truth "
                             "WHERE truth_id =$1;",
diff --git a/src/stasis/test_anastasis_db.c b/src/stasis/test_anastasis_db.c
index c168f2c..11107c1 100644
--- a/src/stasis/test_anastasis_db.c
+++ b/src/stasis/test_anastasis_db.c
@@ -213,11 +213,18 @@ run (void *cls)
   key_share = &key_val;
   RND_BLK (key_share);
 
+  unsigned char aes_gcm_tag[16];
+  RND_BLK (&aes_gcm_tag);
+
   post_counter = 2;
   mime_type = "Picture";
   TALER_string_to_amount ("EUR:30",&amount);
   uuid_t uuid;
   uuid_generate (uuid);
+
+  uint32_t nonce;
+  RND_BLK (&nonce);
+
   struct GNUNET_TIME_Relative rel_time;
   rel_time = GNUNET_TIME_UNIT_MONTHS;
 
@@ -240,11 +247,14 @@ run (void *cls)
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->store_truth (plugin->cls,
                                &uuid,
-                               truth_data,
-                               sizeof (&truth_data),
+                               "key_share_data",
+                               sizeof ("key_share_data"),
                                mime_type,
-                               key_share,
-                               sizeof (&key_share),
+                               "encrypted_truth",
+                               sizeof ("encrypted_truth"),
+                               aes_gcm_tag,
+                               &nonce,
+                               "Methode",
                                rel_time));
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=

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



reply via email to

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