diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-12-01 21:07:56 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-12-01 21:07:56 +0100 |
commit | 9572337aed3ebc5f0654db11c10babc88560c481 (patch) | |
tree | bd03657b4116cbbe53995e5db2c41cbd3be64ba6 /src/exchange/taler-exchange-httpd_management_wire.c | |
parent | d3184e04e2a604673655899989707664736b3468 (diff) | |
download | exchange-9572337aed3ebc5f0654db11c10babc88560c481.tar.gz exchange-9572337aed3ebc5f0654db11c10babc88560c481.tar.bz2 exchange-9572337aed3ebc5f0654db11c10babc88560c481.zip |
more management API tests and bugfixes
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, |