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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
/*
* Copyright (C) 2008-2012 The QXmpp developers
*
* Authors:
* Manjeet Dahiya
* Jeremy Lainé
*
* Source:
* http://code.google.com/p/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
#ifndef QXMPPSASLAUTH_P_H
#define QXMPPSASLAUTH_P_H
#include "QXmppStanza.h"
//
// W A R N I N G
// -------------
//
// This file is not part of the QXmpp API. It exists for the convenience
// of the QXmppSaslClient class. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
class QXmppSaslStanza : public QXmppStanza
{
public:
QXmppSaslStanza(const QString &type, const QByteArray &value = QByteArray());
QString type() const;
void setType(const QString &type);
QByteArray value() const;
void setValue(const QByteArray &value);
/// \cond
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
/// \endcond
private:
QString m_type;
QByteArray m_value;
};
class QXmppSaslAuth : public QXmppSaslStanza
{
public:
QXmppSaslAuth(const QString &mechanism = QString(), const QByteArray &value = QByteArray());
QString mechanism() const;
void setMechanism(const QString &mechanism);
/// \cond
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
/// \endcond
private:
QString m_mechanism;
};
class QXmppSaslChallenge : public QXmppSaslStanza
{
public:
QXmppSaslChallenge(const QByteArray &value = QByteArray());
};
class QXmppSaslFailure : public QXmppSaslStanza
{
public:
QXmppSaslFailure(const QString &condition = QString());
QString condition() const;
void setCondition(const QString &condition);
/// \cond
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
/// \endcond
private:
QString m_condition;
};
class QXmppSaslResponse : public QXmppSaslStanza
{
public:
QXmppSaslResponse(const QByteArray &value = QByteArray());
};
class QXmppSaslSuccess : public QXmppSaslStanza
{
public:
QXmppSaslSuccess();
};
class QXmppSaslClientAnonymous : public QXmppSaslClient
{
public:
QXmppSaslClientAnonymous(QObject *parent = 0);
QString mechanism() const;
bool respond(const QByteArray &challenge, QByteArray &response);
private:
int m_step;
};
class QXmppSaslClientDigestMd5 : public QXmppSaslClient
{
public:
QXmppSaslClientDigestMd5(QObject *parent = 0);
QString mechanism() const;
bool respond(const QByteArray &challenge, QByteArray &response);
private:
QXmppSaslDigestMd5 m_saslDigest;
int m_step;
};
class QXmppSaslClientFacebook : public QXmppSaslClient
{
public:
QXmppSaslClientFacebook(QObject *parent = 0);
QString mechanism() const;
bool respond(const QByteArray &challenge, QByteArray &response);
private:
int m_step;
};
class QXmppSaslClientPlain : public QXmppSaslClient
{
public:
QXmppSaslClientPlain(QObject *parent = 0);
QString mechanism() const;
bool respond(const QByteArray &challenge, QByteArray &response);
private:
int m_step;
};
class QXmppSaslServerAnonymous : public QXmppSaslServer
{
public:
QXmppSaslServerAnonymous(QObject *parent = 0);
QString mechanism() const;
Response respond(const QByteArray &challenge, QByteArray &response);
private:
int m_step;
};
class QXmppSaslServerDigestMd5 : public QXmppSaslServer
{
public:
QXmppSaslServerDigestMd5(QObject *parent = 0);
QString mechanism() const;
Response respond(const QByteArray &challenge, QByteArray &response);
private:
QXmppSaslDigestMd5 m_saslDigest;
int m_step;
};
class QXmppSaslServerFacebook : public QXmppSaslServer
{
public:
QXmppSaslServerFacebook(QObject *parent = 0);
QString mechanism() const;
Response respond(const QByteArray &challenge, QByteArray &response);
private:
int m_step;
};
class QXmppSaslServerPlain : public QXmppSaslServer
{
public:
QXmppSaslServerPlain(QObject *parent = 0);
QString mechanism() const;
Response respond(const QByteArray &challenge, QByteArray &response);
private:
int m_step;
};
#endif
|