aboutsummaryrefslogtreecommitdiff
path: root/src/include
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/include
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/include')
-rw-r--r--src/include/taler_crypto_lib.h4
-rw-r--r--src/include/taler_exchangedb_plugin.h15
-rw-r--r--src/include/taler_extensions.h4
3 files changed, 16 insertions, 7 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 9e744c8dc..ea53efb66 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -1362,7 +1362,6 @@ struct TALER_CRYPTO_RsaDenominationHelper;
* @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 denomnation has age restriction set
*/
typedef void
(*TALER_CRYPTO_RsaDenominationKeyStatusCallback)(
@@ -1373,8 +1372,7 @@ typedef void
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);
/**
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 47504e510..9a1dc78b6 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -630,9 +630,20 @@ struct TALER_EXCHANGEDB_DenominationKeyMetaData
struct TALER_Amount fee_refund;
/**
- * Indication if age restriction is set for this denomination
+ * Age restriction for the denomination. (can be zero). If not zero, the bits
+ * set in the mask mark the edges at the beginning of a next age group. F.e.
+ * for the age groups
+ * 0-7, 8-9, 10-11, 12-14, 14-15, 16-17, 18-21, 21-*
+ * the following bits are set:
+ *
+ * 31 24 16 8 0
+ * | | | | |
+ * oooooooo oo1oo1o1 o1o1o1o1 ooooooo1
+ *
+ * A value of 0 means that the denomination does not support the extension for
+ * age-restriction.
*/
- bool age_restricted;
+ struct TALER_AgeMask age_restrictions;
};
diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h
index 1ef97b2e9..c4e9d1f5a 100644
--- a/src/include/taler_extensions.h
+++ b/src/include/taler_extensions.h
@@ -39,8 +39,8 @@ enum TALER_EXTENSION_ReturnValue
* TALER Age Restriction Extensions
*/
-#define TALER_EXTENSION_SECTION_AGE_RESTRICTION TALER_EXTENSION_SECTION_PREFIX \
- "agerestriction"
+#define TALER_EXTENSION_SECTION_AGE_RESTRICTION (TALER_EXTENSION_SECTION_PREFIX \
+ "agerestriction")
/**
* The default age mask represents the age groups