diff options
| -rw-r--r-- | Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp | 3 | ||||
| -rw-r--r-- | Swiften/SASL/SConscript | 12 | ||||
| -rw-r--r-- | Swiften/SConscript | 5 |
3 files changed, 15 insertions, 5 deletions
diff --git a/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp b/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp index 15c8ab6..b0a9f96 100644 --- a/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp +++ b/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp @@ -5,12 +5,13 @@ #include <boost/lexical_cast.hpp> #include "Swiften/StringCodecs/SHA1.h" #include "Swiften/StringCodecs/Base64.h" #include "Swiften/StringCodecs/HMACSHA1.h" #include "Swiften/StringCodecs/PBKDF2.h" +#include "Swiften/StringPrep/StringPrep.h" namespace Swift { SCRAMSHA1ClientAuthenticator::SCRAMSHA1ClientAuthenticator(const String& nonce) : ClientAuthenticator("SCRAM-SHA-1"), step(Initial), clientnonce(nonce) { // TODO: Normalize authentication id // TODO: Normalize getPassword() @@ -84,13 +85,13 @@ std::map<char, String> SCRAMSHA1ClientAuthenticator::parseMap(const String& s) { result[key] = value; } return result; } ByteArray SCRAMSHA1ClientAuthenticator::getInitialBareClientMessage() const { - String authenticationID = getAuthenticationID(); + String authenticationID = StringPrep::getPrepared(getAuthenticationID(), StringPrep::SASLPrep); String escapedAuthenticationID; for (size_t i = 0; i < authenticationID.getUTF8Size(); ++i) { if (authenticationID[i] == ',') { escapedAuthenticationID += "=2C"; } else if (authenticationID[i] == '=') { diff --git a/Swiften/SASL/SConscript b/Swiften/SASL/SConscript new file mode 100644 index 0000000..22b242e --- /dev/null +++ b/Swiften/SASL/SConscript @@ -0,0 +1,12 @@ +Import("swiften_env") + +myenv = swiften_env.Clone() +myenv.MergeFlags(swiften_env["LIBIDN_FLAGS"]) + +objects = myenv.StaticObject([ + "ClientAuthenticator.cpp", + "PLAINClientAuthenticator.cpp", + "PLAINMessage.cpp", + "SCRAMSHA1ClientAuthenticator.cpp", + ]) +swiften_env.Append(SWIFTEN_OBJECTS = [objects]) diff --git a/Swiften/SConscript b/Swiften/SConscript index af3ac97..6189b2e 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -39,16 +39,12 @@ sources = [ "Queries/Request.cpp", "Queries/Responders/DiscoInfoResponder.cpp", "Queries/Responders/SoftwareVersionResponder.cpp", "Roster/ContactRosterItem.cpp", "Roster/Roster.cpp", "Roster/XMPPRoster.cpp", - "SASL/ClientAuthenticator.cpp", - "SASL/PLAINClientAuthenticator.cpp", - "SASL/PLAINMessage.cpp", - "SASL/SCRAMSHA1ClientAuthenticator.cpp", "Serializer/AuthRequestSerializer.cpp", "Serializer/AuthChallengeSerializer.cpp", "Serializer/AuthResponseSerializer.cpp", "Serializer/CompressRequestSerializer.cpp", "Serializer/ElementSerializer.cpp", "Serializer/MessageSerializer.cpp", @@ -92,12 +88,13 @@ sources = [ if myenv.get("HAVE_OPENSSL", 0) : sources += ["TLS/OpenSSL/OpenSSLContext.cpp"] SConscript(dirs = [ "Base", "StringPrep", + "SASL", "Application", "EventLoop", "Parser", "JID", "Network", "History", |
Swift