gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: fix stupidity


From: gnunet
Subject: [taler-anastasis] branch master updated: fix stupidity
Date: Mon, 08 Feb 2021 20:58:45 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 4560e8a  fix stupidity
4560e8a is described below

commit 4560e8a1371d2d7210863eb704de74987ed4b547
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Feb 8 20:58:41 2021 +0100

    fix stupidity
---
 src/backend/anastasis-httpd_truth.c            | 9 +++++----
 src/restclient/anastasis_api_keyshare_lookup.c | 1 +
 src/stasis/stasis-0001.sql                     | 8 ++++----
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/backend/anastasis-httpd_truth.c 
b/src/backend/anastasis-httpd_truth.c
index e567dba..6354c6f 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -523,7 +523,6 @@ AH_handler_truth_get (struct MHD_Connection *connection,
   struct GetContext *gc = hc->ctx;
   struct ANASTASIS_CRYPTO_TruthKeyP truth_key;
   struct GNUNET_HashCode challenge_response;
-  struct ANASTASIS_AuthorizationPlugin *p;
   bool have_response;
   void *encrypted_truth;
   size_t encrypted_truth_size;
@@ -553,6 +552,7 @@ AH_handler_truth_get (struct MHD_Connection *connection,
       enum ANASTASIS_AUTHORIZATION_Result ret;
       enum GNUNET_DB_QueryStatus qs;
 
+      GNUNET_assert (NULL != gc->authorization);
       ret = gc->authorization->process (gc->as,
                                         connection);
       switch (ret)
@@ -652,6 +652,7 @@ AH_handler_truth_get (struct MHD_Connection *connection,
     tdk = MHD_lookup_connection_value (connection,
                                        MHD_HEADER_KIND,
                                        
ANASTASIS_HTTP_HEADER_TRUTH_DECRYPTION_KEY);
+    if (NULL == tdk)
     {
       GNUNET_break_op (0);
       return TALER_MHD_reply_with_error (connection,
@@ -919,8 +920,8 @@ AH_handler_truth_get (struct MHD_Connection *connection,
 
     qs = db->create_challenge_code (db->cls,
                                     &gc->truth_public_key,
-                                    p->code_rotation_period,
-                                    p->code_validity_period,
+                                    gc->authorization->code_rotation_period,
+                                    gc->authorization->code_validity_period,
                                     INITIAL_RETRY_COUNTER,
                                     &transmission_date,
                                     &gc->code);
@@ -941,7 +942,7 @@ AH_handler_truth_get (struct MHD_Connection *connection,
     }
 
     if (GNUNET_TIME_absolute_get_duration (transmission_date).rel_value_us <
-        p->code_retransmission_frequency.rel_value_us)
+        gc->authorization->code_retransmission_frequency.rel_value_us)
     {
       /* Too early for a retransmission! */
       GNUNET_free (decrypted_truth);
diff --git a/src/restclient/anastasis_api_keyshare_lookup.c 
b/src/restclient/anastasis_api_keyshare_lookup.c
index 663d421..1453586 100644
--- a/src/restclient/anastasis_api_keyshare_lookup.c
+++ b/src/restclient/anastasis_api_keyshare_lookup.c
@@ -72,6 +72,7 @@ struct ANASTASIS_KeyShareLookupOperation
    * Hash of the response (security question)
    */
   const struct GNUNET_HashCode *hashed_answer;
+
 };
 
 
diff --git a/src/stasis/stasis-0001.sql b/src/stasis/stasis-0001.sql
index d0a5ef6..2f66fd0 100644
--- a/src/stasis/stasis-0001.sql
+++ b/src/stasis/stasis-0001.sql
@@ -1,6 +1,6 @@
 --
 -- This file is part of Anastasis
--- Copyright (C) 2020 Anastasis SARL SA
+-- Copyright (C) 2020, 2021 Anastasis SARL SA
 --
 -- ANASTASIS is free software; you can redistribute it and/or modify it under 
the
 -- terms of the GNU General Public License as published by the Free Software
@@ -19,7 +19,7 @@ BEGIN;
 
 -- TODO:
 -- * add comments for every table and column
--- * avoid 'timestamp' as column name
+-- * avoid 'method' as column name (SQL keyword!)
 
 
 -- Check patch versioning is in place.
@@ -29,9 +29,9 @@ SELECT _v.register_patch('stasis-0001', NULL, NULL);
 CREATE TABLE IF NOT EXISTS anastasis_truth
   (truth_public_key BYTEA PRIMARY KEY NOT NULL,
    key_share_data BYTEA NOT NULL,
-   method VARCHAR,
+   method VARCHAR NOT NULL,
    encrypted_truth BYTEA NOT NULL,
-   truth_mime VARCHAR,
+   truth_mime VARCHAR NOT NULL,
    expiration TIMESTAMP NOT NULL);
 COMMENT ON TABLE anastasis_truth
   IS 'Truth data is needed to authenticate clients during recovery';

-- 
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]