Yate
|
SASL authentication mechanism. More...
#include <yatejabber.h>
Public Member Functions | |
SASL (bool plain, const char *realm=0) | |
~SASL () | |
void | setAuthParams (const char *user=0, const char *pwd=0) |
bool | buildAuthRsp (String &buf, const char *digestUri=0) |
void | buildAuthRspReply (String &buf, const String &rsp) |
bool | validAuthReply (const String &reply) |
bool | buildMD5Challenge (String &buf) |
void | buildMD5Digest (String &dest, const char *password, bool challengeRsp=true) |
bool | parsePlain (const DataBlock &buf) |
bool | parseMD5Challenge (const String &buf) |
bool | parseMD5ChallengeRsp (const String &buf) |
Static Public Member Functions | |
static bool | parsePlain (const DataBlock &buf, String &user, String &pwd, String *authzid=0) |
static void | buildMD5Digest (String &dest, const NamedList ¶ms, const char *password, bool challengeRsp=true) |
Public Attributes | |
bool | m_plain |
NamedList * | m_params |
String | m_realm |
String | m_nonce |
String | m_cnonce |
unsigned int | m_nonceCount |
SASL authentication mechanism.
This class handles PLAIN (rfc 4616) and DIGEST (rfc 2831) SASL authentication
SASL | ( | bool | plain, |
const char * | realm = 0 |
||
) |
Constructor
plain | True to build a plain password auth object |
realm | Optional server realm |
~SASL | ( | ) | [inline] |
Destructor
References TelEngine::destruct().
bool buildAuthRsp | ( | String & | buf, |
const char * | digestUri = 0 |
||
) |
void buildAuthRspReply | ( | String & | buf, |
const String & | rsp | ||
) | [inline] |
Build a server reply to challenge response
buf | Destination buffer. It will be filled with Base64 encoded result |
rsp | The response |
References String::c_str(), Base64::encode(), and String::length().
bool buildMD5Challenge | ( | String & | buf | ) |
Build an MD5 challenge from this object. Generate a new nonce and increase nonce count
buf | Destination buffer |
void buildMD5Digest | ( | String & | dest, |
const char * | password, | ||
bool | challengeRsp = true |
||
) | [inline] |
static void buildMD5Digest | ( | String & | dest, |
const NamedList & | params, | ||
const char * | password, | ||
bool | challengeRsp = true |
||
) | [static] |
bool parseMD5Challenge | ( | const String & | buf | ) |
bool parseMD5ChallengeRsp | ( | const String & | buf | ) |
bool parsePlain | ( | const DataBlock & | buf | ) |
Parse plain password auth data
buf | The buffer to parse |
static bool parsePlain | ( | const DataBlock & | buf, |
String & | user, | ||
String & | pwd, | ||
String * | authzid = 0 |
||
) | [static] |
Parse and decode a buffer containing SASL plain authentication data as defined in RFC 4616
buf | Input buffer |
user | Destination buffer for username part |
pwd | Destination buffer for password part |
authzid | Optional destination buffer for authorization identity part |
void setAuthParams | ( | const char * | user = 0 , |
const char * | pwd = 0 |
||
) |
Set auth params
user | Optional username |
pwd | Optional password |
bool validAuthReply | ( | const String & | reply | ) | [inline] |
Check if a challenge response reply is valid
reply | The reply to check |