gsasl  2.2.1
Functions
xstep.c File Reference
#include <config.h>
#include "internal.h"

Go to the source code of this file.

Functions

int gsasl_step (Gsasl_session *sctx, const char *input, size_t input_len, char **output, size_t *output_len)
 
int gsasl_step64 (Gsasl_session *sctx, const char *b64input, char **b64output)
 

Function Documentation

◆ gsasl_step()

int gsasl_step ( Gsasl_session sctx,
const char *  input,
size_t  input_len,
char **  output,
size_t *  output_len 
)

gsasl_step:

Parameters
sctxlibgsasl session handle.
inputinput byte array.
input_lensize of input byte array.
outputnewly allocated output byte array.
output_lenpointer to output variable with size of output byte array.

Perform one step of SASL authentication. This reads data from the other end (from @input and @input_len), processes it (potentially invoking callbacks to the application), and writes data to server (into newly allocated variable @output and @output_len that indicate the length of @output).

The contents of the @output buffer is unspecified if this functions returns anything other than GSASL_OK or GSASL_NEEDS_MORE. If this function return GSASL_OK or GSASL_NEEDS_MORE, however, the @output buffer is allocated by this function, and it is the responsibility of caller to deallocate it by calling gsasl_free(@output).

Return value: Returns GSASL_OK if authenticated terminated successfully, GSASL_NEEDS_MORE if more data is needed, or error code.

Definition at line 52 of file xstep.c.

◆ gsasl_step64()

int gsasl_step64 ( Gsasl_session sctx,
const char *  b64input,
char **  b64output 
)

gsasl_step64:

Parameters
sctxlibgsasl client handle.
b64inputinput base64 encoded byte array.
b64outputnewly allocated output base64 encoded byte array.

This is a simple wrapper around gsasl_step() that base64 decodes the input and base64 encodes the output.

The contents of the @b64output buffer is unspecified if this functions returns anything other than GSASL_OK or GSASL_NEEDS_MORE. If this function return GSASL_OK or GSASL_NEEDS_MORE, however, the @b64output buffer is allocated by this function, and it is the responsibility of caller to deallocate it by calling gsasl_free(@b64output).

Return value: Returns GSASL_OK if authenticated terminated successfully, GSASL_NEEDS_MORE if more data is needed, or error code.

Definition at line 87 of file xstep.c.