diff options
Diffstat (limited to 'src/mint')
| -rw-r--r-- | src/mint/taler-mint-httpd.c | 5 | ||||
| -rw-r--r-- | src/mint/taler-mint-httpd.h | 5 | ||||
| -rw-r--r-- | src/mint/taler-mint-httpd_deposit.c | 9 | 
3 files changed, 18 insertions, 1 deletions
| diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c index 3b1512ff..41685106 100644 --- a/src/mint/taler-mint-httpd.c +++ b/src/mint/taler-mint-httpd.c @@ -56,6 +56,11 @@ struct GNUNET_CONFIGURATION_Handle *cfg;  struct GNUNET_CRYPTO_EddsaPublicKey master_pub;  /** + * In which format does this MINT expect wiring instructions? + */ +char *expected_wire_format = "sepa"; + +/**   * The HTTP Daemon.   */  static struct MHD_Daemon *mydaemon; diff --git a/src/mint/taler-mint-httpd.h b/src/mint/taler-mint-httpd.h index 95d3f1a6..a86b06e4 100644 --- a/src/mint/taler-mint-httpd.h +++ b/src/mint/taler-mint-httpd.h @@ -49,6 +49,11 @@ extern struct GNUNET_CONFIGURATION_Handle *cfg;  extern char *mintdir;  /** + * In which format does this MINT expect wiring instructions? + */ +extern char *expected_wire_format; + +/**   * Master public key (according to the   * configuration in the mint directory).   */ diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/mint/taler-mint-httpd_deposit.c index 84bcd5ba..915a7389 100644 --- a/src/mint/taler-mint-httpd_deposit.c +++ b/src/mint/taler-mint-httpd_deposit.c @@ -145,7 +145,14 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,      return MHD_NO; /* hard failure */    if (GNUNET_NO == res)      return MHD_YES; /* failure */ -  /* FIXME: check that "wire" is formatted correctly */ +  if (GNUNET_YES != +      TALER_JSON_validate_wireformat (expected_wire_format, +				      wire)) +  { +    TALER_MINT_release_parsed_data (spec); +    return TALER_MINT_reply_arg_invalid (connection, +                                         "wire"); +  }    if (NULL == (wire_enc = json_dumps (wire, JSON_COMPACT | JSON_SORT_KEYS)))    {      LOG_WARNING ("Failed to parse JSON wire format specification for /deposit request\n"); | 
