diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-01-16 18:37:32 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-01-16 18:37:32 +0100 |
commit | 2c5a245427fea2e87e0ddba4ae189d19ea785fef (patch) | |
tree | be9d07277200f7d5cce0c74f6f64214d11f0d2c2 /src/backend | |
parent | 4bbb29fbb50cdce874aefcb9a6ab63a698de698b (diff) | |
download | merchant-2c5a245427fea2e87e0ddba4ae189d19ea785fef.tar.gz merchant-2c5a245427fea2e87e0ddba4ae189d19ea785fef.tar.bz2 merchant-2c5a245427fea2e87e0ddba4ae189d19ea785fef.zip |
fix #6699: trust peers if master_pub is in trust set, do not require base URL to match
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/taler-merchant-httpd_exchanges.c | 19 | ||||
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 3 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c index 2c8995ee..35f51e27 100644 --- a/src/backend/taler-merchant-httpd_exchanges.c +++ b/src/backend/taler-merchant-httpd_exchanges.c @@ -828,7 +828,8 @@ keys_mgmt_cb (void *cls, struct GNUNET_TIME_Absolute expire; struct GNUNET_TIME_Relative delay; - if (NULL == keys) + if ( (MHD_HTTP_OK != hr->http_status) || + (NULL == keys) ) { fail_and_retry (exchange, hr, @@ -846,8 +847,22 @@ keys_mgmt_cb (void *cls, exchange->trusted = false; } if (! exchange->trusted) + { exchange->master_pub = keys->master_pub; - + for (struct Exchange *e = exchange_head; + NULL != e; + e = e->next) + { + if (e == exchange) + continue; + if (! e->trusted) + continue; + if (0 == + GNUNET_memcmp (&e->master_pub, + &exchange->master_pub)) + exchange->trusted = true; /* same exchange, different URL => trust applies */ + } + } if (0 != (TALER_EXCHANGE_VC_NEWER & compat)) { /* Warn user exactly once about need to upgrade */ diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c index bc45902a..d4c47822 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -760,7 +760,8 @@ process_pay_with_exchange (void *cls, (json_int_t) TALER_EC_MERCHANT_GENERIC_EXCHANGE_TIMEOUT)); return; } - if (NULL == exchange_handle) + if ( (MHD_HTTP_OK != hr->http_status) || + (NULL == exchange_handle) ) { GNUNET_break_op (0); resume_pay_with_response ( |