summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_reserves_attest.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-29 13:58:56 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-29 13:58:56 +0100
commitff202ef296527083b7b0c879bfc8363eb429b642 (patch)
tree83d281ca52b92917e6c7637760fca8eb25c04e57 /src/exchange/taler-exchange-httpd_reserves_attest.c
parent99753a5d31868af36285418ed317eeef50921b67 (diff)
downloadexchange-ff202ef296527083b7b0c879bfc8363eb429b642.tar.gz
exchange-ff202ef296527083b7b0c879bfc8363eb429b642.tar.bz2
exchange-ff202ef296527083b7b0c879bfc8363eb429b642.zip
KYC: misc. fixes to attribute attestation logic
Diffstat (limited to 'src/exchange/taler-exchange-httpd_reserves_attest.c')
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_attest.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserves_attest.c b/src/exchange/taler-exchange-httpd_reserves_attest.c
index 0d759e1b5..297d8ceec 100644
--- a/src/exchange/taler-exchange-httpd_reserves_attest.c
+++ b/src/exchange/taler-exchange-httpd_reserves_attest.c
@@ -76,7 +76,7 @@ struct ReserveAttestContext
struct TALER_ReserveSignatureP reserve_sig;
/**
- * Attributes we are affirming.
+ * Attributes we are affirming. JSON object.
*/
json_t *json_attest;
@@ -140,8 +140,12 @@ reply_reserve_attest_success (struct MHD_Connection *connection,
&exchange_sig),
GNUNET_JSON_pack_data_auto ("exchange_pub",
&exchange_pub),
- GNUNET_JSON_pack_array_steal ("attest",
- rhc->json_attest));
+ GNUNET_JSON_pack_timestamp ("exchange_timestamp",
+ now),
+ GNUNET_JSON_pack_timestamp ("expiration_time",
+ rhc->etime),
+ GNUNET_JSON_pack_object_steal ("attributes",
+ rhc->json_attest));
}
@@ -201,7 +205,12 @@ kyc_process_cb (void *cls,
}
}
if (! requested)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Skipping attribute `%s': not requested\n",
+ name);
continue;
+ }
match = true;
GNUNET_assert (0 ==
json_object_set (rsc->json_attest, /* NOT set_new! */
@@ -239,7 +248,7 @@ reserve_attest_transaction (void *cls,
struct ReserveAttestContext *rsc = cls;
enum GNUNET_DB_QueryStatus qs;
- rsc->json_attest = json_array ();
+ rsc->json_attest = json_object ();
GNUNET_assert (NULL != rsc->json_attest);
qs = TEH_plugin->select_kyc_attributes (TEH_plugin->cls,
&rsc->h_payto,