[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: use Etags in double-quotes as p
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: use Etags in double-quotes as per standard, add missing 'return' in tests |
Date: |
Sun, 17 Sep 2023 12:05:56 +0200 |
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 4204349 use Etags in double-quotes as per standard, add missing
'return' in tests
4204349 is described below
commit 420434962743a3575ddac06b1c67e541e813cdf6
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Sep 17 12:05:52 2023 +0200
use Etags in double-quotes as per standard, add missing 'return' in tests
---
src/backend/anastasis-httpd_policy-upload.c | 7 ++++--
src/backend/anastasis-httpd_policy.c | 24 ++++++++++++++-------
src/restclient/anastasis_api_policy_store.c | 2 +-
.../taler/exchange/offline-keys/secm_tofus.pub | Bin 96 -> 96 bytes
src/testing/testing_api_cmd_config.c | 1 +
src/testing/testing_api_cmd_policy_lookup.c | 1 +
src/testing/testing_api_cmd_policy_store.c | 1 +
src/testing/testing_api_cmd_truth_challenge.c | 1 +
src/testing/testing_api_cmd_truth_solve.c | 1 +
src/testing/testing_api_cmd_truth_store.c | 1 +
10 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/src/backend/anastasis-httpd_policy-upload.c
b/src/backend/anastasis-httpd_policy-upload.c
index d966eba..fd4e1ca 100644
--- a/src/backend/anastasis-httpd_policy-upload.c
+++ b/src/backend/anastasis-httpd_policy-upload.c
@@ -757,9 +757,12 @@ AH_handler_policy_post (
MHD_HEADER_KIND,
MHD_HTTP_HEADER_IF_NONE_MATCH);
if ( (NULL == etag) ||
+ (2 >= strlen (etag)) ||
+ ('"' != etag[0]) ||
+ ('"' != etag[strlen (etag) - 1]) ||
(GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (etag,
- strlen (etag),
+ GNUNET_STRINGS_string_to_data (etag + 1,
+ strlen (etag) - 2,
&puc->new_policy_upload_hash,
sizeof
(puc->new_policy_upload_hash))) )
{
diff --git a/src/backend/anastasis-httpd_policy.c
b/src/backend/anastasis-httpd_policy.c
index a26d11e..177cc06 100644
--- a/src/backend/anastasis-httpd_policy.c
+++ b/src/backend/anastasis-httpd_policy.c
@@ -122,25 +122,30 @@ return_policy (struct MHD_Connection *connection,
{
char *sig_s;
char *etag;
+ char *etagq;
sig_s = GNUNET_STRINGS_data_to_string_alloc (&account_sig,
sizeof (account_sig));
- etag = GNUNET_STRINGS_data_to_string_alloc (&recovery_data_hash,
- sizeof (recovery_data_hash));
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
ANASTASIS_HTTP_HEADER_POLICY_SIGNATURE,
sig_s));
+ GNUNET_free (sig_s);
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
ANASTASIS_HTTP_HEADER_POLICY_VERSION,
version_s));
+ etag = GNUNET_STRINGS_data_to_string_alloc (&recovery_data_hash,
+ sizeof (recovery_data_hash));
+ GNUNET_asprintf (&etagq,
+ "\"%s\"",
+ etag);
+ GNUNET_free (etag);
GNUNET_break (MHD_YES ==
MHD_add_response_header (resp,
MHD_HTTP_HEADER_ETAG,
- etag));
- GNUNET_free (etag);
- GNUNET_free (sig_s);
+ etagq));
+ GNUNET_free (etagq);
}
{
MHD_RESULT ret;
@@ -203,13 +208,16 @@ AH_policy_get (struct MHD_Connection *connection,
inm = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
MHD_HTTP_HEADER_IF_NONE_MATCH);
- if (NULL != inm)
+ if ( (NULL != inm) &&
+ (2 < strlen (inm)) &&
+ ('"' == inm[0]) &&
+ ('"' == inm[strlen (inm) - 1]) )
{
struct GNUNET_HashCode inm_h;
if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (inm,
- strlen (inm),
+ GNUNET_STRINGS_string_to_data (inm + 1,
+ strlen (inm) - 2,
&inm_h,
sizeof (inm_h)))
{
diff --git a/src/restclient/anastasis_api_policy_store.c
b/src/restclient/anastasis_api_policy_store.c
index 5cfcfcb..3afee7d 100644
--- a/src/restclient/anastasis_api_policy_store.c
+++ b/src/restclient/anastasis_api_policy_store.c
@@ -417,7 +417,7 @@ ANASTASIS_policy_store (
val = GNUNET_STRINGS_data_to_string_alloc (&usp.new_recovery_data_hash,
sizeof (struct
GNUNET_HashCode));
GNUNET_asprintf (&hdr,
- "%s: %s",
+ "%s: \"%s\"",
MHD_HTTP_HEADER_IF_NONE_MATCH,
val);
GNUNET_free (val);
diff --git
a/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub
b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub
index b086cd1..09a3ebd 100644
Binary files
a/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub
and
b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub
differ
diff --git a/src/testing/testing_api_cmd_config.c
b/src/testing/testing_api_cmd_config.c
index 069200b..542e140 100644
--- a/src/testing/testing_api_cmd_config.c
+++ b/src/testing/testing_api_cmd_config.c
@@ -75,6 +75,7 @@ config_cb (void *cls,
TALER_TESTING_unexpected_status (ss->is,
config->http_status,
ss->http_status);
+ return;
}
if (GNUNET_OK == config->http_status)
{
diff --git a/src/testing/testing_api_cmd_policy_lookup.c
b/src/testing/testing_api_cmd_policy_lookup.c
index 58c7ddb..2d854c5 100644
--- a/src/testing/testing_api_cmd_policy_lookup.c
+++ b/src/testing/testing_api_cmd_policy_lookup.c
@@ -86,6 +86,7 @@ policy_lookup_cb (void *cls,
TALER_TESTING_unexpected_status (pls->is,
dd->http_status,
pls->http_status);
+ return;
}
if (NULL != pls->upload_reference)
{
diff --git a/src/testing/testing_api_cmd_policy_store.c
b/src/testing/testing_api_cmd_policy_store.c
index e5404d0..edc753d 100644
--- a/src/testing/testing_api_cmd_policy_store.c
+++ b/src/testing/testing_api_cmd_policy_store.c
@@ -142,6 +142,7 @@ policy_store_cb (void *cls,
TALER_TESTING_unexpected_status (pss->is,
ud->http_status,
pss->http_status);
+ return;
}
switch (ud->us)
{
diff --git a/src/testing/testing_api_cmd_truth_challenge.c
b/src/testing/testing_api_cmd_truth_challenge.c
index e4ea16b..c399345 100644
--- a/src/testing/testing_api_cmd_truth_challenge.c
+++ b/src/testing/testing_api_cmd_truth_challenge.c
@@ -103,6 +103,7 @@ truth_challenge_cb (void *cls,
TALER_TESTING_unexpected_status (ksls->is,
tcd->http_status,
ksls->expected_http_status);
+ return;
}
switch (tcd->http_status)
{
diff --git a/src/testing/testing_api_cmd_truth_solve.c
b/src/testing/testing_api_cmd_truth_solve.c
index 40e662d..29157ed 100644
--- a/src/testing/testing_api_cmd_truth_solve.c
+++ b/src/testing/testing_api_cmd_truth_solve.c
@@ -130,6 +130,7 @@ truth_solve_cb (void *cls,
TALER_TESTING_unexpected_status (ksls->is,
tsr->http_status,
ksls->expected_http_status);
+ return;
}
switch (tsr->http_status)
{
diff --git a/src/testing/testing_api_cmd_truth_store.c
b/src/testing/testing_api_cmd_truth_store.c
index 675bc61..f7a6ece 100644
--- a/src/testing/testing_api_cmd_truth_store.c
+++ b/src/testing/testing_api_cmd_truth_store.c
@@ -130,6 +130,7 @@ truth_store_cb (void *cls,
TALER_TESTING_unexpected_status (tss->is,
ud->http_status,
tss->http_status);
+ return;
}
switch (ud->us)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: use Etags in double-quotes as per standard, add missing 'return' in tests,
gnunet <=