Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/ksslinfodialog.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | 111 | } else { | |||
---|---|---|---|---|---|
117 | } else { | 117 | } else { | ||
118 | d->ui.encryptionIndicator->setPixmap(QIcon::fromTheme(QStringLiteral("security-low")) | 118 | d->ui.encryptionIndicator->setPixmap(QIcon::fromTheme(QStringLiteral("security-low")) | ||
119 | .pixmap(KIconLoader::SizeSmallMedium)); | 119 | .pixmap(KIconLoader::SizeSmallMedium)); | ||
120 | d->ui.explanation->setText(i18n("Current connection is not secured with SSL.")); | 120 | d->ui.explanation->setText(i18n("Current connection is not secured with SSL.")); | ||
121 | } | 121 | } | ||
122 | } | 122 | } | ||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 64) | ||||
125 | void KSslInfoDialog::setSslInfo(const QList<QSslCertificate> &certificateChain, | 126 | void KSslInfoDialog::setSslInfo(const QList<QSslCertificate> &certificateChain, | ||
126 | const QString &ip, const QString &host, | 127 | const QString &ip, const QString &host, | ||
127 | const QString &sslProtocol, const QString &cipher, | 128 | const QString &sslProtocol, const QString &cipher, | ||
128 | int usedBits, int bits, | 129 | int usedBits, int bits, | ||
129 | const QList<QList<KSslError::Error> > &validationErrors) | 130 | const QList<QList<KSslError::Error> > &validationErrors) | ||
130 | { | 131 | { | ||
131 | QList<QList<QSslError::SslError>> qValidationErrors; | 132 | QList<QList<QSslError::SslError>> qValidationErrors; | ||
132 | qValidationErrors.reserve(validationErrors.size()); | 133 | qValidationErrors.reserve(validationErrors.size()); | ||
133 | for (const auto &l : validationErrors) { | 134 | for (const auto &l : validationErrors) { | ||
134 | QList<QSslError::SslError> qErrors; | 135 | QList<QSslError::SslError> qErrors; | ||
135 | qErrors.reserve(l.size()); | 136 | qErrors.reserve(l.size()); | ||
136 | for (const KSslError::Error e : l) { | 137 | for (const KSslError::Error e : l) { | ||
137 | qErrors.push_back(KSslErrorPrivate::errorFromKSslError(e)); | 138 | qErrors.push_back(KSslErrorPrivate::errorFromKSslError(e)); | ||
138 | } | 139 | } | ||
139 | qValidationErrors.push_back(qErrors); | 140 | qValidationErrors.push_back(qErrors); | ||
140 | } | 141 | } | ||
141 | setSslInfo(certificateChain, ip, host, sslProtocol, cipher, usedBits, bits, qValidationErrors); | 142 | setSslInfo(certificateChain, ip, host, sslProtocol, cipher, usedBits, bits, qValidationErrors); | ||
142 | } | 143 | } | ||
144 | #endif | ||||
143 | 145 | | |||
144 | void KSslInfoDialog::setSslInfo(const QList<QSslCertificate> &certificateChain, | 146 | void KSslInfoDialog::setSslInfo(const QList<QSslCertificate> &certificateChain, | ||
145 | const QString &ip, const QString &host, | 147 | const QString &ip, const QString &host, | ||
146 | const QString &sslProtocol, const QString &cipher, | 148 | const QString &sslProtocol, const QString &cipher, | ||
147 | int usedBits, int bits, | 149 | int usedBits, int bits, | ||
148 | const QList<QList<QSslError::SslError>> &validationErrors) | 150 | const QList<QList<QSslError::SslError>> &validationErrors) | ||
149 | { | 151 | { | ||
150 | 152 | | |||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 205 | { | |||
224 | d->ui.serial->setText(QString::fromUtf8(cert.serialNumber())); | 226 | d->ui.serial->setText(QString::fromUtf8(cert.serialNumber())); | ||
225 | d->ui.digest->setText(QString::fromUtf8(cert.digest().toHex())); | 227 | d->ui.digest->setText(QString::fromUtf8(cert.digest().toHex())); | ||
226 | d->ui.sha1Digest->setText(QString::fromUtf8(cert.digest(QCryptographicHash::Sha1).toHex())); | 228 | d->ui.sha1Digest->setText(QString::fromUtf8(cert.digest(QCryptographicHash::Sha1).toHex())); | ||
227 | 229 | | |||
228 | d->subject->setCertificate(cert, KSslCertificateBox::Subject); | 230 | d->subject->setCertificate(cert, KSslCertificateBox::Subject); | ||
229 | d->issuer->setCertificate(cert, KSslCertificateBox::Issuer); | 231 | d->issuer->setCertificate(cert, KSslCertificateBox::Issuer); | ||
230 | } | 232 | } | ||
231 | 233 | | |||
234 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 65) | ||||
232 | //static | 235 | //static | ||
233 | QList<QList<KSslError::Error> > KSslInfoDialog::errorsFromString(const QString &es) | 236 | QList<QList<KSslError::Error> > KSslInfoDialog::errorsFromString(const QString &es) | ||
234 | { | 237 | { | ||
235 | #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) | 238 | #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) | ||
236 | const QStringList sl = es.split(QLatin1Char('\n'), QString::KeepEmptyParts); | 239 | const QStringList sl = es.split(QLatin1Char('\n'), QString::KeepEmptyParts); | ||
237 | #else | 240 | #else | ||
238 | const QStringList sl = es.split(QLatin1Char('\n'), Qt::KeepEmptyParts); | 241 | const QStringList sl = es.split(QLatin1Char('\n'), Qt::KeepEmptyParts); | ||
239 | #endif | 242 | #endif | ||
Show All 12 Lines | 252 | for (const QString &s2 : sl2) { | |||
252 | if (didConvert) { | 255 | if (didConvert) { | ||
253 | certErrors.append(error); | 256 | certErrors.append(error); | ||
254 | } | 257 | } | ||
255 | } | 258 | } | ||
256 | ret.append(certErrors); | 259 | ret.append(certErrors); | ||
257 | } | 260 | } | ||
258 | return ret; | 261 | return ret; | ||
259 | } | 262 | } | ||
263 | #endif | ||||
260 | 264 | | |||
261 | //static | 265 | //static | ||
262 | QList<QList<QSslError::SslError>> KSslInfoDialog::certificateErrorsFromString(const QString &errorsString) | 266 | QList<QList<QSslError::SslError>> KSslInfoDialog::certificateErrorsFromString(const QString &errorsString) | ||
263 | { | 267 | { | ||
264 | #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) | 268 | #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) | ||
265 | const QStringList sl = errorsString.split(QLatin1Char('\n'), QString::KeepEmptyParts); | 269 | const QStringList sl = errorsString.split(QLatin1Char('\n'), QString::KeepEmptyParts); | ||
266 | #else | 270 | #else | ||
267 | const QStringList sl = errorsString.split(QLatin1Char('\n'), Qt::KeepEmptyParts); | 271 | const QStringList sl = errorsString.split(QLatin1Char('\n'), Qt::KeepEmptyParts); | ||
Show All 21 Lines |