summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2021-11-16 14:43:54 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2021-11-16 14:43:54 +0100
commit591cefd3159a2982703a81b637fd7887ecef9a7a (patch)
treed7135deb6111dbe11d10463061942470097e025b /src/util
parent930e31e08fcdf28125b7c3fd6b76868d622d3a92 (diff)
downloadexchange-591cefd3159a2982703a81b637fd7887ecef9a7a.tar.gz
exchange-591cefd3159a2982703a81b637fd7887ecef9a7a.tar.bz2
exchange-591cefd3159a2982703a81b637fd7887ecef9a7a.zip
[age restriction] progress 3/n
- remove redundant struct members for age commitment hash - undo pre-mature implementation in taler-exchange-secmod-rsa.c - carry through age restriction parameter for TALER_denom_blind
Diffstat (limited to 'src/util')
-rw-r--r--src/util/crypto.c6
-rw-r--r--src/util/denom.c2
-rw-r--r--src/util/taler-exchange-secmod-rsa.c26
3 files changed, 7 insertions, 27 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c
index 2d3a569a4..0bd91625e 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -188,6 +188,7 @@ TALER_planchet_prepare (const struct TALER_DenominationPublicKey *dk,
if (GNUNET_OK !=
TALER_denom_blind (dk,
&ps->blinding_key,
+ NULL, /* FIXME-Oec */
&coin_pub,
c_hash,
&pd->coin_ev,
@@ -318,9 +319,10 @@ TALER_coin_ev_hash (const void *coin_ev,
void
TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_AgeHash *age_commitment_hash,
struct TALER_CoinPubHash *coin_h)
{
- if (GNUNET_is_zero (&coin_pub->age_commitment_hash))
+ if (NULL == age_commitment_hash)
{
/* No age commitment was set */
GNUNET_CRYPTO_hash (&coin_pub->eddsa_pub,
@@ -340,7 +342,7 @@ TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
key_s);
GNUNET_memcpy (&data[key_s],
- &coin_pub->age_commitment_hash,
+ age_commitment_hash,
age_s);
GNUNET_CRYPTO_hash (&data,
diff --git a/src/util/denom.c b/src/util/denom.c
index a5305343b..bb1351406 100644
--- a/src/util/denom.c
+++ b/src/util/denom.c
@@ -219,6 +219,7 @@ TALER_denom_priv_to_pub (const struct TALER_DenominationPrivateKey *denom_priv,
enum GNUNET_GenericReturnValue
TALER_denom_blind (const struct TALER_DenominationPublicKey *dk,
const union TALER_DenominationBlindingKeyP *coin_bks,
+ const struct TALER_AgeHash *age_commitment_hash,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_CoinPubHash *c_hash,
void **coin_ev,
@@ -228,6 +229,7 @@ TALER_denom_blind (const struct TALER_DenominationPublicKey *dk,
{
case TALER_DENOMINATION_RSA:
TALER_coin_pub_hash (coin_pub,
+ age_commitment_hash,
c_hash);
if (GNUNET_YES !=
GNUNET_CRYPTO_rsa_blind (&c_hash->hash,
diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c
index 49b241b21..6bca58f88 100644
--- a/src/util/taler-exchange-secmod-rsa.c
+++ b/src/util/taler-exchange-secmod-rsa.c
@@ -39,7 +39,6 @@
#include <pthread.h>
#include <sys/eventfd.h>
#include "taler_error_codes.h"
-#include "taler_extensions.h"
#include "taler_signatures.h"
#include "secmod_common.h"
@@ -152,14 +151,6 @@ struct Denomination
* Length of (new) RSA keys (in bits).
*/
uint32_t rsa_keysize;
-
- /**
- * Age Restriction Mask.
- * If non-zero, it defines the age restriction groups that apply to this
- * denomination.
- */
- struct TALER_AgeMask age_mask;
-
};
@@ -1433,7 +1424,7 @@ parse_key (struct Denomination *denom,
struct DenominationKey *before;
TALER_denom_priv_to_pub (&priv,
- denom->age_mask,
+ (struct TALER_AgeMask) { .mask = 0 }, /* FIXME-Oec */
&pub);
dk = GNUNET_new (struct DenominationKey);
dk->denom_priv = priv;
@@ -1653,21 +1644,6 @@ parse_denomination_cfg (const char *ct,
}
denom->rsa_keysize = (unsigned int) rsa_keysize;
denom->section = GNUNET_strdup (ct);
-
- /* Load the (optional) age groups/mask for this denomination */
- denom->age_mask.mask = 0;
- if (GNUNET_YES != GNUNET_CONFIGURATION_get_value_yesno (kcfg, ct,
- "age-restricted"))
- {
- if (GNUNET_OK != TALER_get_age_mask (kcfg, &denom->age_mask))
- {
- GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "extenstions",
- "age-restriction",
- "invalid age groups");
- return GNUNET_SYSERR;
- }
- }
return GNUNET_OK;
}