aboutsummaryrefslogtreecommitdiff
path: root/src/json
diff options
context:
space:
mode:
authorLucien Heuzeveldt <lucienclaude.heuzeveldt@students.bfh.ch>2022-01-08 20:41:01 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:35:31 +0100
commit9074e66ebc8b73ecc98500f32af52088fd7f0722 (patch)
treee5e270bea1e2b3de44e915b428df01866a93203e /src/json
parent4c7aa097840eb3254a6823177abcc90fa7ccf0d0 (diff)
implement withdraw (nonce reuse check missing)
Diffstat (limited to 'src/json')
-rw-r--r--src/json/json_helper.c24
-rw-r--r--src/json/json_pack.c21
2 files changed, 38 insertions, 7 deletions
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index c07129d1a..6ee9c15a7 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -388,6 +388,7 @@ parse_denom_sig (void *cls,
}
return GNUNET_OK;
}
+ // TODO: case TALER_DENOMINATION_CS:
default:
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -483,6 +484,29 @@ parse_blinded_denom_sig (void *cls,
}
return GNUNET_OK;
}
+ case TALER_DENOMINATION_CS:
+ {
+ struct GNUNET_JSON_Specification ispec[] = {
+ GNUNET_JSON_spec_uint32 ("b",
+ &denom_sig->details.blinded_cs_answer.b),
+ GNUNET_JSON_spec_fixed_auto ("s",
+ &denom_sig->details.blinded_cs_answer.
+ s_scalar),
+ GNUNET_JSON_spec_end ()
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (root,
+ ispec,
+ &emsg,
+ &eline))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+ return GNUNET_OK;
+ }
+ break;
default:
GNUNET_break_op (0);
return GNUNET_SYSERR;
diff --git a/src/json/json_pack.c b/src/json/json_pack.c
index 869867189..cc147c4c0 100644
--- a/src/json/json_pack.c
+++ b/src/json/json_pack.c
@@ -125,14 +125,21 @@ TALER_JSON_pack_blinded_denom_sig (
switch (sig->cipher)
{
case TALER_DENOMINATION_RSA:
- ps.object
- = GNUNET_JSON_PACK (
- GNUNET_JSON_pack_uint64 ("cipher",
- TALER_DENOMINATION_RSA),
- GNUNET_JSON_pack_rsa_signature ("blinded_rsa_signature",
- sig->details.blinded_rsa_signature));
+ ps.object = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_uint64 ("cipher",
+ TALER_DENOMINATION_RSA),
+ GNUNET_JSON_pack_rsa_signature ("blinded_rsa_signature",
+ sig->details.blinded_rsa_signature));
+ break;
+ case TALER_DENOMINATION_CS:
+ ps.object = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_uint64 ("cipher",
+ TALER_DENOMINATION_CS),
+ GNUNET_JSON_pack_uint64 ("b",
+ sig->details.blinded_cs_answer.b),
+ GNUNET_JSON_pack_data_auto ("s",
+ &sig->details.blinded_cs_answer.s_scalar));
break;
- // TODO: case TALER_DENOMINATION_CS:
default:
GNUNET_assert (0);
}