[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 80/130: RSA-despecialization
From: |
gnunet |
Subject: |
[taler-exchange] 80/130: RSA-despecialization |
Date: |
Wed, 17 Nov 2021 12:25:28 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit f01ab79015e1425a9c0cdede4bce0825d4c8c65b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Nov 6 15:29:10 2021 +0100
RSA-despecialization
---
src/exchangedb/test_exchangedb.c | 42 ++++++++++++++++++++++++++--------------
src/include/taler_crypto_lib.h | 18 -----------------
src/util/crypto.c | 15 --------------
src/util/denom.c | 10 +++++-----
4 files changed, 33 insertions(+), 52 deletions(-)
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 9d24ebb5..a1ecfe3d 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -493,14 +493,14 @@ handle_link_data_cb (void *cls,
*
* @return #GNUNET_OK if everything went well; #GNUNET_SYSERR if not
*/
-static int
+static enum GNUNET_GenericReturnValue
test_melting (void)
{
struct TALER_EXCHANGEDB_Refresh refresh_session;
struct TALER_EXCHANGEDB_Melt ret_refresh_session;
struct DenomKeyPair *dkp;
struct TALER_DenominationPublicKey *new_denom_pubs;
- int ret;
+ enum GNUNET_GenericReturnValue ret;
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Absolute now;
@@ -524,17 +524,32 @@ test_melting (void)
GNUNET_assert (NULL != dkp);
/* initialize refresh session melt data */
{
- struct TALER_CoinPubHash hc;
+ struct TALER_CoinPubHash c_hash;
+ struct TALER_PlanchetDetail pd;
+ struct TALER_BlindedDenominationSignature bds;
+ union TALER_DenominationBlindingKeyP bks;
RND_BLK (&refresh_session.coin.coin_pub);
- TALER_coin_pub_hash (&refresh_session.coin.coin_pub,
- &hc);
- refresh_session.coin.denom_sig.cipher = TALER_DENOMINATION_RSA;
- refresh_session.coin.denom_sig.details.rsa_signature =
- GNUNET_CRYPTO_rsa_sign_fdh (dkp->priv.details.rsa_private_key,
- &hc.hash);
- GNUNET_assert (NULL !=
- refresh_session.coin.denom_sig.details.rsa_signature);
+ TALER_blinding_secret_create (&bks);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_denom_blind (&dkp->pub,
+ &bks,
+ &refresh_session.coin.coin_pub,
+ &c_hash,
+ &pd.coin_ev,
+ &pd.coin_ev_size));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_denom_sign_blinded (&bds,
+ &dkp->priv,
+ pd.coin_ev,
+ pd.coin_ev_size));
+ GNUNET_free (pd.coin_ev);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_denom_sig_unblind (&refresh_session.coin.denom_sig,
+ &bds,
+ &bks,
+ &dkp->pub));
+ TALER_blinded_denom_sig_free (&bds);
TALER_denom_pub_hash (&dkp->pub,
&refresh_session.coin.denom_pub_hash);
refresh_session.amount_with_fee = amount_with_fee;
@@ -564,11 +579,10 @@ test_melting (void)
TALER_amount_cmp (&fee_refresh,
&ret_refresh_session.melt_fee));
FAILIF (0 !=
- GNUNET_memcmp (&refresh_session.rc,
&ret_refresh_session.session.rc));
+ GNUNET_memcmp (&refresh_session.rc,
+ &ret_refresh_session.session.rc));
FAILIF (0 != GNUNET_memcmp (&refresh_session.coin_sig,
&ret_refresh_session.session.coin_sig));
- FAILIF (NULL !=
- ret_refresh_session.session.coin.denom_sig.details.rsa_signature);
FAILIF (0 != memcmp (&refresh_session.coin.coin_pub,
&ret_refresh_session.session.coin.coin_pub,
sizeof (refresh_session.coin.coin_pub)));
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 8907ca43..6bb4a50e 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -2167,22 +2167,4 @@ TALER_merchant_wire_signature_make (
struct TALER_MerchantSignatureP *merch_sig);
-/**
- * Blinds the given message with the given blinding key
- *
- * @param hash hash of the message to sign
- * @param bks the blinding key
- * @param pkey the public key of the signer
- * @param[out] buf set to a buffer with the blinded message to be signed
- * @param[out] buf_size number of bytes stored in @a buf
- * @return #GNUNET_YES if successful, #GNUNET_NO if RSA key is malicious
- */
-enum GNUNET_GenericReturnValue
-TALER_rsa_blind (const struct TALER_CoinPubHash *hash,
- const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks,
- struct GNUNET_CRYPTO_RsaPublicKey *pkey,
- void **buf,
- size_t *buf_size);
-
-
#endif
diff --git a/src/util/crypto.c b/src/util/crypto.c
index ed32f31d..2c81554b 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -305,21 +305,6 @@ TALER_refresh_get_commitment (struct
TALER_RefreshCommitmentP *rc,
}
-enum GNUNET_GenericReturnValue
-TALER_rsa_blind (const struct TALER_CoinPubHash *hash,
- const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks,
- struct GNUNET_CRYPTO_RsaPublicKey *pkey,
- void **buf,
- size_t *buf_size)
-{
- return GNUNET_CRYPTO_rsa_blind (&hash->hash,
- bks,
- pkey,
- buf,
- buf_size);
-}
-
-
void
TALER_coin_ev_hash (const void *coin_ev,
size_t coin_ev_size,
diff --git a/src/util/denom.c b/src/util/denom.c
index 4f1fc8e5..d159b21b 100644
--- a/src/util/denom.c
+++ b/src/util/denom.c
@@ -230,11 +230,11 @@ TALER_denom_blind (const struct
TALER_DenominationPublicKey *dk,
TALER_coin_pub_hash (coin_pub,
c_hash);
if (GNUNET_YES !=
- TALER_rsa_blind (c_hash,
- &coin_bks->rsa_bks,
- dk->details.rsa_public_key,
- coin_ev,
- coin_ev_size))
+ GNUNET_CRYPTO_rsa_blind (&c_hash->hash,
+ &coin_bks->rsa_bks,
+ dk->details.rsa_public_key,
+ coin_ev,
+ coin_ev_size))
{
GNUNET_break (0);
return GNUNET_SYSERR;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 41/130: -fixes, (continued)
- [taler-exchange] 41/130: -fixes, gnunet, 2021/11/17
- [taler-exchange] 91/130: -fix wire_deadline SQL, gnunet, 2021/11/17
- [taler-exchange] 83/130: add extension hashing, gnunet, 2021/11/17
- [taler-exchange] 71/130: implement missing SQL statement, gnunet, 2021/11/17
- [taler-exchange] 119/130: add CLIENT_DIR to make test_crypto pass, gnunet, 2021/11/17
- [taler-exchange] 94/130: implement /kyc-proof client API, gnunet, 2021/11/17
- [taler-exchange] 108/130: sleep to get tests to pass, gnunet, 2021/11/17
- [taler-exchange] 90/130: sql fix, gnunet, 2021/11/17
- [taler-exchange] 74/130: fix typo, gnunet, 2021/11/17
- [taler-exchange] 127/130: towards merging with master, gnunet, 2021/11/17
- [taler-exchange] 80/130: RSA-despecialization,
gnunet <=
- [taler-exchange] 96/130: add kyc-wallet test command, gnunet, 2021/11/17
- [taler-exchange] 117/130: complete oauth logic (in theory), gnunet, 2021/11/17
- [taler-exchange] 88/130: SQL fix, gnunet, 2021/11/17
- [taler-exchange] 106/130: -fix NPE, gnunet, 2021/11/17
- [taler-exchange] 120/130: [age restriction] progress 3/n, gnunet, 2021/11/17
- [taler-exchange] 98/130: fix payto:// construction routine and move it to libtalerutil, gnunet, 2021/11/17
- [taler-exchange] 101/130: add /kyc-proof cmd, gnunet, 2021/11/17
- [taler-exchange] 93/130: prepare for KYC tests, gnunet, 2021/11/17
- [taler-exchange] 67/130: fix sharding, gnunet, 2021/11/17
- [taler-exchange] 99/130: add required payto URI traits, gnunet, 2021/11/17