commit f6026688d2c2d42f0c32ba59582213f70a276e2e
parent f9ec6ee27a0c067a49ffef4c1b0527fca5b2c2f3
Author: Florian Dold <florian@dold.me>
Date: Mon, 26 May 2025 14:36:14 +0200
ensure that default LRS specifies custom_measures
It is a mandatory field.
Issue: https://bugs.taler.net/n/10013
Diffstat:
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c
@@ -3076,21 +3076,30 @@ TALER_KYCLOGIC_kyc_init (
}
json_decref (jrule);
}
- wallet_default_lrs
- = GNUNET_JSON_PACK (
- GNUNET_JSON_pack_timestamp ("expiration_time",
- GNUNET_TIME_UNIT_FOREVER_TS),
- GNUNET_JSON_pack_array_steal ("rules",
- jkyc_rules_w)
- );
- bankaccount_default_lrs
- = GNUNET_JSON_PACK (
- GNUNET_JSON_pack_timestamp ("expiration_time",
- GNUNET_TIME_UNIT_FOREVER_TS),
- GNUNET_JSON_pack_array_steal ("rules",
- jkyc_rules_a)
- );
-
+ {
+ json_t *empty = json_object ();
+
+ GNUNET_assert (NULL != empty);
+ wallet_default_lrs
+ = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_timestamp ("expiration_time",
+ GNUNET_TIME_UNIT_FOREVER_TS),
+ GNUNET_JSON_pack_array_steal ("rules",
+ jkyc_rules_w),
+ GNUNET_JSON_pack_object_incref ("custom_measures",
+ empty)
+ );
+ bankaccount_default_lrs
+ = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_timestamp ("expiration_time",
+ GNUNET_TIME_UNIT_FOREVER_TS),
+ GNUNET_JSON_pack_array_steal ("rules",
+ jkyc_rules_a),
+ GNUNET_JSON_pack_object_incref ("custom_measures",
+ empty)
+ );
+ json_decref (empty);
+ }
for (unsigned int i=0; i<default_rules.num_custom_measures; i++)
{
const struct TALER_KYCLOGIC_Measure *measure