aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorGian Demarmels <gian@demarmels.org>2022-01-07 16:33:00 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:34:22 +0100
commit4c7aa097840eb3254a6823177abcc90fa7ccf0d0 (patch)
treec22d5c2b4eb9e6ea9748e82d7a629193bd450da0 /src/util
parent2d70c8c6d01c50ebee59907eeeeb3eed4b630767 (diff)
cleanup
Diffstat (limited to 'src/util')
-rw-r--r--src/util/taler-exchange-secmod-cs.c6
-rw-r--r--src/util/test_helper_cs.c23
2 files changed, 14 insertions, 15 deletions
diff --git a/src/util/taler-exchange-secmod-cs.c b/src/util/taler-exchange-secmod-cs.c
index 5c5675872..d7624a0b9 100644
--- a/src/util/taler-exchange-secmod-cs.c
+++ b/src/util/taler-exchange-secmod-cs.c
@@ -1081,7 +1081,6 @@ parse_key (struct Denomination *denom,
const void *buf,
size_t buf_size)
{
- struct GNUNET_CRYPTO_CsPrivateKey priv;
char *anchor_s;
char dummy;
unsigned long long anchor_ll;
@@ -1119,8 +1118,9 @@ parse_key (struct Denomination *denom,
return;
}
- // TODO: memcpy or cast?
- memcpy (&priv, buf, sizeof(priv));
+ const struct GNUNET_CRYPTO_CsPrivateKey priv
+ = *((struct GNUNET_CRYPTO_CsPrivateKey *) buf);
+// memcpy (&priv, buf, sizeof(priv));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"privkey %zu\n",
diff --git a/src/util/test_helper_cs.c b/src/util/test_helper_cs.c
index b4a5f54c7..501a398fa 100644
--- a/src/util/test_helper_cs.c
+++ b/src/util/test_helper_cs.c
@@ -264,7 +264,6 @@ test_revocation (struct TALER_CRYPTO_CsDenominationHelper *dh)
static int
test_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh)
{
- struct TALER_DenominationCsPublicR r_pub;
enum TALER_ErrorCode ec;
bool success = false;
struct TALER_PlanchetSecretsP ps;
@@ -287,11 +286,12 @@ test_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Requesting R derivation with key %s\n",
GNUNET_h2s (&keys[i].h_cs.hash));
- r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
- &keys[i].h_cs,
- &pd.blinded_planchet.details.
- cs_blinded_planchet.nonce,
- &ec);
+ ps.cs_r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
+ &keys[i].h_cs,
+ &pd.blinded_planchet.
+ details.
+ cs_blinded_planchet.nonce,
+ &ec);
}
switch (ec)
{
@@ -318,12 +318,11 @@ test_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Received valid R for key %s\n",
GNUNET_h2s (&keys[i].h_cs.hash));
- ps.cs_r_pub = r_pub;
+
TALER_blinding_secret_create (&ps.blinding_key,
TALER_DENOMINATION_CS,
&ps.coin_priv,
&ps.cs_r_pub);
- // TODO: sometimes the tests fail here in a calculation in gnunet. needs to be further analysed.
GNUNET_assert (GNUNET_OK ==
TALER_planchet_prepare (&keys[i].denom_pub,
&ps,
@@ -376,10 +375,10 @@ test_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh)
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
&nonce,
sizeof (nonce));
- r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
- &rnd,
- &nonce,
- &ec);
+ ps.cs_r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
+ &rnd,
+ &nonce,
+ &ec);
if (TALER_EC_EXCHANGE_GENERIC_DENOMINATION_KEY_UNKNOWN != ec)
{
GNUNET_break (0);