diff options
author | Gurmeen Bindra <gurmeen.bindra@isode.com> | 2015-09-09 10:17:12 (GMT) |
---|---|---|
committer | Gurmeen Bindra <gurmeen.bindra@isode.com> | 2015-11-04 11:29:29 (GMT) |
commit | 8405fa16b738b6ef6a5920cd9d0f5735f8b62369 (patch) | |
tree | 4f028e3c4d12c45d2a88d0372145a0dad1f57ffe /Sluift | |
parent | 87ff0cf5d0efcda674bbeb0aec306e92c7527ac5 (diff) | |
download | swift-8405fa16b738b6ef6a5920cd9d0f5735f8b62369.zip swift-8405fa16b738b6ef6a5920cd9d0f5735f8b62369.tar.bz2 |
Fix swiften handling when client certificate is missing
This patch prevents SWIFTEN from logging in if provided with a missing PKCS12 file.
Before this patch, swiften would attempt a password based login using operator JID
and pwd of the P12 file when the P12 file was missing.
This patch fixes it by checking the certificate and not initialising session stream
and connection if the certificate is empty. It emits a disconnect with client
certificate load error. The string for certificate load error has been modified to
indicate a file or password invalid.
Test-information:
Tested by doing a certificate based bind to an XMPP server. Removed the PKCS#12
file and checked that swift gave a certificate error instead of doing pwd connect
Change-Id: I1869a13f1f7135b6606f7383cd4a0356ffd6931b
Diffstat (limited to 'Sluift')
-rw-r--r-- | Sluift/Helpers.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Sluift/Helpers.cpp b/Sluift/Helpers.cpp index 9819f76..12d2f8f 100644 --- a/Sluift/Helpers.cpp +++ b/Sluift/Helpers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 Isode Limited. + * Copyright (c) 2013-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -31,7 +31,7 @@ std::string Swift::getErrorString(const ClientError& error) { case ClientError::SessionStartError: reason += "Error starting session"; break; case ClientError::StreamError: reason += "Stream error"; break; case ClientError::TLSError: reason += "Encryption error"; break; - case ClientError::ClientCertificateLoadError: reason += "Error loading certificate (Invalid password?)"; break; + case ClientError::ClientCertificateLoadError: reason += "Error loading certificate (Invalid file or password?)"; break; case ClientError::ClientCertificateError: reason += "Certificate not authorized"; break; case ClientError::UnknownCertificateError: reason += "Unknown certificate"; break; case ClientError::CertificateCardRemoved: reason += "Certificate card removed"; break; |