wocky-sasl-handler

wocky-sasl-handler

Synopsis

                    WockySaslHandler;
gboolean            (*WockySaslSuccessFunc)             (WockySaslHandler *handler,
                                                         GError **error);
void                wocky_sasl_handler_free             (WockySaslHandler *handler);
const gchar *       wocky_sasl_handler_get_mechanism    (WockySaslHandler *handler);
gboolean            wocky_sasl_handler_is_plain         (WockySaslHandler *handler);
gboolean            wocky_sasl_handler_handle_success   (WockySaslHandler *handler,
                                                         GError **error);
                    WockySaslHandlerIface;
gboolean            wocky_sasl_handler_get_initial_response
                                                        (WockySaslHandler *handler,
                                                         gchar **initial_data,
                                                         GError **error);
gboolean            wocky_sasl_handler_handle_auth_data (WockySaslHandler *handler,
                                                         const gchar *data,
                                                         gchar **response,
                                                         GError **error);
gboolean            (*WockySaslInitialResponseFunc)     (WockySaslHandler *handler,
                                                         gchar **initial_data,
                                                         GError **error);
gboolean            (*WockySaslAuthDataFunc)            (WockySaslHandler *handler,
                                                         const gchar *data,
                                                         gchar **response,
                                                         GError **error);

Object Hierarchy

  GInterface
   +----WockySaslHandler

Prerequisites

WockySaslHandler requires GObject.

Description

Details

WockySaslHandler

typedef struct _WockySaslHandler WockySaslHandler;


WockySaslSuccessFunc ()

gboolean            (*WockySaslSuccessFunc)             (WockySaslHandler *handler,
                                                         GError **error);

Called when a <success></success> stanza is received during authentication. If no error is returned, then authentication is considered finished. (Typically, an error is only raised if the <success></success> stanza was received earlier than expected)

handler :

error :

Returns :


wocky_sasl_handler_free ()

void                wocky_sasl_handler_free             (WockySaslHandler *handler);

handler :


wocky_sasl_handler_get_mechanism ()

const gchar *       wocky_sasl_handler_get_mechanism    (WockySaslHandler *handler);

handler :

Returns :


wocky_sasl_handler_is_plain ()

gboolean            wocky_sasl_handler_is_plain         (WockySaslHandler *handler);

handler :

Returns :


wocky_sasl_handler_handle_success ()

gboolean            wocky_sasl_handler_handle_success   (WockySaslHandler *handler,
                                                         GError **error);

handler :

error :

Returns :


WockySaslHandlerIface

typedef struct {
    GTypeInterface parent;
    gchar *mechanism;
    gboolean plain;
    WockySaslInitialResponseFunc initial_response_func;
    WockySaslAuthDataFunc auth_data_func;
    WockySaslSuccessFunc success_func;
} WockySaslHandlerIface;

GTypeInterface parent;

The parent interface.

gchar *mechanism;

The SASL mechanism which this handler responds to challenges for.

gboolean plain;

Whether the mechanism this handler handles sends secrets in plaintext.

WockySaslInitialResponseFunc initial_response_func;

Called when the initial <auth></auth> stanza is generated

WockySaslAuthDataFunc auth_data_func;

Called when any authentication data from the server is received

WockySaslSuccessFunc success_func;

Called when a <success></success> stanza is received.

wocky_sasl_handler_get_initial_response ()

gboolean            wocky_sasl_handler_get_initial_response
                                                        (WockySaslHandler *handler,
                                                         gchar **initial_data,
                                                         GError **error);

handler :

initial_data :

error :

Returns :


wocky_sasl_handler_handle_auth_data ()

gboolean            wocky_sasl_handler_handle_auth_data (WockySaslHandler *handler,
                                                         const gchar *data,
                                                         gchar **response,
                                                         GError **error);

handler :

data :

response :

error :

Returns :


WockySaslInitialResponseFunc ()

gboolean            (*WockySaslInitialResponseFunc)     (WockySaslHandler *handler,
                                                         gchar **initial_data,
                                                         GError **error);

Called when authentication begins, if the mechanism allows a response to an implicit challenge during SASL initiation (which, in XMPP, corresponds to sending the <auth></auth> stanza to the server).

The function should return TRUE on success and optionally set the initial_data to a string (allocated using g_malloc) if there is initial data to send. On error it should return FALSE and set the error

handler :

initial_data :

error :

Returns :


WockySaslAuthDataFunc ()

gboolean            (*WockySaslAuthDataFunc)            (WockySaslHandler *handler,
                                                         const gchar *data,
                                                         gchar **response,
                                                         GError **error);

handler :

data :

response :

error :

Returns :