summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_keys.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2021-11-28 18:43:41 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2021-11-28 18:51:25 +0100
commit97bae4dd65854316611c8f440176b063b545618b (patch)
tree620ce4447fddad7aac07bb500bbacb6984c8b274 /src/exchange/taler-exchange-httpd_keys.c
parent2d1a618d3dfb3dd0b85013b3e70debe308b88e72 (diff)
downloadexchange-97bae4dd65854316611c8f440176b063b545618b.tar.gz
exchange-97bae4dd65854316611c8f440176b063b545618b.tar.bz2
exchange-97bae4dd65854316611c8f440176b063b545618b.zip
[age restriction] progress 5/n
- taler-exchange-secmod-rsa - extracts AGE_RESTRICTED per denomination from config - propagates flag for each denomination to server - if age restriction is set for a denomination, age _mask_ is taken (for now!) from config
Diffstat (limited to 'src/exchange/taler-exchange-httpd_keys.c')
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
index 5f747cccf..b7359392f 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -26,6 +26,7 @@
#include "taler-exchange-httpd_keys.h"
#include "taler-exchange-httpd_responses.h"
#include "taler_exchangedb_plugin.h"
+#include "taler_extensions.h"
/**
@@ -687,6 +688,7 @@ destroy_key_helpers (struct HelperState *hs)
* @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 true, if denomination is age restricted
*/
static void
helper_rsa_cb (
@@ -697,7 +699,8 @@ helper_rsa_cb (
const struct TALER_RsaPubHashP *h_rsa,
const struct TALER_DenominationPublicKey *denom_pub,
const struct TALER_SecurityModulePublicKeyP *sm_pub,
- const struct TALER_SecurityModuleSignatureP *sm_sig)
+ const struct TALER_SecurityModuleSignatureP *sm_sig,
+ bool age_restricted)
{
struct HelperState *hs = cls;
struct HelperDenomination *hd;
@@ -729,13 +732,17 @@ helper_rsa_cb (
TALER_denom_pub_deep_copy (&hd->denom_pub,
denom_pub);
GNUNET_assert (TALER_DENOMINATION_RSA == hd->denom_pub.cipher);
- // FIXME-OEC: set AGE RESTRICTION (from 'global' variable,
- // that itself is set from /managmenet API!) HERE!
- // ISSUE: tricky to handle if configuration changes
- // between denominations (some with/without age
- // restrictions). For that, we probably need to look at
- // configuration [$section_name] (!?).
+
+ /* Set age restriction, if applicable */
hd->denom_pub.age_mask.mask = 0;
+ if (age_restricted)
+ {
+ /* FIXME-oec: get age mask from global */
+ GNUNET_assert (TALER_EXTENSION_OK == TALER_get_age_mask (TEH_cfg,
+ &hd->denom_pub.
+ age_mask));
+ }
+
TALER_denom_pub_hash (&hd->denom_pub,
&hd->h_denom_pub);
hd->section_name = GNUNET_strdup (section_name);