summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMili Verma <mili.verma@isode.com>2015-06-22 13:06:58 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-06-30 07:06:06 (GMT)
commita3564b7aca44f5ccab3881e6f723dfb64bf66884 (patch)
treeb92c151a77842d521615c9c5e9b5a4bfb70ea477
parent394642c69bc232429621e209b787d3496967b37b (diff)
downloadswift-a3564b7aca44f5ccab3881e6f723dfb64bf66884.zip
swift-a3564b7aca44f5ccab3881e6f723dfb64bf66884.tar.bz2
Remove when sending an empty response
In RFC 6120, there are only 2 places where "=" is allowed - in the initial client auth and in the final server success response. While testing challenge response exchanges in Kerberos, it was seen that Swift was adding an '=' in other empty responses. This patch fixes it by sending an empty response instead of an '='. Test-information: Tested on Windows using a WIP GSSAPI authentication exchange with M-Link. Change-Id: I1f82bddbd1380361cbe43e45a2804156249582ae
-rw-r--r--Swiften/Serializer/AuthResponseSerializer.cpp4
-rw-r--r--Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Serializer/AuthResponseSerializer.cpp b/Swiften/Serializer/AuthResponseSerializer.cpp
index 9c9418b..818c6d4 100644
--- a/Swiften/Serializer/AuthResponseSerializer.cpp
+++ b/Swiften/Serializer/AuthResponseSerializer.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2014 Isode Limited. 2 * Copyright (c) 2010-2015 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -22,7 +22,7 @@ SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr<ToplevelElemen
22 boost::optional<SafeByteArray> message = authResponse->getValue(); 22 boost::optional<SafeByteArray> message = authResponse->getValue();
23 if (message) { 23 if (message) {
24 if ((*message).empty()) { 24 if ((*message).empty()) {
25 value = createSafeByteArray("="); 25 value = createSafeByteArray("");
26 } 26 }
27 else { 27 else {
28 value = Base64::encode(*message); 28 value = Base64::encode(*message);
diff --git a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
index 65508d0..4dfb04d 100644
--- a/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
+++ b/Swiften/Serializer/UnitTest/AuthResponseSerializerTest.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010 Isode Limited. 2 * Copyright (c) 2010-2015 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -49,7 +49,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
49 49
50 CPPUNIT_ASSERT_EQUAL(createSafeByteArray( 50 CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
51 "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">" 51 "<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
52 "=" 52 ""
53 "</response>"), testling.serialize(authResponse)); 53 "</response>"), testling.serialize(authResponse));
54 } 54 }
55}; 55};