From 752f10273860d2496fc3eb1e03de6ad4451e7c0f Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Fri, 4 Nov 2022 12:18:16 +0100 Subject: policy extensions and age restriction refactoring - refactoring of extension-plugin-mechanism - refactoring of age restriction extension - added policy extensions plugin plumbing - added DB schema and api - policy_details - policy_fulfillments --- src/testing/test_exchange_api.c | 3 --- src/testing/test_exchange_p2p.c | 3 --- src/testing/testing_api_cmd_auditor_deposit_confirmation.c | 4 ++-- src/testing/testing_api_cmd_batch_deposit.c | 2 +- src/testing/testing_api_cmd_batch_withdraw.c | 2 +- src/testing/testing_api_cmd_deposit.c | 2 +- src/testing/testing_api_cmd_withdraw.c | 2 +- src/testing/testing_api_helpers_exchange.c | 9 +++++++-- 8 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src/testing') diff --git a/src/testing/test_exchange_api.c b/src/testing/test_exchange_api.c index dd39ee940..ec9ccb741 100644 --- a/src/testing/test_exchange_api.c +++ b/src/testing/test_exchange_api.c @@ -1312,9 +1312,6 @@ main (int argc, "INFO", NULL); - GNUNET_assert (GNUNET_OK == - TALER_extension_age_restriction_register ()); - cipher = GNUNET_TESTING_get_testname_from_underscore (argv[0]); GNUNET_assert (NULL != cipher); uses_cs = (0 == strcmp (cipher, "cs")); diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c index 27d47bfd4..f159b2f1b 100644 --- a/src/testing/test_exchange_p2p.c +++ b/src/testing/test_exchange_p2p.c @@ -522,9 +522,6 @@ main (int argc, "INFO", NULL); - GNUNET_assert (GNUNET_OK == - TALER_extension_age_restriction_register ()); - cipher = GNUNET_TESTING_get_testname_from_underscore (argv[0]); GNUNET_assert (NULL != cipher); uses_cs = (0 == strcmp (cipher, "cs")); diff --git a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c index d99b12937..293ecba27 100644 --- a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c +++ b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c @@ -199,7 +199,7 @@ deposit_confirmation_run (void *cls, const struct TALER_TESTING_Command *cmd, struct TALER_TESTING_Interpreter *is) { - static struct TALER_ExtensionContractHashP no_h_extensions; + static struct TALER_ExtensionPolicyHashP no_h_policy; struct DepositConfirmationState *dcs = cls; const struct TALER_TESTING_Command *deposit_cmd; struct TALER_MerchantWireHashP h_wire; @@ -310,7 +310,7 @@ deposit_confirmation_run (void *cls, } dcs->dc = TALER_AUDITOR_deposit_confirmation (dcs->auditor, &h_wire, - &no_h_extensions, + &no_h_policy, &h_contract_terms, *exchange_timestamp, *wire_deadline, diff --git a/src/testing/testing_api_cmd_batch_deposit.c b/src/testing/testing_api_cmd_batch_deposit.c index 967a5ac33..54a20cdb2 100644 --- a/src/testing/testing_api_cmd_batch_deposit.c +++ b/src/testing/testing_api_cmd_batch_deposit.c @@ -381,7 +381,7 @@ batch_deposit_run (void *cls, .merchant_payto_uri = payto_uri, .wire_salt = wire_salt, .h_contract_terms = h_contract_terms, - .extension_details = NULL /* FIXME #7270-OEC */, + .policy_details = NULL /* FIXME #7270-OEC */, .timestamp = ds->wallet_timestamp, .merchant_pub = merchant_pub, .refund_deadline = ds->refund_deadline diff --git a/src/testing/testing_api_cmd_batch_withdraw.c b/src/testing/testing_api_cmd_batch_withdraw.c index b68ca99f7..a5229ae9c 100644 --- a/src/testing/testing_api_cmd_batch_withdraw.c +++ b/src/testing/testing_api_cmd_batch_withdraw.c @@ -490,7 +490,7 @@ TALER_TESTING_cmd_batch_withdraw (const char *label, acp = GNUNET_new (struct TALER_AgeCommitmentProof); hac = GNUNET_new (struct TALER_AgeCommitmentHash); - mask = TALER_extensions_age_restriction_ageMask (); + mask = TALER_extensions_get_age_restriction_mask (); GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &seed, sizeof(seed)); diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c index f66947678..16ac139f4 100644 --- a/src/testing/testing_api_cmd_deposit.c +++ b/src/testing/testing_api_cmd_deposit.c @@ -468,7 +468,7 @@ deposit_run (void *cls, .merchant_payto_uri = payto_uri, .wire_salt = wire_salt, .h_contract_terms = h_contract_terms, - .extension_details = NULL /* FIXME #7270-OEC */, + .policy_details = NULL /* FIXME #7270-OEC */, .timestamp = ds->wallet_timestamp, .merchant_pub = merchant_pub, .refund_deadline = ds->refund_deadline diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c index ce2c49ccc..7a81d1c33 100644 --- a/src/testing/testing_api_cmd_withdraw.c +++ b/src/testing/testing_api_cmd_withdraw.c @@ -590,7 +590,7 @@ TALER_TESTING_cmd_withdraw_amount (const char *label, acp = GNUNET_new (struct TALER_AgeCommitmentProof); hac = GNUNET_new (struct TALER_AgeCommitmentHash); - mask = TALER_extensions_age_restriction_ageMask (); + mask = TALER_extensions_get_age_restriction_mask (); GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &seed, sizeof(seed)); diff --git a/src/testing/testing_api_helpers_exchange.c b/src/testing/testing_api_helpers_exchange.c index d813021bd..7fe0038ad 100644 --- a/src/testing/testing_api_helpers_exchange.c +++ b/src/testing/testing_api_helpers_exchange.c @@ -314,8 +314,13 @@ sign_keys_for_exchange (void *cls, char *exchange_master_pub; int ret; - /* Load the age restriction mask from the configuration */ - TALER_extensions_load_taler_config (cfg); + /* Load the extensions */ + if (GNUNET_OK != TALER_extensions_init (cfg)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "couldn't load extensions"); + return GNUNET_SYSERR; + } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, -- cgit v1.2.3