diff options
Diffstat (limited to 'src/exchange/taler-exchange-httpd_management_wire.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_management_wire.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/src/exchange/taler-exchange-httpd_management_wire.c b/src/exchange/taler-exchange-httpd_management_wire.c index b684a107e..2ec42c3bc 100644 --- a/src/exchange/taler-exchange-httpd_management_wire.c +++ b/src/exchange/taler-exchange-httpd_management_wire.c @@ -175,9 +175,8 @@ TEH_handler_management_denominations_wire ( .start_date = GNUNET_TIME_absolute_hton (awc.validity_start), }; - GNUNET_CRYPTO_hash (awc.payto_uri, - strlen (awc.payto_uri) + 1, - &aw.h_wire); + TALER_exchange_wire_signature_hash (awc.payto_uri, + &aw.h_wire); if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify ( TALER_SIGNATURE_MASTER_ADD_WIRE, @@ -193,30 +192,17 @@ TEH_handler_management_denominations_wire ( NULL); } } + if (GNUNET_OK != + TALER_exchange_wire_signature_check (awc.payto_uri, + &TEH_master_public_key, + &awc.master_sig_wire)) { - struct TALER_MasterWireDetailsPS wd = { - .purpose.purpose = htonl ( - TALER_SIGNATURE_MASTER_ADD_WIRE), - .purpose.size = htonl (sizeof (wd)), - }; - - GNUNET_CRYPTO_hash (awc.payto_uri, - strlen (awc.payto_uri) + 1, - &wd.h_wire_details); - if (GNUNET_OK != - GNUNET_CRYPTO_eddsa_verify ( - TALER_SIGNATURE_MASTER_WIRE_DETAILS, - &wd, - &awc.master_sig_wire.eddsa_signature, - &TEH_master_public_key.eddsa_pub)) - { - GNUNET_break_op (0); - return TALER_MHD_reply_with_error ( - connection, - MHD_HTTP_FORBIDDEN, - TALER_EC_EXCHANGE_MANAGEMENT_WIRE_DETAILS_SIGNATURE_INVALID, - NULL); - } + GNUNET_break_op (0); + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_FORBIDDEN, + TALER_EC_EXCHANGE_MANAGEMENT_WIRE_DETAILS_SIGNATURE_INVALID, + NULL); } qs = TEH_DB_run_transaction (connection, |