summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-08-01 00:24:11 +0200
committerChristian Grothoff <christian@grothoff.org>2019-08-01 00:24:11 +0200
commit8f7388042c433049b2b49c306caa80378e635c4d (patch)
tree87d1dff90a059f05349c1a326849ad4f459b8259 /src
parent5b2efa2b0694f2e1d16af15c7c47cbd26f7c64c1 (diff)
downloadexchange-8f7388042c433049b2b49c306caa80378e635c4d.tar.gz
exchange-8f7388042c433049b2b49c306caa80378e635c4d.tar.bz2
exchange-8f7388042c433049b2b49c306caa80378e635c4d.zip
fix indent
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd.c8
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.c24
-rw-r--r--src/include/taler_exchange_service.h7
-rw-r--r--src/lib/exchange_api_refund.c2
-rw-r--r--src/lib/test_exchange_api_keys_cherry_picking.c21
-rw-r--r--src/lib/test_exchange_api_overlapping_keys_bug.c28
-rw-r--r--src/lib/testing_api_cmd_exec_auditor-sign.c26
-rw-r--r--src/lib/testing_api_cmd_serialize_keys.c16
8 files changed, 57 insertions, 75 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index fe484979d..f0059736f 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -417,7 +417,8 @@ handle_mhd_request (void *cls,
struct GNUNET_AsyncScopeSave old_scope;
const char *correlation_id = NULL;
- if (NULL == ecls) {
+ if (NULL == ecls)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handling new request\n");
/* We're in a new async scope! */
ecls = *con_cls = GNUNET_new (struct ExchangeHttpRequestClosure);
@@ -435,9 +436,7 @@ handle_mhd_request (void *cls,
}
inner_cls = &ecls->opaque_post_parsing_context;
-
GNUNET_async_scope_enter (&ecls->async_scope_id, &old_scope);
-
if (NULL != correlation_id)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Handling request (%s) for URL '%s', correlation_id=%s\n",
@@ -462,6 +461,8 @@ handle_mhd_request (void *cls,
(0 == strcasecmp (method,
rh->method)) ) )
{
+ /* FIXME: consider caching 'rh' in '**connection_cls' to
+ avoid repeated lookup! */
ret = rh->handler (rh,
connection,
inner_cls,
@@ -477,7 +478,6 @@ handle_mhd_request (void *cls,
upload_data,
upload_data_size);
GNUNET_async_scope_restore (&old_scope);
-
return ret;
}
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
index eaa3fa496..6a69a3d55 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -1044,8 +1044,8 @@ reload_auditor_iter (void *cls,
&dke->dki->issue.properties,
sizeof (struct TALER_DenominationKeyValidityPS)))
{
- /* if the hash is the same, the properties should also match! */
- GNUNET_break (0);
+ /* if the hash is the same, the properties should also match! */
+ GNUNET_break (0);
continue;
}
as = GNUNET_malloc (sizeof (struct AuditorSignature) +
@@ -2252,14 +2252,14 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
unsigned long long cherrypickn;
if (1 !=
- sscanf (have_cherrypick,
- "%llu",
- &cherrypickn))
+ sscanf (have_cherrypick,
+ "%llu",
+ &cherrypickn))
{
GNUNET_break_op (0);
return TEH_RESPONSE_reply_arg_invalid (connection,
- TALER_EC_KEYS_HAVE_NOT_NUMERIC,
- "last_issue_date");
+ TALER_EC_KEYS_HAVE_NOT_NUMERIC,
+ "last_issue_date");
}
last_issue_date.abs_value_us = (uint64_t) cherrypickn * 1000000LLU;
}
@@ -2276,14 +2276,14 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
unsigned long long fakenown;
if (1 !=
- sscanf (have_fakenow,
- "%llu",
- &fakenown))
+ sscanf (have_fakenow,
+ "%llu",
+ &fakenown))
{
GNUNET_break_op (0);
return TEH_RESPONSE_reply_arg_invalid (connection,
- TALER_EC_KEYS_HAVE_NOT_NUMERIC,
- "now");
+ TALER_EC_KEYS_HAVE_NOT_NUMERIC,
+ "now");
}
now.abs_value_us = (uint64_t) fakenown * 1000000LLU;
}
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index 4ced8ad92..864beae74 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -357,7 +357,7 @@ enum TALER_EXCHANGE_VersionCompatibility
typedef void
(*TALER_EXCHANGE_CertificationCallback) (void *cls,
const struct TALER_EXCHANGE_Keys *keys,
- enum TALER_EXCHANGE_VersionCompatibility compat);
+ enum TALER_EXCHANGE_VersionCompatibility compat);
/**
@@ -442,6 +442,7 @@ TALER_EXCHANGE_set_now (struct TALER_EXCHANGE_Handle *exchange,
void
TALER_EXCHANGE_unset_now (struct TALER_EXCHANGE_Handle *exchange);
+
/**
* Let the user set the last valid denomination time manually.
*
@@ -499,7 +500,7 @@ TALER_EXCHANGE_test_signing_key (const struct TALER_EXCHANGE_Keys *keys,
*/
const struct TALER_EXCHANGE_SigningPublicKey *
TALER_EXCHANGE_get_signing_key_details (const struct TALER_EXCHANGE_Keys *keys,
- const struct TALER_ExchangePublicKeyP *pub);
+ const struct TALER_ExchangePublicKeyP *pub);
/**
@@ -547,7 +548,7 @@ TALER_EXCHANGE_get_denomination_key_by_hash (const struct TALER_EXCHANGE_Keys *k
*/
const struct TALER_EXCHANGE_SigningPublicKey *
TALER_EXCHANGE_get_exchange_signing_key_info (const struct TALER_EXCHANGE_Keys *keys,
- const struct TALER_ExchangePublicKeyP *exchange_pub);
+ const struct TALER_ExchangePublicKeyP *exchange_pub);
/* ********************* /wire *********************** */
diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c
index 2b8585f9a..5ce0152d2 100644
--- a/src/lib/exchange_api_refund.c
+++ b/src/lib/exchange_api_refund.c
@@ -110,7 +110,7 @@ verify_refund_signature_ok (const struct TALER_EXCHANGE_RefundHandle *rh,
key_state = TALER_EXCHANGE_get_keys (rh->exchange);
if (GNUNET_OK !=
TALER_EXCHANGE_test_signing_key (key_state,
- exchange_pub))
+ exchange_pub))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
diff --git a/src/lib/test_exchange_api_keys_cherry_picking.c b/src/lib/test_exchange_api_keys_cherry_picking.c
index 91ca65603..97fa5a268 100644
--- a/src/lib/test_exchange_api_keys_cherry_picking.c
+++ b/src/lib/test_exchange_api_keys_cherry_picking.c
@@ -16,14 +16,12 @@
License along with TALER; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>
*/
-
/**
* @file exchange-lib/test_exchange_api_keys_cherry_picking.c
* @brief testcase to test exchange's /keys cherry picking ability
* @author Marcello Stanisci
* @author Christian Grothoff
*/
-
#include "platform.h"
#include "taler_util.h"
#include "taler_signatures.h"
@@ -95,6 +93,7 @@ static char *exchange_url;
*/
static char *auditor_url;
+
/**
* Wrapper around the time parser.
*
@@ -118,16 +117,15 @@ TTH_parse_time (const char *str)
* run.
*
* @param cls closure
+ * @param is[in,out] interpreter state
*/
static void
run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct TALER_TESTING_Command keys_serialization[] = {
-
TALER_TESTING_cmd_serialize_keys
("serialize-keys"),
-
TALER_TESTING_cmd_connect_with_state
("reconnect-with-state",
"serialize-keys"),
@@ -152,13 +150,10 @@ run (void *cls,
"x-taler-bank",
NULL,
MHD_HTTP_OK),
-
TALER_TESTING_cmd_end (),
-
};
struct TALER_TESTING_Command ordinary_cherry_pick[] = {
-
/**
* 1 DK with 80s withdraw duration, lookahead_sign is 60s
* => expect 1 DK.
@@ -176,7 +171,6 @@ run (void *cls,
("keyup-1",
CONFIG_FILE,
TTH_parse_time (JAN2030)),
-
/**
* Should return 1 new key, + the original one. NOTE: the
* original DK will never be 'cancelled' as for the current
@@ -187,7 +181,6 @@ run (void *cls,
2, /* generation */
2,
TTH_parse_time (JAN2030)),
-
TALER_TESTING_cmd_exec_keyup_with_now
("keyup-3",
CONFIG_FILE_EXTENDED_2,
@@ -200,7 +193,7 @@ run (void *cls,
/**
* Expected number of DK:
*
- * 3500 (the lookaeahd_sign time frame, in seconds)
+ * 3500 (the lookahead_sign time frame, in seconds)
* - 69 (how many seconds are covered by the latest DK)
* ----
* 3431
@@ -231,7 +224,7 @@ run (void *cls,
};
TALER_TESTING_run (is,
- commands);
+ commands);
}
@@ -242,7 +235,7 @@ main (int argc,
/* These environment variables get in the way... */
unsetenv ("XDG_DATA_HOME");
unsetenv ("XDG_CONFIG_HOME");
- GNUNET_log_setup ("test-exchange-api-cherry-picking-new",
+ GNUNET_log_setup ("test-exchange-api-cherry-picking",
"DEBUG",
NULL);
TALER_TESTING_cleanup_files (CONFIG_FILE);
@@ -251,7 +244,7 @@ main (int argc,
* if it's available. */
switch (TALER_TESTING_prepare_exchange (CONFIG_FILE,
&auditor_url,
- &exchange_url))
+ &exchange_url))
{
case GNUNET_SYSERR:
GNUNET_break (0);
@@ -276,4 +269,4 @@ main (int argc,
return 0;
}
-/* end of test_exchange_api_keys_cherry_picking_new.c */
+/* end of test_exchange_api_keys_cherry_picking.c */
diff --git a/src/lib/test_exchange_api_overlapping_keys_bug.c b/src/lib/test_exchange_api_overlapping_keys_bug.c
index 253851925..7b1458447 100644
--- a/src/lib/test_exchange_api_overlapping_keys_bug.c
+++ b/src/lib/test_exchange_api_overlapping_keys_bug.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2018 Taler Systems SA
+ Copyright (C) 2018, 2019 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
@@ -18,8 +18,9 @@
*/
/**
- * @file exchange-lib/test_exchange_api_keys_cherry_picking_new.c
- * @brief testcase to test exchange's /keys cherry picking ability
+ * @file exchange-lib/test_exchange_api_overlapping_keys_bug.c
+ * @brief testcase to test exchange's /keys cherry picking ability and
+ * other /keys related operations
* @author Marcello Stanisci
* @author Christian Grothoff
*/
@@ -36,16 +37,6 @@
#include "taler_testing_lib.h"
/**
- * XXX:
- *
- * This test case aims at reproducing one bug that appears
- * when some /keys are redownloaded (although already owned
- * by the client). In particular, the bug makes signature
- * verifications to fail (often times, auditor signatures
- * have proven to be faulty).
- */
-
-/**
* Configuration file we use. One (big) configuration is used
* for the various components for this test.
*/
@@ -84,13 +75,10 @@ static void
run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
-
struct TALER_TESTING_Command commands[] = {
-
TALER_TESTING_cmd_check_keys ("first-download",
1,
1),
-
/* Causes GET /keys?last_denom_issue=0 */
TALER_TESTING_cmd_check_keys_with_last_denom ("second-download",
3,
@@ -100,7 +88,7 @@ run (void *cls,
};
TALER_TESTING_run (is,
- commands);
+ commands);
}
@@ -111,7 +99,7 @@ main (int argc,
/* These environment variables get in the way... */
unsetenv ("XDG_DATA_HOME");
unsetenv ("XDG_CONFIG_HOME");
- GNUNET_log_setup ("test-exchange-api-cherry-picking-new",
+ GNUNET_log_setup ("test-exchange-api-overlapping-keys-bug",
"DEBUG", NULL);
TALER_TESTING_cleanup_files (CONFIG_FILE);
/* @helpers. Run keyup, create tables, ... Note: it
@@ -119,7 +107,7 @@ main (int argc,
* if it's available. */
switch (TALER_TESTING_prepare_exchange (CONFIG_FILE,
&auditor_url,
- &exchange_url))
+ &exchange_url))
{
case GNUNET_SYSERR:
GNUNET_break (0);
@@ -144,4 +132,4 @@ main (int argc,
return 0;
}
-/* end of test_exchange_api_keys_cherry_picking_new.c */
+/* end of test_exchange_api_overlapping_keys_bug.c */
diff --git a/src/lib/testing_api_cmd_exec_auditor-sign.c b/src/lib/testing_api_cmd_exec_auditor-sign.c
index 90a1654ce..db58b44c9 100644
--- a/src/lib/testing_api_cmd_exec_auditor-sign.c
+++ b/src/lib/testing_api_cmd_exec_auditor-sign.c
@@ -30,7 +30,6 @@
#include "taler_testing_lib.h"
-
/**
* State for a "auditor sign" CMD.
*/
@@ -104,7 +103,7 @@ auditor_sign_run (void *cls,
test_home_dir,
(unsigned long long) now.abs_value_us);
GNUNET_free (test_home_dir);
-
+
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
"exchange",
@@ -155,7 +154,7 @@ auditor_sign_run (void *cls,
*/
static void
auditor_sign_cleanup (void *cls,
- const struct TALER_TESTING_Command *cmd)
+ const struct TALER_TESTING_Command *cmd)
{
struct AuditorSignState *ass = cls;
@@ -217,16 +216,17 @@ TALER_TESTING_cmd_exec_auditor_sign (const char *label,
ass = GNUNET_new (struct AuditorSignState);
ass->config_filename = config_filename;
-
- struct TALER_TESTING_Command cmd = {
- .cls = ass,
- .label = label,
- .run = &auditor_sign_run,
- .cleanup = &auditor_sign_cleanup,
- .traits = &auditor_sign_traits
- };
-
- return cmd;
+ {
+ struct TALER_TESTING_Command cmd = {
+ .cls = ass,
+ .label = label,
+ .run = &auditor_sign_run,
+ .cleanup = &auditor_sign_cleanup,
+ .traits = &auditor_sign_traits
+ };
+
+ return cmd;
+ }
}
/* end of testing_api_cmd_exec_auditor-sign.c */
diff --git a/src/lib/testing_api_cmd_serialize_keys.c b/src/lib/testing_api_cmd_serialize_keys.c
index 866c95852..bacd041a7 100644
--- a/src/lib/testing_api_cmd_serialize_keys.c
+++ b/src/lib/testing_api_cmd_serialize_keys.c
@@ -76,6 +76,7 @@ struct ConnectWithStateState
struct TALER_TESTING_Interpreter *is;
};
+
/**
* Run the command.
*
@@ -109,7 +110,7 @@ serialize_keys_run (void *cls,
* @param cls closure.
* @param cmd the command which is being cleaned up.
*/
-void
+static void
serialize_keys_cleanup (void *cls,
const struct TALER_TESTING_Command *cmd)
{
@@ -117,9 +118,8 @@ serialize_keys_cleanup (void *cls,
if (NULL != sks->keys)
{
- json_decref (sks->keys);
+ json_decref (sks->keys);
}
-
GNUNET_free ((char *) sks->exchange_url);
GNUNET_free (sks);
}
@@ -142,9 +142,7 @@ serialize_keys_traits (void *cls,
unsigned int index)
{
struct SerializeKeysState *sks = cls;
-
struct TALER_TESTING_Trait traits[] = {
-
TALER_TESTING_make_trait_exchange_keys (0, sks->keys),
TALER_TESTING_make_trait_url (0, sks->exchange_url),
TALER_TESTING_trait_end ()
@@ -230,7 +228,7 @@ connect_with_state_run (void *cls,
* @param cls closure.
* @param cmd the command which is being cleaned up.
*/
-void
+static void
connect_with_state_cleanup
(void *cls,
const struct TALER_TESTING_Command *cmd)
@@ -240,6 +238,7 @@ connect_with_state_cleanup
GNUNET_free (cwss);
}
+
/**
* Make a serialize-keys CMD. It will ask for
* keys serialization __and__ disconnect from the
@@ -259,12 +258,13 @@ TALER_TESTING_cmd_serialize_keys (const char *label)
.label = label,
.run = serialize_keys_run,
.cleanup = serialize_keys_cleanup,
- .traits = serialize_keys_traits
+ .traits = serialize_keys_traits
};
return cmd;
}
+
/**
* Make a connect-with-state CMD. This command
* will use a serialized key state to reconnect
@@ -288,7 +288,7 @@ TALER_TESTING_cmd_connect_with_state (const char *label,
struct TALER_TESTING_Command cmd = {
.cls = cwss,
.label = label,
- .run = connect_with_state_run,
+ .run = connect_with_state_run,
.cleanup = connect_with_state_cleanup
};