summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/SASL/SCRAMSHA1ClientAuthenticator.h')
-rw-r--r--Swiften/SASL/SCRAMSHA1ClientAuthenticator.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/Swiften/SASL/SCRAMSHA1ClientAuthenticator.h b/Swiften/SASL/SCRAMSHA1ClientAuthenticator.h
new file mode 100644
index 0000000..d129468
--- /dev/null
+++ b/Swiften/SASL/SCRAMSHA1ClientAuthenticator.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "Swiften/Base/String.h"
+#include "Swiften/Base/ByteArray.h"
+
+namespace Swift {
+ class SCRAMSHA1ClientAuthenticator {
+ public:
+ SCRAMSHA1ClientAuthenticator(const String& authcid, const String& password, const String& authzid, const ByteArray& nonce);
+
+ ByteArray getMessage() const;
+ bool setResponse(const ByteArray&);
+
+ private:
+ ByteArray getInitialClientMessage() const;
+ ByteArray getSalt() const;
+ ByteArray getClientVerifier() const;
+
+ private:
+ enum Step {
+ Initial,
+ Proof
+ } step;
+ String authcid;
+ String password;
+ String authzid;
+ ByteArray clientnonce;
+ ByteArray initialServerMessage;
+ };
+}