diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-10-06 20:07:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-10-06 21:11:49 +0200 |
commit | e6a8b181f8e242e78c5c893c751d8ab179987fd2 (patch) | |
tree | 0a213101b5bb9ca3ade5b5bc2ba12ebceab5d067 /src/backend/taler-merchant-httpd_proposal.c | |
parent | b23781154ace70764e0c65efa1d49abba004dbf2 (diff) | |
download | merchant-e6a8b181f8e242e78c5c893c751d8ab179987fd2.tar.gz merchant-e6a8b181f8e242e78c5c893c751d8ab179987fd2.tar.bz2 merchant-e6a8b181f8e242e78c5c893c751d8ab179987fd2.zip |
check return value from TALER_JSON_hash
Diffstat (limited to 'src/backend/taler-merchant-httpd_proposal.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_proposal.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd_proposal.c b/src/backend/taler-merchant-httpd_proposal.c index 4cb6dc99..59bd62a8 100644 --- a/src/backend/taler-merchant-httpd_proposal.c +++ b/src/backend/taler-merchant-httpd_proposal.c @@ -293,9 +293,16 @@ proposal_put (struct MHD_Connection *connection, /* create proposal signature */ pdps.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_CONTRACT); pdps.purpose.size = htonl (sizeof (pdps)); - GNUNET_assert (GNUNET_OK == - TALER_JSON_hash (order, - &pdps.hash)); + if (GNUNET_OK != + TALER_JSON_hash (order, + &pdps.hash)) + { + GNUNET_break (0); + GNUNET_JSON_parse_free (spec); + return TMH_RESPONSE_reply_internal_error (connection, + TALER_EC_INTERNAL_LOGIC_ERROR, + "Could not hash order"); + } GNUNET_CRYPTO_eddsa_sign (&mi->privkey.eddsa_priv, &pdps.purpose, |