summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2017-10-13 13:06:38 (GMT)
committerKevin Smith <git@kismith.co.uk>2017-10-13 13:26:28 (GMT)
commit80ef26c165a08d5251d7ee56e0bd07b86fc82f55 (patch)
tree5d45482a4088f3fe473db0ae850596d4da2480fc
parent7c6ebccaea10689d791c1c2f2488fcd60a44db0c (diff)
downloadswift-80ef26c165a08d5251d7ee56e0bd07b86fc82f55.zip
swift-80ef26c165a08d5251d7ee56e0bd07b86fc82f55.tar.bz2
Don't require servers to advertise an SSO domain
This doesn't change the behaviour where domain is advertised, but does mean that SSO can be attempted where the hostname isn't advertised, where previously it would be refused. Test-Information: Light testing (not by me) against M-Link not advertising hostname. I think this is sufficient, given this is an experimental feature, hidden behind a config flag, and this only extends behaviour, rather than changing previously supported paths. (The tested version was with a ternary instead of value_or) Change-Id: I381fe23ab152486b195acff5858bf0a705b86b59
-rw-r--r--Swiften/Client/ClientSession.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp
index 661a832..bb9be58 100644
--- a/Swiften/Client/ClientSession.cpp
+++ b/Swiften/Client/ClientSession.cpp
@@ -231,13 +231,13 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
#ifdef SWIFTEN_PLATFORM_WIN32
if (singleSignOn) {
const boost::optional<std::string> authenticationHostname = streamFeatures->getAuthenticationHostname();
- bool gssapiSupported = streamFeatures->hasAuthenticationMechanism("GSSAPI") && authenticationHostname && !authenticationHostname->empty();
+ bool gssapiSupported = streamFeatures->hasAuthenticationMechanism("GSSAPI");
if (!gssapiSupported) {
finishSession(Error::NoSupportedAuthMechanismsError);
}
else {
- WindowsGSSAPIClientAuthenticator* gssapiAuthenticator = new WindowsGSSAPIClientAuthenticator(*authenticationHostname, localJID.getDomain(), authenticationPort);
+ WindowsGSSAPIClientAuthenticator* gssapiAuthenticator = new WindowsGSSAPIClientAuthenticator(authenticationHostname.value_or(""), localJID.getDomain(), authenticationPort);
std::shared_ptr<Error> error = std::make_shared<Error>(Error::AuthenticationFailedError);
authenticator = gssapiAuthenticator;