diff options
Diffstat (limited to 'src/exchange')
-rw-r--r-- | src/exchange/Makefile.am | 3 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_aml-decision-get.c | 3 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_common_kyc.c | 44 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_reserves_attest.c | 3 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_reserves_get_attest.c | 3 | ||||
-rwxr-xr-x | src/exchange/taler-exchange-kyc-aml-pep-trigger.sh | 7 |
6 files changed, 22 insertions, 41 deletions
diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am index c04bca0f2..ba74a10f5 100644 --- a/src/exchange/Makefile.am +++ b/src/exchange/Makefile.am @@ -15,6 +15,8 @@ pkgcfg_DATA = \ exchange.conf # Programs +bin_SCRIPTS = \ + taler-exchange-kyc-aml-pep-trigger.sh bin_PROGRAMS = \ taler-exchange-aggregator \ @@ -228,4 +230,5 @@ EXTRA_DIST = \ test_taler_exchange_httpd.get \ test_taler_exchange_httpd.post \ exchange.conf \ + $(bin_SCRIPTS) \ $(check_SCRIPTS) diff --git a/src/exchange/taler-exchange-httpd_aml-decision-get.c b/src/exchange/taler-exchange-httpd_aml-decision-get.c index 6b36fe27f..b4f337db1 100644 --- a/src/exchange/taler-exchange-httpd_aml-decision-get.c +++ b/src/exchange/taler-exchange-httpd_aml-decision-get.c @@ -43,8 +43,6 @@ * @param[in,out] cls closure with a `json_t *` array to update * @param h_payto account for which the attribute data is stored * @param provider_section provider that must be checked - * @param birthdate birthdate of user, in format YYYY-MM-DD; can be NULL; - * digits can be 0 if exact day, month or year are unknown * @param collection_time when was the data collected * @param expiration_time when does the data expire * @param enc_attributes_size number of bytes in @a enc_attributes @@ -55,7 +53,6 @@ kyc_attribute_cb ( void *cls, const struct TALER_PaytoHashP *h_payto, const char *provider_section, - const char *birthdate, struct GNUNET_TIME_Timestamp collection_time, struct GNUNET_TIME_Timestamp expiration_time, size_t enc_attributes_size, diff --git a/src/exchange/taler-exchange-httpd_common_kyc.c b/src/exchange/taler-exchange-httpd_common_kyc.c index 62e6fe526..6d879b7ac 100644 --- a/src/exchange/taler-exchange-httpd_common_kyc.c +++ b/src/exchange/taler-exchange-httpd_common_kyc.c @@ -114,6 +114,7 @@ kyc_aml_finished (void *cls, size_t eas; void *ea; const char *birthdate; + unsigned int birthday; struct GNUNET_ShortHashCode kyc_prox; struct GNUNET_AsyncScopeSave old_scope; @@ -124,21 +125,27 @@ kyc_aml_finished (void *cls, &kyc_prox); birthdate = json_string_value (json_object_get (kat->attributes, TALER_ATTRIBUTE_BIRTHDATE)); + birthday = 0; (void) birthdate; // FIXME-Oec: calculate birthday here... + // Convert 'birthdate' to time after 1970, then compute days. + // Then compare against max age-restriction, and if before, set to 0. TALER_CRYPTO_kyc_attributes_encrypt (&TEH_attribute_key, kat->attributes, &ea, &eas); - // FIXME: begin transaction (or move everything into one stored procedure?) qs = TEH_plugin->insert_kyc_attributes ( TEH_plugin->cls, + kat->process_row, &kat->account_id, &kyc_prox, kat->provider_section, - birthdate, + birthday, GNUNET_TIME_timestamp_get (), - GNUNET_TIME_absolute_to_timestamp (kat->expiration), + kat->provider_user_id, + kat->provider_legitimization_id, + kat->expiration, eas, - ea); + ea, + 0 != code); GNUNET_free (ea); if (GNUNET_DB_STATUS_HARD_ERROR == qs) { @@ -147,36 +154,9 @@ kyc_aml_finished (void *cls, MHD_destroy_response (kat->response); kat->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR; kat->response = TALER_MHD_make_error (TALER_EC_GENERIC_DB_STORE_FAILED, - "insert_kyc_attributes"); - goto finish; + "do_insert_kyc_attributes"); } - qs = TEH_plugin->update_kyc_process_by_row (TEH_plugin->cls, - kat->process_row, - kat->provider_section, - &kat->account_id, - kat->provider_user_id, - kat->provider_legitimization_id, - kat->expiration); - if (GNUNET_DB_STATUS_HARD_ERROR == qs) - { - GNUNET_break (0); - if (NULL != kat->response) - MHD_destroy_response (kat->response); - kat->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR; - kat->response = TALER_MHD_make_error (TALER_EC_GENERIC_DB_STORE_FAILED, - "update_kyc_process_by_row"); - goto finish; - } - // FIXME: do DB work, possibly updating kat! - if (0 != code) - { - // FIXME: trigger AML! - GNUNET_break (0); // FIXME: not implemented - } - // FIXME: end transaction - /* Finally, return result to main handler */ -finish: kat->cb (kat->cb_cls, kat->http_status, kat->response); diff --git a/src/exchange/taler-exchange-httpd_reserves_attest.c b/src/exchange/taler-exchange-httpd_reserves_attest.c index 297d8ceec..d0f3614e6 100644 --- a/src/exchange/taler-exchange-httpd_reserves_attest.c +++ b/src/exchange/taler-exchange-httpd_reserves_attest.c @@ -158,8 +158,6 @@ reply_reserve_attest_success (struct MHD_Connection *connection, * @param cls our `struct ReserveAttestContext *` * @param h_payto account for which the attribute data is stored * @param provider_section provider that must be checked - * @param birthdate birthdate of user, in format YYYY-MM-DD; can be NULL; - * digits can be 0 if exact day, month or year are unknown * @param collection_time when was the data collected * @param expiration_time when does the data expire * @param enc_attributes_size number of bytes in @a enc_attributes @@ -169,7 +167,6 @@ static void kyc_process_cb (void *cls, const struct TALER_PaytoHashP *h_payto, const char *provider_section, - const char *birthdate, struct GNUNET_TIME_Timestamp collection_time, struct GNUNET_TIME_Timestamp expiration_time, size_t enc_attributes_size, diff --git a/src/exchange/taler-exchange-httpd_reserves_get_attest.c b/src/exchange/taler-exchange-httpd_reserves_get_attest.c index b53a8641a..ae983682a 100644 --- a/src/exchange/taler-exchange-httpd_reserves_get_attest.c +++ b/src/exchange/taler-exchange-httpd_reserves_get_attest.c @@ -64,8 +64,6 @@ struct ReserveAttestContext * @param cls our `struct ReserveAttestContext *` * @param h_payto account for which the attribute data is stored * @param provider_section provider that must be checked - * @param birthdate birthdate of user, in format YYYY-MM-DD; can be NULL; - * digits can be 0 if exact day, month or year are unknown * @param collection_time when was the data collected * @param expiration_time when does the data expire * @param enc_attributes_size number of bytes in @a enc_attributes @@ -75,7 +73,6 @@ static void kyc_process_cb (void *cls, const struct TALER_PaytoHashP *h_payto, const char *provider_section, - const char *birthdate, struct GNUNET_TIME_Timestamp collection_time, struct GNUNET_TIME_Timestamp expiration_time, size_t enc_attributes_size, diff --git a/src/exchange/taler-exchange-kyc-aml-pep-trigger.sh b/src/exchange/taler-exchange-kyc-aml-pep-trigger.sh new file mode 100755 index 000000000..9baa32baf --- /dev/null +++ b/src/exchange/taler-exchange-kyc-aml-pep-trigger.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# This file is in the public domain. +# This is an example of how to trigger AML if the +# KYC attributes include '{"pep":true}' +# +# To be used as a script for the KYC_AML_TRIGGER. +test "false" = $(jq .pep -) |