From 563b30bbfb6869679f74bdd731367210d19e3c47 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 11 Aug 2015 16:53:04 +0200 Subject: finishing taler-mint-sepa --- src/mint/taler-mint-httpd_wire.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/mint/taler-mint-httpd_wire.c') diff --git a/src/mint/taler-mint-httpd_wire.c b/src/mint/taler-mint-httpd_wire.c index cf177f8b..ee3b4ff0 100644 --- a/src/mint/taler-mint-httpd_wire.c +++ b/src/mint/taler-mint-httpd_wire.c @@ -22,7 +22,7 @@ #include "taler-mint-httpd_keystate.h" #include "taler-mint-httpd_responses.h" #include "taler-mint-httpd_wire.h" - +#include /** * Handle a "/wire" request. @@ -44,6 +44,7 @@ TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh, struct TALER_MintWireSupportMethodsPS wsm; struct TALER_MintPublicKeyP pub; struct TALER_MintSignatureP sig; + json_t *methods; wsm.purpose.size = htonl (sizeof (wsm)); wsm.purpose.purpose = htonl (TALER_SIGNATURE_MINT_WIRE_TYPES); @@ -53,11 +54,17 @@ TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh, TMH_KS_sign (&wsm.purpose, &pub, &sig); - /* FIXME: check against spec! */ + methods = json_array (); + /* NOTE: for now, we only support *ONE* wire format per + mint instance; if we supply multiple, we need to + add the strings for each type separately here -- and + hash the 0-terminated strings above differently as well... */ + json_array_append_new (methods, + json_string (TMH_expected_wire_format)); return TMH_RESPONSE_reply_json_pack (connection, MHD_HTTP_OK, "{s:s, s:o, s:o}", - "wire", TMH_expected_wire_format, + "methods", methods, "sig", TALER_json_from_data (&sig, sizeof (sig)), "pub", TALER_json_from_data (&pub, -- cgit v1.2.3