diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-04-28 13:55:58 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-04-28 13:55:58 +0200 |
commit | a95dfe2f7882055f50ee804cf950b3350e162bcf (patch) | |
tree | 8da846acaf9e0b5276dd931ae863b037c3e0f907 /src/json | |
parent | d4f6ca72309f5400af20aa57905846fd3ac13949 (diff) |
json pack token envelope
Diffstat (limited to 'src/json')
-rw-r--r-- | src/json/json_pack.c | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/src/json/json_pack.c b/src/json/json_pack.c index 940123ea0..427ac3e85 100644 --- a/src/json/json_pack.c +++ b/src/json/json_pack.c @@ -171,6 +171,22 @@ TALER_JSON_pack_token_issue_sig ( struct GNUNET_JSON_PackSpec +TALER_JSON_pack_token_envelope ( + const char *name, + const struct TALER_TokenEnvelopeP *envelope) +{ + struct GNUNET_JSON_PackSpec ps = { + .field_name = name, + }; + + if (NULL == envelope) + return ps; + return GNUNET_JSON_pack_blinded_message (name, + envelope->blinded_pub); +} + + +struct GNUNET_JSON_PackSpec TALER_JSON_pack_exchange_withdraw_values ( const char *name, const struct TALER_ExchangeWithdrawValues *ewv) @@ -263,37 +279,8 @@ TALER_JSON_pack_blinded_planchet ( if (NULL == blinded_planchet) return ps; - bm = blinded_planchet->blinded_message; - switch (bm->cipher) - { - case GNUNET_CRYPTO_BSA_INVALID: - break; - case GNUNET_CRYPTO_BSA_RSA: - ps.object = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ("cipher", - "RSA"), - GNUNET_JSON_pack_data_varsize ( - "rsa_blinded_planchet", - bm->details.rsa_blinded_message.blinded_msg, - bm->details.rsa_blinded_message.blinded_msg_size)); - return ps; - case GNUNET_CRYPTO_BSA_CS: - ps.object = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ("cipher", - "CS"), - GNUNET_JSON_pack_data_auto ( - "cs_nonce", - &bm->details.cs_blinded_message.nonce), - GNUNET_JSON_pack_data_auto ( - "cs_blinded_c0", - &bm->details.cs_blinded_message.c[0]), - GNUNET_JSON_pack_data_auto ( - "cs_blinded_c1", - &bm->details.cs_blinded_message.c[1])); - return ps; - } - GNUNET_assert (0); - return ps; + return GNUNET_JSON_pack_blinded_message (name, + blinded_planchet->blinded_message); } |