diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2021-10-24 12:33:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-10-27 09:23:12 +0200 |
commit | ec3d5a7655d63c0d5675c095e3ebbb3cdc72a087 (patch) | |
tree | 9b3eccfca1eed0cd53bde9ae8797ada8beee0b62 /src/json | |
parent | 464c1f806cd1518ebd87b598c7d8232e9f234ac2 (diff) |
-more changes towards fixing FTBFS
Diffstat (limited to 'src/json')
-rw-r--r-- | src/json/json_pack.c | 64 |
1 files changed, 50 insertions, 14 deletions
diff --git a/src/json/json_pack.c b/src/json/json_pack.c index a03b09e2c..910fc6396 100644 --- a/src/json/json_pack.c +++ b/src/json/json_pack.c @@ -88,22 +88,58 @@ TALER_JSON_pack_time_rel_nbo (const char *name, struct GNUNET_JSON_PackSpec -TALER_JSON_pack_denomination_public_key (const char *name, - const struct - TALER_DenominationPublicKey *pk) +TALER_JSON_pack_denomination_public_key ( + const char *name, + const struct TALER_DenominationPublicKey *pk) { - return GNUNET_JSON_pack_rsa_public_key (name, - pk->rsa_public_key); + struct GNUNET_JSON_PackSpec ps = { + .field_name = name, + }; + + switch (pk->cipher) + { + case TALER_DENOMINATION_RSA: + ps.object + = GNUNET_JSON_PACK ( + GNUNET_JSON_pack_uint32 ("cipher", + TALER_DENOMINATION_RSA), + GNUNET_JSON_pack_uint32 ("age_mask", + pk->age_mask), + GNUNET_JSON_pack_rsa_public_key ("rsa_public_key", + pk->details.rsa_public_key)); + break; + default: + GNUNET_assert (0); + return GNUNET_SYSERR; + } + return ps; } struct GNUNET_JSON_PackSpec -TALER_JSON_pack_denomination_signature (const char *name, - const struct - TALER_DenominationSignature *sig) +TALER_JSON_pack_denomination_signature ( + const char *name, + const struct TALER_DenominationSignature *sig) { - return GNUNET_JSON_pack_rsa_signature (name, - sig->rsa_signature); + struct GNUNET_JSON_PackSpec ps = { + .field_name = name, + }; + + switch (sig->cipher) + { + case TALER_DENOMINATION_RSA: + ps.object + = GNUNET_JSON_PACK ( + GNUNET_JSON_pack_uint32 ("cipher", + TALER_DENOMINATION_RSA), + GNUNET_JSON_pack_rsa_signature ("rsa_signature", + sig->details.rsa_signature)); + break; + default: + GNUNET_assert (0); + return GNUNET_SYSERR; + } + return ps; } @@ -114,8 +150,8 @@ TALER_JSON_pack_amount (const char *name, struct GNUNET_JSON_PackSpec ps = { .field_name = name, .object = (NULL != amount) - ? TALER_JSON_from_amount (amount) - : NULL + ? TALER_JSON_from_amount (amount) + : NULL }; return ps; @@ -129,8 +165,8 @@ TALER_JSON_pack_amount_nbo (const char *name, struct GNUNET_JSON_PackSpec ps = { .field_name = name, .object = (NULL != amount) - ? TALER_JSON_from_amount_nbo (amount) - : NULL + ? TALER_JSON_from_amount_nbo (amount) + : NULL }; return ps; |