diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2023-10-23 13:28:25 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2023-11-15 13:18:09 +0200 |
commit | 668ce80e9e0c37823312c4ebf3d11194a509f0ff (patch) | |
tree | e46c1a913cbbdef2c4cf235325e6ab9222af1f40 /src/plugins/tls | |
parent | cc4834c0b975300e9405fa001f917199dd41139c (diff) |
Schannel: change UNREACHABLE into error-handling
Because it happens in some (unknown precondition) cases.
While it would be nice to know what the client is doing to trigger this,
it's not worth crashing over in the meantime.
Fixes: QTBUG-118458
Pick-to: 6.6 6.5 6.2
Change-Id: I261a17578e7cd3a95e591a3228b33561000fd336
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/tls')
-rw-r--r-- | src/plugins/tls/schannel/qtls_schannel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/tls/schannel/qtls_schannel.cpp b/src/plugins/tls/schannel/qtls_schannel.cpp index 98856288d4..d42aea42d0 100644 --- a/src/plugins/tls/schannel/qtls_schannel.cpp +++ b/src/plugins/tls/schannel/qtls_schannel.cpp @@ -1916,8 +1916,12 @@ void TlsCryptographSchannel::transmit() qCWarning(lcTlsBackendSchannel, "The internal SSPI handle is invalid!"); Q_UNREACHABLE(); } else if (status == SEC_E_INVALID_TOKEN) { - qCWarning(lcTlsBackendSchannel, "Got SEC_E_INVALID_TOKEN!"); - Q_UNREACHABLE(); // Happened once due to a bug, but shouldn't generally happen(?) + // Supposedly we have an invalid token, it's under-documented what + // this means, so to be safe we disconnect. + shutdown = true; + disconnectFromHost(); + setErrorAndEmit(d, QAbstractSocket::SslInternalError, schannelErrorToString(status)); + break; } else if (status == SEC_E_MESSAGE_ALTERED) { // The message has been altered, disconnect now. shutdown = true; // skips sending the shutdown alert |