gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] 12/130: -more changes towards fixing FTBFS


From: gnunet
Subject: [taler-exchange] 12/130: -more changes towards fixing FTBFS
Date: Wed, 17 Nov 2021 12:24:20 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

commit ec3d5a7655d63c0d5675c095e3ebbb3cdc72a087
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sun Oct 24 12:33:25 2021 +0200

    -more changes towards fixing FTBFS
---
 src/json/json_pack.c | 64 ++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 50 insertions(+), 14 deletions(-)

diff --git a/src/json/json_pack.c b/src/json/json_pack.c
index a03b09e2..910fc639 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;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]