summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGurmeen Bindra <gurmeen.bindra@isode.com>2015-07-14 13:30:58 (GMT)
committerGurmeen Bindra <gurmeen.bindra@isode.com>2015-07-20 14:47:03 (GMT)
commitde14a6ae530f450dc89493d0bc2f3d1100e4eeba (patch)
tree958e8bf566040cd9703b8c13ef9f994f95984336 /src
parenteeaac6c30d2bb24dd0b783cf13d056007a5b5ee3 (diff)
downloadstroke-de14a6ae530f450dc89493d0bc2f3d1100e4eeba.zip
stroke-de14a6ae530f450dc89493d0bc2f3d1100e4eeba.tar.bz2
Fix ClientSession class bug due to recent stroke changes
Stroke was brought in line with swiften as a result of which strong (certificate based bind) authentication between client and xmpp server stopped working. This was happening because of missing "=" in the <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='EXTERNAL'>=</auth> The AuthRequestSerialiser was not adding "=" because the ByteArray object that was passed was null. This patch fixes the ClientSession class to pass empty ByteArray object as is done in existing swiften code. Test-information: strong bind works using java client to xmpp server Change-Id: Ide2d61723d92df19a251db7f1eb9f1581329f782
Diffstat (limited to 'src')
-rw-r--r--src/com/isode/stroke/client/ClientSession.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/isode/stroke/client/ClientSession.java b/src/com/isode/stroke/client/ClientSession.java
index 9ceecf0..10a09f6 100644
--- a/src/com/isode/stroke/client/ClientSession.java
+++ b/src/com/isode/stroke/client/ClientSession.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2014 Isode Limited, London, England.
+ * Copyright (c) 2010-2015 Isode Limited, London, England.
* All rights reserved.
*/
/*
@@ -8,6 +8,7 @@
*/
package com.isode.stroke.client;
+import com.isode.stroke.base.ByteArray;
import com.isode.stroke.elements.AuthChallenge;
import com.isode.stroke.elements.AuthFailure;
import com.isode.stroke.elements.AuthRequest;
@@ -341,7 +342,7 @@ public class ClientSession {
if (stream.hasTLSCertificate()) {
if (streamFeatures.hasAuthenticationMechanism("EXTERNAL")) {
state = State.Authenticating;
- stream.writeElement(new AuthRequest("EXTERNAL"));
+ stream.writeElement(new AuthRequest("EXTERNAL",new ByteArray()));
}
else {
finishSession(Error.Type.TLSClientCertificateError);
@@ -349,7 +350,7 @@ public class ClientSession {
}
else if (streamFeatures.hasAuthenticationMechanism("EXTERNAL")) {
state = State.Authenticating;
- stream.writeElement(new AuthRequest("EXTERNAL"));
+ stream.writeElement(new AuthRequest("EXTERNAL",new ByteArray()));
}
else if (streamFeatures.hasAuthenticationMechanism("SCRAM-SHA-1") || streamFeatures.hasAuthenticationMechanism("SCRAM-SHA-1-PLUS")) {
final SCRAMSHA1ClientAuthenticator scramAuthenticator = new SCRAMSHA1ClientAuthenticator(UUID.randomUUID().toString(), streamFeatures.hasAuthenticationMechanism("SCRAM-SHA-1-PLUS"));