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/taler-merchant-httpd_exchanges.c | |
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/taler-merchant-httpd_exchanges.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_exchanges.c | 19 |
1 files changed, 17 insertions, 2 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 */ |