aboutsummaryrefslogtreecommitdiff
path: root/src/json
diff options
context:
space:
mode:
authorLucien Heuzeveldt <lucienclaude.heuzeveldt@students.bfh.ch>2022-01-06 15:55:50 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:34:19 +0100
commit82405b0ce5593b30a1b0ee1a1995f2214a71751c (patch)
treea71d2c78a344cc9e9b68e88cfdb8615f698d3383 /src/json
parent36f551ff33ac0974788aff28d4b19390ca484f4b (diff)
implement CS key handling and csr endpoint
Diffstat (limited to 'src/json')
-rw-r--r--src/json/json_helper.c22
-rw-r--r--src/json/json_pack.c13
2 files changed, 34 insertions, 1 deletions
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
@@ -273,6 +273,26 @@ parse_denom_pub (void *cls,
}
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,
+ &emsg,
+ &eline))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+ return GNUNET_OK;
+ }
default:
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -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);
}