Port ssl_cert_errors meta data from KSslError to QSslError
ClosedPublic

Authored by vkrause on Oct 27 2019, 9:12 AM.

Details

Summary

The TCPSlaveBase side of this can be fully ported to QSslError once D24928
is in.

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vkrause created this revision.Oct 27 2019, 9:12 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 27 2019, 9:12 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
vkrause requested review of this revision.Oct 27 2019, 9:12 AM
nicolasfella accepted this revision.Nov 8 2019, 6:22 PM
nicolasfella added a subscriber: nicolasfella.

Code looks sane to me and builds. Haven't done any testing though

This revision is now accepted and ready to land.Nov 8 2019, 6:22 PM
ahmadsamir added inline comments.
src/widgets/jobuidelegate.cpp
365

Nitpick, wouldn't QLatin1String be better here?

c.f. Marc Mutz's talk about QStringLiteral and QLatin1String: https://youtu.be/Ov7s0GgBbOQ?t=2806

src/widgets/ksslinfodialog.cpp
263–283

Nitpick, shouldn't there be a "// static" comment like the other method?

Wouldn't a QVector be better here (QVector<QList<QSslError::SslError>>)? that is IIUC what the QList docs and [1] are saying.

[1]https://marcmutz.wordpress.com/effective-qt/containers/

vkrause added inline comments.Nov 9 2019, 10:42 AM
src/widgets/jobuidelegate.cpp
365

sslMetaData is a QMap<QString, ...>, ie. value() has no QLatin1String overload, calling it with a QLatin1String will work but convert to a QString at runtime (involving a memory allocation), using QStringLiteral avoids that.

src/widgets/ksslinfodialog.cpp
263–283

In theory, yes. However, changing this here and now would trigger quite some ripple effect through the code, which currently is using QList everywhere, so I'd suggest to do that as a separate change (if at all), to not hide security-relevant changes under lots of QList -> QVector porting noise. The other thing to consider the consistency in this code if we change just a single use from QList to QVector, especially if that's not a performance-sensitive path and Qt6 is supposed to change all this anyway (QList's implementation going away).

ahmadsamir added inline comments.Nov 9 2019, 3:13 PM
src/widgets/jobuidelegate.cpp
365

Right, value() is what matters here, thanks for explaining.

src/widgets/ksslinfodialog.cpp
263–283

OK, thanks for explaining.

(But I think there still should be a "// static" comment for that method).

vkrause updated this revision to Diff 69514.Nov 10 2019, 9:42 AM

add comment requested during review

vkrause updated this revision to Diff 69526.Nov 10 2019, 3:50 PM

rebase to latest master

nicolasfella added inline comments.Nov 10 2019, 4:04 PM
src/widgets/ksslinfodialog.h
113–123

Shouldn't this be 65 now?

vkrause updated this revision to Diff 69531.Nov 10 2019, 4:16 PM

bump deprecation version

nicolasfella added inline comments.Nov 10 2019, 4:17 PM
src/widgets/ksslinfodialog.h
113–123

You missed a spot

vkrause updated this revision to Diff 69534.Nov 10 2019, 4:22 PM

bump the right version numbers, sorry

nicolasfella accepted this revision.Nov 10 2019, 4:23 PM
This revision was automatically updated to reflect the committed changes.