diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-19 21:24:16 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-19 21:24:16 +0200 |
| commit | 4ae3a4e3cdcbffb77b4a329c70e6e8071cb4b161 (patch) | |
| tree | 2a8783f262793f05ad6e518acd37adac0b55bdfe /src/browsertab.cpp | |
| parent | 7e93bdb9243d5b0076a747cf074ce66fc97b89f4 (diff) | |
Fixes bug in client certificate handling
Diffstat (limited to 'src/browsertab.cpp')
| -rw-r--r-- | src/browsertab.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index eb34ae3..1c0a99b 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -763,10 +763,7 @@ bool BrowserTab::trySetClientCertificate(const QString &query) if (dialog.exec() != QDialog::Accepted) { - for(auto & handler : this->protocol_handlers) { - handler->disableClientCertificate(); - } - this->ui->enable_client_cert_button->setChecked(false); + this->disableClientCertificate(); return false; } @@ -775,7 +772,7 @@ bool BrowserTab::trySetClientCertificate(const QString &query) if (not current_identitiy.isValid()) { QMessageBox::warning(this, "Kristall", "Failed to generate temporary crypto-identitiy"); - this->ui->enable_client_cert_button->setChecked(false); + this->disableClientCertificate(); return false; } @@ -796,12 +793,7 @@ void BrowserTab::resetClientCertificate() } } - this->current_identitiy = CryptoIdentity(); - - for(auto & handler : this->protocol_handlers) { - handler->disableClientCertificate(); - } - this->ui->enable_client_cert_button->setChecked(false); + this->disableClientCertificate(); } void BrowserTab::addProtocolHandler(std::unique_ptr<ProtocolHandler> &&handler) @@ -838,12 +830,10 @@ bool BrowserTab::startRequest(const QUrl &url, ProtocolHandler::RequestOptions o ); if(answer != QMessageBox::Yes) return false; - this->current_handler->disableClientCertificate(); - this->ui->enable_client_cert_button->setChecked(false); + this->disableClientCertificate(); } } else { - this->current_handler->disableClientCertificate(); - this->ui->enable_client_cert_button->setChecked(false); + this->disableClientCertificate(); } if(this->current_identitiy.isValid() and (url.host() != this->current_location.host())) { @@ -855,8 +845,7 @@ bool BrowserTab::startRequest(const QUrl &url, ProtocolHandler::RequestOptions o QMessageBox::No ); if(answer != QMessageBox::Yes) { - this->current_handler->disableClientCertificate(); - this->ui->enable_client_cert_button->setChecked(false); + this->disableClientCertificate(); } } @@ -869,6 +858,15 @@ bool BrowserTab::startRequest(const QUrl &url, ProtocolHandler::RequestOptions o return this->current_handler->startRequest(url, options); } +void BrowserTab::disableClientCertificate() +{ + for(auto & handler : this->protocol_handlers) { + handler->disableClientCertificate(); + } + this->ui->enable_client_cert_button->setChecked(false); + this->current_identitiy = CryptoIdentity(); +} + void BrowserTab::on_text_browser_customContextMenuRequested(const QPoint &pos) { QMenu menu; |
