summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-05-08 16:48:21 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-05-08 16:48:21 (GMT)
commitd233ec7a863fb0b9a6f20ea0aa52c7c0ea38e2fd (patch)
treeb0ff4203dc76d3995fbf696d0432f15d7f4916a9 /Swiften/Client
parent52bd37a759acc7edbd616c745ff64ac70ae41b9c (diff)
downloadswift-d233ec7a863fb0b9a6f20ea0aa52c7c0ea38e2fd.zip
swift-d233ec7a863fb0b9a6f20ea0aa52c7c0ea38e2fd.tar.bz2
Added DIGEST-MD5 client authenticator.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/ClientSession.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp
index 7fdb8ac..a255cef 100644
--- a/Swiften/Client/ClientSession.cpp
+++ b/Swiften/Client/ClientSession.cpp
@@ -29,6 +29,7 @@
#include "Swiften/Elements/ResourceBind.h"
#include "Swiften/SASL/PLAINClientAuthenticator.h"
#include "Swiften/SASL/SCRAMSHA1ClientAuthenticator.h"
+#include "Swiften/SASL/DIGESTMD5ClientAuthenticator.h"
#include "Swiften/Session/SessionStream.h"
namespace Swift {
@@ -107,6 +108,14 @@ void ClientSession::handleElement(boost::shared_ptr<Element> element) {
state = WaitingForCredentials;
onNeedCredentials();
}
+ else if (streamFeatures->hasAuthenticationMechanism("DIGEST-MD5")) {
+ std::ostringstream s;
+ s << boost::uuids::random_generator()();
+ // FIXME: Host should probably be the actual host
+ authenticator = new DIGESTMD5ClientAuthenticator(localJID.getDomain(), s.str());
+ state = WaitingForCredentials;
+ onNeedCredentials();
+ }
else if (streamFeatures->hasAuthenticationMechanism("PLAIN")) {
authenticator = new PLAINClientAuthenticator();
state = WaitingForCredentials;