summaryrefslogtreecommitdiffstats
path: root/src/core/net/client_cert_store_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/net/client_cert_store_data.cpp')
-rw-r--r--src/core/net/client_cert_store_data.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/core/net/client_cert_store_data.cpp b/src/core/net/client_cert_store_data.cpp
index ae4deed1..d1018a06 100644
--- a/src/core/net/client_cert_store_data.cpp
+++ b/src/core/net/client_cert_store_data.cpp
@@ -138,12 +138,27 @@ void ClientCertificateStoreData::add(const QSslCertificate &certificate, const Q
data->certPtr = net::X509Certificate::CreateFromBytes(certInBytes.data(), certInBytes.length());
data->key = privateKey;
data->certificate = certificate;
- addedCerts.append(data);
+ extraCerts.append(data);
}
-ClientCertificateStoreData::~ClientCertificateStoreData()
+void ClientCertificateStoreData::remove(const QSslCertificate &certificate)
{
- qDeleteAll(deletedCerts);
+ auto it = extraCerts.begin();
+ while (it != extraCerts.end()) {
+ const QtWebEngineCore::ClientCertificateStoreData::Entry *overrideData = *it;
+ if (certificate.toDer() == overrideData->certificate.toDer()) {
+ it = extraCerts.erase(it);
+ delete overrideData;
+ continue;
+ }
+ ++it;
+ }
+}
+
+void ClientCertificateStoreData::clear()
+{
+ qDeleteAll(extraCerts);
+ extraCerts.clear();
}
} // namespace QtWebEngineCore