[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 22/37: cleanup
From: |
gnunet |
Subject: |
[taler-exchange] 22/37: cleanup |
Date: |
Fri, 04 Feb 2022 16:53:52 +0100 |
This is an automated email from the git hooks/post-receive script.
gian-demarmels pushed a commit to branch master
in repository exchange.
commit 4c7aa097840eb3254a6823177abcc90fa7ccf0d0
Author: Gian Demarmels <gian@demarmels.org>
AuthorDate: Fri Jan 7 16:33:00 2022 +0100
cleanup
---
src/util/taler-exchange-secmod-cs.c | 6 +++---
src/util/test_helper_cs.c | 23 +++++++++++------------
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 5c567587..d7624a0b 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 b4a5f54c..501a398f 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);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 13/37: secmod cs signatures implementation, (continued)
- [taler-exchange] 13/37: secmod cs signatures implementation, gnunet, 2022/02/04
- [taler-exchange] 11/37: clean up cs implementation, gnunet, 2022/02/04
- [taler-exchange] 16/37: revocation, gnunet, 2022/02/04
- [taler-exchange] 17/37: implement secmod cs derive R, gnunet, 2022/02/04
- [taler-exchange] 08/37: fixed CS signatures and cleanup/refactoring, gnunet, 2022/02/04
- [taler-exchange] 14/37: initial cs_secmod implementation, gnunet, 2022/02/04
- [taler-exchange] 15/37: setup_key for cs secmod helper, gnunet, 2022/02/04
- [taler-exchange] 34/37: include denom_pub into coin_ev_hash, gnunet, 2022/02/04
- [taler-exchange] 36/37: denomination CIPHER field per denom, gnunet, 2022/02/04
- [taler-exchange] 21/37: secmod CS sign implementation, gnunet, 2022/02/04
- [taler-exchange] 22/37: cleanup,
gnunet <=
- [taler-exchange] 23/37: implement withdraw (nonce reuse check missing), gnunet, 2022/02/04
- [taler-exchange] 10/37: remove varargs in cs crypto implementation, gnunet, 2022/02/04
- [taler-exchange] 31/37: introduce new type for security module pubkeys, gnunet, 2022/02/04
- [taler-exchange] 25/37: implement spend, gnunet, 2022/02/04
- [taler-exchange] 27/37: change TEH_keys_denomination_sign message parameter, gnunet, 2022/02/04
- [taler-exchange] 35/37: refactor TALER_coin_ev_hash, gnunet, 2022/02/04
- [taler-exchange] 28/37: -scope needed, gnunet, 2022/02/04
- [taler-exchange] 33/37: fixed nonce check, renamed WithdrawNonce, gnunet, 2022/02/04
- [taler-exchange] 26/37: refactoring, gnunet, 2022/02/04
- [taler-exchange] 19/37: set planchet detail cipher, add cipher checks, gnunet, 2022/02/04