aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2021-12-01 15:25:33 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2021-12-01 15:25:33 +0100
commit54c62f3ab9a38f734601e3af3bfa97b3587dd634 (patch)
treee7e1ded8e5b6b8151996f16f27f96d61534e9946 /src/util
parent41aba39f0fccc8ba30ba78995880aa07704dbb25 (diff)
downloadexchange-54c62f3ab9a38f734601e3af3bfa97b3587dd634.tar.xz
[age restriction] progress 6/n
lift logic for detection of age restriction of a denomination out from taler-exchange-secmod-rsa.c to taler-exchange_httpd_keys.c
Diffstat (limited to 'src/util')
-rw-r--r--src/util/crypto_helper_rsa.c6
-rw-r--r--src/util/taler-exchange-secmod-rsa.c50
-rw-r--r--src/util/taler-exchange-secmod-rsa.h5
-rw-r--r--src/util/test_helper_rsa.c6
4 files changed, 16 insertions, 51 deletions
diff --git a/src/util/crypto_helper_rsa.c b/src/util/crypto_helper_rsa.c
index d4deec0d1..85741d5e5 100644
--- a/src/util/crypto_helper_rsa.c
+++ b/src/util/crypto_helper_rsa.c
@@ -239,8 +239,7 @@ handle_mt_avail (struct TALER_CRYPTO_RsaDenominationHelper *dh,
&h_rsa,
&denom_pub,
&kan->secm_pub,
- &kan->secm_sig,
- (kan->age_restricted > 0));
+ &kan->secm_sig);
TALER_denom_pub_free (&denom_pub);
}
return GNUNET_OK;
@@ -276,8 +275,7 @@ handle_mt_purge (struct TALER_CRYPTO_RsaDenominationHelper *dh,
&pn->h_rsa,
NULL,
NULL,
- NULL,
- false);
+ NULL);
return GNUNET_OK;
}
diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c
index 4dfb2e3aa..5fd6049a7 100644
--- a/src/util/taler-exchange-secmod-rsa.c
+++ b/src/util/taler-exchange-secmod-rsa.c
@@ -1,18 +1,18 @@
/*
- This file is part of TALER
- Copyright (C) 2014-2021 Taler Systems SA
+ This file is part of TALER
+ Copyright (C) 2014-2021 Taler Systems SA
- TALER is free software; you can redistribute it and/or modify it under the
- terms of the GNU General Public License as published by the Free Software
- Foundation; either version 3, or (at your option) any later version.
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along with
- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+*/
/**
* @file util/taler-exchange-secmod-rsa.c
* @brief Standalone process to perform private key RSA operations
@@ -156,11 +156,6 @@ struct Denomination
* Length of (new) RSA keys (in bits).
*/
uint32_t rsa_keysize;
-
- /**
- * Is the denomination age restricted? 0 == false
- */
- uint8_t age_restricted;
};
@@ -263,7 +258,6 @@ notify_client_dk_add (struct TES_Client *client,
an->section_name_len = htons ((uint16_t) nlen);
an->anchor_time = GNUNET_TIME_absolute_hton (dk->anchor);
an->duration_withdraw = GNUNET_TIME_relative_hton (denom->duration_withdraw);
- an->age_restricted = denom->age_restricted;
TALER_exchange_secmod_rsa_sign (&dk->h_rsa,
denom->section,
dk->anchor,
@@ -1262,24 +1256,6 @@ parse_denomination_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg,
}
denom->rsa_keysize = (unsigned int) rsa_keysize;
denom->section = GNUNET_strdup (ct);
- if (GNUNET_OK == (GNUNET_CONFIGURATION_have_value (cfg,
- ct,
- "AGE_RESTRICTED")))
- {
- enum GNUNET_GenericReturnValue ret;
- if (GNUNET_SYSERR == (ret = GNUNET_CONFIGURATION_get_value_yesno (cfg,
- ct,
- "AGE_RESTRICTED")))
- {
- GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- ct,
- "AGE_RESTRICTED",
- "Value must be YES or NO\n");
- return GNUNET_SYSERR;
- }
- denom->age_restricted = (ret == GNUNET_OK) ? 1 : 0;
- }
-
return GNUNET_OK;
}
@@ -1546,8 +1522,8 @@ main (int argc,
(void) umask (S_IWGRP | S_IROTH | S_IWOTH | S_IXOTH);
/* force linker to link against libtalerutil; if we do
- not do this, the linker may "optimize" libtalerutil
- away and skip #TALER_OS_init(), which we do need */
+ not do this, the linker may "optimize" libtalerutil
+ away and skip #TALER_OS_init(), which we do need */
TALER_OS_init ();
now = now_tmp = GNUNET_TIME_absolute_get ();
ret = GNUNET_PROGRAM_run (argc, argv,
diff --git a/src/util/taler-exchange-secmod-rsa.h b/src/util/taler-exchange-secmod-rsa.h
index 9207e705a..b0fdfbd96 100644
--- a/src/util/taler-exchange-secmod-rsa.h
+++ b/src/util/taler-exchange-secmod-rsa.h
@@ -77,11 +77,6 @@ struct TALER_CRYPTO_RsaKeyAvailableNotification
*/
struct TALER_SecurityModuleSignatureP secm_sig;
- /**
- * Indicator for age restriction
- */
- uint8_t age_restricted;
-
/* followed by @e pub_size bytes of the RSA public key */
/* followed by @e section_name bytes of the configuration section name
diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c
index 6377a39d8..14ff2bfab 100644
--- a/src/util/test_helper_rsa.c
+++ b/src/util/test_helper_rsa.c
@@ -133,7 +133,6 @@ free_keys (void)
* @param sm_pub public key of the security module, NULL if the key was revoked or purged
* @param sm_sig signature from the security module, NULL if the key was revoked or purged
* The signature was already verified against @a sm_pub.
- * @param age_restricted indication if denomination is age restricted
*/
static void
key_cb (void *cls,
@@ -143,13 +142,11 @@ key_cb (void *cls,
const struct TALER_RsaPubHashP *h_rsa,
const struct TALER_DenominationPublicKey *denom_pub,
const struct TALER_SecurityModulePublicKeyP *sm_pub,
- const struct TALER_SecurityModuleSignatureP *sm_sig,
- bool age_restricted)
+ const struct TALER_SecurityModuleSignatureP *sm_sig)
{
(void) cls;
(void) sm_pub;
(void) sm_sig;
- (void) age_restricted;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Key notification about key %s in `%s'\n",
GNUNET_h2s (&h_rsa->hash),
@@ -189,7 +186,6 @@ key_cb (void *cls,
keys[i].validity_duration = validity_duration;
TALER_denom_pub_deep_copy (&keys[i].denom_pub,
denom_pub);
- /* FIXME-oec: take age_restriction into account!? */
num_keys++;
return;
}