class SASL

SASL authentication mechanism. More...

Full nameTelEngine::SASL
Definition#include <libs/yjabber/yatejabber.h>
InheritsTelEngine::GenObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Public Members


Detailed Description

This class handles PLAIN (rfc 4616) and DIGEST (rfc 2831) SASL authentication

 SASL (bool plain, const char* realm = 0)

SASL

Constructor

Parameters:
plainTrue to build a plain password auth object
realmOptional server realm

 ~SASL ()

~SASL

Destructor

void  setAuthParams (const char* user = 0, const char* pwd = 0)

setAuthParams

Set auth params

Parameters:
userOptional username
pwdOptional password

bool  buildAuthRsp (String& buf, const char* digestUri = 0)

buildAuthRsp

Build a client initial auth or challenge response

Parameters:
bufDestination buffer. It will be filled with Base64 encoded result
digestUriDigest MD5 URI

Returns: True on success

inline void  buildAuthRspReply (String& buf, const String& rsp)

buildAuthRspReply

Build a server reply to challenge response

Parameters:
bufDestination buffer. It will be filled with Base64 encoded result
rspThe response

inline bool  validAuthReply (const String& reply)

validAuthReply

Check if a challenge response reply is valid

Parameters:
replyThe reply to check

Returns: True if valid

bool  buildMD5Challenge (String& buf)

buildMD5Challenge

Build an MD5 challenge from this object. Generate a new nonce and increase nonce count

Parameters:
bufDestination buffer

Returns: True on success

inline void  buildMD5Digest (String& dest, const char* password, bool challengeRsp = true)

buildMD5Digest

Build a Digest MD5 SASL (RFC 2831) to be sent with authentication responses

Parameters:
destDestination string
passwordThe password to use
challengeRspTrue if building a Digest MD5 challenge response, false if building a challenge response reply

bool  parsePlain (const DataBlock& buf)

parsePlain

Parse plain password auth data

Parameters:
bufThe buffer to parse

Returns: True if succesfully parsed

bool  parseMD5Challenge (const String& buf)

parseMD5Challenge

Parse and decode a buffer containing a SASL Digest MD5 challenge.

Parameters:
bufAlready checked for valid UTF8 characters input string

Returns: True on success

bool  parseMD5ChallengeRsp (const String& buf)

parseMD5ChallengeRsp

Parse and decode a buffer containing a SASL Digest MD5 response. Check realm, nonce and nonce count

Parameters:
bufAlready checked for valid UTF8 characters input string

Returns: True on success

bool  parsePlain (const DataBlock& buf, String& user, String& pwd, String* authzid = 0)

parsePlain

[static]

Parse and decode a buffer containing SASL plain authentication data as defined in RFC 4616

Parameters:
bufInput buffer
userDestination buffer for username part
pwdDestination buffer for password part
authzidOptional destination buffer for authorization identity part

Returns: True on success

void  buildMD5Digest (String& dest, const NamedList& params, const char* password, bool challengeRsp = true)

buildMD5Digest

[static]

Build a Digest MD5 SASL (RFC 2831) to be sent with authentication responses

Parameters:
destDestination string
paramsList of parameters
passwordThe password to use
challengeRspTrue if building a Digest MD5 challenge response, false if building a challenge response reply

bool m_plain

m_plain

NamedList* m_params

m_params

String m_realm

m_realm

String m_nonce

m_nonce

String m_cnonce

m_cnonce

unsigned int m_nonceCount

m_nonceCount


Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.