PreviousNext

String and Similar Data

Many of the GSSAPI routines take arguments and return values that describe contiguous multiple-byte data, such as opaque data and character strings. Use the gss_buffer_t data type, which is a pointer to the buffer descriptor gss_buffer_desc, to pass the data between the GSSAPI routines and applications.

The gss_buffer_t data type has the following structure:

typedef struct gss_buffer_desc_struct {
size_t length;
void *value;
} gss_buffer_desc, *gss_buffer_t;

The length field contains the total number of bytes in the data and the value field contains a pointer to the actual data.

When using the gss_buffer_t data type, the GSSAPI routine allocates storage for any data it passes to the application. The calling application must allocate the gss_buffer_desc object. It can initialize unused gss_buffer_desc objects with the value GSS_C_EMPTY_BUFFER. To free the storage, the application calls the gss_release_buffer( ) routine.