VMime
builtinSASLMechanism Class Reference

#include <builtinSASLMechanism.hpp>

Inheritance diagram for builtinSASLMechanism:
Collaboration diagram for builtinSASLMechanism:

Public Member Functions

 builtinSASLMechanism (shared_ptr< SASLContext > ctx, const string &name)
 ~builtinSASLMechanism ()
const string getName () const
bool step (shared_ptr< SASLSession > sess, const byte_t *challenge, const size_t challengeLen, byte_t **response, size_t *responseLen)
bool isComplete () const
bool hasInitialResponse () const
void encode (shared_ptr< SASLSession > sess, const byte_t *input, const size_t inputLen, byte_t **output, size_t *outputLen)
void decode (shared_ptr< SASLSession > sess, const byte_t *input, const size_t inputLen, byte_t **output, size_t *outputLen)

Additional Inherited Members

Protected Member Functions inherited from object
 object ()
 object (const object &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

A built-in authentication mechanism that relies on the GNU SASL library.

Constructor & Destructor Documentation

◆ builtinSASLMechanism()

builtinSASLMechanism ( shared_ptr< SASLContext > ctx,
const string & name )

◆ ~builtinSASLMechanism()

Member Function Documentation

◆ decode()

void decode ( shared_ptr< SASLSession > sess,
const byte_t * input,
const size_t inputLen,
byte_t ** output,
size_t * outputLen )
virtual

Decode data according to negotiated SASL mechanism.

This might mean that data is integrity or privacy protected.

Parameters
sessSASL session
inputinput buffer
inputLenlength of input buffer
outputoutput buffer (allocated bu the function, free with delete[])
outputLenlength of output buffer
Exceptions
exceptions::sasl_exceptionif an error occurred during the encoding of data (in this case, the values in 'output' and 'outputLen' are undetermined)

Implements SASLMechanism.

◆ encode()

void encode ( shared_ptr< SASLSession > sess,
const byte_t * input,
const size_t inputLen,
byte_t ** output,
size_t * outputLen )
virtual

Encode data according to negotiated SASL mechanism.

This might mean that data is integrity or privacy protected.

Parameters
sessSASL session
inputinput buffer
inputLenlength of input buffer
outputoutput buffer (allocated bu the function, free with delete[])
outputLenlength of output buffer
Exceptions
exceptions::sasl_exceptionif an error occurred during the encoding of data (in this case, the values in 'output' and 'outputLen' are undetermined)

Implements SASLMechanism.

◆ getName()

const string getName ( ) const
virtual

Return the name of this mechanism.

Returns
mechanism name

Implements SASLMechanism.

◆ hasInitialResponse()

bool hasInitialResponse ( ) const
virtual

Determine if this mechanism has an optional initial response.

If true, caller should call step() with an empty challenge to get the initial response.

Returns
true if this mechanism has an initial response, or false otherwise

Implements SASLMechanism.

◆ isComplete()

bool isComplete ( ) const
virtual

Check whether authentication has completed.

If false, more calls to evaluateChallenge() are needed to complete the authentication process).

Returns
true if the authentication has finished, or false otherwise

Implements SASLMechanism.

◆ step()

bool step ( shared_ptr< SASLSession > sess,
const byte_t * challenge,
const size_t challengeLen,
byte_t ** response,
size_t * responseLen )
virtual

Perform one step of SASL authentication.

Accept data from the server (challenge), process it and return data to be returned in response to the server.

If the challenge is empty (challengeLen == 0), the initial response is returned, if this mechanism has one.

Parameters
sessSASL session
challengechallenge sent from the server
challengeLenlength of challenge
responseresponse to send to the server (allocated by this function, free with delete[])
responseLenlength of response buffer
Returns
true if authentication terminated successfully, or false if the authentication process should continue
Exceptions
exceptions::sasl_exceptionif an error occurred during authentication (in this case, the values in 'response' and 'responseLen' are undetermined)

Implements SASLMechanism.


The documentation for this class was generated from the following files: