Schannel: Get rid of Windows < 10 code

No need to check if we're running on windows 8.1 or above.
We always are.

Pick-to: 6.2
Change-Id: I9f2e7a58631064e573725705882a603e900c7e39
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Mårten Nordheim 2021-06-24 18:57:12 +02:00
parent 773b37fb38
commit 43a36dfd81

View File

@ -289,8 +289,10 @@ QList<QSsl::SupportedFeature> QSchannelBackend::supportedFeatures() const
{ {
QList<QSsl::SupportedFeature> features; QList<QSsl::SupportedFeature> features;
#ifdef SUPPORTS_ALPN
features << QSsl::SupportedFeature::ClientSideAlpn; features << QSsl::SupportedFeature::ClientSideAlpn;
features << QSsl::SupportedFeature::ServerSideAlpn; features << QSsl::SupportedFeature::ServerSideAlpn;
#endif
return features; return features;
} }
@ -632,15 +634,10 @@ Required const_reinterpret_cast(Actual *p)
} }
#ifdef SUPPORTS_ALPN #ifdef SUPPORTS_ALPN
bool supportsAlpn()
{
return QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8_1;
}
QByteArray createAlpnString(const QByteArrayList &nextAllowedProtocols) QByteArray createAlpnString(const QByteArrayList &nextAllowedProtocols)
{ {
QByteArray alpnString; QByteArray alpnString;
if (!nextAllowedProtocols.isEmpty() && supportsAlpn()) { if (!nextAllowedProtocols.isEmpty()) {
const QByteArray names = [&nextAllowedProtocols]() { const QByteArray names = [&nextAllowedProtocols]() {
QByteArray protocolString; QByteArray protocolString;
for (QByteArray proto : nextAllowedProtocols) { for (QByteArray proto : nextAllowedProtocols) {
@ -1323,7 +1320,7 @@ bool TlsCryptographSchannel::verifyHandshake()
#ifdef SUPPORTS_ALPN #ifdef SUPPORTS_ALPN
const auto allowedProtos = configuration.allowedNextProtocols(); const auto allowedProtos = configuration.allowedNextProtocols();
if (!allowedProtos.isEmpty() && supportsAlpn()) { if (!allowedProtos.isEmpty()) {
SecPkgContext_ApplicationProtocol alpn; SecPkgContext_ApplicationProtocol alpn;
status = QueryContextAttributes(&contextHandle, status = QueryContextAttributes(&contextHandle,
SECPKG_ATTR_APPLICATION_PROTOCOL, SECPKG_ATTR_APPLICATION_PROTOCOL,