+ All Categories
Home > Documents > GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual

Date post: 04-Nov-2021
Category:
Upload: others
View: 7 times
Download: 0 times
Share this document with a friend
75
GNU Generic Security Service (GSS) API Reference Manual i GNU Generic Security Service (GSS) API Reference Manual
Transcript
Page 1: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual i

GNU Generic Security Service (GSS) API ReferenceManual

Page 2: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual ii

COLLABORATORS

TITLE :

GNU Generic Security Service (GSS) API Ref-erence Manual

ACTION NAME DATE SIGNATURE

WRITTEN BY October 9, 2014

REVISION HISTORY

NUMBER DATE DESCRIPTION NAME

Page 3: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual iii

Contents

1 GNU Generic Security Service (GSS) API Reference Manual 1

1.1 gss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 api . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 ext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

1.4 krb5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

1.5 krb5-ext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

2 Index 71

Page 4: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 1 / 72

Chapter 1

GNU Generic Security Service (GSS) API Refer-ence Manual

GSS is an implementation of the Generic Security Service Application Program Interface (GSS-API). GSS-API is used bynetwork servers to provide security services, e.g., to authenticate SMTP/IMAP clients against SMTP/IMAP servers. GSS consistsof a library and a manual.

GSS is developed for the GNU/Linux system, but runs on over 20 platforms including most major Unix platforms and Windows,and many kind of devices including iPAQ handhelds and S/390 mainframes.

GSS is a GNU project, and is licensed under the GNU General Public License version 3 or later.

1.1 gss

gss —

Types and Values

#define GSS_VERSION#define GSS_VERSION_MAJOR#define GSS_VERSION_MINOR#define GSS_VERSION_PATCH#define GSS_VERSION_NUMBER

Description

Functions

Types and Values

GSS_VERSION

# define GSS_VERSION "1.0.3"

Pre-processor symbol with a string that describe the header file version number. Used together with gss_check_version() to verifyheader file and run-time library consistency.

Page 5: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 2 / 72

GSS_VERSION_MAJOR

# define GSS_VERSION_MAJOR 1

Pre-processor symbol with a decimal value that describe the major level of the header file version number. For example, whenthe header version is 1.2.3 this symbol will be 1.

GSS_VERSION_MINOR

# define GSS_VERSION_MINOR 0

Pre-processor symbol with a decimal value that describe the minor level of the header file version number. For example, whenthe header version is 1.2.3 this symbol will be 2.

GSS_VERSION_PATCH

# define GSS_VERSION_PATCH 3

Pre-processor symbol with a decimal value that describe the patch level of the header file version number. For example, whenthe header version is 1.2.3 this symbol will be 3.

GSS_VERSION_NUMBER

# define GSS_VERSION_NUMBER 0x010003

Pre-processor symbol with a hexadecimal value describing the header file version number. For example, when the header versionis 1.2.3 this symbol will have the value 0x010203.

1.2 api

api —

Functions

#define GSS_C_NO_NAME#define GSS_C_NO_BUFFER#define GSS_C_NO_OID#define GSS_C_NO_OID_SET#define GSS_C_NO_CONTEXT#define GSS_C_NO_CREDENTIAL#define GSS_C_NO_CHANNEL_BINDINGS#define GSS_CALLING_ERROR()#define GSS_ROUTINE_ERROR()#define GSS_SUPPLEMENTARY_INFO()#define GSS_ERROR()#define GSS_S_BAD_MECH#define GSS_S_BAD_NAME#define GSS_S_BAD_NAMETYPE#define GSS_S_BAD_BINDINGS#define GSS_S_BAD_STATUS#define GSS_S_BAD_SIG

Page 6: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 3 / 72

#define GSS_S_NO_CRED#define GSS_S_NO_CONTEXT#define GSS_S_DEFECTIVE_TOKEN#define GSS_S_DEFECTIVE_CREDENTIAL#define GSS_S_CREDENTIALS_EXPIRED#define GSS_S_CONTEXT_EXPIRED#define GSS_S_FAILURE#define GSS_S_BAD_QOP#define GSS_S_UNAUTHORIZED#define GSS_S_UNAVAILABLE#define GSS_S_DUPLICATE_ELEMENT#define GSS_S_NAME_NOT_MNOM_uint32 gss_acquire_cred ()OM_uint32 gss_release_cred ()OM_uint32 gss_init_sec_context ()OM_uint32 gss_accept_sec_context ()OM_uint32 gss_process_context_token ()OM_uint32 gss_delete_sec_context ()OM_uint32 gss_context_time ()OM_uint32 gss_get_mic ()OM_uint32 gss_verify_mic ()OM_uint32 gss_wrap ()OM_uint32 gss_unwrap ()OM_uint32 gss_display_status ()OM_uint32 gss_indicate_mechs ()OM_uint32 gss_compare_name ()OM_uint32 gss_display_name ()OM_uint32 gss_import_name ()OM_uint32 gss_export_name ()OM_uint32 gss_release_name ()OM_uint32 gss_release_buffer ()OM_uint32 gss_release_oid_set ()OM_uint32 gss_inquire_cred ()OM_uint32 gss_inquire_context ()OM_uint32 gss_wrap_size_limit ()OM_uint32 gss_add_cred ()OM_uint32 gss_inquire_cred_by_mech ()OM_uint32 gss_export_sec_context ()OM_uint32 gss_import_sec_context ()OM_uint32 gss_create_empty_oid_set ()OM_uint32 gss_add_oid_set_member ()OM_uint32 gss_test_oid_set_member ()OM_uint32 gss_inquire_names_for_mech ()OM_uint32 gss_inquire_mechs_for_name ()OM_uint32 gss_canonicalize_name ()OM_uint32 gss_duplicate_name ()OM_uint32 gss_sign ()OM_uint32 gss_verify ()OM_uint32 gss_seal ()OM_uint32 gss_unseal ()OM_uint32 gss_inquire_saslname_for_mech ()OM_uint32 gss_inquire_mech_for_saslname ()int gss_oid_equal ()OM_uint32 gss_encapsulate_token ()OM_uint32 gss_decapsulate_token ()

Page 7: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 4 / 72

Types and Values

typedef gss_ctx_id_ttypedef gss_cred_id_ttypedef gss_name_ttypedef gss_uint32typedef OM_uint32typedef gss_qop_ttypedef gss_cred_usage_t#define GSS_C_DELEG_FLAG#define GSS_C_MUTUAL_FLAG#define GSS_C_REPLAY_FLAG#define GSS_C_SEQUENCE_FLAG#define GSS_C_CONF_FLAG#define GSS_C_INTEG_FLAG#define GSS_C_ANON_FLAG#define GSS_C_PROT_READY_FLAG#define GSS_C_TRANS_FLAG#define GSS_C_BOTH#define GSS_C_INITIATE#define GSS_C_ACCEPT#define GSS_C_GSS_CODE#define GSS_C_MECH_CODE#define GSS_C_AF_UNSPEC#define GSS_C_AF_LOCAL#define GSS_C_AF_INET#define GSS_C_AF_IMPLINK#define GSS_C_AF_PUP#define GSS_C_AF_CHAOS#define GSS_C_AF_NS#define GSS_C_AF_NBS#define GSS_C_AF_ECMA#define GSS_C_AF_DATAKIT#define GSS_C_AF_CCITT#define GSS_C_AF_SNA#define GSS_C_AF_DECnet#define GSS_C_AF_DLI#define GSS_C_AF_LAT#define GSS_C_AF_HYLINK#define GSS_C_AF_APPLETALK#define GSS_C_AF_BSC#define GSS_C_AF_DSS#define GSS_C_AF_OSI#define GSS_C_AF_X25#define GSS_C_AF_NULLADDR#define GSS_C_EMPTY_BUFFER#define GSS_C_NULL_OID#define GSS_C_NULL_OID_SET#define GSS_C_QOP_DEFAULT#define GSS_C_INDEFINITEextern gss_OID GSS_C_NT_USER_NAMEextern gss_OID GSS_C_NT_MACHINE_UID_NAMEextern gss_OID GSS_C_NT_STRING_UID_NAMEextern gss_OID GSS_C_NT_HOSTBASED_SERVICE_Xextern gss_OID GSS_C_NT_HOSTBASED_SERVICEextern gss_OID GSS_C_NT_ANONYMOUS

Page 8: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 5 / 72

extern gss_OID GSS_C_NT_EXPORT_NAME#define GSS_S_COMPLETE#define GSS_C_CALLING_ERROR_OFFSET#define GSS_C_ROUTINE_ERROR_OFFSET#define GSS_C_SUPPLEMENTARY_OFFSET#define GSS_C_CALLING_ERROR_MASK#define GSS_C_ROUTINE_ERROR_MASK#define GSS_C_SUPPLEMENTARY_MASK#define GSS_S_CALL_INACCESSIBLE_READ#define GSS_S_CALL_INACCESSIBLE_WRITE#define GSS_S_CALL_BAD_STRUCTURE#define GSS_S_BAD_MIC#define GSS_S_CONTINUE_NEEDED#define GSS_S_DUPLICATE_TOKEN#define GSS_S_OLD_TOKEN#define GSS_S_UNSEQ_TOKEN#define GSS_S_GAP_TOKENtypedef gss_const_buffer_ttypedef gss_const_ctx_id_ttypedef gss_const_cred_id_ttypedef gss_const_name_ttypedef gss_const_OIDtypedef gss_const_OID_set

Description

Functions

GSS_C_NO_NAME

#define GSS_C_NO_NAME ((gss_name_t) 0)

GSS_C_NO_BUFFER

#define GSS_C_NO_BUFFER ((gss_buffer_t) 0)

GSS_C_NO_OID

#define GSS_C_NO_OID ((gss_OID) 0)

GSS_C_NO_OID_SET

#define GSS_C_NO_OID_SET ((gss_OID_set) 0)

GSS_C_NO_CONTEXT

#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)

Page 9: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 6 / 72

GSS_C_NO_CREDENTIAL

#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)

GSS_C_NO_CHANNEL_BINDINGS

#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)

GSS_CALLING_ERROR()

#define GSS_CALLING_ERROR(x)

GSS_ROUTINE_ERROR()

#define GSS_ROUTINE_ERROR(x)

GSS_SUPPLEMENTARY_INFO()

#define GSS_SUPPLEMENTARY_INFO(x)

GSS_ERROR()

#define GSS_ERROR(x)

GSS_S_BAD_MECH

#define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_BAD_NAME

#define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_BAD_NAMETYPE

#define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_BAD_BINDINGS

#define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_BAD_STATUS

#define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)

Page 10: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 7 / 72

GSS_S_BAD_SIG

#define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_NO_CRED

#define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_NO_CONTEXT

#define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_DEFECTIVE_TOKEN

#define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_DEFECTIVE_CREDENTIAL

#define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_CREDENTIALS_EXPIRED

#define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_CONTEXT_EXPIRED

#define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_FAILURE

#define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_BAD_QOP

#define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_UNAUTHORIZED

#define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_UNAVAILABLE

#define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)

Page 11: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 8 / 72

GSS_S_DUPLICATE_ELEMENT

#define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)

GSS_S_NAME_NOT_MN

#define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)

gss_acquire_cred ()

OM_uint32gss_acquire_cred (OM_uint32 *minor_status,

const gss_name_t desired_name,OM_uint32 time_req,const gss_OID_set desired_mechs,gss_cred_usage_t cred_usage,gss_cred_id_t *output_cred_handle,gss_OID_set *actual_mechs,OM_uint32 *time_rec);

Allows an application to acquire a handle for a pre-existing credential by name. GSS-API implementations must impose a localaccess-control policy on callers of this routine to prevent unauthorized callers from acquiring credentials to which they are notentitled. This routine is not intended to provide a "login to the network" function, as such a function would involve the creationof new credentials rather than merely acquiring a handle to existing credentials. Such functions, if required, should be defined inimplementation-specific extensions to the API.

If desired_name is GSS_C_NO_NAME, the call is interpreted as a request for a credential handle that will invoke default behaviorwhen passed to gss_init_sec_context() (if cred_usage is GSS_C_INITIATE or GSS_C_BOTH) or gss_accept_sec_context() (ifcred_usage is GSS_C_ACCEPT or GSS_C_BOTH).

Mechanisms should honor the desired_mechs parameter, and return a credential that is suitable to use only with the requestedmechanisms. An exception to this is the case where one underlying credential element can be shared by multiple mechanisms;in this case it is permissible for an implementation to indicate all mechanisms with which the credential element may be used. Ifdesired_mechs is an empty set, behavior is undefined.

This routine is expected to be used primarily by context acceptors, since implementations are likely to provide mechanism-specific ways of obtaining GSS-API initiator credentials from the system login process. Some implementations may thereforenot support the acquisition of GSS_C_INITIATE or GSS_C_BOTH credentials via gss_acquire_cred for any name other thanGSS_C_NO_NAME, or a name produced by applying either gss_inquire_cred to a valid credential, or gss_inquire_context to anactive context.

If credential acquisition is time-consuming for a mechanism, the mechanism may choose to delay the actual acquisition untilthe credential is required (e.g. by gss_init_sec_context or gss_accept_sec_context). Such mechanism-specific implementa-tion decisions should be invisible to the calling application; thus a call of gss_inquire_cred immediately following the call ofgss_acquire_cred must return valid credential data, and may therefore incur the overhead of a deferred credential acquisition.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

desired_name(gss_name_t, read) Name ofprincipal whose credentialshould be acquired.

Page 12: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 9 / 72

time_req

(Integer, read, optional)Number of seconds thatcredentials should remainvalid. SpecifyGSS_C_INDEFINITE torequest that the credentialshave the maximumpermitted lifetime.

desired_mechs

(Set of Object IDs, read,optional) Set of underlyingsecurity mechanisms thatmay be used.GSS_C_NO_OID_SETmay be used to obtain animplementation-specificdefault.

cred_usage

(gss_cred_usage_t, read)GSS_C_BOTH -Credentials may be usedeither to initiate or acceptsecurity contexts.GSS_C_INITIATE -Credentials will only beused to initiate securitycontexts. GSS_C_ACCEPT- Credentials will only beused to accept securitycontexts.

output_cred_handle

(gss_cred_id_t, modify)The returned credentialhandle. Resourcesassociated with thiscredential handle must bereleased by the applicationafter use with a call togss_release_cred().

actual_mechs

(Set of Object IDs, modify,optional) The set ofmechanisms for which thecredential is valid. Storageassociated with the returnedOID-set must be releasedby the application after usewith a call togss_release_oid_set().Specify NULL if notrequired.

time_rec

(Integer, modify, optional)Actual number of secondsfor which the returnedcredentials will remainvalid. If the implementationdoes not support expirationof credentials, the valueGSS_C_INDEFINITE willbe returned. Specify NULLif not required.

Page 13: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 10 / 72

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_MECH: Unavailable mechanism requested.

GSS_S_BAD_NAMETYPE: Type contained within desired_name parameter is not supported.

GSS_S_BAD_NAME: Value supplied for desired_name parameter is ill formed.

GSS_S_CREDENTIALS_EXPIRED: The credentials could not be acquired Because they have expired.

GSS_S_NO_CRED: No credentials were found for the specified name.

gss_release_cred ()

OM_uint32gss_release_cred (OM_uint32 *minor_status,

gss_cred_id_t *cred_handle);

Informs GSS-API that the specified credential handle is no longer required by the application, and frees associated resources.The cred_handle is set to GSS_C_NO_CREDENTIAL on successful completion of this call.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

cred_handle

(gss_cred_id_t, modify,optional) Opaque handleidentifying credential to bereleased. IfGSS_C_NO_CREDENTIALis supplied, the routine willcomplete successfully, butwill do nothing.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NO_CRED: Credentials could not be accessed.

gss_init_sec_context ()

OM_uint32gss_init_sec_context (OM_uint32 *minor_status,

const gss_cred_id_t initiator_cred_handle,gss_ctx_id_t *context_handle,const gss_name_t target_name,const gss_OID mech_type,OM_uint32 req_flags,OM_uint32 time_req,const gss_channel_bindings_t input_chan_bindings,const gss_buffer_t input_token,gss_OID *actual_mech_type,gss_buffer_t output_token,OM_uint32 *ret_flags,OM_uint32 *time_rec);

Page 14: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 11 / 72

Initiates the establishment of a security context between the application and a remote peer. Initially, the input_token parametershould be specified either as GSS_C_NO_BUFFER, or as a pointer to a gss_buffer_desc object whose length field containsthe value zero. The routine may return a output_token which should be transferred to the peer application, where the peerapplication will present it to gss_accept_sec_context. If no token need be sent, gss_init_sec_context will indicate this by settingthe length field of the output_token argument to zero. To complete the context establishment, one or more reply tokens may berequired from the peer application; if so, gss_init_sec_context will return a status containing the supplementary information bitGSS_S_CONTINUE_NEEDED. In this case, gss_init_sec_context should be called again when the reply token is received fromthe peer application, passing the reply token to gss_init_sec_context via the input_token parameters.

Portable applications should be constructed to use the token length and return status to determine whether a tokenneeds to be sent or waited for. Thus a typical portable caller should always invoke gss_init_sec_context within a loop:

int context_established = 0; gss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT; ... input_token->length = 0;

while (!context_established) { maj_stat = gss_init_sec_context(&min_stat, cred_hdl, &context_hdl, target_name, desired_mech,desired_services, desired_time, input_bindings, input_token, &actual_mech, output_token, &actual_services, &actual_time); if(GSS_ERROR(maj_stat)) { report_error(maj_stat, min_stat); };

if (output_token->length != 0) { send_token_to_peer(output_token); gss_release_buffer(&min_stat, output_token) }; if (GSS_ERROR(maj_stat)){

if (context_hdl != GSS_C_NO_CONTEXT) gss_delete_sec_context(&min_stat, &context_hdl, GSS_C_NO_BUFFER); break;};

if (maj_stat & GSS_S_CONTINUE_NEEDED) { receive_token_from_peer(input_token); } else { context_established = 1; };

Portable applications should be constructed to use the token length and return status to determine whether a tokenneeds to be sent or waited for. Thus a typical portable caller should always invoke gss_init_sec_context within a loop:

int context_established = 0; gss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT; ... input_token->length = 0;

while (!context_established) { maj_stat = gss_init_sec_context(&min_stat, cred_hdl, &context_hdl, target_name, desired_mech,desired_services, desired_time, input_bindings, input_token, &actual_mech, output_token, &actual_services, &actual_time); if(GSS_ERROR(maj_stat)) { report_error(maj_stat, min_stat); };

if (output_token->length != 0) { send_token_to_peer(output_token); gss_release_buffer(&min_stat, output_token) }; if (GSS_ERROR(maj_stat)){

if (context_hdl != GSS_C_NO_CONTEXT) gss_delete_sec_context(&min_stat, &context_hdl, GSS_C_NO_BUFFER); break;};

if (maj_stat & GSS_S_CONTINUE_NEEDED) { receive_token_from_peer(input_token); } else { context_established = 1; };

};

Whenever the routine returns a major status that includes the value GSS_S_CONTINUE_NEEDED, the context is not fullyestablished and the following restrictions apply to the output parameters:

• The value returned via the time_rec parameter is undefined unless the accompanying ret_flags parameter contains the bitGSS_C_PROT_READY_FLAG, indicating that per-message services may be applied in advance of a successful completionstatus, the value returned via the actual_mech_type parameter is undefined until the routine returns a major status value ofGSS_S_COMPLETE.

• The values of the GSS_C_DELEG_FLAG, GSS_C_MUTUAL_FLAG, GSS_C_REPLAY_FLAG, GSS_C_SEQUENCE_FLAG,GSS_C_CONF_FLAG, GSS_C_INTEG_FLAG and GSS_C_ANON_FLAG bits returned via the ret_flags parameter shouldcontain the values that the implementation expects would be valid if context establishment were to succeed. In particular, ifthe application has requested a service such as delegation or anonymous authentication via the req_flags argument, and such aservice is unavailable from the underlying mechanism, gss_init_sec_context should generate a token that will not provide theservice, and indicate via the ret_flags argument that the service will not be supported. The application may choose to abort thecontext establishment by calling gss_delete_sec_context (if it cannot continue in the absence of the service), or it may chooseto transmit the token and continue context establishment (if the service was merely desired but not mandatory).

Page 15: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 12 / 72

• The values of the GSS_C_PROT_READY_FLAG and GSS_C_TRANS_FLAG bits within ret_flags should indicate the actualstate at the time gss_init_sec_context returns, whether or not the context is fully established.

• GSS-API implementations that support per-message protection are encouraged to set the GSS_C_PROT_READY_FLAG inthe final ret_flags returned to a caller (i.e. when accompanied by a GSS_S_COMPLETE status code). However, applicationsshould not rely on this behavior as the flag was not defined in Version 1 of the GSS-API. Instead, applications should determinewhat per-message services are available after a successful context establishment according to the GSS_C_INTEG_FLAG andGSS_C_CONF_FLAG values.

• All other bits within the ret_flags argument should be set to zero.

If the initial call of gss_init_sec_context() fails, the implementation should not create a context object, and should leave the valueof the context_handle parameter set to GSS_C_NO_CONTEXT to indicate this. In the event of a failure on a subsequent call, theimplementation is permitted to delete the "half-built" security context (in which case it should set the context_handle parameterto GSS_C_NO_CONTEXT), but the preferred behavior is to leave the security context untouched for the application to delete(using gss_delete_sec_context).

During context establishment, the informational status bits GSS_S_OLD_TOKEN and GSS_S_DUPLICATE_TOKEN indicatefatal errors, and GSS-API mechanisms should always return them in association with a routine error of GSS_S_FAILURE. Thisrequirement for pairing did not exist in version 1 of the GSS-API specification, so applications that wish to run over version 1implementations must special-case these codes.

The req_flags values:

GSS_C_DELEG_FLAG::

• True - Delegate credentials to remote peer.

• False - Don’t delegate.

GSS_C_MUTUAL_FLAG::

• True - Request that remote peer authenticate itself.

• False - Authenticate self to remote peer only.

GSS_C_REPLAY_FLAG::

• True - Enable replay detection for messages protected with gss_wrap or gss_get_mic.

• False - Don’t attempt to detect replayed messages.

GSS_C_SEQUENCE_FLAG::

• True - Enable detection of out-of-sequence protected messages.

• False - Don’t attempt to detect out-of-sequence messages.

GSS_C_CONF_FLAG::

• True - Request that confidentiality service be made available (via gss_wrap).

• False - No per-message confidentiality service is required.

GSS_C_INTEG_FLAG::

• True - Request that integrity service be made available (via gss_wrap or gss_get_mic).

• False - No per-message integrity service is required.

Page 16: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 13 / 72

GSS_C_ANON_FLAG::

• True - Do not reveal the initiator’s identity to the acceptor.

• False - Authenticate normally.

The ret_flags values:

GSS_C_DELEG_FLAG::

• True - Credentials were delegated to the remote peer.

• False - No credentials were delegated.

GSS_C_MUTUAL_FLAG::

• True - The remote peer has authenticated itself.

• False - Remote peer has not authenticated itself.

GSS_C_REPLAY_FLAG::

• True - replay of protected messages will be detected.

• False - replayed messages will not be detected.

GSS_C_SEQUENCE_FLAG::

• True - out-of-sequence protected messages will be detected.

• False - out-of-sequence messages will not be detected.

GSS_C_CONF_FLAG::

• True - Confidentiality service may be invoked by calling gss_wrap routine.

• False - No confidentiality service (via gss_wrap) available. gss_wrap will provide message encapsulation, data-origin authen-tication and integrity services only.

GSS_C_INTEG_FLAG::

• True - Integrity service may be invoked by calling either gss_get_mic or gss_wrap routines.

• False - Per-message integrity service unavailable.

GSS_C_ANON_FLAG::

• True - The initiator’s identity has not been revealed, and will not be revealed if any emitted token is passed to the acceptor.

• False - The initiator’s identity has been or will be authenticated normally.

GSS_C_PROT_READY_FLAG::

• True - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are availablefor use if the accompanying major status return value is either GSS_S_COMPLETE or GSS_S_CONTINUE_NEEDED.

• False - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are availableonly if the accompanying major status return value is GSS_S_COMPLETE.

GSS_C_TRANS_FLAG::

• True - The resultant security context may be transferred to other processes via a call to gss_export_sec_context().

• False - The security context is not transferable.

All other bits should be set to zero.

Page 17: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 14 / 72

Parameters

Page 18: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 15 / 72

minor_status(integer, modify)Mechanism specific statuscode.

initiator_cred_handle

(gss_cred_id_t, read,optional) Handle forcredentials claimed. SupplyGSS_C_NO_CREDENTIALto act as a default initiatorprincipal. If no defaultinitiator is defined, thefunction will returnGSS_S_NO_CRED.

context_handle

(gss_ctx_id_t, read/modify)Context handle for newcontext. SupplyGSS_C_NO_CONTEXTfor first call; use valuereturned by first call incontinuation calls.Resources associated withthis context-handle must bereleased by the applicationafter use with a call togss_delete_sec_context().

target_name (gss_name_t, read) Nameof target.

mech_type

(OID, read, optional)Object ID of desiredmechanism. SupplyGSS_C_NO_OID to obtainan implementation specificdefault.

req_flags

(bit-mask, read) Containsvarious independent flags,each of which requests thatthe context support aspecific service option.Symbolic names areprovided for each flag, andthe symbolic namescorresponding to therequired flags should belogically-ORed together toform the bit-mask value.See below for the flags.

time_req

(Integer, read, optional)Desired number of secondsfor which context shouldremain valid. Supply 0 torequest a default validityperiod.

Page 19: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 16 / 72

input_chan_bindings

(channel bindings, read,optional)Application-specifiedbindings. Allowsapplication to securely bindchannel identificationinformation to the securitycontext. SpecifyGSS_C_NO_CHANNEL_BINDINGSif channel bindings are notused.

input_token

(buffer, opaque, read,optional) Token receivedfrom peer application.SupplyGSS_C_NO_BUFFER, or apointer to a buffercontaining the valueGSS_C_EMPTY_BUFFERon initial call.

actual_mech_type

(OID, modify, optional)Actual mechanism used.The OID returned via thisparameter will be a pointerto static storage that shouldbe treated as read-only; Inparticular the applicationshould not attempt to free it.Specify NULL if notrequired.

output_token

(buffer, opaque, modify)Token to be sent to peerapplication. If the lengthfield of the returned bufferis zero, no token need besent to the peer application.Storage associated with thisbuffer must be freed by theapplication after use with acall to gss_release_buffer().

ret_flags

(bit-mask, modify, optional)Contains variousindependent flags, each ofwhich indicates that thecontext supports a specificservice option. SpecifyNULL if not required.Symbolic names areprovided for each flag, andthe symbolic namescorresponding to therequired flags should belogically-ANDed with theret_flags value to testwhether a given option issupported by the context.See below for the flags.

Page 20: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 17 / 72

time_rec

(Integer, modify, optional)Number of seconds forwhich the context willremain valid. If theimplementation does notsupport context expiration,the valueGSS_C_INDEFINITE willbe returned. Specify NULLif not required.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_CONTINUE_NEEDED: Indicates that a token from the peer application is required to complete the context, and thatgss_init_sec_context must be called again with that token.

GSS_S_DEFECTIVE_TOKEN: Indicates that consistency checks performed on the input_token failed.

GSS_S_DEFECTIVE_CREDENTIAL: Indicates that consistency checks performed on the credential failed.

GSS_S_NO_CRED: The supplied credentials were not valid for context initiation, or the credential handle did not reference anycredentials.

GSS_S_CREDENTIALS_EXPIRED: The referenced credentials have expired.

GSS_S_BAD_BINDINGS: The input_token contains different channel bindings to those specified via the input_chan_bindingsparameter.

GSS_S_BAD_SIG: The input_token contains an invalid MIC, or a MIC that could not be verified.

GSS_S_OLD_TOKEN: The input_token was too old. This is a fatal error during context establishment.

GSS_S_DUPLICATE_TOKEN: The input_token is valid, but is a duplicate of a token already processed. This is a fatal errorduring context establishment.

GSS_S_NO_CONTEXT: Indicates that the supplied context handle did not refer to a valid context.

GSS_S_BAD_NAMETYPE: The provided target_name parameter contained an invalid or unsupported type of name.

GSS_S_BAD_NAME: The provided target_name parameter was ill-formed.

GSS_S_BAD_MECH: The specified mechanism is not supported by the provided credential, or is unrecognized by the implemen-tation.

gss_accept_sec_context ()

OM_uint32gss_accept_sec_context (OM_uint32 *minor_status,

gss_ctx_id_t *context_handle,const gss_cred_id_t acceptor_cred_handle,const gss_buffer_t input_token_buffer,const gss_channel_bindings_t input_chan_bindings,gss_name_t *src_name,gss_OID *mech_type,gss_buffer_t output_token,OM_uint32 *ret_flags,OM_uint32 *time_rec,gss_cred_id_t *delegated_cred_handle);

Page 21: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 18 / 72

Allows a remotely initiated security context between the application and a remote peer to be established. The routine may return aoutput_token which should be transferred to the peer application, where the peer application will present it to gss_init_sec_context.If no token need be sent, gss_accept_sec_context will indicate this by setting the length field of the output_token argumentto zero. To complete the context establishment, one or more reply tokens may be required from the peer application; if so,gss_accept_sec_context will return a status flag of GSS_S_CONTINUE_NEEDED, in which case it should be called again whenthe reply token is received from the peer application, passing the token to gss_accept_sec_context via the input_token parameters.

Portable applications should be constructed to use the token length and return status to determine whether a tokenneeds to be sent or waited for. Thus a typical portable caller should always invoke gss_accept_sec_context within aloop:

gss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT;

do { receive_token_from_peer(input_token); maj_stat = gss_accept_sec_context(&min_stat, &context_hdl, cred_hdl, input_token,input_bindings, &client_name, &mech_type, output_token, &ret_flags, &time_rec, &deleg_cred); if (GSS_ERROR(maj_stat)){ report_error(maj_stat, min_stat); }; if (output_token->length != 0) { send_token_to_peer(output_token);

gss_release_buffer(&min_stat, output_token); }; if (GSS_ERROR(maj_stat)) { if (context_hdl != GSS_C_NO_CONTEXT)gss_delete_sec_context(&min_stat, &context_hdl, GSS_C_NO_BUFFER); break; };

Portable applications should be constructed to use the token length and return status to determine whether a tokenneeds to be sent or waited for. Thus a typical portable caller should always invoke gss_accept_sec_context within aloop:

gss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT;

do { receive_token_from_peer(input_token); maj_stat = gss_accept_sec_context(&min_stat, &context_hdl, cred_hdl, input_token,input_bindings, &client_name, &mech_type, output_token, &ret_flags, &time_rec, &deleg_cred); if (GSS_ERROR(maj_stat)){ report_error(maj_stat, min_stat); }; if (output_token->length != 0) { send_token_to_peer(output_token);

gss_release_buffer(&min_stat, output_token); }; if (GSS_ERROR(maj_stat)) { if (context_hdl != GSS_C_NO_CONTEXT)gss_delete_sec_context(&min_stat, &context_hdl, GSS_C_NO_BUFFER); break; };

} while (maj_stat & GSS_S_CONTINUE_NEEDED);

Whenever the routine returns a major status that includes the value GSS_S_CONTINUE_NEEDED, the context is not fullyestablished and the following restrictions apply to the output parameters:

The value returned via the time_rec parameter is undefined Unless the accompanying ret_flags parameter contains the bitGSS_C_PROT_READY_FLAG, indicating that per-message services may be applied in advance of a successful completionstatus, the value returned via the mech_type parameter may be undefined until the routine returns a major status value ofGSS_S_COMPLETE.

The values of the GSS_C_DELEG_FLAG, GSS_C_MUTUAL_FLAG,GSS_C_REPLAY_FLAG, GSS_C_SEQUENCE_FLAG,GSS_C_CONF_FLAG,GSS_C_INTEG_FLAG and GSS_C_ANON_FLAG bits returned via the ret_flags parameter should con-tain the values that the implementation expects would be valid if context establishment were to succeed.

The values of the GSS_C_PROT_READY_FLAG and GSS_C_TRANS_FLAG bits within ret_flags should indicate the actualstate at the time gss_accept_sec_context returns, whether or not the context is fully established.

Although this requires that GSS-API implementations set the GSS_C_PROT_READY_FLAG in the final ret_flags returned toa caller (i.e. when accompanied by a GSS_S_COMPLETE status code), applications should not rely on this behavior as theflag was not defined in Version 1 of the GSS-API. Instead, applications should be prepared to use per-message services after asuccessful context establishment, according to the GSS_C_INTEG_FLAG and GSS_C_CONF_FLAG values.

All other bits within the ret_flags argument should be set to zero. While the routine returns GSS_S_CONTINUE_NEEDED,the values returned via the ret_flags argument indicate the services that the implementation expects to be available from theestablished context.

If the initial call of gss_accept_sec_context() fails, the implementation should not create a context object, and should leave thevalue of the context_handle parameter set to GSS_C_NO_CONTEXT to indicate this. In the event of a failure on a subsequent

Page 22: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 19 / 72

call, the implementation is permitted to delete the "half-built" security context (in which case it should set the context_handleparameter to GSS_C_NO_CONTEXT), but the preferred behavior is to leave the security context (and the context_handle pa-rameter) untouched for the application to delete (using gss_delete_sec_context).

During context establishment, the informational status bits GSS_S_OLD_TOKEN and GSS_S_DUPLICATE_TOKEN indicatefatal errors, and GSS-API mechanisms should always return them in association with a routine error of GSS_S_FAILURE. Thisrequirement for pairing did not exist in version 1 of the GSS-API specification, so applications that wish to run over version 1implementations must special-case these codes.

The ret_flags values:

GSS_C_DELEG_FLAG::

• True - Delegated credentials are available via the delegated_cred_handle parameter.

• False - No credentials were delegated.

GSS_C_MUTUAL_FLAG::

• True - Remote peer asked for mutual authentication.

• False - Remote peer did not ask for mutual authentication.

GSS_C_REPLAY_FLAG::

• True - replay of protected messages will be detected.

• False - replayed messages will not be detected.

GSS_C_SEQUENCE_FLAG::

• True - out-of-sequence protected messages will be detected.

• False - out-of-sequence messages will not be detected.

GSS_C_CONF_FLAG::

• True - Confidentiality service may be invoked by calling the gss_wrap routine.

• False - No confidentiality service (via gss_wrap) available. gss_wrap will provide message encapsulation, data-origin authen-tication and integrity services only.

GSS_C_INTEG_FLAG::

• True - Integrity service may be invoked by calling either gss_get_mic or gss_wrap routines.

• False - Per-message integrity service unavailable.

GSS_C_ANON_FLAG::

• True - The initiator does not wish to be authenticated; the src_name parameter (if requested) contains an anonymous internalname.

• False - The initiator has been authenticated normally.

GSS_C_PROT_READY_FLAG::

• True - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are availableif the accompanying major status return value is either GSS_S_COMPLETE or GSS_S_CONTINUE_NEEDED.

Page 23: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 20 / 72

• False - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are availableonly if the accompanying major status return value is GSS_S_COMPLETE.

GSS_C_TRANS_FLAG::

• True - The resultant security context may be transferred to other processes via a call to gss_export_sec_context().

• False - The security context is not transferable.

All other bits should be set to zero.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle

(gss_ctx_id_t, read/modify)Context handle for newcontext. SupplyGSS_C_NO_CONTEXTfor first call; use valuereturned in subsequentcalls. Oncegss_accept_sec_context()has returned a value via thisparameter, resources havebeen assigned to thecorresponding context, andmust be freed by theapplication after use with acall togss_delete_sec_context().

acceptor_cred_handle

(gss_cred_id_t, read)Credential handle claimedby context acceptor. SpecifyGSS_C_NO_CREDENTIALto accept the context as adefault principal. IfGSS_C_NO_CREDENTIALis specified, but no defaultacceptor principal isdefined,GSS_S_NO_CRED will bereturned.

input_token_buffer(buffer, opaque, read)Token obtained fromremote application.

input_chan_bindings

(channel bindings, read,optional) Application-specified bindings. Allowsapplication to securely bindchannel identificationinformation to the securitycontext. If channel bindingsare not used, specifyGSS_C_NO_CHANNEL_BINDINGS.

Page 24: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 21 / 72

src_name

(gss_name_t, modify,optional) Authenticatedname of context initiator.After use, this name shouldbe deallocated by passing itto gss_release_name(). Ifnot required, specifyNULL.

mech_type

(Object ID, modify,optional) Securitymechanism used. Thereturned OID value will bea pointer into static storage,and should be treated asread-only by the caller (inparticular, it does not needto be freed). If not required,specify NULL.

output_token

(buffer, opaque, modify)Token to be passed to peerapplication. If the lengthfield of the returned tokenbuffer is 0, then no tokenneed be passed to the peerapplication. If a non- zerolength field is returned, theassociated storage must befreed after use by theapplication with a call togss_release_buffer().

ret_flags

(bit-mask, modify, optional)Contains variousindependent flags, each ofwhich indicates that thecontext supports a specificservice option. If notneeded, specify NULL.Symbolic names areprovided for each flag, andthe symbolic namescorresponding to therequired flags should belogically-ANDed with theret_flags value to testwhether a given option issupported by the context.See below for the flags.

time_rec

(Integer, modify, optional)Number of seconds forwhich the context willremain valid. SpecifyNULL if not required.

Page 25: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 22 / 72

delegated_cred_handle

(gss_cred_id_t, modify,optional credential) Handlefor credentials receivedfrom context initiator. Onlyvalid if deleg_flag inret_flags is true, in whichcase an explicit credentialhandle (i.e. notGSS_C_NO_CREDENTIAL)will be returned; ifdeleg_flag is false,gss_accept_sec_context()will set this parameter toGSS_C_NO_CREDENTIAL.If a credential handle isreturned, the associatedresources must be releasedby the application after usewith a call togss_release_cred(). SpecifyNULL if not required.

Returns

GSS_S_CONTINUE_NEEDED: Indicates that a token from the peer application is required to complete the context, and thatgss_accept_sec_context must be called again with that token.

GSS_S_DEFECTIVE_TOKEN: Indicates that consistency checks performed on the input_token failed.

GSS_S_DEFECTIVE_CREDENTIAL: Indicates that consistency checks performed on the credential failed.

GSS_S_NO_CRED: The supplied credentials were not valid for context acceptance, or the credential handle did not referenceany credentials.

GSS_S_CREDENTIALS_EXPIRED: The referenced credentials have expired.

GSS_S_BAD_BINDINGS: The input_token contains different channel bindings to those specified via the input_chan_bindingsparameter.

GSS_S_NO_CONTEXT: Indicates that the supplied context handle did not refer to a valid context.

GSS_S_BAD_SIG: The input_token contains an invalid MIC.

GSS_S_OLD_TOKEN: The input_token was too old. This is a fatal error during context establishment.

GSS_S_DUPLICATE_TOKEN: The input_token is valid, but is a duplicate of a token already processed. This is a fatal errorduring context establishment.

GSS_S_BAD_MECH: The received token specified a mechanism that is not supported by the implementation or the providedcredential.

gss_process_context_token ()

OM_uint32gss_process_context_token (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,const gss_buffer_t token_buffer);

Provides a way to pass an asynchronous token to the security service. Most context-level tokens are emitted and processedsynchronously by gss_init_sec_context and gss_accept_sec_context, and the application is informed as to whether further tokensare expected by the GSS_C_CONTINUE_NEEDED major status bit. Occasionally, a mechanism may need to emit a context-level token at a point when the peer entity is not expecting a token. For example, the initiator’s final call to gss_init_sec_context

Page 26: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 23 / 72

may emit a token and return a status of GSS_S_COMPLETE, but the acceptor’s call to gss_accept_sec_context may fail. Theacceptor’s mechanism may wish to send a token containing an error indication to the initiator, but the initiator is not expectinga token at this point, believing that the context is fully established. Gss_process_context_token provides a way to pass such atoken to the mechanism at any time.

Parameters

minor_status(Integer, modify)Implementation specificstatus code.

context_handle

(gss_ctx_id_t, read)Context handle of contexton which token is to beprocessed

token_buffer (buffer, opaque, read)Token to process.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_DEFECTIVE_TOKEN: Indicates that consistency checks performed on the token failed.

GSS_S_NO_CONTEXT: The context_handle did not refer to a valid context.

gss_delete_sec_context ()

OM_uint32gss_delete_sec_context (OM_uint32 *minor_status,

gss_ctx_id_t *context_handle,gss_buffer_t output_token);

Delete a security context. gss_delete_sec_context will delete the local data structures associated with the specified securitycontext, and may generate an output_token, which when passed to the peer gss_process_context_token will instruct it to dolikewise. If no token is required by the mechanism, the GSS-API should set the length field of the output_token (if provided) tozero. No further security services may be obtained using the context specified by context_handle.

In addition to deleting established security contexts, gss_delete_sec_context must also be able to delete "half-built" securitycontexts resulting from an incomplete sequence of gss_init_sec_context()/gss_accept_sec_context() calls.

The output_token parameter is retained for compatibility with version 1 of the GSS-API. It is recommended that both peerapplications invoke gss_delete_sec_context passing the value GSS_C_NO_BUFFER for the output_token parameter, indicatingthat no token is required, and that gss_delete_sec_context should simply delete local context data structures. If the applicationdoes pass a valid buffer to gss_delete_sec_context, mechanisms are encouraged to return a zero-length token, indicating that nopeer action is necessary, and that no token should be transferred by the application.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle

(gss_ctx_id_t, modify)Context handle identifyingcontext to delete. Afterdeleting the context, theGSS-API will set thiscontext handle toGSS_C_NO_CONTEXT.

Page 27: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 24 / 72

output_token

(buffer, opaque, modify,optional) Token to be sentto remote application toinstruct it to also delete thecontext. It is recommendedthat applications specifyGSS_C_NO_BUFFER forthis parameter, requestinglocal deletion only. If abuffer parameter isprovided by the application,the mechanism may returna token in it; mechanismsthat implement only localdeletion should set thelength field of this token tozero to indicate to theapplication that no token isto be sent to the peer.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NO_CONTEXT: No valid context was supplied.

gss_context_time ()

OM_uint32gss_context_time (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,OM_uint32 *time_rec);

Determines the number of seconds for which the specified context will remain valid.

Parameters

minor_status(Integer, modify)Implementation specificstatus code.

context_handle(gss_ctx_id_t, read)Identifies the context to beinterrogated.

time_rec

(Integer, modify) Numberof seconds that the contextwill remain valid. If thecontext has already expired,zero will be returned.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_CONTEXT_EXPIRED: The context has already expired.

GSS_S_NO_CONTEXT: The context_handle parameter did not identify a valid context

Page 28: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 25 / 72

gss_get_mic ()

OM_uint32gss_get_mic (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,gss_qop_t qop_req,const gss_buffer_t message_buffer,gss_buffer_t message_token);

Generates a cryptographic MIC for the supplied message, and places the MIC in a token for transfer to the peer application. Theqop_req parameter allows a choice between several cryptographic algorithms, if supported by the chosen mechanism.

Since some application-level protocols may wish to use tokens emitted by gss_wrap() to provide "secure framing", implementa-tions must support derivation of MICs from zero-length messages.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle

(gss_ctx_id_t, read)Identifies the context onwhich the message will besent.

qop_req

(gss_qop_t, read, optional)Specifies requested qualityof protection. Callers areencouraged, on portabilitygrounds, to accept thedefault quality of protectionoffered by the chosenmechanism, which may berequested by specifyingGSS_C_QOP_DEFAULTfor this parameter. If anunsupported protectionstrength is requested,gss_get_mic will return amajor_status ofGSS_S_BAD_QOP.

message_buffer (buffer, opaque, read)Message to be protected.

message_token

(buffer, opaque, modify)Buffer to receive token. Theapplication must freestorage associated with thisbuffer after use with a callto gss_release_buffer().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_CONTEXT_EXPIRED: The context has already expired.

GSS_S_NO_CONTEXT: The context_handle parameter did not identify a valid context.

GSS_S_BAD_QOP: The specified QOP is not supported by the mechanism.

Page 29: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 26 / 72

gss_verify_mic ()

OM_uint32gss_verify_mic (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,const gss_buffer_t message_buffer,const gss_buffer_t token_buffer,gss_qop_t *qop_state);

Verifies that a cryptographic MIC, contained in the token parameter, fits the supplied message. The qop_state parameter allowsa message recipient to determine the strength of protection that was applied to the message.

Since some application-level protocols may wish to use tokens emitted by gss_wrap() to provide "secure framing", implementa-tions must support the calculation and verification of MICs over zero-length messages.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle(gss_ctx_id_t, read)Identifies the context onwhich the message arrived.

message_buffer (buffer, opaque, read)Message to be verified.

token_buffer(buffer, opaque, read)Token associated withmessage.

qop_state

(gss_qop_t, modify,optional) Quality ofprotection gained from MICSpecify NULL if notrequired.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_DEFECTIVE_TOKEN: The token failed consistency checks.

GSS_S_BAD_SIG: The MIC was incorrect.

GSS_S_DUPLICATE_TOKEN: The token was valid, and contained a correct MIC for the message, but it had already beenprocessed.

GSS_S_OLD_TOKEN: The token was valid, and contained a correct MIC for the message, but it is too old to check for duplica-tion.

GSS_S_UNSEQ_TOKEN: The token was valid, and contained a correct MIC for the message, but has been verified out ofsequence; a later token has already been received.

GSS_S_GAP_TOKEN: The token was valid, and contained a correct MIC for the message, but has been verified out of sequence;an earlier expected token has not yet been received.

GSS_S_CONTEXT_EXPIRED: The context has already expired.

GSS_S_NO_CONTEXT: The context_handle parameter did not identify a valid context.

gss_wrap ()

Page 30: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 27 / 72

OM_uint32gss_wrap (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,int conf_req_flag,gss_qop_t qop_req,const gss_buffer_t input_message_buffer,int *conf_state,gss_buffer_t output_message_buffer);

Attaches a cryptographic MIC and optionally encrypts the specified input_message. The output_message contains both the MICand the message. The qop_req parameter allows a choice between several cryptographic algorithms, if supported by the chosenmechanism.

Since some application-level protocols may wish to use tokens emitted by gss_wrap() to provide "secure framing", implementa-tions must support the wrapping of zero-length messages.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle

(gss_ctx_id_t, read)Identifies the context onwhich the message will besent.

conf_req_flag

(boolean, read) Non-zero -Both confidentiality andintegrity services arerequested. Zero - Onlyintegrity service isrequested.

qop_req

(gss_qop_t, read, optional)Specifies required quality ofprotection. Amechanism-specific defaultmay be requested by settingqop_req toGSS_C_QOP_DEFAULT.If an unsupportedprotection strength isrequested, gss_wrap willreturn a major_status ofGSS_S_BAD_QOP.

input_message_buffer (buffer, opaque, read)Message to be protected.

conf_state

(boolean, modify, optional)Non-zero - Confidentiality,data origin authenticationand integrity services havebeen applied. Zero -Integrity and data originservices only has beenapplied. Specify NULL ifnot required.

Page 31: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 28 / 72

output_message_buffer

(buffer, opaque, modify)Buffer to receive protectedmessage. Storageassociated with thismessage must be freed bythe application after usewith a call togss_release_buffer().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_CONTEXT_EXPIRED: The context has already expired.

GSS_S_NO_CONTEXT: The context_handle parameter did not identify a valid context.

GSS_S_BAD_QOP: The specified QOP is not supported by the mechanism.

gss_unwrap ()

OM_uint32gss_unwrap (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,const gss_buffer_t input_message_buffer,gss_buffer_t output_message_buffer,int *conf_state,gss_qop_t *qop_state);

Converts a message previously protected by gss_wrap back to a usable form, verifying the embedded MIC. The conf_stateparameter indicates whether the message was encrypted; the qop_state parameter indicates the strength of protection that wasused to provide the confidentiality and integrity services.

Since some application-level protocols may wish to use tokens emitted by gss_wrap() to provide "secure framing", implementa-tions must support the wrapping and unwrapping of zero-length messages.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle(gss_ctx_id_t, read)Identifies the context onwhich the message arrived.

input_message_buffer (buffer, opaque, read)Protected message.

output_message_buffer

(buffer, opaque, modify)Buffer to receiveunwrapped message.Storage associated with thisbuffer must be freed by theapplication after use usewith a call togss_release_buffer().

Page 32: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 29 / 72

conf_state

(boolean, modify, optional)Non-zero - Confidentialityand integrity protectionwere used. Zero - Integrityservice only was used.Specify NULL if notrequired.

qop_state

(gss_qop_t, modify,optional) Quality ofprotection provided.Specify NULL if notrequired.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_DEFECTIVE_TOKEN: The token failed consistency checks.

GSS_S_BAD_SIG: The MIC was incorrect.

GSS_S_DUPLICATE_TOKEN: The token was valid, and contained a correct MIC for the message, but it had already beenprocessed.

GSS_S_OLD_TOKEN: The token was valid, and contained a correct MIC for the message, but it is too old to check for duplica-tion.

GSS_S_UNSEQ_TOKEN: The token was valid, and contained a correct MIC for the message, but has been verified out ofsequence; a later token has already been received.

GSS_S_GAP_TOKEN: The token was valid, and contained a correct MIC for the message, but has been verified out of sequence;an earlier expected token has not yet been received.

GSS_S_CONTEXT_EXPIRED: The context has already expired.

GSS_S_NO_CONTEXT: The context_handle parameter did not identify a valid context.

gss_display_status ()

OM_uint32gss_display_status (OM_uint32 *minor_status,

OM_uint32 status_value,int status_type,const gss_OID mech_type,OM_uint32 *message_context,gss_buffer_t status_string);

Allows an application to obtain a textual representation of a GSS-API status code, for display to the user or for logging purposes.Since some status values may indicate multiple conditions, applications may need to call gss_display_status multiple times, eachcall generating a single text string. The message_context parameter is used by gss_display_status to store state informationabout which error messages have already been extracted from a given status_value; message_context must be initialized to 0 bythe application prior to the first call, and gss_display_status will return a non-zero value in this parameter if there are furthermessages to extract.

The message_context parameter contains all state information required by gss_display_status in order to extract furthermessages from the status_value; even when a non-zero value is returned in this parameter, the application is not requiredto call gss_display_status again unless subsequent messages are desired. The following code extracts all messagesfrom a given status code and prints them to stderr:

OM_uint32 message_context; OM_uint32 status_code; OM_uint32 maj_status; OM_uint32 min_status; gss_buffer_desc sta-tus_string;

Page 33: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 30 / 72

...

message_context = 0;

do { maj_status = gss_display_status ( &min_status, status_code, GSS_C_GSS_CODE, GSS_C_NO_OID, &message_context,&status_string)

fprintf(stderr, "%.*s\n", (int)status_string.length,

(char *)status_string.value);

gss_release_buffer(&min_status, &status_string);

The message_context parameter contains all state information required by gss_display_status in order to extract furthermessages from the status_value; even when a non-zero value is returned in this parameter, the application is not requiredto call gss_display_status again unless subsequent messages are desired. The following code extracts all messagesfrom a given status code and prints them to stderr:

OM_uint32 message_context; OM_uint32 status_code; OM_uint32 maj_status; OM_uint32 min_status; gss_buffer_desc sta-tus_string;

...

message_context = 0;

do { maj_status = gss_display_status ( &min_status, status_code, GSS_C_GSS_CODE, GSS_C_NO_OID, &message_context,&status_string)

fprintf(stderr, "%.*s\n", (int)status_string.length,

(char *)status_string.value);

gss_release_buffer(&min_status, &status_string);

} while (message_context != 0);

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

status_value (Integer, read) Status valueto be converted.

status_type

(Integer, read)GSS_C_GSS_CODE -status_value is a GSS statuscode.GSS_C_MECH_CODE -status_value is amechanism status code.

mech_type

(Object ID, read, optional)Underlying mechanism(used to interpret a minorstatus value). SupplyGSS_C_NO_OID to obtainthe system default.

Page 34: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 31 / 72

message_context

(Integer, read/modify)Should be initialized to zeroby the application prior tothe first call. On returnfrom gss_display_status(), anon-zero status_valueparameter indicates thatadditional messages may beextracted from the statuscode via subsequent calls togss_display_status(),passing the samestatus_value, status_type,mech_type, andmessage_contextparameters.

status_string

(buffer, character string,modify) Textualinterpretation of thestatus_value. Storageassociated with thisparameter must be freed bythe application after usewith a call togss_release_buffer().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_MECH: Indicates that translation in accordance with an unsupported mechanism type was requested.

GSS_S_BAD_STATUS: The status value was not recognized, or the status type was neither GSS_C_GSS_CODE nor GSS_C_MECH_CODE.

gss_indicate_mechs ()

OM_uint32gss_indicate_mechs (OM_uint32 *minor_status,

gss_OID_set *mech_set);

Allows an application to determine which underlying security mechanisms are available.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

mech_set

(set of Object IDs, modify)Set ofimplementation-supportedmechanisms. The returnedgss_OID_set value will be adynamically-allocated OIDset, that should be releasedby the caller after use with acall togss_release_oid_set().

Page 35: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 32 / 72

Returns

GSS_S_COMPLETE: Successful completion.

gss_compare_name ()

OM_uint32gss_compare_name (OM_uint32 *minor_status,

const gss_name_t name1,const gss_name_t name2,int *name_equal);

Allows an application to compare two internal-form names to determine whether they refer to the same entity.

If either name presented to gss_compare_name denotes an anonymous principal, the routines should indicate that the two namesdo not refer to the same identity.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

name1 (gss_name_t, read)Internal-form name.

name2 (gss_name_t, read)Internal-form name.

name_equal

(boolean, modify) Non-zero- names refer to same entity.Zero - names refer todifferent entities (strictly,the names are not known torefer to the same identity).

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_NAMETYPE: The two names were of incomparable types.

GSS_S_BAD_NAME: One or both of name1 or name2 was ill-formed.

gss_display_name ()

OM_uint32gss_display_name (OM_uint32 *minor_status,

const gss_name_t input_name,gss_buffer_t output_name_buffer,gss_OID *output_name_type);

Allows an application to obtain a textual representation of an opaque internal-form name for display purposes. The syntax of aprintable name is defined by the GSS-API implementation.

If input_name denotes an anonymous principal, the implementation should return the gss_OID value GSS_C_NT_ANONYMOUSas the output_name_type, and a textual name that is syntactically distinct from all valid supported printable names in out-put_name_buffer.

If input_name was created by a call to gss_import_name, specifying GSS_C_NO_OID as the name-type, implementations thatemploy lazy conversion between name types may return GSS_C_NO_OID via the output_name_type parameter.

Page 36: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 33 / 72

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

input_name (gss_name_t, read) Name tobe displayed.

output_name_buffer

(buffer, character-string,modify) Buffer to receivetextual name string. Theapplication must freestorage associated with thisname after use with a call togss_release_buffer().

output_name_type

(Object ID, modify,optional) The type of thereturned name. Thereturned gss_OID will be apointer into static storage,and should be treated asread-only by the caller (inparticular, the applicationshould not attempt to freeit). Specify NULL if notrequired.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_NAME: input_name was ill-formed.

gss_import_name ()

OM_uint32gss_import_name (OM_uint32 *minor_status,

const gss_buffer_t input_name_buffer,const gss_OID input_name_type,gss_name_t *output_name);

Convert a contiguous string name to internal form. In general, the internal name returned (via the output_name parameter)will not be an MN; the exception to this is if the input_name_type indicates that the contiguous string provided via theinput_name_buffer parameter is of type GSS_C_NT_EXPORT_NAME, in which case the returned internal name will be anMN for the mechanism that exported the name.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

input_name_buffer

(buffer, octet-string, read)Buffer containingcontiguous string name toconvert.

Page 37: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 34 / 72

input_name_type

(Object ID, read, optional)Object ID specifying typeof printable name.Applications may specifyeither GSS_C_NO_OID touse a mechanism-specificdefault printable syntax, oran OID recognized by theGSS-API implementationto name a specificnamespace.

output_name

(gss_name_t, modify)Returned name in internalform. Storage associatedwith this name must befreed by the applicationafter use with a call togss_release_name().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_NAMETYPE: The input_name_type was unrecognized.

GSS_S_BAD_NAME: The input_name parameter could not be interpreted as a name of the specified type.

GSS_S_BAD_MECH: The input name-type was GSS_C_NT_EXPORT_NAME, but the mechanism contained within the input-name is not supported.

gss_export_name ()

OM_uint32gss_export_name (OM_uint32 *minor_status,

const gss_name_t input_name,gss_buffer_t exported_name);

To produce a canonical contiguous string representation of a mechanism name (MN), suitable for direct comparison (e.g. withmemcmp) for use in authorization functions (e.g. matching entries in an access-control list). The input_name parameter mustspecify a valid MN (i.e. an internal name generated by gss_accept_sec_context() or by gss_canonicalize_name()).

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

input_name (gss_name_t, read) The MNto be exported.

exported_name

(gss_buffer_t, octet-string,modify) The canonicalcontiguous string form ofinput_name . Storageassociated with this stringmust freed by theapplication after use withgss_release_buffer().

Page 38: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 35 / 72

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NAME_NOT_MN: The provided internal name was not a mechanism name.

GSS_S_BAD_NAME: The provided internal name was ill-formed.

GSS_S_BAD_NAMETYPE: The internal name was of a type not supported by the GSS-API implementation.

gss_release_name ()

OM_uint32gss_release_name (OM_uint32 *minor_status,

gss_name_t *name);

Free GSSAPI-allocated storage associated with an internal-form name. The name is set to GSS_C_NO_NAME on successfulcompletion of this call.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

name (gss_name_t, modify) Thename to be deleted.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_NAME: The name parameter did not contain a valid name.

gss_release_buffer ()

OM_uint32gss_release_buffer (OM_uint32 *minor_status,

gss_buffer_t buffer);

Free storage associated with a buffer. The storage must have been allocated by a GSS-API routine. In addition to freeing theassociated storage, the routine will zero the length field in the descriptor to which the buffer parameter refers, and implementationsare encouraged to additionally set the pointer field in the descriptor to NULL. Any buffer object returned by a GSS-API routinemay be passed to gss_release_buffer (even if there is no storage associated with the buffer).

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

buffer

(buffer, modify) Thestorage associated with thebuffer will be deleted. Thegss_buffer_desc object willnot be freed, but its lengthfield will be zeroed.

Page 39: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 36 / 72

Returns

GSS_S_COMPLETE: Successful completion.

gss_release_oid_set ()

OM_uint32gss_release_oid_set (OM_uint32 *minor_status,

gss_OID_set *set);

Free storage associated with a GSSAPI-generated gss_OID_set object. The set parameter must refer to an OID-set that wasreturned from a GSS-API routine. gss_release_oid_set() will free the storage associated with each individual member OID, theOID set’s elements array, and the gss_OID_set_desc.

The gss_OID_set parameter is set to GSS_C_NO_OID_SET on successful completion of this routine.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

set

(Set of Object IDs, modify)The storage associated withthe gss_OID_set will bedeleted.

Returns

GSS_S_COMPLETE: Successful completion.

gss_inquire_cred ()

OM_uint32gss_inquire_cred (OM_uint32 *minor_status,

const gss_cred_id_t cred_handle,gss_name_t *name,OM_uint32 *lifetime,gss_cred_usage_t *cred_usage,gss_OID_set *mechanisms);

Obtains information about a credential.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

cred_handle

(gss_cred_id_t, read) Ahandle that refers to thetarget credential. SpecifyGSS_C_NO_CREDENTIALto inquire about the defaultinitiator principal.

Page 40: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 37 / 72

name

(gss_name_t, modify,optional) The name whoseidentity the credentialasserts. Storage associatedwith this name should befreed by the applicationafter use with a call togss_release_name().Specify NULL if notrequired.

lifetime

(Integer, modify, optional)The number of seconds forwhich the credential willremain valid. If thecredential has expired, thisparameter will be set tozero. If the implementationdoes not support credentialexpiration, the valueGSS_C_INDEFINITE willbe returned. Specify NULLif not required.

cred_usage

(gss_cred_usage_t, modify,optional) How thecredential may be used.One of the following:GSS_C_INITIATE,GSS_C_ACCEPT,GSS_C_BOTH. SpecifyNULL if not required.

mechanisms

(gss_OID_set, modify,optional) Set ofmechanisms supported bythe credential. Storageassociated with this OID setmust be freed by theapplication after use with acall togss_release_oid_set().Specify NULL if notrequired.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NO_CRED: The referenced credentials could not be accessed.

GSS_S_DEFECTIVE_CREDENTIAL: The referenced credentials were invalid.

GSS_S_CREDENTIALS_EXPIRED: The referenced credentials have expired. If the lifetime parameter was not passed asNULL, it will be set to 0.

gss_inquire_context ()

OM_uint32gss_inquire_context (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,

Page 41: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 38 / 72

gss_name_t *src_name,gss_name_t *targ_name,OM_uint32 *lifetime_rec,gss_OID *mech_type,OM_uint32 *ctx_flags,int *locally_initiated,int *open);

Obtains information about a security context. The caller must already have obtained a handle that refers to the context, althoughthe context need not be fully established.

The ctx_flags values:

GSS_C_DELEG_FLAG::

• True - Credentials were delegated from the initiator to the acceptor.

• False - No credentials were delegated.

GSS_C_MUTUAL_FLAG::

• True - The acceptor was authenticated to the initiator.

• False - The acceptor did not authenticate itself.

GSS_C_REPLAY_FLAG::

• True - replay of protected messages will be detected.

• False - replayed messages will not be detected.

GSS_C_SEQUENCE_FLAG::

• True - out-of-sequence protected messages will be detected.

• False - out-of-sequence messages will not be detected.

GSS_C_CONF_FLAG::

• True - Confidentiality service may be invoked by calling gss_wrap routine.

• False - No confidentiality service (via gss_wrap) available. gss_wrap will provide message encapsulation, data-origin authen-tication and integrity services only.

GSS_C_INTEG_FLAG::

• True - Integrity service may be invoked by calling either gss_get_mic or gss_wrap routines.

• False - Per-message integrity service unavailable.

GSS_C_ANON_FLAG::

• True - The initiator’s identity will not be revealed to the acceptor. The src_name parameter (if requested) contains an anony-mous internal name.

• False - The initiator has been authenticated normally.

GSS_C_PROT_READY_FLAG::

Page 42: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 39 / 72

• True - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are availablefor use.

• False - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are availableonly if the context is fully established (i.e. if the open parameter is non-zero).

GSS_C_TRANS_FLAG::

• True - The resultant security context may be transferred to other processes via a call to gss_export_sec_context().

• False - The security context is not transferable.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle(gss_ctx_id_t, read) Ahandle that refers to thesecurity context.

src_name

(gss_name_t, modify,optional) The name of thecontext initiator. If thecontext was establishedusing anonymousauthentication, and if theapplication invokinggss_inquire_context is thecontext acceptor, ananonymous name will bereturned. Storageassociated with this namemust be freed by theapplication after use with acall to gss_release_name().Specify NULL if notrequired.

targ_name

(gss_name_t, modify,optional) The name of thecontext acceptor. Storageassociated with this namemust be freed by theapplication after use with acall to gss_release_name().If the context acceptor didnot authenticate itself, andif the initiator did notspecify a target name in itscall togss_init_sec_context(), thevalue GSS_C_NO_NAMEwill be returned. SpecifyNULL if not required.

Page 43: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 40 / 72

lifetime_rec

(Integer, modify, optional)The number of seconds forwhich the context willremain valid. If the contexthas expired, this parameterwill be set to zero. If theimplementation does notsupport context expiration,the valueGSS_C_INDEFINITE willbe returned. Specify NULLif not required.

mech_type

(gss_OID, modify,optional) The securitymechanism providing thecontext. The returned OIDwill be a pointer to staticstorage that should betreated as read-only by theapplication; in particular theapplication should notattempt to free it. SpecifyNULL if not required.

ctx_flags

(bit-mask, modify, optional)Contains variousindependent flags, each ofwhich indicates that thecontext supports (or isexpected to support, ifctx_open is false) a specificservice option. If notneeded, specify NULL.Symbolic names areprovided for each flag, andthe symbolic namescorresponding to therequired flags should belogically-ANDed with theret_flags value to testwhether a given option issupported by the context.See below for the flags.

locally_initiated

(Boolean, modify)Non-zero if the invokingapplication is the contextinitiator. Specify NULL ifnot required.

open

(Boolean, modify)Non-zero if the context isfully established; Zero if acontext-establishment tokenis expected from the peerapplication. Specify NULLif not required.

Page 44: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 41 / 72

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NO_CONTEXT: The referenced context could not be accessed.

gss_wrap_size_limit ()

OM_uint32gss_wrap_size_limit (OM_uint32 *minor_status,

const gss_ctx_id_t context_handle,int conf_req_flag,gss_qop_t qop_req,OM_uint32 req_output_size,OM_uint32 *max_input_size);

Allows an application to determine the maximum message size that, if presented to gss_wrap with the same conf_req_flag andqop_req parameters, will result in an output token containing no more than req_output_size bytes.

This call is intended for use by applications that communicate over protocols that impose a maximum message size. It enablesthe application to fragment messages prior to applying protection.

GSS-API implementations are recommended but not required to detect invalid QOP values when gss_wrap_size_limit() is called.This routine guarantees only a maximum message size, not the availability of specific QOP values for message protection.

Successful completion of this call does not guarantee that gss_wrap will be able to protect a message of length max_input_sizebytes, since this ability may depend on the availability of system resources at the time that gss_wrap is called. However, if theimplementation itself imposes an upper limit on the length of messages that may be processed by gss_wrap, the implementationshould not return a value via max_input_bytes that is greater than this length.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle

(gss_ctx_id_t, read) Ahandle that refers to thesecurity over which themessages will be sent.

conf_req_flag

(Boolean, read) Indicateswhether gss_wrap will beasked to applyconfidentiality protection inaddition to integrityprotection. See the routinedescription for gss_wrap formore details.

qop_req

(gss_qop_t, read) Indicatesthe level of protection thatgss_wrap will be asked toprovide. See the routinedescription for gss_wrap formore details.

req_output_size(Integer, read) The desiredmaximum size for tokensemitted by gss_wrap.

Page 45: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 42 / 72

max_input_size

(Integer, modify) Themaximum input messagesize that may be presentedto gss_wrap in order toguarantee that the emittedtoken shall be no larger thanreq_output_size bytes.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NO_CONTEXT: The referenced context could not be accessed.

GSS_S_CONTEXT_EXPIRED: The context has expired.

GSS_S_BAD_QOP: The specified QOP is not supported by the mechanism.

gss_add_cred ()

OM_uint32gss_add_cred (OM_uint32 *minor_status,

const gss_cred_id_t input_cred_handle,const gss_name_t desired_name,const gss_OID desired_mech,gss_cred_usage_t cred_usage,OM_uint32 initiator_time_req,OM_uint32 acceptor_time_req,gss_cred_id_t *output_cred_handle,gss_OID_set *actual_mechs,OM_uint32 *initiator_time_rec,OM_uint32 *acceptor_time_rec);

Adds a credential-element to a credential. The credential-element is identified by the name of the principal to which it refers.GSS-API implementations must impose a local access-control policy on callers of this routine to prevent unauthorized callersfrom acquiring credential-elements to which they are not entitled. This routine is not intended to provide a "login to the network"function, as such a function would involve the creation of new mechanism-specific authentication data, rather than merely ac-quiring a GSS-API handle to existing data. Such functions, if required, should be defined in implementation-specific extensionsto the API.

If desired_name is GSS_C_NO_NAME, the call is interpreted as a request to add a credential element that will invoke default be-havior when passed to gss_init_sec_context() (if cred_usage is GSS_C_INITIATE or GSS_C_BOTH) or gss_accept_sec_context()(if cred_usage is GSS_C_ACCEPT or GSS_C_BOTH).

This routine is expected to be used primarily by context acceptors, since implementations are likely to provide mechanism-specific ways of obtaining GSS-API initiator credentials from the system login process. Some implementations may thereforenot support the acquisition of GSS_C_INITIATE or GSS_C_BOTH credentials via gss_acquire_cred for any name other thanGSS_C_NO_NAME, or a name produced by applying either gss_inquire_cred to a valid credential, or gss_inquire_context to anactive context.

If credential acquisition is time-consuming for a mechanism, the mechanism may choose to delay the actual acquisition until thecredential is required (e.g. by gss_init_sec_context or gss_accept_sec_context). Such mechanism-specific implementation deci-sions should be invisible to the calling application; thus a call of gss_inquire_cred immediately following the call of gss_add_credmust return valid credential data, and may therefore incur the overhead of a deferred credential acquisition.

This routine can be used to either compose a new credential containing all credential-elements of the original in addition to thenewly-acquire credential-element, or to add the new credential- element to an existing credential. If NULL is specified for the out-put_cred_handle parameter argument, the new credential-element will be added to the credential identified by input_cred_handle;if a valid pointer is specified for the output_cred_handle parameter, a new credential handle will be created.

If GSS_C_NO_CREDENTIAL is specified as the input_cred_handle, gss_add_cred will compose a credential (and set the out-put_cred_handle parameter accordingly) based on default behavior. That is, the call will have the same effect as if the application

Page 46: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 43 / 72

had first made a call to gss_acquire_cred(), specifying the same usage and passing GSS_C_NO_NAME as the desired_nameparameter to obtain an explicit credential handle embodying default behavior, passed this credential handle to gss_add_cred(),and finally called gss_release_cred() on the first credential handle.

If GSS_C_NO_CREDENTIAL is specified as the input_cred_handle parameter, a non-NULL output_cred_handle must be sup-plied.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

input_cred_handle

(gss_cred_id_t, read,optional) The credential towhich a credential-elementwill be added. IfGSS_C_NO_CREDENTIALis specified, the routine willcompose the new credentialbased on default behavior(see text). Note that, whilethe credential-handle is notmodified bygss_add_cred(), theunderlying credential willbe modified ifoutput_credential_handle isNULL.

desired_name

(gss_name_t, read.) Nameof principal whosecredential should beacquired.

desired_mech

(Object ID, read)Underlying securitymechanism with which thecredential may be used.

cred_usage

(gss_cred_usage_t, read)GSS_C_BOTH - Credentialmay be used either toinitiate or accept securitycontexts.GSS_C_INITIATE -Credential will only be usedto initiate security contexts.GSS_C_ACCEPT -Credential will only be usedto accept security contexts.

Page 47: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 44 / 72

initiator_time_req

(Integer, read, optional)number of seconds that thecredential should remainvalid for initiating securitycontexts. This argument isignored if the composedcredentials are of typeGSS_C_ACCEPT. SpecifyGSS_C_INDEFINITE torequest that the credentialshave the maximumpermitted initiator lifetime.

acceptor_time_req

(Integer, read, optional)number of seconds that thecredential should remainvalid for accepting securitycontexts. This argument isignored if the composedcredentials are of typeGSS_C_INITIATE. SpecifyGSS_C_INDEFINITE torequest that the credentialshave the maximumpermitted initiator lifetime.

output_cred_handle

(gss_cred_id_t, modify,optional) The returnedcredential handle,containing the newcredential-element and allthe credential-elementsfrom input_cred_handle. Ifa valid pointer to agss_cred_id_t is suppliedfor this parameter,gss_add_cred creates a newcredential handlecontaining allcredential-elements fromthe input_cred_handle andthe newly acquiredcredential-element; ifNULL is specified for thisparameter, the newlyacquired credential-elementwill be added to thecredential identified byinput_cred_handle. Theresources associated withany credential handlereturned via this parametermust be released by theapplication after use with acall to gss_release_cred().

Page 48: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 45 / 72

actual_mechs

(Set of Object IDs, modify,optional) The complete setof mechanisms for whichthe new credential is valid.Storage for the returnedOID-set must be freed bythe application after usewith a call togss_release_oid_set().Specify NULL if notrequired.

initiator_time_rec

(Integer, modify, optional)Actual number of secondsfor which the returnedcredentials will remainvalid for initiating contextsusing the specifiedmechanism. If theimplementation ormechanism does notsupport expiration ofcredentials, the valueGSS_C_INDEFINITE willbe returned. Specify NULLif not required

acceptor_time_rec

(Integer, modify, optional)Actual number of secondsfor which the returnedcredentials will remainvalid for accepting securitycontexts using the specifiedmechanism. If theimplementation ormechanism does notsupport expiration ofcredentials, the valueGSS_C_INDEFINITE willbe returned. Specify NULLif not required

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_MECH: Unavailable mechanism requested.

GSS_S_BAD_NAMETYPE: Type contained within desired_name parameter is not supported.

GSS_S_BAD_NAME: Value supplied for desired_name parameter is ill-formed.

GSS_S_DUPLICATE_ELEMENT: The credential already contains an element for the requested mechanism with overlappingusage and validity period.

GSS_S_CREDENTIALS_EXPIRED: The required credentials could not be added because they have expired.

GSS_S_NO_CRED: No credentials were found for the specified name.

gss_inquire_cred_by_mech ()

Page 49: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 46 / 72

OM_uint32gss_inquire_cred_by_mech (OM_uint32 *minor_status,

const gss_cred_id_t cred_handle,const gss_OID mech_type,gss_name_t *name,OM_uint32 *initiator_lifetime,OM_uint32 *acceptor_lifetime,gss_cred_usage_t *cred_usage);

Obtains per-mechanism information about a credential.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

cred_handle

(gss_cred_id_t, read) Ahandle that refers to thetarget credential. SpecifyGSS_C_NO_CREDENTIALto inquire about the defaultinitiator principal.

mech_type

(gss_OID, read) Themechanism for whichinformation should bereturned.

name

(gss_name_t, modify,optional) The name whoseidentity the credentialasserts. Storage associatedwith this name must befreed by the applicationafter use with a call togss_release_name().Specify NULL if notrequired.

initiator_lifetime

(Integer, modify, optional)The number of seconds forwhich the credential willremain capable of initiatingsecurity contexts under thespecified mechanism. If thecredential can no longer beused to initiate contexts, orif the credential usage forthis mechanism isGSS_C_ACCEPT, thisparameter will be set tozero. If the implementationdoes not support expirationof initiator credentials, thevalueGSS_C_INDEFINITE willbe returned. Specify NULLif not required.

Page 50: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 47 / 72

acceptor_lifetime

(Integer, modify, optional)The number of seconds forwhich the credential willremain capable of acceptingsecurity contexts under thespecified mechanism. If thecredential can no longer beused to accept contexts, orif the credential usage forthis mechanism isGSS_C_INITIATE, thisparameter will be set tozero. If the implementationdoes not support expirationof acceptor credentials, thevalueGSS_C_INDEFINITE willbe returned. Specify NULLif not required.

cred_usage

(gss_cred_usage_t, modify,optional) How thecredential may be used withthe specified mechanism.One of the following:GSS_C_INITIATE,GSS_C_ACCEPT,GSS_C_BOTH. SpecifyNULL if not required.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NO_CRED: The referenced credentials could not be accessed.

GSS_S_DEFECTIVE_CREDENTIAL: The referenced credentials were invalid.

GSS_S_CREDENTIALS_EXPIRED: The referenced credentials have expired. If the lifetime parameter was not passed asNULL, it will be set to 0.

gss_export_sec_context ()

OM_uint32gss_export_sec_context (OM_uint32 *minor_status,

gss_ctx_id_t *context_handle,gss_buffer_t interprocess_token);

Provided to support the sharing of work between multiple processes. This routine will typically be used by the context-acceptor,in an application where a single process receives incoming connection requests and accepts security contexts over them, thenpasses the established context to one or more other processes for message exchange. gss_export_sec_context() deactivates thesecurity context for the calling process and creates an interprocess token which, when passed to gss_import_sec_context inanother process, will re-activate the context in the second process. Only a single instantiation of a given context may be active atany one time; a subsequent attempt by a context exporter to access the exported security context will fail.

The implementation may constrain the set of processes by which the interprocess token may be imported, either as a function oflocal security policy, or as a result of implementation decisions. For example, some implementations may constrain contexts tobe passed only between processes that run under the same account, or which are part of the same process group.

Page 51: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 48 / 72

The interprocess token may contain security-sensitive information (for example cryptographic keys). While mechanisms areencouraged to either avoid placing such sensitive information within interprocess tokens, or to encrypt the token before returningit to the application, in a typical object-library GSS-API implementation this may not be possible. Thus the application must takecare to protect the interprocess token, and ensure that any process to which the token is transferred is trustworthy.

If creation of the interprocess token is successful, the implementation shall deallocate all process-wide resources associated withthe security context, and set the context_handle to GSS_C_NO_CONTEXT. In the event of an error that makes it impossibleto complete the export of the security context, the implementation must not return an interprocess token, and should strive toleave the security context referenced by the context_handle parameter untouched. If this is impossible, it is permissible for theimplementation to delete the security context, providing it also sets the context_handle parameter to GSS_C_NO_CONTEXT.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

context_handle(gss_ctx_id_t, modify)Context handle identifyingthe context to transfer.

interprocess_token

(buffer, opaque, modify)Token to be transferred totarget process. Storageassociated with this tokenmust be freed by theapplication after use with acall to gss_release_buffer().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_CONTEXT_EXPIRED: The context has expired.

GSS_S_NO_CONTEXT: The context was invalid.

GSS_S_UNAVAILABLE: The operation is not supported.

gss_import_sec_context ()

OM_uint32gss_import_sec_context (OM_uint32 *minor_status,

const gss_buffer_t interprocess_token,gss_ctx_id_t *context_handle);

Allows a process to import a security context established by another process. A given interprocess token may be imported onlyonce. See gss_export_sec_context.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

interprocess_token(buffer, opaque, modify)Token received fromexporting process

Page 52: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 49 / 72

context_handle

(gss_ctx_id_t, modify)Context handle of newlyreactivated context.Resources associated withthis context handle must bereleased by the applicationafter use with a call togss_delete_sec_context().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_NO_CONTEXT: The token did not contain a valid context reference.

GSS_S_DEFECTIVE_TOKEN: The token was invalid.

GSS_S_UNAVAILABLE: The operation is unavailable.

GSS_S_UNAUTHORIZED: Local policy prevents the import of this context by the current process.

gss_create_empty_oid_set ()

OM_uint32gss_create_empty_oid_set (OM_uint32 *minor_status,

gss_OID_set *oid_set);

Create an object-identifier set containing no object identifiers, to which members may be subsequently added using the gss_add_oid_set_member()routine. These routines are intended to be used to construct sets of mechanism object identifiers, for input to gss_acquire_cred.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

oid_set

(Set of Object IDs, modify)The empty object identifierset. The routine willallocate thegss_OID_set_desc object,which the application mustfree after use with a call togss_release_oid_set().

Returns

GSS_S_COMPLETE: Successful completion.

gss_add_oid_set_member ()

OM_uint32gss_add_oid_set_member (OM_uint32 *minor_status,

const gss_OID member_oid,gss_OID_set *oid_set);

Add an Object Identifier to an Object Identifier set. This routine is intended for use in conjunction with gss_create_empty_oid_setwhen constructing a set of mechanism OIDs for input to gss_acquire_cred. The oid_set parameter must refer to an OID-set that

Page 53: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 50 / 72

was created by GSS-API (e.g. a set returned by gss_create_empty_oid_set()). GSS-API creates a copy of the member_oid andinserts this copy into the set, expanding the storage allocated to the OID-set’s elements array if necessary. The routine may addthe new member OID anywhere within the elements array, and implementations should verify that the new member_oid is notalready contained within the elements array; if the member_oid is already present, the oid_set should remain unchanged.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

member_oid(Object ID, read) Theobject identifier to copiedinto the set.

oid_set

(Set of Object ID, modify)The set in which the objectidentifier should beinserted.

Returns

GSS_S_COMPLETE: Successful completion.

gss_test_oid_set_member ()

OM_uint32gss_test_oid_set_member (OM_uint32 *minor_status,

const gss_OID member,const gss_OID_set set,int *present);

Interrogate an Object Identifier set to determine whether a specified Object Identifier is a member. This routine is intended tobe used with OID sets returned by gss_indicate_mechs(), gss_acquire_cred(), and gss_inquire_cred(), but will also work withuser-generated sets.

Parameters

minor_status(integer, modify)Mechanism specific statuscode.

member(Object ID, read) Theobject identifier whosepresence is to be tested.

set (Set of Object ID, read) TheObject Identifier set.

present

(Boolean, modify)Non-zero if the specifiedOID is a member of the set,zero if not.

Returns

GSS_S_COMPLETE: Successful completion.

Page 54: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 51 / 72

gss_inquire_names_for_mech ()

OM_uint32gss_inquire_names_for_mech (OM_uint32 *minor_status,

const gss_OID mechanism,gss_OID_set *name_types);

Returns the set of nametypes supported by the specified mechanism.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

mechanism(gss_OID, read) Themechanism to beinterrogated.

name_types

(gss_OID_set, modify) Setof name-types supported bythe specified mechanism.The returned OID set mustbe freed by the applicationafter use with a call togss_release_oid_set().

Returns

GSS_S_COMPLETE: Successful completion.

gss_inquire_mechs_for_name ()

OM_uint32gss_inquire_mechs_for_name (OM_uint32 *minor_status,

const gss_name_t input_name,gss_OID_set *mech_types);

Returns the set of mechanisms supported by the GSS-API implementation that may be able to process the specified name.

Each mechanism returned will recognize at least one element within the name. It is permissible for this routine to be implementedwithin a mechanism-independent GSS-API layer, using the type information contained within the presented name, and based onregistration information provided by individual mechanism implementations. This means that the returned mech_types set mayindicate that a particular mechanism will understand the name when in fact it would refuse to accept the name as input togss_canonicalize_name, gss_init_sec_context, gss_acquire_cred or gss_add_cred (due to some property of the specific name, asopposed to the name type). Thus this routine should be used only as a prefilter for a call to a subsequent mechanism-specificroutine.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

input_name(gss_name_t, read) Thename to which the inquiryrelates.

Page 55: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 52 / 72

mech_types

(gss_OID_set, modify) Setof mechanisms that maysupport the specified name.The returned OID set mustbe freed by the caller afteruse with a call togss_release_oid_set().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_NAME: The input_name parameter was ill-formed.

GSS_S_BAD_NAMETYPE: The input_name parameter contained an invalid or unsupported type of name.

gss_canonicalize_name ()

OM_uint32gss_canonicalize_name (OM_uint32 *minor_status,

const gss_name_t input_name,const gss_OID mech_type,gss_name_t *output_name);

Generate a canonical mechanism name (MN) from an arbitrary internal name. The mechanism name is the name that wouldbe returned to a context acceptor on successful authentication of a context where the initiator used the input_name in a suc-cessful call to gss_acquire_cred, specifying an OID set containing mech_type as its only member, followed by a call togss_init_sec_context(), specifying mech_type as the authentication mechanism.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

input_name(gss_name_t, read) Thename for which a canonicalform is desired.

mech_type

(Object ID, read) Theauthentication mechanismfor which the canonicalform of the name is desired.The desired mechanismmust be specified explicitly;no default is provided.

output_name

(gss_name_t, modify) Theresultant canonical name.Storage associated with thisname must be freed by theapplication after use with acall to gss_release_name().

Returns

GSS_S_COMPLETE: Successful completion.

Page 56: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 53 / 72

gss_duplicate_name ()

OM_uint32gss_duplicate_name (OM_uint32 *minor_status,

const gss_name_t src_name,gss_name_t *dest_name);

Create an exact duplicate of the existing internal name src_name . The new dest_name will be independent of src_name (i.e.src_name and dest_name must both be released, and the release of one shall not affect the validity of the other).

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

src_name (gss_name_t, read) Internalname to be duplicated.

dest_name

(gss_name_t, modify) Theresultant copy of src_name. Storage associated withthis name must be freed bythe application after usewith a call togss_release_name().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_NAME: The src_name parameter was ill-formed.

gss_sign ()

OM_uint32gss_sign (OM_uint32 *minor_status,

gss_ctx_id_t context_handle,int qop_req,gss_buffer_t message_buffer,gss_buffer_t message_token);

Returns

gss_verify ()

OM_uint32gss_verify (OM_uint32 *minor_status,

gss_ctx_id_t context_handle,gss_buffer_t message_buffer,gss_buffer_t token_buffer,int *qop_state);

Page 57: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 54 / 72

Returns

gss_seal ()

OM_uint32gss_seal (OM_uint32 *minor_status,

gss_ctx_id_t context_handle,int conf_req_flag,int qop_req,gss_buffer_t input_message_buffer,int *conf_state,gss_buffer_t output_message_buffer);

Returns

gss_unseal ()

OM_uint32gss_unseal (OM_uint32 *minor_status,

gss_ctx_id_t context_handle,gss_buffer_t input_message_buffer,gss_buffer_t output_message_buffer,int *conf_state,int *qop_state);

Returns

gss_inquire_saslname_for_mech ()

OM_uint32gss_inquire_saslname_for_mech (OM_uint32 *minor_status,

const gss_OID desired_mech,gss_buffer_t sasl_mech_name,gss_buffer_t mech_name,gss_buffer_t mech_description);

Output the SASL mechanism name of a GSS-API mechanism. It also returns a name and description of the mechanism in a userfriendly form.

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

desired_mech(OID, read) Identifies theGSS-API mechanism toquery.

sasl_mech_name

(buffer, character-string,modify, optional) Buffer toreceive SASL mechanismname. The application mustfree storage associated withthis name after use with acall to gss_release_buffer().

Page 58: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 55 / 72

mech_name

(buffer, character-string,modify, optional) Buffer toreceive human readablemechanism name. Theapplication must freestorage associated with thisname after use with a call togss_release_buffer().

mech_description

(buffer, character-string,modify, optional) Buffer toreceive description ofmechanism. Theapplication must freestorage associated with thisname after use with a call togss_release_buffer().

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_MECH: The desired_mech OID is unsupported.

gss_inquire_mech_for_saslname ()

OM_uint32gss_inquire_mech_for_saslname (OM_uint32 *minor_status,

const gss_buffer_t sasl_mech_name,gss_OID *mech_type);

Output GSS-API mechanism OID of mechanism associated with given sasl_mech_name .

Parameters

minor_status(Integer, modify)Mechanism specific statuscode.

sasl_mech_name(buffer, character-string,read) Buffer with SASLmechanism name.

mech_type

(OID, modify, optional)Actual mechanism used.The OID returned via thisparameter will be a pointerto static storage that shouldbe treated as read-only; Inparticular the applicationshould not attempt to free it.Specify NULL if notrequired.

Returns

GSS_S_COMPLETE: Successful completion.

GSS_S_BAD_MECH: There is no GSS-API mechanism known as sasl_mech_name .

Page 59: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 56 / 72

gss_oid_equal ()

intgss_oid_equal (gss_const_OID first_oid,

gss_const_OID second_oid);

Compare two OIDs for equality. The comparison is "deep", i.e., the actual byte sequences of the OIDs are compared instead ofjust the pointer equality. This function is standardized in RFC 6339.

Parameters

first_oid (Object ID, read) FirstObject identifier.

second_oid (Object ID, read) FirstObject identifier.

Returns

Returns boolean value true when the two OIDs are equal, otherwise false.

gss_encapsulate_token ()

OM_uint32gss_encapsulate_token (gss_const_buffer_t input_token,

gss_const_OID token_oid,gss_buffer_t output_token);

Add the mechanism-independent token header to GSS-API context token data. This is used for the initial token of a GSS-APIcontext establishment sequence. It incorporates an identifier of the mechanism type to be used on that context, and enables tokensto be interpreted unambiguously at GSS-API peers. See further section 3.1 of RFC 2743. This function is standardized in RFC6339.

Parameters

input_token(buffer, opaque, read)Buffer with GSS-APIcontext token data.

token_oid (Object ID, read) Objectidentifier of token.

output_token

(buffer, opaque, modify)Encapsulated token data;caller must release withgss_release_buffer().

Returns

GSS_S_COMPLETE: Indicates successful completion, and that output parameters holds correct information.

GSS_S_FAILURE: Indicates that encapsulation failed for reasons unspecified at the GSS-API level.

gss_decapsulate_token ()

OM_uint32

Page 60: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 57 / 72

gss_decapsulate_token (gss_const_buffer_t input_token,gss_const_OID token_oid,gss_buffer_t output_token);

Remove the mechanism-independent token header from an initial GSS-API context token. Unwrap a buffer in the mechanism-independent token format. This is the reverse of gss_encapsulate_token(). The translation is loss-less, all data is preserved as is.This function is standardized in RFC 6339.

Parameters

input_token(buffer, opaque, read)Buffer with GSS-APIcontext token.

token_oid (Object ID, read) Expectedobject identifier of token.

output_token

(buffer, opaque, modify)Decapsulated token data;caller must release withgss_release_buffer().

Returns

GSS_S_COMPLETE: Indicates successful completion, and that output parameters holds correct information.

GSS_S_DEFECTIVE_TOKEN: Means that the token failed consistency checks (e.g., OID mismatch or ASN.1 DER lengtherrors).

GSS_S_FAILURE: Indicates that decapsulation failed for reasons unspecified at the GSS-API level.

Types and Values

gss_ctx_id_t

typedef struct gss_ctx_id_struct *gss_ctx_id_t;

gss_cred_id_t

typedef struct gss_cred_id_struct *gss_cred_id_t;

gss_name_t

typedef struct gss_name_struct *gss_name_t;

gss_uint32

typedef unsigned short gss_uint32;

OM_uint32

typedef gss_uint32 OM_uint32;

Page 61: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 58 / 72

gss_qop_t

typedef OM_uint32 gss_qop_t;

gss_cred_usage_t

typedef int gss_cred_usage_t;

GSS_C_DELEG_FLAG

#define GSS_C_DELEG_FLAG 1

GSS_C_MUTUAL_FLAG

#define GSS_C_MUTUAL_FLAG 2

GSS_C_REPLAY_FLAG

#define GSS_C_REPLAY_FLAG 4

GSS_C_SEQUENCE_FLAG

#define GSS_C_SEQUENCE_FLAG 8

GSS_C_CONF_FLAG

#define GSS_C_CONF_FLAG 16

GSS_C_INTEG_FLAG

#define GSS_C_INTEG_FLAG 32

GSS_C_ANON_FLAG

#define GSS_C_ANON_FLAG 64

GSS_C_PROT_READY_FLAG

#define GSS_C_PROT_READY_FLAG 128

GSS_C_TRANS_FLAG

#define GSS_C_TRANS_FLAG 256

Page 62: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 59 / 72

GSS_C_BOTH

#define GSS_C_BOTH 0

GSS_C_INITIATE

#define GSS_C_INITIATE 1

GSS_C_ACCEPT

#define GSS_C_ACCEPT 2

GSS_C_GSS_CODE

#define GSS_C_GSS_CODE 1

GSS_C_MECH_CODE

#define GSS_C_MECH_CODE 2

GSS_C_AF_UNSPEC

#define GSS_C_AF_UNSPEC 0

GSS_C_AF_LOCAL

#define GSS_C_AF_LOCAL 1

GSS_C_AF_INET

#define GSS_C_AF_INET 2

GSS_C_AF_IMPLINK

#define GSS_C_AF_IMPLINK 3

GSS_C_AF_PUP

#define GSS_C_AF_PUP 4

GSS_C_AF_CHAOS

#define GSS_C_AF_CHAOS 5

Page 63: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 60 / 72

GSS_C_AF_NS

#define GSS_C_AF_NS 6

GSS_C_AF_NBS

#define GSS_C_AF_NBS 7

GSS_C_AF_ECMA

#define GSS_C_AF_ECMA 8

GSS_C_AF_DATAKIT

#define GSS_C_AF_DATAKIT 9

GSS_C_AF_CCITT

#define GSS_C_AF_CCITT 10

GSS_C_AF_SNA

#define GSS_C_AF_SNA 11

GSS_C_AF_DECnet

#define GSS_C_AF_DECnet 12

GSS_C_AF_DLI

#define GSS_C_AF_DLI 13

GSS_C_AF_LAT

#define GSS_C_AF_LAT 14

GSS_C_AF_HYLINK

#define GSS_C_AF_HYLINK 15

GSS_C_AF_APPLETALK

#define GSS_C_AF_APPLETALK 16

Page 64: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 61 / 72

GSS_C_AF_BSC

#define GSS_C_AF_BSC 17

GSS_C_AF_DSS

#define GSS_C_AF_DSS 18

GSS_C_AF_OSI

#define GSS_C_AF_OSI 19

GSS_C_AF_X25

#define GSS_C_AF_X25 21

GSS_C_AF_NULLADDR

#define GSS_C_AF_NULLADDR 255

GSS_C_EMPTY_BUFFER

#define GSS_C_EMPTY_BUFFER {0, NULL}

GSS_C_NULL_OID

#define GSS_C_NULL_OID GSS_C_NO_OID

GSS_C_NULL_OID_SET

#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET

GSS_C_QOP_DEFAULT

#define GSS_C_QOP_DEFAULT 0

GSS_C_INDEFINITE

#define GSS_C_INDEFINITE 0xfffffffful

GSS_C_NT_USER_NAME

extern gss_OID GSS_C_NT_USER_NAME;

Page 65: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 62 / 72

GSS_C_NT_MACHINE_UID_NAME

extern gss_OID GSS_C_NT_MACHINE_UID_NAME;

GSS_C_NT_STRING_UID_NAME

extern gss_OID GSS_C_NT_STRING_UID_NAME;

GSS_C_NT_HOSTBASED_SERVICE_X

extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;

GSS_C_NT_HOSTBASED_SERVICE

extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;

GSS_C_NT_ANONYMOUS

extern gss_OID GSS_C_NT_ANONYMOUS;

GSS_C_NT_EXPORT_NAME

extern gss_OID GSS_C_NT_EXPORT_NAME;

GSS_S_COMPLETE

#define GSS_S_COMPLETE 0

GSS_C_CALLING_ERROR_OFFSET

#define GSS_C_CALLING_ERROR_OFFSET 24

GSS_C_ROUTINE_ERROR_OFFSET

#define GSS_C_ROUTINE_ERROR_OFFSET 16

GSS_C_SUPPLEMENTARY_OFFSET

#define GSS_C_SUPPLEMENTARY_OFFSET 0

GSS_C_CALLING_ERROR_MASK

#define GSS_C_CALLING_ERROR_MASK 0377ul

Page 66: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 63 / 72

GSS_C_ROUTINE_ERROR_MASK

#define GSS_C_ROUTINE_ERROR_MASK 0377ul

GSS_C_SUPPLEMENTARY_MASK

#define GSS_C_SUPPLEMENTARY_MASK 0177777ul

GSS_S_CALL_INACCESSIBLE_READ

#define GSS_S_CALL_INACCESSIBLE_READ~(1ul << GSS_C_CALLING_ERROR_OFFSET)

GSS_S_CALL_INACCESSIBLE_WRITE

#define GSS_S_CALL_INACCESSIBLE_WRITE~(2ul << GSS_C_CALLING_ERROR_OFFSET)

GSS_S_CALL_BAD_STRUCTURE

#define GSS_S_CALL_BAD_STRUCTURE~(3ul << GSS_C_CALLING_ERROR_OFFSET)

GSS_S_BAD_MIC

#define GSS_S_BAD_MIC GSS_S_BAD_SIG

GSS_S_CONTINUE_NEEDED

#define GSS_S_CONTINUE_NEEDED~(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))

GSS_S_DUPLICATE_TOKEN

#define GSS_S_DUPLICATE_TOKEN~(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))

GSS_S_OLD_TOKEN

#define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))

GSS_S_UNSEQ_TOKEN

#define GSS_S_UNSEQ_TOKEN~(1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))

GSS_S_GAP_TOKEN

#define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))

Page 67: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 64 / 72

gss_const_buffer_t

typedef const gss_buffer_desc *gss_const_buffer_t;

gss_const_ctx_id_t

typedef const struct gss_ctx_id_struct *gss_const_ctx_id_t;

gss_const_cred_id_t

typedef const struct gss_cred_id_struct *gss_const_cred_id_t;

gss_const_name_t

typedef const struct gss_name_struct *gss_const_name_t;

gss_const_OID

typedef const gss_OID_desc *gss_const_OID;

gss_const_OID_set

typedef const gss_OID_set_desc *gss_const_OID_set;

1.3 ext

ext —

Functions

const char * gss_check_version ()int gss_userok ()

Types and Values

extern gss_OID_desc GSS_C_NT_USER_NAME_staticextern gss_OID_desc GSS_C_NT_MACHINE_UID_NAME_staticextern gss_OID_desc GSS_C_NT_STRING_UID_NAME_staticextern gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_X_staticextern gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_staticextern gss_OID_desc GSS_C_NT_ANONYMOUS_staticextern gss_OID_desc GSS_C_NT_EXPORT_NAME_static

Page 68: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 65 / 72

Description

Functions

gss_check_version ()

const char~*gss_check_version (const char *req_version);

Check that the version of the library is at minimum the one given as a string in req_version .

WARNING: This function is a GNU GSS specific extension, and is not part of the official GSS API.

Parameters

req_version version string to comparewith, or NULL

Returns

The actual version string of the library; NULL if the condition is not met. If NULL is passed to this function no check is doneand only the version string is returned.

gss_userok ()

intgss_userok (const gss_name_t name,

const char *username);

Compare the username against the output from gss_export_name() invoked on name , after removing the leading OID. Thisanswers the question whether the particular mechanism would authenticate them as the same principal

WARNING: This function is a GNU GSS specific extension, and is not part of the official GSS API.

Parameters

name (gss_name_t, read) Name tobe compared.

username Zero terminated string withusername.

Returns

Returns 0 if the names match, non-0 otherwise.

Types and Values

GSS_C_NT_USER_NAME_static

extern gss_OID_desc GSS_C_NT_USER_NAME_static;

Page 69: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 66 / 72

GSS_C_NT_MACHINE_UID_NAME_static

extern gss_OID_desc GSS_C_NT_MACHINE_UID_NAME_static;

GSS_C_NT_STRING_UID_NAME_static

extern gss_OID_desc GSS_C_NT_STRING_UID_NAME_static;

GSS_C_NT_HOSTBASED_SERVICE_X_static

extern gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_X_static;

GSS_C_NT_HOSTBASED_SERVICE_static

extern gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_static;

GSS_C_NT_ANONYMOUS_static

extern gss_OID_desc GSS_C_NT_ANONYMOUS_static;

GSS_C_NT_EXPORT_NAME_static

extern gss_OID_desc GSS_C_NT_EXPORT_NAME_static;

1.4 krb5

krb5 —

Types and Values

#define GSS_KRB5_S_G_BAD_SERVICE_NAME#define GSS_KRB5_S_G_BAD_STRING_UID#define GSS_KRB5_S_G_NOUSER#define GSS_KRB5_S_G_VALIDATE_FAILED#define GSS_KRB5_S_G_BUFFER_ALLOC#define GSS_KRB5_S_G_BAD_MSG_CTX#define GSS_KRB5_S_G_WRONG_SIZE#define GSS_KRB5_S_G_BAD_USAGE#define GSS_KRB5_S_G_UNKNOWN_QOP#define GSS_KRB5_S_KG_CCACHE_NOMATCH#define GSS_KRB5_S_KG_KEYTAB_NOMATCH#define GSS_KRB5_S_KG_TGT_MISSING#define GSS_KRB5_S_KG_NO_SUBKEY#define GSS_KRB5_S_KG_CONTEXT_ESTABLISHED#define GSS_KRB5_S_KG_BAD_SIGN_TYPE#define GSS_KRB5_S_KG_BAD_LENGTH

Page 70: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 67 / 72

#define GSS_KRB5_S_KG_CTX_INCOMPLETEextern gss_OID GSS_KRB5_NT_USER_NAMEextern gss_OID GSS_KRB5_NT_HOSTBASED_SERVICE_NAMEextern gss_OID GSS_KRB5_NT_PRINCIPAL_NAMEextern gss_OID GSS_KRB5_NT_MACHINE_UID_NAMEextern gss_OID GSS_KRB5_NT_STRING_UID_NAME

Description

Functions

Types and Values

GSS_KRB5_S_G_BAD_SERVICE_NAME

#define GSS_KRB5_S_G_BAD_SERVICE_NAME 1

GSS_KRB5_S_G_BAD_STRING_UID

#define GSS_KRB5_S_G_BAD_STRING_UID 2

GSS_KRB5_S_G_NOUSER

#define GSS_KRB5_S_G_NOUSER 3

GSS_KRB5_S_G_VALIDATE_FAILED

#define GSS_KRB5_S_G_VALIDATE_FAILED 4

GSS_KRB5_S_G_BUFFER_ALLOC

#define GSS_KRB5_S_G_BUFFER_ALLOC 5

GSS_KRB5_S_G_BAD_MSG_CTX

#define GSS_KRB5_S_G_BAD_MSG_CTX 6

GSS_KRB5_S_G_WRONG_SIZE

#define GSS_KRB5_S_G_WRONG_SIZE 7

GSS_KRB5_S_G_BAD_USAGE

#define GSS_KRB5_S_G_BAD_USAGE 8

Page 71: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 68 / 72

GSS_KRB5_S_G_UNKNOWN_QOP

#define GSS_KRB5_S_G_UNKNOWN_QOP 9

GSS_KRB5_S_KG_CCACHE_NOMATCH

#define GSS_KRB5_S_KG_CCACHE_NOMATCH 10

GSS_KRB5_S_KG_KEYTAB_NOMATCH

#define GSS_KRB5_S_KG_KEYTAB_NOMATCH 11

GSS_KRB5_S_KG_TGT_MISSING

#define GSS_KRB5_S_KG_TGT_MISSING 12

GSS_KRB5_S_KG_NO_SUBKEY

#define GSS_KRB5_S_KG_NO_SUBKEY 13

GSS_KRB5_S_KG_CONTEXT_ESTABLISHED

#define GSS_KRB5_S_KG_CONTEXT_ESTABLISHED 14

GSS_KRB5_S_KG_BAD_SIGN_TYPE

#define GSS_KRB5_S_KG_BAD_SIGN_TYPE 15

GSS_KRB5_S_KG_BAD_LENGTH

#define GSS_KRB5_S_KG_BAD_LENGTH 16

GSS_KRB5_S_KG_CTX_INCOMPLETE

#define GSS_KRB5_S_KG_CTX_INCOMPLETE 17

GSS_KRB5_NT_USER_NAME

extern gss_OID GSS_KRB5_NT_USER_NAME;

GSS_KRB5_NT_HOSTBASED_SERVICE_NAME

extern gss_OID GSS_KRB5_NT_HOSTBASED_SERVICE_NAME;

Page 72: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 69 / 72

GSS_KRB5_NT_PRINCIPAL_NAME

extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;

GSS_KRB5_NT_MACHINE_UID_NAME

extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;

GSS_KRB5_NT_STRING_UID_NAME

extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;

1.5 krb5-ext

krb5-ext —

Types and Values

extern gss_OID GSS_KRB5extern gss_OID_desc GSS_KRB5_staticextern gss_OID_desc GSS_KRB5_NT_USER_NAME_staticextern gss_OID_desc GSS_KRB5_NT_HOSTBASED_SERVICE_NAME_staticextern gss_OID_desc GSS_KRB5_NT_PRINCIPAL_NAME_staticextern gss_OID_desc GSS_KRB5_NT_MACHINE_UID_NAME_staticextern gss_OID_desc GSS_KRB5_NT_STRING_UID_NAME_static

Description

Functions

Types and Values

GSS_KRB5

extern gss_OID GSS_KRB5;

GSS_KRB5_static

extern gss_OID_desc GSS_KRB5_static;

GSS_KRB5_NT_USER_NAME_static

extern gss_OID_desc GSS_KRB5_NT_USER_NAME_static;

Page 73: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 70 / 72

GSS_KRB5_NT_HOSTBASED_SERVICE_NAME_static

extern gss_OID_desc GSS_KRB5_NT_HOSTBASED_SERVICE_NAME_static;

GSS_KRB5_NT_PRINCIPAL_NAME_static

extern gss_OID_desc GSS_KRB5_NT_PRINCIPAL_NAME_static;

GSS_KRB5_NT_MACHINE_UID_NAME_static

extern gss_OID_desc GSS_KRB5_NT_MACHINE_UID_NAME_static;

GSS_KRB5_NT_STRING_UID_NAME_static

extern gss_OID_desc GSS_KRB5_NT_STRING_UID_NAME_static;

Page 74: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 71 / 72

Chapter 2

Index

Ggss_accept_sec_context, 17gss_acquire_cred, 8gss_add_cred, 42gss_add_oid_set_member, 49GSS_C_ACCEPT, 59GSS_C_AF_APPLETALK, 60GSS_C_AF_BSC, 61GSS_C_AF_CCITT, 60GSS_C_AF_CHAOS, 59GSS_C_AF_DATAKIT, 60GSS_C_AF_DECnet, 60GSS_C_AF_DLI, 60GSS_C_AF_DSS, 61GSS_C_AF_ECMA, 60GSS_C_AF_HYLINK, 60GSS_C_AF_IMPLINK, 59GSS_C_AF_INET, 59GSS_C_AF_LAT, 60GSS_C_AF_LOCAL, 59GSS_C_AF_NBS, 60GSS_C_AF_NS, 60GSS_C_AF_NULLADDR, 61GSS_C_AF_OSI, 61GSS_C_AF_PUP, 59GSS_C_AF_SNA, 60GSS_C_AF_UNSPEC, 59GSS_C_AF_X25, 61GSS_C_ANON_FLAG, 58GSS_C_BOTH, 59GSS_C_CALLING_ERROR_MASK, 62GSS_C_CALLING_ERROR_OFFSET, 62GSS_C_CONF_FLAG, 58GSS_C_DELEG_FLAG, 58GSS_C_EMPTY_BUFFER, 61GSS_C_GSS_CODE, 59GSS_C_INDEFINITE, 61GSS_C_INITIATE, 59GSS_C_INTEG_FLAG, 58GSS_C_MECH_CODE, 59GSS_C_MUTUAL_FLAG, 58GSS_C_NO_BUFFER, 5GSS_C_NO_CHANNEL_BINDINGS, 6

GSS_C_NO_CONTEXT, 5GSS_C_NO_CREDENTIAL, 6GSS_C_NO_NAME, 5GSS_C_NO_OID, 5GSS_C_NO_OID_SET, 5GSS_C_NT_ANONYMOUS, 62GSS_C_NT_ANONYMOUS_static, 66GSS_C_NT_EXPORT_NAME, 62GSS_C_NT_EXPORT_NAME_static, 66GSS_C_NT_HOSTBASED_SERVICE, 62GSS_C_NT_HOSTBASED_SERVICE_static, 66GSS_C_NT_HOSTBASED_SERVICE_X, 62GSS_C_NT_HOSTBASED_SERVICE_X_static, 66GSS_C_NT_MACHINE_UID_NAME, 62GSS_C_NT_MACHINE_UID_NAME_static, 66GSS_C_NT_STRING_UID_NAME, 62GSS_C_NT_STRING_UID_NAME_static, 66GSS_C_NT_USER_NAME, 61GSS_C_NT_USER_NAME_static, 65GSS_C_NULL_OID, 61GSS_C_NULL_OID_SET, 61GSS_C_PROT_READY_FLAG, 58GSS_C_QOP_DEFAULT, 61GSS_C_REPLAY_FLAG, 58GSS_C_ROUTINE_ERROR_MASK, 63GSS_C_ROUTINE_ERROR_OFFSET, 62GSS_C_SEQUENCE_FLAG, 58GSS_C_SUPPLEMENTARY_MASK, 63GSS_C_SUPPLEMENTARY_OFFSET, 62GSS_C_TRANS_FLAG, 58GSS_CALLING_ERROR, 6gss_canonicalize_name, 52gss_check_version, 65gss_compare_name, 32gss_const_buffer_t, 64gss_const_cred_id_t, 64gss_const_ctx_id_t, 64gss_const_name_t, 64gss_const_OID, 64gss_const_OID_set, 64gss_context_time, 24gss_create_empty_oid_set, 49gss_cred_id_t, 57

Page 75: GNU Generic Security Service (GSS) API Reference Manual

GNU Generic Security Service (GSS) API Reference Manual 72 / 72

gss_cred_usage_t, 58gss_ctx_id_t, 57gss_decapsulate_token, 56gss_delete_sec_context, 23gss_display_name, 32gss_display_status, 29gss_duplicate_name, 53gss_encapsulate_token, 56GSS_ERROR, 6gss_export_name, 34gss_export_sec_context, 47gss_get_mic, 25gss_import_name, 33gss_import_sec_context, 48gss_indicate_mechs, 31gss_init_sec_context, 10gss_inquire_context, 37gss_inquire_cred, 36gss_inquire_cred_by_mech, 45gss_inquire_mech_for_saslname, 55gss_inquire_mechs_for_name, 51gss_inquire_names_for_mech, 51gss_inquire_saslname_for_mech, 54GSS_KRB5, 69GSS_KRB5_NT_HOSTBASED_SERVICE_NAME, 68GSS_KRB5_NT_HOSTBASED_SERVICE_NAME_static,

70GSS_KRB5_NT_MACHINE_UID_NAME, 69GSS_KRB5_NT_MACHINE_UID_NAME_static, 70GSS_KRB5_NT_PRINCIPAL_NAME, 69GSS_KRB5_NT_PRINCIPAL_NAME_static, 70GSS_KRB5_NT_STRING_UID_NAME, 69GSS_KRB5_NT_STRING_UID_NAME_static, 70GSS_KRB5_NT_USER_NAME, 68GSS_KRB5_NT_USER_NAME_static, 69GSS_KRB5_S_G_BAD_MSG_CTX, 67GSS_KRB5_S_G_BAD_SERVICE_NAME, 67GSS_KRB5_S_G_BAD_STRING_UID, 67GSS_KRB5_S_G_BAD_USAGE, 67GSS_KRB5_S_G_BUFFER_ALLOC, 67GSS_KRB5_S_G_NOUSER, 67GSS_KRB5_S_G_UNKNOWN_QOP, 68GSS_KRB5_S_G_VALIDATE_FAILED, 67GSS_KRB5_S_G_WRONG_SIZE, 67GSS_KRB5_S_KG_BAD_LENGTH, 68GSS_KRB5_S_KG_BAD_SIGN_TYPE, 68GSS_KRB5_S_KG_CCACHE_NOMATCH, 68GSS_KRB5_S_KG_CONTEXT_ESTABLISHED, 68GSS_KRB5_S_KG_CTX_INCOMPLETE, 68GSS_KRB5_S_KG_KEYTAB_NOMATCH, 68GSS_KRB5_S_KG_NO_SUBKEY, 68GSS_KRB5_S_KG_TGT_MISSING, 68GSS_KRB5_static, 69gss_name_t, 57gss_oid_equal, 56gss_process_context_token, 22gss_qop_t, 58

gss_release_buffer, 35gss_release_cred, 10gss_release_name, 35gss_release_oid_set, 36GSS_ROUTINE_ERROR, 6GSS_S_BAD_BINDINGS, 6GSS_S_BAD_MECH, 6GSS_S_BAD_MIC, 63GSS_S_BAD_NAME, 6GSS_S_BAD_NAMETYPE, 6GSS_S_BAD_QOP, 7GSS_S_BAD_SIG, 7GSS_S_BAD_STATUS, 6GSS_S_CALL_BAD_STRUCTURE, 63GSS_S_CALL_INACCESSIBLE_READ, 63GSS_S_CALL_INACCESSIBLE_WRITE, 63GSS_S_COMPLETE, 62GSS_S_CONTEXT_EXPIRED, 7GSS_S_CONTINUE_NEEDED, 63GSS_S_CREDENTIALS_EXPIRED, 7GSS_S_DEFECTIVE_CREDENTIAL, 7GSS_S_DEFECTIVE_TOKEN, 7GSS_S_DUPLICATE_ELEMENT, 8GSS_S_DUPLICATE_TOKEN, 63GSS_S_FAILURE, 7GSS_S_GAP_TOKEN, 63GSS_S_NAME_NOT_MN, 8GSS_S_NO_CONTEXT, 7GSS_S_NO_CRED, 7GSS_S_OLD_TOKEN, 63GSS_S_UNAUTHORIZED, 7GSS_S_UNAVAILABLE, 7GSS_S_UNSEQ_TOKEN, 63gss_seal, 54gss_sign, 53GSS_SUPPLEMENTARY_INFO, 6gss_test_oid_set_member, 50gss_uint32, 57gss_unseal, 54gss_unwrap, 28gss_userok, 65gss_verify, 53gss_verify_mic, 26GSS_VERSION, 1GSS_VERSION_MAJOR, 2GSS_VERSION_MINOR, 2GSS_VERSION_NUMBER, 2GSS_VERSION_PATCH, 2gss_wrap, 26gss_wrap_size_limit, 41

OOM_uint32, 57


Recommended