[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: kill truth hash, use varsize (j
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: kill truth hash, use varsize (json) |
Date: |
Thu, 09 Apr 2020 10:44:23 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new f3dff0f kill truth hash, use varsize (json)
f3dff0f is described below
commit f3dff0ff5f3e08770c94f4cab72c060843b124e2
Author: Dennis Neufeld <address@hidden>
AuthorDate: Thu Apr 9 08:44:19 2020 +0000
kill truth hash, use varsize (json)
---
src/backend/anastasis-httpd_truth_upload.c | 13 +++----------
src/include/anastasis_database_plugin.h | 6 +-----
src/lib/test_anastasis_api.c | 2 --
src/stasis/plugin_anastasis_postgres.c | 6 ------
src/stasis/test_anastasis_db.c | 10 ----------
5 files changed, 4 insertions(+), 33 deletions(-)
diff --git a/src/backend/anastasis-httpd_truth_upload.c
b/src/backend/anastasis-httpd_truth_upload.c
index 4a48517..f9c8e41 100644
--- a/src/backend/anastasis-httpd_truth_upload.c
+++ b/src/backend/anastasis-httpd_truth_upload.c
@@ -44,12 +44,11 @@ verify_and_execute_truth (struct MHD_Connection *connection,
enum ANASTASIS_DB_QueryStatus qs;
qs = db->store_truth (db->cls,
uuid,
- truth->keyshare_data,
+ &truth->keyshare_data,
sizeof (&truth->keyshare_data),
truth->truth_mime,
truth->encrypted_truth,
sizeof (&truth->encrypted_truth),
- &truth->truth_hash,
&truth->aes_gcm_tag,
&truth->nonce,
truth->method,
@@ -95,15 +94,13 @@ AH_handler_truth_post (struct MHD_Connection *connection,
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_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_string ("encrypted_truth", &encrypted_truth_str),
+ GNUNET_JSON_spec_varsize ("encrypted_truth", &truth.encrypted_truth,
+ &truth.encrypted_truth_size),
GNUNET_JSON_spec_string ("truth_mime", &truth.truth_mime),
GNUNET_JSON_spec_end ()
};
@@ -129,10 +126,6 @@ AH_handler_truth_post (struct MHD_Connection *connection,
"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 163d284..0553bb0 100644
--- a/src/include/anastasis_database_plugin.h
+++ b/src/include/anastasis_database_plugin.h
@@ -33,15 +33,13 @@
*/
struct ANASTASIS_DB_Truth
{
- const struct ANASTASIS_CRYPTO_EncryptedKeyShare *keyshare_data;
+ struct ANASTASIS_CRYPTO_EncryptedKeyShare keyshare_data;
struct ANASTASIS_CRYPTO_Nonce nonce;
// AES_GCM_Tag
struct ANASTASIS_CRYPTO_AesTag aes_gcm_tag;
- struct GNUNET_HashCode truth_hash;
-
void *encrypted_truth;
size_t encrypted_truth_size;
@@ -264,8 +262,6 @@ struct ANASTASIS_DatabasePlugin
const char *mime_type,
const void *encrypted_truth,
size_t encrypted_truth_size,
- const struct
- GNUNET_HashCode *truth_data_hash,
const struct ANASTASIS_CRYPTO_AesTag *aes_gcm_tag,
const struct ANASTASIS_CRYPTO_Nonce *nonce,
const char *method,
diff --git a/src/lib/test_anastasis_api.c b/src/lib/test_anastasis_api.c
index 25d415b..d24c90f 100644
--- a/src/lib/test_anastasis_api.c
+++ b/src/lib/test_anastasis_api.c
@@ -269,8 +269,6 @@ run (void *cls,
"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)"
diff --git a/src/stasis/plugin_anastasis_postgres.c
b/src/stasis/plugin_anastasis_postgres.c
index fc8319b..8780421 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -984,8 +984,6 @@ postgres_store_truth (void *cls,
const char *mime_type,
const void *encrypted_truth,
size_t encrypted_truth_size,
- const struct
- GNUNET_HashCode *truth_data_hash,
const struct ANASTASIS_CRYPTO_AesTag *aes_gcm_tag,
const struct ANASTASIS_CRYPTO_Nonce *nonce,
const char *method,
@@ -1015,7 +1013,6 @@ postgres_store_truth (void *cls,
GNUNET_PQ_query_param_string (method),
GNUNET_PQ_query_param_auto_from_type (nonce),
GNUNET_PQ_query_param_auto_from_type (aes_gcm_tag),
- GNUNET_PQ_query_param_auto_from_type (truth_data_hash),
GNUNET_PQ_query_param_fixed_size (encrypted_truth,
encrypted_truth_size),
GNUNET_PQ_query_param_string (mime_type),
@@ -1382,7 +1379,6 @@ libanastasis_plugin_db_postgres_init (void *cls)
" nonce BYTEA NOT NULL,"
" aes_gcm_tag BYTEA NOT NULL,"
" encrypted_truth BYTEA NOT NULL,"
- " truth_hash BYTEA NOT NULL
CHECK(length(truth_hash)=64),"
" truth_mime VARCHAR,"
" expiration TIMESTAMP NOT NULL"
");"),
@@ -1497,7 +1493,6 @@ libanastasis_plugin_db_postgres_init (void *cls)
",method"
",nonce"
",aes_gcm_tag"
- ",truth_hash"
",encrypted_truth"
",truth_mime"
",expiration"
@@ -1521,7 +1516,6 @@ libanastasis_plugin_db_postgres_init (void *cls)
",method"
",nonce"
",aes_gcm_tag"
- ",truth_hash"
",encrypted_truth"
",truth_mime"
",expiration"
diff --git a/src/stasis/test_anastasis_db.c b/src/stasis/test_anastasis_db.c
index 1e6f959..0f6a03a 100644
--- a/src/stasis/test_anastasis_db.c
+++ b/src/stasis/test_anastasis_db.c
@@ -81,11 +81,6 @@ struct ANASTASIS_AccountSignatureP res_account_sig;
*/
struct GNUNET_HashCode recoveryDataHash;
-/**
- * Hash of the truth to be uploaded
- */
-struct GNUNET_HashCode truthDataHash;
-
/**
* Hash of the current recovery document
*/
@@ -213,10 +208,6 @@ run (void *cls)
sizeof (recovery_data),
&recoveryDataHash);
- GNUNET_CRYPTO_hash ("key_share_data",
- sizeof ("key_share_data"),
- &truthDataHash);
-
GNUNET_CRYPTO_eddsa_sign (&accountPrivP.priv,
&usp,
&accountSig.eddsa_sig);
@@ -273,7 +264,6 @@ run (void *cls)
mime_type,
"encrypted_truth",
sizeof ("encrypted_truth"),
- &truthDataHash,
aes_gcm_tag,
&nonce,
"Methode",
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: kill truth hash, use varsize (json),
gnunet <=