Sets an SSL callback.
#include <gskssl.h>
gsk_status gsk_attribute_set_callback (
gsk_handle ssl_handle,
GSK_CALLBACK_ID callback_id,
void * callback)
The gsk_attribute_set_callback() routine establishes a callback to an application routine by the SSL run time. A callback allows the application to replace the default routine used by the SSL run time. The SSL environment or SSL connection must be in the open state and not in the initialized state (that is, gsk_environment_init() or gsk_secure_socket_init() has not been called). The callback routine must use standard C linkage and not C++ linkage.
This is the prototype for the callback routine provided by the application. It shows the parameters passed to the application callback and the value returned by the callback.
int client_cert_callback (
gsk_handle soc_handle)
int io_read (
int fd,
void * buffer,
int count,
char * user_data)
int io_write (
int fd,
void * buffer,
int count,
char * user_data)
unsigned long io_getpeerid (
int fd,
char * user_data)
int io_setsocketoptions (
int fd,
int cmd,
char * user_data)
int io_getpeername (
int fd,
void * buffer,
int * length,
char * user_data)
GSK_SESSION_RESET_CALLBACK can be specified for an SSL environment or an SSL connection. The callback is only invoked when using SSL V3, TLS V1.0, or higher protocols.
void (Reset_Init) (
gsk_handle con_handle)
void (Reset_Complete) (
gsk_handle con_handle)
gsk_data_buffer * Get (
const unsigned char * session_id,
unsigned int session_id_length,
gsk_sslversion ssl_version)
gsk_data_buffer * Put (
gsk_data_buffer * ssl_session_data,
const unsigned char * session_id,
unsigned int session_id_length,
gsk_sslversion ssl_version)
void Delete (
const unsigned char * session_id,
unsigned int session_id_length,
gsk_sslversion ssl_version)
void FreeDataBuffer (
gsk_data_buffer * ssl_session_data)
The callback routine cannot enforce the required use of the server name indication extension. The failure to select a key label causes a fatal UNRECOGNIZED_NAME alert. To enforce such actions with the callback routine the user must set the GSK_TLS_EXTID_SNI_SERVER_LABELS extension by calling the attribute_set_tls_extension() routine. The required and unrecognized_name_fatal fields of the extension must be set appropriately to achieve the requested outcome, although the serverKeyLabel list may be empty.
The function return value should be 0 if a key label has been set or GSK_ERR_UNRECOGNIZED_NAME if no server certificate is selected. Enforcement of the required and unrecognized_name_fatal settings occur on return from the callback routine. GSK_SNI_CALLBACK can be specified only for an SSL environment.
int sni_callback (
gsk_handle soc_handle)