From de14a6ae530f450dc89493d0bc2f3d1100e4eeba Mon Sep 17 00:00:00 2001 From: Gurmeen Bindra Date: Tue, 14 Jul 2015 14:30:58 +0100 Subject: 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 = 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 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")); -- cgit v0.10.2-6-g49f6