[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 19/37: set planchet detail cipher, add cipher checks
From: |
gnunet |
Subject: |
[taler-exchange] 19/37: set planchet detail cipher, add cipher checks |
Date: |
Fri, 04 Feb 2022 16:53:49 +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 36f551ff33ac0974788aff28d4b19390ca484f4b
Author: Lucien Heuzeveldt <lucienclaude.heuzeveldt@students.bfh.ch>
AuthorDate: Tue Jan 4 17:46:36 2022 +0100
set planchet detail cipher, add cipher checks
---
src/include/taler_crypto_lib.h | 3 ++-
src/util/crypto.c | 7 +++++++
src/util/denom.c | 8 ++++++++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index a20e5120..295d0e7b 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -1444,7 +1444,8 @@ TALER_planchet_setup_random (struct
TALER_PlanchetSecretsP *ps,
* @param ps secret planchet internals (for #TALER_planchet_to_coin)
* @param[out] c_hash set to the hash of the public key of the coin (needed
later)
* @param[out] pd set to the planchet detail for TALER_MERCHANT_tip_pickup()
and
- * other withdraw operations
+ * other withdraw operations, pd->blinded_planchet.cipher will
be set
+ * to cipher from dk
* @return #GNUNET_OK on success
*/
enum GNUNET_GenericReturnValue
diff --git a/src/util/crypto.c b/src/util/crypto.c
index 84d20d6b..445b820a 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -319,6 +319,7 @@ TALER_planchet_prepare (const struct
TALER_DenominationPublicKey *dk,
return GNUNET_SYSERR;
}
+ pd->blinded_planchet.cipher = dk->cipher;
TALER_denom_pub_hash (dk,
&pd->denom_pub_hash);
return GNUNET_OK;
@@ -335,6 +336,12 @@ TALER_planchet_to_coin (const struct
TALER_DenominationPublicKey *dk,
{
struct TALER_DenominationSignature sig;
+ if (dk->cipher != blind_sig->cipher)
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+
switch (dk->cipher)
{
case TALER_DENOMINATION_RSA:
diff --git a/src/util/denom.c b/src/util/denom.c
index 90830260..a4965c05 100644
--- a/src/util/denom.c
+++ b/src/util/denom.c
@@ -112,6 +112,13 @@ TALER_denom_sign_blinded (struct
TALER_BlindedDenominationSignature *denom_sig,
memset (denom_sig,
0,
sizeof (*denom_sig));
+
+ if (blinded_planchet->cipher != denom_priv->cipher)
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+
switch (denom_priv->cipher)
{
case TALER_DENOMINATION_INVALID:
@@ -394,6 +401,7 @@ TALER_denom_pub_verify (const struct
TALER_DenominationPublicKey *denom_pub,
GNUNET_break (0);
return GNUNET_SYSERR;
}
+
switch (denom_pub->cipher)
{
case TALER_DENOMINATION_INVALID:
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 22/37: cleanup, (continued)
- [taler-exchange] 22/37: cleanup, gnunet, 2022/02/04
- [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 <=
- [taler-exchange] 30/37: -make picky gcc happy, gnunet, 2022/02/04
- [taler-exchange] 37/37: resolves merge conflicts, gnunet, 2022/02/04
- [taler-exchange] 20/37: implement CS key handling and csr endpoint, gnunet, 2022/02/04
- [taler-exchange] 29/37: implement feedback, gnunet, 2022/02/04
- [taler-exchange] 24/37: removed varargs, gnunet, 2022/02/04
- [taler-exchange] 32/37: repair nonce check, gnunet, 2022/02/04