From 82405b0ce5593b30a1b0ee1a1995f2214a71751c Mon Sep 17 00:00:00 2001 From: Lucien Heuzeveldt Date: Thu, 6 Jan 2022 15:55:50 +0100 Subject: implement CS key handling and csr endpoint --- src/json/json_helper.c | 22 +++++++++++++++++++++- src/json/json_pack.c | 13 +++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'src/json') diff --git a/src/json/json_helper.c b/src/json/json_helper.c index ef1617ef3..c07129d1a 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -262,6 +262,26 @@ parse_denom_pub (void *cls, GNUNET_JSON_spec_end () }; + if (GNUNET_OK != + GNUNET_JSON_parse (root, + ispec, + &emsg, + &eline)) + { + GNUNET_break_op (0); + return GNUNET_SYSERR; + } + return GNUNET_OK; + } + case TALER_DENOMINATION_CS: + { + struct GNUNET_JSON_Specification ispec[] = { + GNUNET_JSON_spec_fixed ("cs_public_key", + &denom_pub->details.cs_public_key, + sizeof (denom_pub->details.cs_public_key)), + GNUNET_JSON_spec_end () + }; + if (GNUNET_OK != GNUNET_JSON_parse (root, ispec, @@ -686,7 +706,7 @@ TALER_JSON_parse_agemask (const json_t *root, { return GNUNET_SYSERR; } - +//FIXME: return GNUNET_OK; /** * Parse given JSON object to CS R. diff --git a/src/json/json_pack.c b/src/json/json_pack.c index 6fea72a39..869867189 100644 --- a/src/json/json_pack.c +++ b/src/json/json_pack.c @@ -68,6 +68,17 @@ TALER_JSON_pack_denom_pub ( GNUNET_JSON_pack_rsa_public_key ("rsa_public_key", pk->details.rsa_public_key)); break; + case TALER_DENOMINATION_CS: + ps.object + = GNUNET_JSON_PACK ( + GNUNET_JSON_pack_uint64 ("cipher", + TALER_DENOMINATION_CS), + GNUNET_JSON_pack_uint64 ("age_mask", + pk->age_mask.mask), + GNUNET_JSON_pack_data_varsize ("cs_public_key", + &pk->details.cs_public_key, + sizeof (pk->details.cs_public_key))); + break; default: GNUNET_assert (0); } @@ -94,6 +105,7 @@ TALER_JSON_pack_denom_sig ( GNUNET_JSON_pack_rsa_signature ("rsa_signature", sig->details.rsa_signature)); break; + // TODO: case TALER_DENOMINATION_CS: default: GNUNET_assert (0); } @@ -120,6 +132,7 @@ TALER_JSON_pack_blinded_denom_sig ( GNUNET_JSON_pack_rsa_signature ("blinded_rsa_signature", sig->details.blinded_rsa_signature)); break; + // TODO: case TALER_DENOMINATION_CS: default: GNUNET_assert (0); } -- cgit v1.2.3