summaryrefslogtreecommitdiffstats
blob: 161afd1e1568dcb0932c0f63f2b081c76c37cad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include "Swiften/Base/String.h"
#include "Swiften/Base/ByteArray.h"
#include "Swiften/SASL/ClientAuthenticator.h"

namespace Swift {
	class SCRAMSHA1ClientAuthenticator : public ClientAuthenticator {
		public:
			SCRAMSHA1ClientAuthenticator(const ByteArray& nonce);
			
			ByteArray getResponse() const;
			bool setChallenge(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;
	};
}