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 /Swiften/Serializer
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
Diffstat (limited to 'Swiften/Serializer')
-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 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -22,7 +22,7 @@ SafeByteArray AuthResponseSerializer::serialize(boost::shared_ptr<ToplevelElemen
boost::optional<SafeByteArray> message = authResponse->getValue();
if (message) {
if ((*message).empty()) {
- value = createSafeByteArray("=");
+ value = createSafeByteArray("");
}
else {
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 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -49,7 +49,7 @@ class AuthResponseSerializerTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(createSafeByteArray(
"<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"
- "="
+ ""
"</response>"), testling.serialize(authResponse));
}
};