From e9bdc38536488b76e5e3a715961a94085302cc15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Thu, 19 Nov 2009 20:25:56 +0100
Subject: Added HMAC-SHA1 and SCRAM-SHA1 implementations.

We don't authenticate with SCRAM-SHA1 yet.

diff --git a/Swiften/Base/ByteArray.h b/Swiften/Base/ByteArray.h
index ea96d09..ab256a4 100644
--- a/Swiften/Base/ByteArray.h
+++ b/Swiften/Base/ByteArray.h
@@ -56,6 +56,13 @@ namespace Swift {
 				return result;
 			}
 
+			friend ByteArray operator+(const ByteArray& a, char b) {
+				ByteArray x;
+				x.resize(1);
+				x[0] = b;
+				return a + x;
+			}
+
 			ByteArray& operator+=(const ByteArray& b) {
 				data_.insert(data_.end(), b.data_.begin(), b.data_.end());
 				return *this;
diff --git a/Swiften/SConscript b/Swiften/SConscript
index 6ebc865..039856e 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -43,6 +43,7 @@ sources = [
 		"Roster/Roster.cpp",
 		"Roster/XMPPRoster.cpp",
 		"SASL/PLAINMessage.cpp",
+		"SASL/SCRAMSHA1ClientAuthenticator.cpp",
 		"Serializer/AuthRequestSerializer.cpp",
 		"Serializer/CompressRequestSerializer.cpp",
 		"Serializer/ElementSerializer.cpp",
@@ -79,6 +80,7 @@ sources = [
 		"Session/BasicSessionStream.cpp",
 		"StringCodecs/Base64.cpp",
 		"StringCodecs/SHA1.cpp",
+		"StringCodecs/HMACSHA1.cpp",
 	]
 # "Notifier/GrowlNotifier.cpp",
 
@@ -179,4 +181,5 @@ env.Append(UNITTEST_SOURCES = [
 		File("StreamStack/UnitTest/XMPPLayerTest.cpp"),
 		File("StringCodecs/UnitTest/Base64Test.cpp"),
 		File("StringCodecs/UnitTest/SHA1Test.cpp"),
+		File("StringCodecs/UnitTest/HMACSHA1Test.cpp"),
 	])
-- 
cgit v0.10.2-6-g49f6