summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-01-25 12:53:07 +0100
committerChristian Grothoff <christian@grothoff.org>2016-01-25 12:53:07 +0100
commit936acfa13116a7cb81e656db3acc31c5f9ab2fd5 (patch)
treebde33e975b8a65250477f6556fcc889d10e65058 /src
parentfc5791353087812db6df374d1e453a387c57550c (diff)
downloadexchange-936acfa13116a7cb81e656db3acc31c5f9ab2fd5.tar.gz
exchange-936acfa13116a7cb81e656db3acc31c5f9ab2fd5.tar.bz2
exchange-936acfa13116a7cb81e656db3acc31c5f9ab2fd5.zip
check type in plugin
Diffstat (limited to 'src')
-rw-r--r--src/wire/plugin_wire_sepa.c8
-rw-r--r--src/wire/test_sepa_wireformat.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/wire/plugin_wire_sepa.c b/src/wire/plugin_wire_sepa.c
index 1867c0483..00d19d4b0 100644
--- a/src/wire/plugin_wire_sepa.c
+++ b/src/wire/plugin_wire_sepa.c
@@ -385,6 +385,14 @@ sepa_wire_validate (const json_t *wire)
TALER_json_warn (error);
return GNUNET_SYSERR;
}
+ if (0 != strcasecmp (type,
+ "sepa"))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Transfer type `%s' invalid\n",
+ type);
+ return GNUNET_SYSERR;
+ }
if (1 != validate_iban (iban))
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/wire/test_sepa_wireformat.c b/src/wire/test_sepa_wireformat.c
index d00228dd1..958aac260 100644
--- a/src/wire/test_sepa_wireformat.c
+++ b/src/wire/test_sepa_wireformat.c
@@ -130,7 +130,7 @@ main(int argc,
GNUNET_assert (NULL != plugin);
(void) memset(&error, 0, sizeof(error));
GNUNET_assert (NULL != (wire = json_loads (unsupported_wire_str, 0, NULL)));
- GNUNET_assert (GNUNET_NO == plugin->wire_validate (wire));
+ GNUNET_assert (GNUNET_YES != plugin->wire_validate (wire));
json_decref (wire);
GNUNET_assert (NULL != (wire = json_loads (invalid_wire_str, 0, NULL)));
GNUNET_assert (GNUNET_NO == plugin->wire_validate (wire));