summaryrefslogtreecommitdiff
path: root/src/util/offline_signatures.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-01-08 14:40:20 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2022-01-08 14:40:20 +0100
commitcc7d7707ab2bd43bc9e95c0eeec9ce95cdc0c523 (patch)
tree472e895b321e539f4675f016a285d6f6e6436b76 /src/util/offline_signatures.c
parentb49fac3d5892f75a2eb7fbfbca0056965c6967c7 (diff)
downloadexchange-cc7d7707ab2bd43bc9e95c0eeec9ce95cdc0c523.tar.gz
exchange-cc7d7707ab2bd43bc9e95c0eeec9ce95cdc0c523.tar.bz2
exchange-cc7d7707ab2bd43bc9e95c0eeec9ce95cdc0c523.zip
[age restriction] progress 10/n
More work towards support for extensions: - Prepared statements and DB-plugin-functions for setting and retrieving configurations from the database added. - primitive "registry" of extensions for age restrictions and peer2peer (stub) - TALER_Extensions now with FP for parsing, setting and converting a configuration. - /management/extensions handler now verifies signature of the (opaque) json object for all extensions. - /management/extensions handler calls the FP in the corrensponding TALER_Extension for parsing and setting the configuration of a particular extension More work towards age restriction: - TALER_Extensions interfaces for config-parser, -setter and converter implemented for age restriction - DB event handler now retrieves config from database, parses it and sets it (the age mask) in the global extension. - load_age_mask now loads age mask from the global extension (and not from the config file) - add age_restricted_denoms to /keys response
Diffstat (limited to 'src/util/offline_signatures.c')
-rw-r--r--src/util/offline_signatures.c56
1 files changed, 15 insertions, 41 deletions
diff --git a/src/util/offline_signatures.c b/src/util/offline_signatures.c
index 7fbec826b..1240a8bc5 100644
--- a/src/util/offline_signatures.c
+++ b/src/util/offline_signatures.c
@@ -491,66 +491,40 @@ TALER_exchange_offline_wire_fee_verify (
void
-TALER_exchange_offline_extension_agemask_sign (
- const struct TALER_AgeMask mask,
+TALER_exchange_offline_extension_config_hash_sign (
+ const struct TALER_ExtensionConfigHash h_config,
const struct TALER_MasterPrivateKeyP *master_priv,
struct TALER_MasterSignatureP *master_sig)
{
- struct TALER_MasterExtensionAgeRestrictionPS ar = {
+ struct TALER_MasterExtensionConfigurationPS ec = {
.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_EXTENSION),
- .purpose.size = htonl (sizeof(ar)),
- .mask = mask
+ .purpose.size = htonl (sizeof(ec)),
+ .h_config = h_config
};
GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
- &ar,
+ &ec,
&master_sig->eddsa_signature);
}
enum GNUNET_GenericReturnValue
-TALER_exchange_offline_extension_agemask_verify (
- const struct TALER_AgeMask mask,
+TALER_exchange_offline_extension_config_hash_verify (
+ const struct TALER_ExtensionConfigHash h_config,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_MasterSignatureP *master_sig
)
{
- struct TALER_MasterExtensionAgeRestrictionPS ar = {
+ struct TALER_MasterExtensionConfigurationPS ec = {
.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_EXTENSION),
- .purpose.size = htonl (sizeof(ar)),
- .mask = mask
+ .purpose.size = htonl (sizeof(ec)),
+ .h_config = h_config
};
- return
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_EXTENSION,
- &ar,
- &master_sig->eddsa_signature,
- &master_pub->eddsa_pub);
-}
-
-#if 0
-/* TODO peer2peer */
-void
-TALER_exchange_offline_extension_p2p_sign (
- // TODO
- const struct TALER_MasterPrivateKeyP *master_priv,
- struct TALER_MasterSignatureP *master_sig)
-{
- // TODO
-}
-
-
-enum GNUNET_GenericReturnValue
-TALER_exchange_offline_extension_p2p_verify (
- // TODO
- const struct TALER_MasterPublicKeyP *master_pub,
- const struct TALER_MasterSignatureP *master_sig,
- )
-{
- // TODO
- return GNUNET_FALSE;
+ return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_EXTENSION,
+ &ec,
+ &master_sig->eddsa_signature,
+ &master_pub->eddsa_pub);
}
-#endif
-
/* end of offline_signatures.c */