aboutsummaryrefslogtreecommitdiff
path: root/src/lib
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/lib
parent5b2efa2b0694f2e1d16af15c7c47cbd26f7c64c1 (diff)
fix indent
Diffstat (limited to 'src/lib')
-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
5 files changed, 37 insertions, 56 deletions
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
};