diff options
Diffstat (limited to 'src/mint')
| -rw-r--r-- | src/mint/taler-mint-httpd_wire.c | 20 | 
1 files changed, 12 insertions, 8 deletions
| diff --git a/src/mint/taler-mint-httpd_wire.c b/src/mint/taler-mint-httpd_wire.c index d6f0fd7f..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 <jansson.h>  /**   * 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, @@ -150,11 +157,8 @@ TMH_WIRE_handler_wire_sepa (struct TMH_RequestHandler *rh,  					     "SEPA_RESPONSE_FILE",  					     &sepa_wire_file))    { -    ret = MHD_queue_response (connection, -			      MHD_HTTP_NOT_IMPLEMENTED, -			      response); -    MHD_destroy_response (response); -    return ret; +    return TMH_RESPONSE_reply_internal_error (connection, +					      "SEPA_RESPONSE_FILE not configured");    }    fd = open (sepa_wire_file,  	     O_RDONLY); | 
