Links

pbs_auth_set_config

const pbs_auth_config_t *auth_config

Pointer to a configuration structure as shown below for the authentication library.

typedef struct pbs_auth_config {

/* Path to PBS_HOME directory (aka same value as PBS_HOME in pbs.conf). This must be a null-terminated string. */

char *pbs_home_path;


/* Path to PBS_EXEC directory (aka same value as PBS_EXEC in pbs.conf). This must be a null-terminated string. */

char *pbs_exec_path;


/* Name of authentication method (aka same value as PBS_AUTH_METHOD in pbs.conf). This must be a null-terminated string. */

char *auth_method;


/* Name of encryption method (aka same value as PBS_ENCRYPT_METHOD in pbs.conf). This must be a null-terminated string. */

char *encrypt_method;


/*

  * Function pointer to the logging method with the same signature as log_event from Liblog.

  * With this, the user of the authentication library can redirect logs from the authentication

  * library into respective log files or stderr in case no log files.

  * If func is set to NULL then logs will be written to stderr (if available, else no logging at all).

  */

void (*logfunc)(int type, int objclass, int severity, const char *objname, const char *text);

} pbs_auth_config_t;

pbs_auth_create_ctx

void **ctx

Pointer to auth context to be created

int mode

Specify which type of context to be created, should be one of AUTH_CLIENT or AUTH_SERVER.

Use AUTH_CLIENT for client-side (aka who is initiating authentication) context

Use AUTH_SERVER for server-side (aka who is authenticating incoming user/connection) context

enum AUTH_ROLE {
        AUTH_ROLE_UNKNOWN = 0,
        AUTH_CLIENT,
        AUTH_SERVER,
        AUTH_ROLE_LAST
};

int conn_type

Specify which type of connection is for which context to be created, should be one of AUTH_USER_CONN or AUTH_SERVICE_CONN

Use AUTH_USER_CONN for user-oriented connection (aka like PBS client is connecting to PBS Server)

Use AUTH_SERVICE_CONN for service-oriented connection (aka like PBS Mom is connecting to PBS Server via PBS Comm)

enum AUTH_CONN_TYPE {
        AUTH_USER_CONN = 0,
        AUTH_SERVICE_CONN
};

char *hostname

The null-terminated hostname of another authenticating party

pbs_auth_destroy_ctx

void *ctx

Pointer to auth context to be destroyed

pbs_auth_get_userinfo

void *ctx

Pointer to auth context from which information will be extracted

char **user

Pointer to a buffer in which this API will write the user name

char **host

Pointer to a buffer in which this API will write hostname

char **realm

Pointer to a buffer in which this API will write the realm

pbs_auth_process_handshake_data

void *ctx

Pointer to auth context for which handshake is happening

void *data_in

Incoming handshake data to process if any. This can be NULL which indicates to initiate handshake and generate initial handshake data to be sent to the authentication server.

size_t len_in

Length of incoming handshake data if any, else 0

void **data_out

Outgoing handshake data to be sent to another authentication party, this can be NULL is handshake is completed and no further data needs to be sent.

On failure (aka return 1 by this API), data in data_out will be considered as error data/message, which will be sent to another authentication party as auth error data.

size_t *len_out

Length of outgoing handshake/auth error data if any, else 0

int *is_handshake_done

To indicate whether handshake is completed or not, 0 - means handshake is not completed or 1 - means handshake is completed

pbs_auth_encrypt_data

void *ctx

Pointer to auth context which will be used while encrypting given unencrypted data

void *data_in

unencrypted data to encrypt

size_t len_in

Length of unencrypted data

void **data_out

Encrypted data

size_t *len_out

Length of encrypted data

pbs_auth_decrypt_data

void *ctx

Pointer to auth context which will be used while decrypting given encrypted data

void *data_in

Encrypted data to decrypt

size_t len_in

Length of Encrypted data

void **data_out

unencrypted data

size_t *len_out

Length of unencrypted data



OSS Site Map

Project Documentation Main Page

Developer Guide Pages