HP Open Source Security for OpenVMS Volume 3: Kerberos > Chapter 5 GSSAPI (Generic Security Services Application Programming Interface)

gss_delete_sec_context — Delete a security context

  Table of Contents



C Prototype

OM_uint32 gss_delete_sec_context(
OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
gss_buffer_t output_token );


minor_status (output) 

A mechanism-specific status code.

context_handle (input/output) 

A context handle identifying the context to delete. After deleting the context, the GSSAPI will set this context handle to GSS_C_NO_CONTEXT.

output_token (output) 

A token to be sent to the remote application to instruct it to also delete the context. It is recommended that applications specify GSS_C_NO_BUFFER for this argument, requesting local deletion only. If a buffer argument is provided by the application, the mechanism will either return a token in it, or set the length field of this token to zero to indicate to the application that no token is to be sent to the peer.


This routine deletes a security context. The gss_delete_sec_context routine deletes the local data structures associated with the specified security context, and may generate an output_token, which when passed to the peer gss_process_context_token will instruct it to do likewise. No further security services may be obtained using the context specified by context_handle.

The output_token argument is retained for compatibility with Version 1 of the GSSAPI. It is recommended that both peer applications invoke gss_delete_sec_context passing the value GSS_C_NO_BUFFER for the output_token argument, indicating that no token is required, and that gss_delete_sec_context should simply delete local context data structures.

Return Values

This routine returns one of the following GSS status codes:


Successful completion.
GSS_S_FAILUREFailure. See minor_status for more information.
GSS_S_NO_CONTEXTNo valid context was supplied.