diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-12-04 20:29:18 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-12-04 20:29:18 +0100 |
commit | 6cceb617af887df49df74729bb1813bbd75a1346 (patch) | |
tree | 867616e235e6a1d84790f6c7c73f60900cbe2bb7 /src/exchange/taler-exchange-httpd_management_wire_disable.c | |
parent | 9b290fb26b2d18725858508bc14ae0933fff0250 (diff) | |
download | exchange-6cceb617af887df49df74729bb1813bbd75a1346.tar.gz exchange-6cceb617af887df49df74729bb1813bbd75a1346.tar.bz2 exchange-6cceb617af887df49df74729bb1813bbd75a1346.zip |
centralize (most) offline signing/verifying operations into offline_signatures.c
Diffstat (limited to 'src/exchange/taler-exchange-httpd_management_wire_disable.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_management_wire_disable.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/exchange/taler-exchange-httpd_management_wire_disable.c b/src/exchange/taler-exchange-httpd_management_wire_disable.c index af5942a1b..51b811604 100644 --- a/src/exchange/taler-exchange-httpd_management_wire_disable.c +++ b/src/exchange/taler-exchange-httpd_management_wire_disable.c @@ -161,30 +161,19 @@ TEH_handler_management_denominations_wire_disable ( if (GNUNET_NO == res) return MHD_YES; /* failure */ } + if (GNUNET_OK != + TALER_exchange_offline_wire_del_verify ( + awc.payto_uri, + awc.validity_end, + &TEH_master_public_key, + &awc.master_sig)) { - struct TALER_MasterDelWirePS aw = { - .purpose.purpose = htonl ( - TALER_SIGNATURE_MASTER_DEL_WIRE), - .purpose.size = htonl (sizeof (aw)), - .end_date = GNUNET_TIME_absolute_hton (awc.validity_end), - }; - - TALER_exchange_wire_signature_hash (awc.payto_uri, - &aw.h_wire); - if (GNUNET_OK != - GNUNET_CRYPTO_eddsa_verify ( - TALER_SIGNATURE_MASTER_DEL_WIRE, - &aw, - &awc.master_sig.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_DEL_SIGNATURE_INVALID, - NULL); - } + GNUNET_break_op (0); + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_FORBIDDEN, + TALER_EC_EXCHANGE_MANAGEMENT_WIRE_DEL_SIGNATURE_INVALID, + NULL); } qs = TEH_DB_run_transaction (connection, "del wire", |