diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-21 18:48:46 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-21 18:48:46 +0200 |
| commit | 75084776140610f31f28371a2c78191464577c40 (patch) | |
| tree | c8967b31c5d64e7e4592ad62742a9cbd61304f64 /src/ssltrust.cpp | |
| parent | 79a03469fc46ced070980a1446af94877dc8c466 (diff) | |
| download | kristall-75084776140610f31f28371a2c78191464577c40.tar.gz | |
Fixes a double-error-handlign with SSL trust. Error page is now more correct
Diffstat (limited to 'src/ssltrust.cpp')
| -rw-r--r-- | src/ssltrust.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ssltrust.cpp b/src/ssltrust.cpp index bbbc360..f35988e 100644 --- a/src/ssltrust.cpp +++ b/src/ssltrust.cpp @@ -49,15 +49,20 @@ void SslTrust::save(QSettings &settings) const bool SslTrust::isTrusted(QUrl const & url, const QSslCertificate &certificate) { + return (getTrust(url, certificate) == Trusted); +} + +SslTrust::TrustStatus SslTrust::getTrust(const QUrl &url, const QSslCertificate &certificate) +{ if(trust_level == TrustEverything) - return true; + return Trusted; if(auto host_or_none = trusted_hosts.get(url.host()); host_or_none) { if(host_or_none->public_key == certificate.publicKey()) - return true; + return Trusted; qDebug() << "certificate mismatch for" << url; - return false; + return Mistrusted; } else { @@ -70,9 +75,9 @@ bool SslTrust::isTrusted(QUrl const & url, const QSslCertificate &certificate) bool ok = trusted_hosts.insert(host); assert(ok); - return true; + return Trusted; } - return false; + return Untrusted; } } |
