Network Working Group                                             J. Wray
Request for Comments: 2744                                Iris Associates
Obsoletes: 1509                                              January 2000
Category: Standards Track
        
Network Working Group                                             J. Wray
Request for Comments: 2744                                Iris Associates
Obsoletes: 1509                                              January 2000
Category: Standards Track
        

Generic Security Service API Version 2 : C-bindings

通用安全服务API版本2:C绑定

Status of this Memo

本备忘录的状况

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (2000). All Rights Reserved.

版权所有(C)互联网协会(2000年)。版权所有。

Abstract

摘要

This document specifies C language bindings for Version 2, Update 1 of the Generic Security Service Application Program Interface (GSS-API), which is described at a language-independent conceptual level in RFC-2743 [GSSAPI]. It obsoletes RFC-1509, making specific incremental changes in response to implementation experience and liaison requests. It is intended, therefore, that this memo or a successor version thereof will become the basis for subsequent progression of the GSS-API specification on the standards track.

本文档规定了通用安全服务应用程序接口(GSS-API)第2版更新1的C语言绑定,该接口在RFC-2743[GSSAPI]中以独立于语言的概念级别进行了描述。它淘汰了RFC-1509,根据实施经验和联络要求进行具体的增量更改。因此,本备忘录或其后续版本将成为GSS-API规范在标准轨道上后续发展的基础。

The Generic Security Service Application Programming Interface provides security services to its callers, and is intended for implementation atop a variety of underlying cryptographic mechanisms. Typically, GSS-API callers will be application protocols into which security enhancements are integrated through invocation of services provided by the GSS-API. The GSS-API allows a caller application to authenticate a principal identity associated with a peer application, to delegate rights to a peer, and to apply security services such as confidentiality and integrity on a per-message basis.

通用安全服务应用程序编程接口为其调用者提供安全服务,并用于各种底层加密机制之上的实现。通常,GSS-API调用方将是应用程序协议,通过调用GSS-API提供的服务将安全增强集成到其中。GSS-API允许调用方应用程序对与对等应用程序相关联的主体身份进行身份验证,将权限委托给对等方,并基于每条消息应用保密性和完整性等安全服务。

1. Introduction
1. 介绍

The Generic Security Service Application Programming Interface [GSSAPI] provides security services to calling applications. It allows a communicating application to authenticate the user associated with another application, to delegate rights to another application, and to apply security services such as confidentiality and integrity on a per-message basis.

通用安全服务应用程序编程接口[GSSAPI]为调用应用程序提供安全服务。它允许通信应用程序对与另一个应用程序关联的用户进行身份验证,将权限委托给另一个应用程序,并基于每条消息应用保密性和完整性等安全服务。

There are four stages to using the GSS-API:

使用GSS-API分为四个阶段:

a) The application acquires a set of credentials with which it may prove its identity to other processes. The application's credentials vouch for its global identity, which may or may not be related to any local username under which it may be running.

a) 应用程序获取一组凭据,可以使用这些凭据向其他进程证明其身份。应用程序的凭据保证其全局标识,该标识可能与应用程序运行时使用的任何本地用户名相关,也可能与此无关。

b) A pair of communicating applications establish a joint security context using their credentials. The security context is a pair of GSS-API data structures that contain shared state information, which is required in order that per-message security services may be provided. Examples of state that might be shared between applications as part of a security context are cryptographic keys, and message sequence numbers. As part of the establishment of a security context, the context initiator is authenticated to the responder, and may require that the responder is authenticated in turn. The initiator may optionally give the responder the right to initiate further security contexts, acting as an agent or delegate of the initiator. This transfer of rights is termed delegation, and is achieved by creating a set of credentials, similar to those used by the initiating application, but which may be used by the responder.

b) 一对通信应用程序使用其凭据建立联合安全上下文。安全上下文是一对GSS-API数据结构,其中包含共享状态信息,这是提供每条消息安全服务所必需的。作为安全上下文的一部分,应用程序之间可能共享的状态示例有加密密钥和消息序列号。作为建立安全上下文的一部分,上下文发起方向响应方进行身份验证,并且可能要求响应方依次进行身份验证。发起者可以任选地给予响应者作为发起者的代理或委托来发起进一步的安全上下文的权利。这种权利的转移称为委托,通过创建一组凭证来实现,类似于发起应用程序使用的凭证,但响应者可以使用这些凭证。

To establish and maintain the shared information that makes up the security context, certain GSS-API calls will return a token data structure, which is an opaque data type that may contain cryptographically protected data. The caller of such a GSS-API routine is responsible for transferring the token to the peer application, encapsulated if necessary in an application-application protocol. On receipt of such a token, the peer application should pass it to a corresponding GSS-API routine which will decode the token and extract the information, updating the security context state information accordingly.

为了建立和维护组成安全上下文的共享信息,某些GSS-API调用将返回令牌数据结构,这是一种不透明的数据类型,可能包含受加密保护的数据。此类GSS-API例程的调用方负责将令牌传输到对等应用程序,必要时封装在应用程序协议中。在收到这样的令牌后,对等应用程序应将其传递给相应的GSS-API例程,该例程将解码令牌并提取信息,相应地更新安全上下文状态信息。

c) Per-message services are invoked to apply either:

c) 将调用每消息服务以应用:

integrity and data origin authentication, or confidentiality, integrity and data origin authentication to application data, which are treated by GSS-API as arbitrary octet-strings. An application transmitting a message that it wishes to protect will call the appropriate GSS-API routine (gss_get_mic or gss_wrap) to apply protection, specifying the appropriate security context, and send the resulting token to the receiving application. The receiver will pass the received token (and, in the case of data protected by gss_get_mic, the accompanying message-data) to the corresponding decoding routine (gss_verify_mic or gss_unwrap) to remove the protection and validate the data.

完整性和数据源身份验证,或对应用程序数据的机密性、完整性和数据源身份验证,GSS-API将其视为任意八位字符串。传输其希望保护的消息的应用程序将调用适当的GSS-API例程(GSS_get_mic或GSS_wrap)来应用保护,指定适当的安全上下文,并将生成的令牌发送给接收应用程序。接收器将接收到的令牌(如果数据受gss_get_mic保护,则为伴随的消息数据)传递给相应的解码例程(gss_verify_mic或gss_unwrap),以移除保护并验证数据。

d) At the completion of a communications session (which may extend across several transport connections), each application calls a GSS-API routine to delete the security context. Multiple contexts may also be used (either successively or simultaneously) within a single communications association, at the option of the applications.

d) 在通信会话(可能扩展到多个传输连接)完成时,每个应用程序调用GSS-API例程来删除安全上下文。根据应用程序的选择,还可以在单个通信关联中使用(连续或同时)多个上下文。

2. GSS-API Routines
2. GSS-API例程

This section lists the routines that make up the GSS-API, and offers a brief description of the purpose of each routine. Detailed descriptions of each routine are listed in alphabetical order in section 5.

本节列出了组成GSS-API的例程,并简要说明了每个例程的用途。第5节按字母顺序列出了每个例程的详细说明。

Table 2-1 GSS-API Credential-management Routines

表2-1 GSS-API凭证管理例程

   Routine                Section              Function
   -------                -------              --------
   gss_acquire_cred           5.2  Assume a global identity; Obtain
                                   a GSS-API credential handle for
                                   pre-existing credentials.
   gss_add_cred               5.3  Construct credentials
                                   incrementally
   gss_inquire_cred           5.21 Obtain information about a
                                   credential
   gss_inquire_cred_by_mech   5.22 Obtain per-mechanism information
                                   about a credential.
   gss_release_cred           5.27 Discard a credential handle.
        
   Routine                Section              Function
   -------                -------              --------
   gss_acquire_cred           5.2  Assume a global identity; Obtain
                                   a GSS-API credential handle for
                                   pre-existing credentials.
   gss_add_cred               5.3  Construct credentials
                                   incrementally
   gss_inquire_cred           5.21 Obtain information about a
                                   credential
   gss_inquire_cred_by_mech   5.22 Obtain per-mechanism information
                                   about a credential.
   gss_release_cred           5.27 Discard a credential handle.
        

Table 2-2 GSS-API Context-Level Routines

表2-2 GSS-API上下文级例程

   Routine                 Section              Function
   -------                 -------              --------
   gss_init_sec_context       5.19 Initiate a security context with
                                   a peer application
   gss_accept_sec_context     5.1  Accept a security context
                                   initiated by a
                                   peer application
   gss_delete_sec_context     5.9  Discard a security context
   gss_process_context_token  5.25 Process a token on a security
                                   context from a peer application
   gss_context_time           5.7  Determine for how long a context
                                   will remain valid
   gss_inquire_context        5.20 Obtain information about a
                                   security context
   gss_wrap_size_limit        5.34 Determine token-size limit for
                                   gss_wrap on a context
   gss_export_sec_context     5.14 Transfer a security context to
                                   another process
   gss_import_sec_context     5.17 Import a transferred context
        
   Routine                 Section              Function
   -------                 -------              --------
   gss_init_sec_context       5.19 Initiate a security context with
                                   a peer application
   gss_accept_sec_context     5.1  Accept a security context
                                   initiated by a
                                   peer application
   gss_delete_sec_context     5.9  Discard a security context
   gss_process_context_token  5.25 Process a token on a security
                                   context from a peer application
   gss_context_time           5.7  Determine for how long a context
                                   will remain valid
   gss_inquire_context        5.20 Obtain information about a
                                   security context
   gss_wrap_size_limit        5.34 Determine token-size limit for
                                   gss_wrap on a context
   gss_export_sec_context     5.14 Transfer a security context to
                                   another process
   gss_import_sec_context     5.17 Import a transferred context
        

Table 2-3 GSS-API Per-message Routines

表2-3 GSS-API每条消息例程

   Routine                 Section              Function
   -------                 -------              --------
   gss_get_mic                5.15 Calculate a cryptographic message
                                   integrity code (MIC) for a
                                   message; integrity service
   gss_verify_mic             5.32 Check a MIC against a message;
                                   verify integrity of a received
                                   message
   gss_wrap                   5.33 Attach a MIC to a message, and
                                   optionally encrypt the message
                                   content;
                                   confidentiality service
   gss_unwrap                 5.31 Verify a message with attached
                                   MIC, and decrypt message content
                                   if necessary.
        
   Routine                 Section              Function
   -------                 -------              --------
   gss_get_mic                5.15 Calculate a cryptographic message
                                   integrity code (MIC) for a
                                   message; integrity service
   gss_verify_mic             5.32 Check a MIC against a message;
                                   verify integrity of a received
                                   message
   gss_wrap                   5.33 Attach a MIC to a message, and
                                   optionally encrypt the message
                                   content;
                                   confidentiality service
   gss_unwrap                 5.31 Verify a message with attached
                                   MIC, and decrypt message content
                                   if necessary.
        

Table 2-4 GSS-API Name manipulation Routines

表2-4 GSS-API名称操作例程

   Routine                 Section              Function
   -------                 -------              --------
   gss_import_name            5.16 Convert a contiguous string name
                                   to internal-form
   gss_display_name           5.10 Convert internal-form name to
                                   text
   gss_compare_name           5.6  Compare two internal-form names
        
   Routine                 Section              Function
   -------                 -------              --------
   gss_import_name            5.16 Convert a contiguous string name
                                   to internal-form
   gss_display_name           5.10 Convert internal-form name to
                                   text
   gss_compare_name           5.6  Compare two internal-form names
        

gss_release_name 5.28 Discard an internal-form name gss_inquire_names_for_mech 5.24 List the name-types supported by the specified mechanism gss_inquire_mechs_for_name 5.23 List mechanisms that support the specified name-type gss_canonicalize_name 5.5 Convert an internal name to an MN gss_export_name 5.13 Convert an MN to export form gss_duplicate_name 5.12 Create a copy of an internal name

gss_release_name 5.28放弃内部表单名称gss_inquire_names_for_mech 5.24列出指定机制gss_inquire_mech_for_name 5.23列出支持指定名称类型gss_规范化_name 5.5将内部名称转换为MN gss_导出名称5.13将MN转换为导出表单gss_duplicate_name 5.12创建内部名称的副本

Table 2-5 GSS-API Miscellaneous Routines

表2-5 GSS-API杂项例程

   Routine                Section              Function
   -------                -------              --------
   gss_add_oid_set_member    5.4  Add an object identifier to
                                  a set
   gss_display_status        5.11 Convert a GSS-API status code
                                  to text
   gss_indicate_mechs        5.18 Determine available underlying
                                  authentication mechanisms
   gss_release_buffer        5.26 Discard a buffer
   gss_release_oid_set       5.29 Discard a set of object
                                  identifiers
   gss_create_empty_oid_set  5.8  Create a set containing no
                                  object identifiers
   gss_test_oid_set_member   5.30 Determines whether an object
                                       identifier is a member of a set.
        
   Routine                Section              Function
   -------                -------              --------
   gss_add_oid_set_member    5.4  Add an object identifier to
                                  a set
   gss_display_status        5.11 Convert a GSS-API status code
                                  to text
   gss_indicate_mechs        5.18 Determine available underlying
                                  authentication mechanisms
   gss_release_buffer        5.26 Discard a buffer
   gss_release_oid_set       5.29 Discard a set of object
                                  identifiers
   gss_create_empty_oid_set  5.8  Create a set containing no
                                  object identifiers
   gss_test_oid_set_member   5.30 Determines whether an object
                                       identifier is a member of a set.
        

Individual GSS-API implementations may augment these routines by providing additional mechanism-specific routines if required functionality is not available from the generic forms. Applications are encouraged to use the generic routines wherever possible on portability grounds.

如果通用表单中没有所需的功能,则单个GSS-API实现可以通过提供额外的特定于机制的例程来扩充这些例程。出于可移植性的考虑,鼓励应用程序尽可能使用通用例程。

3. Data Types and Calling Conventions
3. 数据类型和调用约定

The following conventions are used by the GSS-API C-language bindings:

GSS-API C语言绑定使用以下约定:

3.1. Integer types
3.1. 整数类型

GSS-API uses the following integer data type:

GSS-API使用以下整数数据类型:

OM_uint32 32-bit unsigned integer

OM_uint32 32位无符号整数

Where guaranteed minimum bit-count is important, this portable data type is used by the GSS-API routine definitions. Individual GSS-API implementations will include appropriate typedef definitions to map this type onto a built-in data type. If the platform supports the X/Open xom.h header file, the OM_uint32 definition contained therein should be used; the GSS-API header file in Appendix A contains logic that will detect the prior inclusion of xom.h, and will not attempt to re-declare OM_uint32. If the X/Open header file is not available on the platform, the GSS-API implementation should use the smallest natural unsigned integer type that provides at least 32 bits of precision.

在保证最小位计数很重要的情况下,GSS-API例程定义使用这种可移植数据类型。各个GSS-API实现将包括适当的typedef定义,以将此类型映射到内置数据类型。如果平台支持X/Open xom.h头文件,则应使用其中包含的OM_uint32定义;附录A中的GSS-API头文件包含的逻辑将检测先前包含的xom.h,并且不会尝试重新声明OM_uint32。如果X/Open头文件在平台上不可用,GSS-API实现应使用最小的自然无符号整数类型,该类型至少提供32位精度。

3.2. String and similar data
3.2. 字符串和类似数据

Many of the GSS-API routines take arguments and return values that describe contiguous octet-strings. All such data is passed between the GSS-API and the caller using the gss_buffer_t data type. This data type is a pointer to a buffer descriptor, which consists of a length field that contains the total number of bytes in the datum, and a value field which contains a pointer to the actual datum:

许多GSS-API例程采用参数和返回值来描述连续的八位字节字符串。所有这些数据都使用GSS\u buffer\t数据类型在GSS-API和调用者之间传递。此数据类型是指向缓冲区描述符的指针,缓冲区描述符由包含数据中字节总数的长度字段和包含指向实际数据指针的值字段组成:

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

Storage for data returned to the application by a GSS-API routine using the gss_buffer_t conventions is allocated by the GSS-API routine. The application may free this storage by invoking the gss_release_buffer routine. Allocation of the gss_buffer_desc object is always the responsibility of the application; unused gss_buffer_desc objects may be initialized to the value GSS_C_EMPTY_BUFFER.

GSS-API例程使用GSS_buffer_t约定为返回到应用程序的数据分配存储。应用程序可以通过调用gss_release_buffer例程来释放该存储。gss_buffer_desc对象的分配始终由应用程序负责;未使用的gss_buffer_desc对象可以初始化为值gss_C_EMPTY_buffer。

3.2.1. Opaque data types
3.2.1. 不透明数据类型

Certain multiple-word data items are considered opaque data types at the GSS-API, because their internal structure has no significance either to the GSS-API or to the caller. Examples of such opaque data types are the input_token parameter to gss_init_sec_context (which is opaque to the caller), and the input_message parameter to gss_wrap (which is opaque to the GSS-API). Opaque data is passed between the GSS-API and the application using the gss_buffer_t datatype.

某些多字数据项在GSS-API中被视为不透明的数据类型,因为它们的内部结构对GSS-API或调用者都没有意义。此类不透明数据类型的示例包括gss_init_sec_上下文的input_token参数(对调用方不透明)和gss_wrap的input_message参数(对gss-API不透明)。不透明数据使用GSS_buffer_t数据类型在GSS-API和应用程序之间传递。

3.2.2. Character strings
3.2.2. 字符串

Certain multiple-word data items may be regarded as simple ISO Latin-1 character strings. Examples are the printable strings passed to gss_import_name via the input_name_buffer parameter. Some GSS-API routines also return character strings. All such character strings are passed between the application and the GSS-API implementation using the gss_buffer_t datatype, which is a pointer to a gss_buffer_desc object.

某些多字数据项可视为简单的ISO拉丁-1字符串。例如,通过input_name_buffer参数传递给gss_import_name的可打印字符串。一些GSS-API例程还返回字符串。所有这些字符串都使用GSS_buffer_t数据类型在应用程序和GSS-API实现之间传递,GSS_buffer_t数据类型是指向GSS_buffer_desc对象的指针。

When a gss_buffer_desc object describes a printable string, the length field of the gss_buffer_desc should only count printable characters within the string. In particular, a trailing NUL character should NOT be included in the length count, nor should either the GSS-API implementation or the application assume the presence of an uncounted trailing NUL.

当gss_buffer_desc对象描述可打印字符串时,gss_buffer_desc的长度字段应仅对字符串中的可打印字符计数。特别是,长度计数中不应包含尾随NUL字符,GSS-API实现或应用程序也不应假定存在未计数的尾随NUL。

3.3. Object Identifiers
3.3. 对象标识符

Certain GSS-API procedures take parameters of the type gss_OID, or Object identifier. This is a type containing ISO-defined tree-structured values, and is used by the GSS-API caller to select an underlying security mechanism and to specify namespaces. A value of type gss_OID has the following structure:

某些GSS-API过程采用GSS_OID或对象标识符类型的参数。这是一种包含ISO定义的树结构值的类型,GSS-API调用程序使用它来选择底层安全机制和指定名称空间。gss_OID类型的值具有以下结构:

   typedef struct gss_OID_desc_struct {
      OM_uint32   length;
      void        *elements;
   } gss_OID_desc, *gss_OID;
        
   typedef struct gss_OID_desc_struct {
      OM_uint32   length;
      void        *elements;
   } gss_OID_desc, *gss_OID;
        

The elements field of this structure points to the first byte of an octet string containing the ASN.1 BER encoding of the value portion of the normal BER TLV encoding of the gss_OID. The length field contains the number of bytes in this value. For example, the gss_OID value corresponding to {iso(1) identified-organization(3) icd-ecma(12) member-company(2) dec(1011) cryptoAlgorithms(7) DASS(5)}, meaning the DASS X.509 authentication mechanism, has a length field of 7 and an elements field pointing to seven octets containing the

此结构的elements字段指向八位字节字符串的第一个字节,该字符串包含gss_OID的正常BER TLV编码的值部分的ASN.1 BER编码。长度字段包含此值中的字节数。例如,对应于{iso(1)已识别组织(3)icd ecma(12)成员公司(2)dec(1011)加密算法(7)DASS(5)}的gss_OID值,意味着DASS X.509身份验证机制,其长度字段为7,元素字段指向包含

following octal values: 53,14,2,207,163,7,5. GSS-API implementations should provide constant gss_OID values to allow applications to request any supported mechanism, although applications are encouraged on portability grounds to accept the default mechanism. gss_OID values should also be provided to allow applications to specify particular name types (see section 3.10). Applications should treat gss_OID_desc values returned by GSS-API routines as read-only. In particular, the application should not attempt to deallocate them with free(). The gss_OID_desc datatype is equivalent to the X/Open OM_object_identifier datatype[XOM].

以下八进制值:53,14,2207163,7,5。GSS-API实现应提供恒定的GSS_OID值,以允许应用程序请求任何受支持的机制,尽管出于可移植性的考虑,鼓励应用程序接受默认机制。还应提供gss_OID值,以允许应用程序指定特定的名称类型(参见第3.10节)。应用程序应将gss-API例程返回的gss_OID_desc值视为只读。特别是,应用程序不应尝试使用free()解除分配它们。gss_OID_desc数据类型等效于X/Open OM_对象_标识符数据类型[XOM]。

3.4. Object Identifier Sets
3.4. 对象标识符集

Certain GSS-API procedures take parameters of the type gss_OID_set. This type represents one or more object identifiers (section 2.3). A gss_OID_set object has the following structure:

某些GSS-API程序采用GSS_OID_集合类型的参数。该类型表示一个或多个对象标识符(第2.3节)。gss_OID_集合对象具有以下结构:

   typedef struct gss_OID_set_desc_struct {
      size_t    count;
      gss_OID   elements;
   } gss_OID_set_desc, *gss_OID_set;
        
   typedef struct gss_OID_set_desc_struct {
      size_t    count;
      gss_OID   elements;
   } gss_OID_set_desc, *gss_OID_set;
        

The count field contains the number of OIDs within the set. The elements field is a pointer to an array of gss_OID_desc objects, each of which describes a single OID. gss_OID_set values are used to name the available mechanisms supported by the GSS-API, to request the use of specific mechanisms, and to indicate which mechanisms a given credential supports.

计数字段包含集合中的OID数。elements字段是指向gss_OID_desc对象数组的指针,每个对象描述一个OID。gss_OID_set值用于命名gss-API支持的可用机制,请求使用特定机制,并指示给定凭证支持哪些机制。

All OID sets returned to the application by GSS-API are dynamic objects (the gss_OID_set_desc, the "elements" array of the set, and the "elements" array of each member OID are all dynamically allocated), and this storage must be deallocated by the application using the gss_release_oid_set() routine.

GSS-API返回给应用程序的所有OID集都是动态对象(GSS_OID_set_desc、集合的“元素”数组和每个成员OID的“元素”数组都是动态分配的),应用程序必须使用GSS_release_OID_set()例程释放此存储。

3.5. Credentials
3.5. 资格证书

A credential handle is a caller-opaque atomic datum that identifies a GSS-API credential data structure. It is represented by the caller-opaque type gss_cred_id_t, which should be implemented as a pointer or arithmetic type. If a pointer implementation is chosen, care must be taken to ensure that two gss_cred_id_t values may be compared with the == operator.

凭证句柄是标识GSS-API凭证数据结构的调用方不透明原子数据。它由调用方不透明类型gss_cred_id_t表示,该类型应实现为指针或算术类型。如果选择了指针实现,则必须注意确保两个gss_cred_id_t值可以与==运算符进行比较。

GSS-API credentials can contain mechanism-specific principal authentication data for multiple mechanisms. A GSS-API credential is composed of a set of credential-elements, each of which is applicable to a single mechanism. A credential may contain at most one

GSS-API凭据可以包含多个机制的特定于机制的主体身份验证数据。GSS-API凭据由一组凭据元素组成,每个元素都适用于单个机制。凭证最多可以包含一个

credential-element for each supported mechanism. A credential-element identifies the data needed by a single mechanism to authenticate a single principal, and conceptually contains two credential-references that describe the actual mechanism-specific authentication data, one to be used by GSS-API for initiating contexts, and one to be used for accepting contexts. For mechanisms that do not distinguish between acceptor and initiator credentials, both references would point to the same underlying mechanism-specific authentication data.

每个受支持机制的凭据元素。凭证元素标识单个机制对单个主体进行身份验证所需的数据,概念上包含两个凭证引用,用于描述实际机制特定的身份验证数据,一个用于GSS-API启动上下文,另一个用于接受上下文。对于不区分接受方凭据和发起方凭据的机制,两个引用将指向相同的底层机制特定身份验证数据。

Credentials describe a set of mechanism-specific principals, and give their holder the ability to act as any of those principals. All principal identities asserted by a single GSS-API credential should belong to the same entity, although enforcement of this property is an implementation-specific matter. The GSS-API does not make the actual credentials available to applications; instead a credential handle is used to identify a particular credential, held internally by GSS-API. The combination of GSS-API credential handle and mechanism identifies the principal whose identity will be asserted by the credential when used with that mechanism.

凭证描述一组特定于机制的主体,并使其持有者能够充当这些主体中的任何一个。由单个GSS-API凭据声明的所有主体标识都应属于同一实体,尽管此属性的强制执行是一个特定于实现的问题。GSS-API不向应用程序提供实际凭证;相反,凭证句柄用于标识GSS-API内部持有的特定凭证。GSS-API凭证句柄和机制的组合标识了主体,当与该机制一起使用时,其身份将由凭证断言。

The gss_init_sec_context and gss_accept_sec_context routines allow the value GSS_C_NO_CREDENTIAL to be specified as their credential handle parameter. This special credential-handle indicates a desire by the application to act as a default principal. While individual GSS-API implementations are free to determine such default behavior as appropriate to the mechanism, the following default behavior by these routines is recommended for portability:

gss_init_sec_context和gss_accept_sec_context例程允许将值gss_C_NO_CREDENTIAL指定为其凭证句柄参数。此特殊凭证句柄表示应用程序希望充当默认主体。虽然各个GSS-API实现可以自由确定适合于该机制的默认行为,但为了便于移植,建议使用这些例程的以下默认行为:

gss_init_sec_context

gss_初始_秒_上下文

1) If there is only a single principal capable of initiating security contexts for the chosen mechanism that the application is authorized to act on behalf of, then that principal shall be used, otherwise

1) 如果只有一个主体能够为应用程序被授权代表的所选机制启动安全上下文,则应使用该主体,否则

2) If the platform maintains a concept of a default network-identity for the chosen mechanism, and if the application is authorized to act on behalf of that identity for the purpose of initiating security contexts, then the principal corresponding to that identity shall be used, otherwise

2) 如果平台为所选机制维护默认网络身份的概念,并且如果应用程序被授权代表该身份启动安全上下文,则应使用与该身份对应的主体,否则

3) If the platform maintains a concept of a default local identity, and provides a means to map local identities into network-identities for the chosen mechanism, and if the application is authorized to act on behalf of the network-identity image of the default local identity for the purpose of

3) 如果平台维护默认本地标识的概念,并提供将本地标识映射到所选机制的网络标识的方法,并且如果应用程序被授权代表默认本地标识的网络标识映像进行操作,则

initiating security contexts using the chosen mechanism, then the principal corresponding to that identity shall be used, otherwise

使用所选机制启动安全上下文,则应使用与该标识对应的主体,否则

4) A user-configurable default identity should be used.

4) 应使用用户可配置的默认标识。

gss_accept_sec_context

gss_接受_秒_上下文

1) If there is only a single authorized principal identity capable of accepting security contexts for the chosen mechanism, then that principal shall be used, otherwise

1) 如果只有一个授权主体标识能够接受所选机制的安全上下文,则应使用该主体,否则

2) If the mechanism can determine the identity of the target principal by examining the context-establishment token, and if the accepting application is authorized to act as that principal for the purpose of accepting security contexts using the chosen mechanism, then that principal identity shall be used, otherwise

2) 如果该机制可以通过检查上下文建立令牌来确定目标主体的身份,并且如果接受应用程序被授权作为该主体使用所选机制接受安全上下文,则应使用该主体身份,否则

3) If the mechanism supports context acceptance by any principal, and if mutual authentication was not requested, any principal that the application is authorized to accept security contexts under using the chosen mechanism may be used, otherwise

3) 如果该机制支持任何主体接受上下文,并且如果未请求相互认证,则可以使用应用程序在使用所选机制的情况下被授权接受安全上下文的任何主体,否则

4)A user-configurable default identity shall be used.

4) 应使用用户可配置的默认标识。

The purpose of the above rules is to allow security contexts to be established by both initiator and acceptor using the default behavior wherever possible. Applications requesting default behavior are likely to be more portable across mechanisms and platforms than ones that use gss_acquire_cred to request a specific identity.

上述规则的目的是允许发起方和接受方尽可能使用默认行为来建立安全上下文。与使用gss_acquire_cred请求特定身份的应用程序相比,请求默认行为的应用程序可能更易于跨机制和平台移植。

3.6. Contexts
3.6. 上下文

The gss_ctx_id_t data type contains a caller-opaque atomic value that identifies one end of a GSS-API security context. It should be implemented as a pointer or arithmetic type. If a pointer type is chosen, care should be taken to ensure that two gss_ctx_id_t values may be compared with the == operator.

gss_ctx_id_t数据类型包含一个调用方不透明的原子值,用于标识gss-API安全上下文的一端。它应该实现为指针或算术类型。如果选择了指针类型,应注意确保两个gss_ctx_id_t值可以与==运算符进行比较。

The security context holds state information about each end of a peer communication, including cryptographic state information.

安全上下文保存关于对等通信的每一端的状态信息,包括加密状态信息。

3.7. Authentication tokens
3.7. 身份验证令牌

A token is a caller-opaque type that GSS-API uses to maintain synchronization between the context data structures at each end of a GSS-API security context. The token is a cryptographically protected octet-string, generated by the underlying mechanism at one end of a GSS-API security context for use by the peer mechanism at the other end. Encapsulation (if required) and transfer of the token are the responsibility of the peer applications. A token is passed between the GSS-API and the application using the gss_buffer_t conventions.

令牌是一种调用方不透明类型,GSS-API使用它来维护GSS-API安全上下文两端的上下文数据结构之间的同步。令牌是受加密保护的八位字节字符串,由GSS-API安全上下文一端的底层机制生成,供另一端的对等机制使用。令牌的封装(如果需要)和传输由对等应用程序负责。使用GSS_buffer_t约定在GSS-API和应用程序之间传递令牌。

3.8. Interprocess tokens
3.8. 进程间令牌

Certain GSS-API routines are intended to transfer data between processes in multi-process programs. These routines use a caller-opaque octet-string, generated by the GSS-API in one process for use by the GSS-API in another process. The calling application is responsible for transferring such tokens between processes in an OS-specific manner. Note that, while GSS-API implementors are encouraged to avoid placing sensitive information within interprocess tokens, or to cryptographically protect them, many implementations will be unable to avoid placing key material or other sensitive data within them. It is the application's responsibility to ensure that interprocess tokens are protected in transit, and transferred only to processes that are trustworthy. An interprocess token is passed between the GSS-API and the application using the gss_buffer_t conventions.

某些GSS-API例程用于在多进程程序中的进程之间传输数据。这些例程使用一个调用方不透明八位字节字符串,该字符串由GSS-API在一个进程中生成,供GSS-API在另一个进程中使用。调用应用程序负责以特定于操作系统的方式在进程之间传输此类令牌。注意,虽然鼓励GSS-API实现者避免在进程间令牌中放置敏感信息,或对其进行加密保护,但许多实现将无法避免在其中放置关键材料或其他敏感数据。应用程序负责确保进程间令牌在传输过程中受到保护,并且仅传输到值得信任的进程。使用GSS_buffer_t约定在GSS-API和应用程序之间传递进程间令牌。

3.9. Status values
3.9. 状态值

Every GSS-API routine returns two distinct values to report status information to the caller: GSS status codes and Mechanism status codes.

每个GSS-API例程返回两个不同的值以向调用者报告状态信息:GSS状态代码和机构状态代码。

3.9.1. GSS status codes
3.9.1. GSS状态代码

GSS-API routines return GSS status codes as their OM_uint32 function value. These codes indicate errors that are independent of the underlying mechanism(s) used to provide the security service. The errors that can be indicated via a GSS status code are either generic API routine errors (errors that are defined in the GSS-API specification) or calling errors (errors that are specific to these language bindings).

GSS-API例程返回GSS状态代码作为其OM_uint32函数值。这些代码表示独立于用于提供安全服务的底层机制的错误。可以通过GSS状态代码指示的错误是通用API例程错误(GSS-API规范中定义的错误)或调用错误(特定于这些语言绑定的错误)。

A GSS status code can indicate a single fatal generic API error from the routine and a single calling error. In addition, supplementary status information may be indicated via the setting of bits in the supplementary info field of a GSS status code.

GSS状态代码可以指示来自例程的单个致命通用API错误和单个调用错误。此外,可以通过在GSS状态码的补充信息字段中设置位来指示补充状态信息。

These errors are encoded into the 32-bit GSS status code as follows:

这些错误被编码到32位GSS状态代码中,如下所示:

      MSB                                                        LSB
      |------------------------------------------------------------|
      |  Calling Error | Routine Error  |    Supplementary Info    |
      |------------------------------------------------------------|
   Bit 31            24 23            16 15                       0
        
      MSB                                                        LSB
      |------------------------------------------------------------|
      |  Calling Error | Routine Error  |    Supplementary Info    |
      |------------------------------------------------------------|
   Bit 31            24 23            16 15                       0
        

Hence if a GSS-API routine returns a GSS status code whose upper 16 bits contain a non-zero value, the call failed. If the calling error field is non-zero, the invoking application's call of the routine was erroneous. Calling errors are defined in table 5-1. If the routine error field is non-zero, the routine failed for one of the routine-specific reasons listed below in table 5-2. Whether or not the upper 16 bits indicate a failure or a success, the routine may indicate additional information by setting bits in the supplementary info field of the status code. The meaning of individual bits is listed below in table 5-3.

因此,如果GSS-API例程返回一个GSS状态码,其上16位包含一个非零值,则调用失败。如果调用错误字段为非零,则调用应用程序对例程的调用是错误的。调用错误定义见表5-1。如果例程错误字段为非零,则例程因表5-2中列出的例程特定原因之一而失败。无论高16位是否指示故障或成功,例程都可以通过在状态码的补充信息字段中设置位来指示附加信息。下表5-3列出了各个位的含义。

Table 3-1 Calling Errors

表3-1呼叫错误

   Name                   Value in field           Meaning
   ----                   --------------           -------
   GSS_S_CALL_INACCESSIBLE_READ  1       A required input parameter
                                         could not be read
   GSS_S_CALL_INACCESSIBLE_WRITE 2       A required output parameter
                                          could not be written.
   GSS_S_CALL_BAD_STRUCTURE      3       A parameter was malformed
        
   Name                   Value in field           Meaning
   ----                   --------------           -------
   GSS_S_CALL_INACCESSIBLE_READ  1       A required input parameter
                                         could not be read
   GSS_S_CALL_INACCESSIBLE_WRITE 2       A required output parameter
                                          could not be written.
   GSS_S_CALL_BAD_STRUCTURE      3       A parameter was malformed
        

Table 3-2 Routine Errors

表3-2常规错误

   Name                   Value in field           Meaning
   ----                   --------------           -------
   GSS_S_BAD_MECH                1       An unsupported mechanism
                                         was requested
   GSS_S_BAD_NAME                2       An invalid name was
                                         supplied
   GSS_S_BAD_NAMETYPE            3       A supplied name was of an
                                         unsupported type
   GSS_S_BAD_BINDINGS            4       Incorrect channel bindings
                                         were supplied
   GSS_S_BAD_STATUS              5       An invalid status code was
                                         supplied
   GSS_S_BAD_MIC GSS_S_BAD_SIG   6       A token had an invalid MIC
   GSS_S_NO_CRED                 7       No credentials were
                                         supplied, or the
                                         credentials were
                                         unavailable or
                                         inaccessible.
   GSS_S_NO_CONTEXT              8       No context has been
                                         established
   GSS_S_DEFECTIVE_TOKEN         9       A token was invalid
   GSS_S_DEFECTIVE_CREDENTIAL   10       A credential was invalid
   GSS_S_CREDENTIALS_EXPIRED    11       The referenced credentials
                                         have expired
   GSS_S_CONTEXT_EXPIRED        12       The context has expired
   GSS_S_FAILURE                13       Miscellaneous failure (see
                                         text)
   GSS_S_BAD_QOP                14       The quality-of-protection
                                         requested could not be
                                         provided
   GSS_S_UNAUTHORIZED           15       The operation is forbidden
                                         by local security policy
   GSS_S_UNAVAILABLE            16       The operation or option is
                                         unavailable
   GSS_S_DUPLICATE_ELEMENT      17       The requested credential
                                         element already exists
   GSS_S_NAME_NOT_MN            18       The provided name was not a
                                         mechanism name
        
   Name                   Value in field           Meaning
   ----                   --------------           -------
   GSS_S_BAD_MECH                1       An unsupported mechanism
                                         was requested
   GSS_S_BAD_NAME                2       An invalid name was
                                         supplied
   GSS_S_BAD_NAMETYPE            3       A supplied name was of an
                                         unsupported type
   GSS_S_BAD_BINDINGS            4       Incorrect channel bindings
                                         were supplied
   GSS_S_BAD_STATUS              5       An invalid status code was
                                         supplied
   GSS_S_BAD_MIC GSS_S_BAD_SIG   6       A token had an invalid MIC
   GSS_S_NO_CRED                 7       No credentials were
                                         supplied, or the
                                         credentials were
                                         unavailable or
                                         inaccessible.
   GSS_S_NO_CONTEXT              8       No context has been
                                         established
   GSS_S_DEFECTIVE_TOKEN         9       A token was invalid
   GSS_S_DEFECTIVE_CREDENTIAL   10       A credential was invalid
   GSS_S_CREDENTIALS_EXPIRED    11       The referenced credentials
                                         have expired
   GSS_S_CONTEXT_EXPIRED        12       The context has expired
   GSS_S_FAILURE                13       Miscellaneous failure (see
                                         text)
   GSS_S_BAD_QOP                14       The quality-of-protection
                                         requested could not be
                                         provided
   GSS_S_UNAUTHORIZED           15       The operation is forbidden
                                         by local security policy
   GSS_S_UNAVAILABLE            16       The operation or option is
                                         unavailable
   GSS_S_DUPLICATE_ELEMENT      17       The requested credential
                                         element already exists
   GSS_S_NAME_NOT_MN            18       The provided name was not a
                                         mechanism name
        

Table 3-3 Supplementary Status Bits

表3-3补充状态位

   Name                   Bit Number           Meaning
   ----                   ----------           -------
   GSS_S_CONTINUE_NEEDED   0 (LSB)   Returned only by
                                     gss_init_sec_context or
                                     gss_accept_sec_context. The
                                     routine must be called again
                                     to complete its function.
                                     See routine documentation for
                                     detailed description
   GSS_S_DUPLICATE_TOKEN   1         The token was a duplicate of
                                     an earlier token
   GSS_S_OLD_TOKEN         2         The token's validity period
                                     has expired
   GSS_S_UNSEQ_TOKEN       3         A later token has already been
                                     processed
   GSS_S_GAP_TOKEN         4         An expected per-message token
                                     was not received
        
   Name                   Bit Number           Meaning
   ----                   ----------           -------
   GSS_S_CONTINUE_NEEDED   0 (LSB)   Returned only by
                                     gss_init_sec_context or
                                     gss_accept_sec_context. The
                                     routine must be called again
                                     to complete its function.
                                     See routine documentation for
                                     detailed description
   GSS_S_DUPLICATE_TOKEN   1         The token was a duplicate of
                                     an earlier token
   GSS_S_OLD_TOKEN         2         The token's validity period
                                     has expired
   GSS_S_UNSEQ_TOKEN       3         A later token has already been
                                     processed
   GSS_S_GAP_TOKEN         4         An expected per-message token
                                     was not received
        

The routine documentation also uses the name GSS_S_COMPLETE, which is a zero value, to indicate an absence of any API errors or supplementary information bits.

例行文档还使用名称GSS_S_COMPLETE,它是一个零值,表示没有任何API错误或补充信息位。

All GSS_S_xxx symbols equate to complete OM_uint32 status codes, rather than to bitfield values. For example, the actual value of the symbol GSS_S_BAD_NAMETYPE (value 3 in the routine error field) is 3<<16. The macros GSS_CALLING_ERROR(), GSS_ROUTINE_ERROR() and GSS_SUPPLEMENTARY_INFO() are provided, each of which takes a GSS status code and removes all but the relevant field. For example, the value obtained by applying GSS_ROUTINE_ERROR to a status code removes the calling errors and supplementary info fields, leaving only the routine errors field. The values delivered by these macros may be directly compared with a GSS_S_xxx symbol of the appropriate type. The macro GSS_ERROR() is also provided, which when applied to a GSS status code returns a non-zero value if the status code indicated a calling or routine error, and a zero value otherwise. All macros defined by GSS-API evaluate their argument(s) exactly once.

所有GSS_S_xxx符号等同于完整的OM_uint32状态代码,而不是位字段值。例如,符号GSS_S_BAD_NAMETYPE的实际值(例程错误字段中的值3)为3<<16。提供了宏GSS_CALLING_ERROR()、GSS_ROUTINE_ERROR()和GSS_supplemental_INFO(),每个宏都采用GSS状态代码并删除除相关字段外的所有字段。例如,通过将GSS_例程_ERROR应用于状态代码而获得的值将删除调用错误和补充信息字段,只留下例程错误字段。这些宏传递的值可以直接与相应类型的GSS_S_xxx符号进行比较。还提供了宏GSS_ERROR(),当应用于GSS状态代码时,如果状态代码指示调用或例程错误,则返回非零值,否则返回零值。GSS-API定义的所有宏只对其参数求值一次。

A GSS-API implementation may choose to signal calling errors in a platform-specific manner instead of, or in addition to the routine value; routine errors and supplementary info should be returned via major status values only.

GSS-API实现可以选择以特定于平台的方式发出调用错误的信号,而不是在例程值之外,或者在例程值之外;常规错误和补充信息只能通过主要状态值返回。

The GSS major status code GSS_S_FAILURE is used to indicate that the underlying mechanism detected an error for which no specific GSS status code is defined. The mechanism-specific status code will provide more details about the error.

GSS主要状态代码GSS_S_FAILURE用于指示底层机制检测到错误,但未定义具体的GSS状态代码。特定于机制的状态代码将提供有关错误的更多详细信息。

3.9.2. Mechanism-specific status codes
3.9.2. 机构特定状态代码

GSS-API routines return a minor_status parameter, which is used to indicate specialized errors from the underlying security mechanism. This parameter may contain a single mechanism-specific error, indicated by a OM_uint32 value.

GSS-API例程返回一个次要的_状态参数,用于指示来自底层安全机制的特殊错误。此参数可能包含由OM_uint32值指示的单个机构特定错误。

The minor_status parameter will always be set by a GSS-API routine, even if it returns a calling error or one of the generic API errors indicated above as fatal, although most other output parameters may remain unset in such cases. However, output parameters that are expected to return pointers to storage allocated by a routine must always be set by the routine, even in the event of an error, although in such cases the GSS-API routine may elect to set the returned parameter value to NULL to indicate that no storage was actually allocated. Any length field associated with such pointers (as in a gss_buffer_desc structure) should also be set to zero in such cases.

次要_状态参数将始终由GSS-API例程设置,即使它返回调用错误或上面指示为致命的通用API错误之一,但大多数其他输出参数在这种情况下可能保持未设置。但是,即使在发生错误的情况下,预期返回指向例程分配的存储的指针的输出参数也必须始终由例程设置,尽管在这种情况下,GSS-API例程可以选择将返回的参数值设置为NULL,以指示实际未分配存储。在这种情况下,与此类指针(如gss_buffer_desc结构中)关联的任何长度字段也应设置为零。

3.10. Names
3.10. 名字

A name is used to identify a person or entity. GSS-API authenticates the relationship between a name and the entity claiming the name.

姓名用于识别个人或实体。GSS-API验证名称和声明名称的实体之间的关系。

Since different authentication mechanisms may employ different namespaces for identifying their principals, GSSAPI's naming support is necessarily complex in multi-mechanism environments (or even in some single-mechanism environments where the underlying mechanism supports multiple namespaces).

由于不同的身份验证机制可能会使用不同的名称空间来标识其主体,因此GSSAPI的命名支持在多机制环境中(甚至在底层机制支持多个名称空间的某些单机制环境中)必然非常复杂。

Two distinct representations are defined for names:

为名称定义了两种不同的表示形式:

An internal form. This is the GSS-API "native" format for names, represented by the implementation-specific gss_name_t type. It is opaque to GSS-API callers. A single gss_name_t object may contain multiple names from different namespaces, but all names should refer to the same entity. An example of such an internal name would be the name returned from a call to the gss_inquire_cred routine, when applied to a credential containing credential elements for multiple authentication mechanisms employing different namespaces. This gss_name_t object will contain a distinct name for the entity for each authentication mechanism.

内部形式。这是用于名称的GSS-API“本机”格式,由特定于实现的GSS_name_t类型表示。它对GSS-API调用方是不透明的。单个gss_name_t对象可能包含来自不同名称空间的多个名称,但所有名称都应引用同一实体。这种内部名称的一个示例是调用gss_inquire_cred例程返回的名称,该名称应用于包含使用不同名称空间的多个身份验证机制的凭证元素的凭证。此gss_name_t对象将包含每个身份验证机制的实体的不同名称。

For GSS-API implementations supporting multiple namespaces, objects of type gss_name_t must contain sufficient information to determine the namespace to which each primitive name belongs.

对于支持多个名称空间的GSS-API实现,GSS_name_t类型的对象必须包含足够的信息来确定每个原语名称所属的名称空间。

Mechanism-specific contiguous octet-string forms. A format capable of containing a single name (from a single namespace). Contiguous string names are always accompanied by an object identifier specifying the namespace to which the name belongs, and their format is dependent on the authentication mechanism that employs the name. Many, but not all, contiguous string names will be printable, and may therefore be used by GSS-API applications for communication with their users.

特定于机制的连续八位字节字符串形式。能够包含单个名称(来自单个命名空间)的格式。连续字符串名称始终伴随着一个对象标识符,该标识符指定名称所属的命名空间,其格式取决于使用该名称的身份验证机制。许多(但不是全部)连续字符串名称都是可打印的,因此GSS-API应用程序可能会使用它们与用户通信。

Routines (gss_import_name and gss_display_name) are provided to convert names between contiguous string representations and the internal gss_name_t type. gss_import_name may support multiple syntaxes for each supported namespace, allowing users the freedom to choose a preferred name representation. gss_display_name should use an implementation-chosen printable syntax for each supported name-type.

提供例程(gss_导入_名称和gss_显示_名称)以在连续字符串表示形式和内部gss_名称类型之间转换名称。gss_import_name可以为每个受支持的命名空间支持多个语法,允许用户自由选择首选名称表示形式。gss_display_name应该为每个支持的名称类型使用实现选择的可打印语法。

If an application calls gss_display_name(), passing the internal name resulting from a call to gss_import_name(), there is no guarantee the the resulting contiguous string name will be the same as the original imported string name. Nor do name-space identifiers necessarily survive unchanged after a journey through the internal name-form. An example of this might be a mechanism that authenticates X.500 names, but provides an algorithmic mapping of Internet DNS names into X.500. That mechanism's implementation of gss_import_name() might, when presented with a DNS name, generate an internal name that contained both the original DNS name and the equivalent X.500 name. Alternatively, it might only store the X.500 name. In the latter case, gss_display_name() would most likely generate a printable X.500 name, rather than the original DNS name.

如果应用程序调用gss_display_name(),将调用gss_import_name()产生的内部名称传递给gss_import_name(),则无法保证生成的连续字符串名称与原始导入的字符串名称相同。名称空间标识符也不一定在通过内部名称表单后保持不变。这方面的一个例子可能是一种验证X.500名称的机制,但它提供了将Internet DNS名称映射到X.500的算法。该机制的gss_import_name()实现可能会在显示DNS名称时生成一个包含原始DNS名称和等效X.500名称的内部名称。或者,它可能只存储X.500名称。在后一种情况下,gss_display_name()很可能生成可打印的X.500名称,而不是原始DNS名称。

The process of authentication delivers to the context acceptor an internal name. Since this name has been authenticated by a single mechanism, it contains only a single name (even if the internal name presented by the context initiator to gss_init_sec_context had multiple components). Such names are termed internal mechanism names, or "MN"s and the names emitted by gss_accept_sec_context() are always of this type. Since some applications may require MNs without wanting to incur the overhead of an authentication operation, a second function, gss_canonicalize_name(), is provided to convert a general internal name into an MN.

身份验证过程向上下文接受者传递一个内部名称。由于此名称已通过单个机制进行身份验证,因此它只包含一个名称(即使上下文启动器向gss_init_sec_context提供的内部名称包含多个组件)。这些名称被称为内部机制名称,或“MN”,而gss_accept_sec_context()发出的名称始终属于这种类型。由于某些应用程序可能需要MN而不希望产生身份验证操作的开销,因此提供了第二个函数gss_canonicalize_name(),用于将通用内部名称转换为MN。

Comparison of internal-form names may be accomplished via the gss_compare_name() routine, which returns true if the two names being compared refer to the same entity. This removes the need for the application program to understand the syntaxes of the various printable names that a given GSS-API implementation may support. Since GSS-API assumes that all primitive names contained within a

内部表单名称的比较可以通过gss_compare_name()例程完成,如果要比较的两个名称引用同一实体,该例程将返回true。这就不需要应用程序理解给定GSS-API实现可能支持的各种可打印名称的语法。因为GSS-API假定包含在

given internal name refer to the same entity, gss_compare_name() can return true if the two names have at least one primitive name in common. If the implementation embodies knowledge of equivalence relationships between names taken from different namespaces, this knowledge may also allow successful comparison of internal names containing no overlapping primitive elements.

给定引用同一实体的内部名称,如果两个名称至少有一个共同的基元名称,则gss_compare_name()可以返回true。如果实现包含来自不同名称空间的名称之间的等价关系的知识,那么该知识还可以允许成功比较不包含重叠基本元素的内部名称。

When used in large access control lists, the overhead of invoking gss_import_name() and gss_compare_name() on each name from the ACL may be prohibitive. As an alternative way of supporting this case, GSS-API defines a special form of the contiguous string name which may be compared directly (e.g. with memcmp()). Contiguous names suitable for comparison are generated by the gss_export_name() routine, which requires an MN as input. Exported names may be re-imported by the gss_import_name() routine, and the resulting internal name will also be an MN. The gss_OID constant GSS_C_NT_EXPORT_NAME indentifies the "export name" type, and the value of this constant is given in Appendix A. Structurally, an exported name object consists of a header containing an OID identifying the mechanism that authenticated the name, and a trailer containing the name itself, where the syntax of the trailer is defined by the individual mechanism specification. The precise format of an export name is defined in the language-independent GSS-API specification [GSSAPI].

在大型访问控制列表中使用时,对ACL中的每个名称调用gss_import_name()和gss_compare_name()的开销可能会很高。作为支持这种情况的另一种方式,GSS-API定义了一种特殊形式的连续字符串名称,可以直接进行比较(例如,与memcmp()进行比较)。适合比较的连续名称由gss_export_name()例程生成,该例程需要一个MN作为输入。导出的名称可以通过gss_import_name()例程重新导入,生成的内部名称也将是MN。gss_OID常量gss_C_NT_EXPORT_NAME标识“EXPORT NAME”类型,该常量的值在附录A中给出。从结构上讲,导出的NAME对象由一个包含OID的头和一个包含名称本身的尾部组成,OID标识认证名称的机制,其中拖车的语法由单独的机构规范定义。导出名称的精确格式在独立于语言的GSS-API规范[GSSAPI]中定义。

Note that the results obtained by using gss_compare_name() will in general be different from those obtained by invoking gss_canonicalize_name() and gss_export_name(), and then comparing the exported names. The first series of operation determines whether two (unauthenticated) names identify the same principal; the second whether a particular mechanism would authenticate them as the same principal. These two operations will in general give the same results only for MNs.

请注意,使用gss_compare_name()获得的结果通常与调用gss_canonicalize_name()和gss_export_name()然后比较导出的名称获得的结果不同。第一系列操作确定两个(未经验证的)名称是否标识相同的主体;第二个问题是特定机制是否将它们作为同一主体进行身份验证。这两种操作通常仅对MNs产生相同的结果。

The gss_name_t datatype should be implemented as a pointer type. To allow the compiler to aid the application programmer by performing type-checking, the use of (void *) is discouraged. A pointer to an implementation-defined type is the preferred choice.

gss_name_t数据类型应实现为指针类型。为了允许编译器通过执行类型检查来帮助应用程序程序员,不鼓励使用(void*)。指向实现定义类型的指针是首选。

Storage is allocated by routines that return gss_name_t values. A procedure, gss_release_name, is provided to free storage associated with an internal-form name.

存储由返回gss_name_t值的例程分配。提供了一个过程gss_release_name,用于释放与内部表单名称关联的存储。

3.11. Channel Bindings
3.11. 通道绑定

GSS-API supports the use of user-specified tags to identify a given context to the peer application. These tags are intended to be used to identify the particular communications channel that carries the context. Channel bindings are communicated to the GSS-API using the following structure:

GSS-API支持使用用户指定的标记来标识对等应用程序的给定上下文。这些标签用于识别承载上下文的特定通信信道。通道绑定使用以下结构与GSS-API通信:

   typedef struct gss_channel_bindings_struct {
      OM_uint32       initiator_addrtype;
      gss_buffer_desc initiator_address;
      OM_uint32       acceptor_addrtype;
      gss_buffer_desc acceptor_address;
      gss_buffer_desc application_data;
   } *gss_channel_bindings_t;
        
   typedef struct gss_channel_bindings_struct {
      OM_uint32       initiator_addrtype;
      gss_buffer_desc initiator_address;
      OM_uint32       acceptor_addrtype;
      gss_buffer_desc acceptor_address;
      gss_buffer_desc application_data;
   } *gss_channel_bindings_t;
        

The initiator_addrtype and acceptor_addrtype fields denote the type of addresses contained in the initiator_address and acceptor_address buffers. The address type should be one of the following:

initiator_addrtype和acceptor_addrtype字段表示包含在initiator_地址和acceptor_地址缓冲区中的地址类型。地址类型应为以下类型之一:

GSS_C_AF_UNSPEC Unspecified address type GSS_C_AF_LOCAL Host-local address type GSS_C_AF_INET Internet address type (e.g. IP) GSS_C_AF_IMPLINK ARPAnet IMP address type GSS_C_AF_PUP pup protocols (eg BSP) address type GSS_C_AF_CHAOS MIT CHAOS protocol address type GSS_C_AF_NS XEROX NS address type GSS_C_AF_NBS nbs address type GSS_C_AF_ECMA ECMA address type GSS_C_AF_DATAKIT datakit protocols address type GSS_C_AF_CCITT CCITT protocols GSS_C_AF_SNA IBM SNA address type GSS_C_AF_DECnet DECnet address type GSS_C_AF_DLI Direct data link interface address type GSS_C_AF_LAT LAT address type GSS_C_AF_HYLINK NSC Hyperchannel address type GSS_C_AF_APPLETALK AppleTalk address type GSS_C_AF_BSC BISYNC 2780/3780 address type GSS_C_AF_DSS Distributed system services address type GSS_C_AF_OSI OSI TP4 address type GSS_C_AF_X25 X.25 GSS_C_AF_NULLADDR No address specified

GSS_C_AF_unsec未指定地址类型GSS_C_AF_本地主机本地地址类型GSS_C_AF_INET Internet地址类型(如IP)GSS_C_AF_IMPLINK ARPAnet IMP地址类型GSS_C_AF_PUP协议(如BSP)地址类型GSS\U C\U AF\U混沌MIT混沌协议地址类型GSS\U C\U AF\NS XEROX NS地址类型GSS\U C\U AF\NBS地址类型GSS\U C\U AF\U ECMA ECMA地址类型GSS\U C\U AF\U数据包协议地址类型GSS\U C\U CCITT CCITT协议GSS\U C\U AF\U SNA IBM SNA地址类型GSS\U C\U AF\U DECnet地址类型GSS\U C\U AF\U AFU直接数据链路接口地址类型GSS\u C\u AF\u LAT LAT地址类型GSS\u C\u AF\u HYLINK NSC超通道地址类型GSS\u C\u AF\u APPLETALK APPLETALK地址类型GSS\u C\u AF\u BSC BISYNC 2780/3780地址类型GSS\u C\u AF\u DSS分布式系统服务地址类型GSS\u AF\u OSI TP4地址类型GSS\u C\u AF\u AF\u X25 X.25 GSS\u C\u空地址未指定地址

Note that these symbols name address families rather than specific addressing formats. For address families that contain several alternative address forms, the initiator_address and acceptor_address fields must contain sufficient information to determine which address

请注意,这些符号命名的是地址族,而不是特定的地址格式。对于包含多个备选地址表单的地址族,启动器地址和接受者地址字段必须包含足够的信息以确定哪个地址

form is used. When not otherwise specified, addresses should be specified in network byte-order (that is, native byte-ordering for the address family).

使用表格。如果未另行指定,则应按网络字节顺序(即地址系列的本机字节顺序)指定地址。

Conceptually, the GSS-API concatenates the initiator_addrtype, initiator_address, acceptor_addrtype, acceptor_address and application_data to form an octet string. The mechanism calculates a MIC over this octet string, and binds the MIC to the context establishment token emitted by gss_init_sec_context. The same bindings are presented by the context acceptor to gss_accept_sec_context, and a MIC is calculated in the same way. The calculated MIC is compared with that found in the token, and if the MICs differ, gss_accept_sec_context will return a GSS_S_BAD_BINDINGS error, and the context will not be established. Some mechanisms may include the actual channel binding data in the token (rather than just a MIC); applications should therefore not use confidential data as channel-binding components.

从概念上讲,GSS-API将启动器\添加类型、启动器\地址、接受器\添加类型、接受器\地址和应用程序\数据连接起来,以形成八位字节字符串。该机制计算此八位字节字符串上的MIC,并将MIC绑定到gss_init_sec_context发出的上下文建立令牌。上下文接受器向gss_accept_sec_上下文提供相同的绑定,并以相同的方式计算MIC。将计算出的MIC与令牌中的MIC进行比较,如果MIC不同,gss_accept_sec_上下文将返回gss_S_BAD_绑定错误,并且不会建立上下文。一些机制可以包括令牌中的实际信道绑定数据(而不仅仅是MIC);因此,应用程序不应将机密数据用作通道绑定组件。

Individual mechanisms may impose additional constraints on addresses and address types that may appear in channel bindings. For example, a mechanism may verify that the initiator_address field of the channel bindings presented to gss_init_sec_context contains the correct network address of the host system. Portable applications should therefore ensure that they either provide correct information for the address fields, or omit addressing information, specifying GSS_C_AF_NULLADDR as the address-types.

个别机制可能会对可能出现在通道绑定中的地址和地址类型施加额外的约束。例如,一种机制可以验证提供给gss_init_sec_上下文的通道绑定的启动器_地址字段是否包含主机系统的正确网络地址。因此,便携式应用程序应该确保它们为地址字段提供正确的信息,或者省略地址信息,将GSS_C_AF_NULLADDR指定为地址类型。

3.12. Optional parameters
3.12. 可选参数

Various parameters are described as optional. This means that they follow a convention whereby a default value may be requested. The following conventions are used for omitted parameters. These conventions apply only to those parameters that are explicitly documented as optional.

各种参数被描述为可选参数。这意味着它们遵循一种约定,即可以请求默认值。以下约定用于省略的参数。这些约定仅适用于明确记录为可选的参数。

3.12.1. gss_buffer_t types
3.12.1. gss\u缓冲区\u t类型

Specify GSS_C_NO_BUFFER as a value. For an input parameter this signifies that default behavior is requested, while for an output parameter it indicates that the information that would be returned via the parameter is not required by the application.

将GSS_C_NO_BUFFER指定为一个值。对于输入参数,这表示请求默认行为,而对于输出参数,这表示应用程序不需要通过参数返回的信息。

3.12.2. Integer types (input)
3.12.2. 整数类型(输入)

Individual parameter documentation lists values to be used to indicate default actions.

单个参数文档列出了用于指示默认操作的值。

3.12.3. Integer types (output)
3.12.3. 整数类型(输出)

Specify NULL as the value for the pointer.

指定NULL作为指针的值。

3.12.4. Pointer types
3.12.4. 指针类型

Specify NULL as the value.

指定NULL作为值。

3.12.5. Object IDs
3.12.5. 对象ID

Specify GSS_C_NO_OID as the value.

指定GSS_C_NO_OID作为值。

3.12.6. Object ID Sets
3.12.6. 对象ID集

Specify GSS_C_NO_OID_SET as the value.

指定GSS_C_NO_OID_SET作为值。

3.12.7. Channel Bindings
3.12.7. 通道绑定

Specify GSS_C_NO_CHANNEL_BINDINGS to indicate that channel bindings are not to be used.

指定GSS_C_NO_CHANNEL_绑定以指示不使用通道绑定。

4. Additional Controls
4. 附加控制

This section discusses the optional services that a context initiator may request of the GSS-API at context establishment. Each of these services is requested by setting a flag in the req_flags input parameter to gss_init_sec_context.

本节讨论了上下文启动器在上下文建立时可能向GSS-API请求的可选服务。通过在gss_init_sec_上下文的req_flags输入参数中设置一个标志来请求这些服务。

The optional services currently defined are:

当前定义的可选服务包括:

Delegation - The (usually temporary) transfer of rights from initiator to acceptor, enabling the acceptor to authenticate itself as an agent of the initiator.

委托-权利从发起人转移到接受人(通常是临时的),使接受人能够将自己作为发起人的代理进行身份验证。

Mutual Authentication - In addition to the initiator authenticating its identity to the context acceptor, the context acceptor should also authenticate itself to the initiator.

相互身份验证-除了启动器向上下文接受者验证其身份外,上下文接受者还应向启动器验证自身身份。

Replay detection - In addition to providing message integrity services, gss_get_mic and gss_wrap should include message numbering information to enable gss_verify_mic and gss_unwrap to detect if a message has been duplicated.

回放检测-除了提供消息完整性服务外,gss_get_mic和gss_wrap还应包括消息编号信息,以使gss_verify_mic和gss_unwrap能够检测消息是否重复。

Out-of-sequence detection - In addition to providing message integrity services, gss_get_mic and gss_wrap should include message sequencing information to enable gss_verify_mic and gss_unwrap to detect if a message has been received out of sequence.

无序检测-除了提供消息完整性服务外,gss_get_mic和gss_wrap还应包括消息序列信息,以使gss_verify_mic和gss_unwrap能够检测消息是否已无序接收。

Anonymous authentication - The establishment of the security context should not reveal the initiator's identity to the context acceptor.

匿名身份验证-安全上下文的建立不应向上下文接受者透露启动器的身份。

Any currently undefined bits within such flag arguments should be ignored by GSS-API implementations when presented by an application, and should be set to zero when returned to the application by the GSS-API implementation.

当GSS-API实现由应用程序呈现时,此类标志参数中当前未定义的任何位都应被GSS-API实现忽略,并且当GSS-API实现返回到应用程序时,应将其设置为零。

Some mechanisms may not support all optional services, and some mechanisms may only support some services in conjunction with others. Both gss_init_sec_context and gss_accept_sec_context inform the applications which services will be available from the context when the establishment phase is complete, via the ret_flags output parameter. In general, if the security mechanism is capable of providing a requested service, it should do so, even if additional services must be enabled in order to provide the requested service. If the mechanism is incapable of providing a requested service, it should proceed without the service, leaving the application to abort the context establishment process if it considers the requested service to be mandatory.

有些机制可能不支持所有可选服务,有些机制可能只支持某些服务与其他服务结合使用。gss_init_secu_context和gss_accept_secu_context都通过ret_flags输出参数通知应用程序,当建立阶段完成时,哪些服务将从上下文中可用。一般来说,如果安全机制能够提供请求的服务,那么它应该这样做,即使为了提供请求的服务必须启用其他服务。如果该机制无法提供请求的服务,则应在不提供该服务的情况下继续,如果应用程序认为请求的服务是强制性的,则允许应用程序中止上下文建立过程。

Some mechanisms may specify that support for some services is optional, and that implementors of the mechanism need not provide it. This is most commonly true of the confidentiality service, often because of legal restrictions on the use of data-encryption, but may apply to any of the services. Such mechanisms are required to send at least one token from acceptor to initiator during context establishment when the initiator indicates a desire to use such a service, so that the initiating GSS-API can correctly indicate whether the service is supported by the acceptor's GSS-API.

一些机制可能指定对某些服务的支持是可选的,并且该机制的实现者不需要提供它。这在保密服务中最常见,通常是因为数据加密的使用受到法律限制,但可能适用于任何服务。当发起方表示希望使用这样的服务时,需要这样的机制在上下文建立期间从接受方向发起方发送至少一个令牌,以便发起GSS-API能够正确指示该服务是否受接受方的GSS-API支持。

4.1. Delegation
4.1. 代表团

The GSS-API allows delegation to be controlled by the initiating application via a boolean parameter to gss_init_sec_context(), the routine that establishes a security context. Some mechanisms do not support delegation, and for such mechanisms attempts by an application to enable delegation are ignored.

GSS-API允许启动应用程序通过一个布尔参数控制对GSS_init_sec_context()的委托,GSS_init_sec_context()是建立安全上下文的例程。有些机制不支持委托,对于这种机制,应用程序启用委托的尝试将被忽略。

The acceptor of a security context for which the initiator enabled delegation will receive (via the delegated_cred_handle parameter of gss_accept_sec_context) a credential handle that contains the delegated identity, and this credential handle may be used to initiate subsequent GSS-API security contexts as an agent or delegate of the initiator. If the original initiator's identity is "A" and the delegate's identity is "B", then, depending on the underlying mechanism, the identity embodied by the delegated credential may be

安全上下文的接受者,对于该安全上下文,启用启动器的委派将(通过gss_accept_sec_context的delegate_cred_handle参数)接收包含委派标识的凭证句柄,该凭证句柄可用于作为启动器的代理或委派启动后续gss-API安全上下文。如果原始发起人的身份是“A”,而委托人的身份是“B”,则根据基础机制,委托凭证体现的身份可能是

either "A" or "B acting for A".

“A”或“B代表A”。

For many mechanisms that support delegation, a simple boolean does not provide enough control. Examples of additional aspects of delegation control that a mechanism might provide to an application are duration of delegation, network addresses from which delegation is valid, and constraints on the tasks that may be performed by a delegate. Such controls are presently outside the scope of the GSS-API. GSS-API implementations supporting mechanisms offering additional controls should provide extension routines that allow these controls to be exercised (perhaps by modifying the initiator's GSS-API credential prior to its use in establishing a context). However, the simple delegation control provided by GSS-API should always be able to over-ride other mechanism-specific delegation controls - If the application instructs gss_init_sec_context() that delegation is not desired, then the implementation must not permit delegation to occur. This is an exception to the general rule that a mechanism may enable services even if they are not requested - delegation may only be provided at the explicit request of the application.

对于许多支持委托的机制,简单的布尔值不能提供足够的控制。机制可能向应用程序提供的委托控制的其他方面的示例包括委托持续时间、委托有效的网络地址以及委托可能执行的任务的约束。此类控制目前不在GSS-API的范围内。支持提供附加控件的机制的GSS-API实现应提供允许执行这些控件的扩展例程(可能是通过在使用发起程序的GSS-API凭据建立上下文之前修改它)。但是,GSS-API提供的简单委托控制应该始终能够超越其他机制特定的委托控制-如果应用程序指示GSS_init_sec_context()不需要委托,则实现不得允许发生委托。这是一般规则的一个例外,即即使未请求服务,机制也可以启用服务-只能在应用程序明确请求时提供委托。

4.2. Mutual authentication
4.2. 相互认证

Usually, a context acceptor will require that a context initiator authenticate itself so that the acceptor may make an access-control decision prior to performing a service for the initiator. In some cases, the initiator may also request that the acceptor authenticate itself. GSS-API allows the initiating application to request this mutual authentication service by setting a flag when calling gss_init_sec_context.

通常,上下文接受者将要求上下文发起者进行自身身份验证,以便接受者可以在为发起者执行服务之前做出访问控制决策。在某些情况下,发起者还可以请求接受者对自己进行身份验证。GSS-API允许发起应用程序通过在调用GSS_init_sec_上下文时设置标志来请求此相互身份验证服务。

The initiating application is informed as to whether or not the context acceptor has authenticated itself. Note that some mechanisms may not support mutual authentication, and other mechanisms may always perform mutual authentication, whether or not the initiating application requests it. In particular, mutual authentication my be required by some mechanisms in order to support replay or out-of-sequence message detection, and for such mechanisms a request for either of these services will automatically enable mutual authentication.

启动应用程序被告知上下文接受者是否已对自身进行了身份验证。请注意,某些机制可能不支持相互身份验证,而其他机制可能始终执行相互身份验证,无论启动应用程序是否请求它。特别是,某些机制可能需要相互身份验证,以支持重播或无序消息检测,对于此类机制,对这些服务中的任何一项的请求都将自动启用相互身份验证。

4.3. Replay and out-of-sequence detection
4.3. 重放和无序检测

The GSS-API may provide detection of mis-ordered message once a security context has been established. Protection may be applied to messages by either application, by calling either gss_get_mic or gss_wrap, and verified by the peer application by calling gss_verify_mic or gss_unwrap.

一旦建立了安全上下文,GSS-API可提供错误排序消息的检测。通过调用gss_get_mic或gss_wrap,可通过任一应用程序对消息应用保护,并通过调用gss_verify_mic或gss_unwrap,由对等应用程序对消息进行验证。

gss_get_mic calculates a cryptographic MIC over an application message, and returns that MIC in a token. The application should pass both the token and the message to the peer application, which presents them to gss_verify_mic.

gss_get_mic计算应用程序消息上的加密mic,并在令牌中返回该mic。应用程序应将令牌和消息传递给对等应用程序,对等应用程序将它们呈现给gss_verify_mic。

gss_wrap calculates a cryptographic MIC of an application message, and places both the MIC and the message inside a single token. The Application should pass the token to the peer application, which presents it to gss_unwrap to extract the message and verify the MIC.

gss_wrap计算应用程序消息的加密MIC,并将MIC和消息放在单个令牌中。应用程序应将令牌传递给对等应用程序,对等应用程序将令牌呈现给gss_unwrap以提取消息并验证MIC。

Either pair of routines may be capable of detecting out-of-sequence message delivery, or duplication of messages. Details of such mis-ordered messages are indicated through supplementary status bits in the major status code returned by gss_verify_mic or gss_unwrap. The relevant supplementary bits are:

这两个例程中的任何一个都可以检测到顺序错误的消息传递或消息的重复。此类误序消息的详细信息通过gss_verify_mic或gss_unwrap返回的主要状态代码中的补充状态位表示。相关补充位为:

GSS_S_DUPLICATE_TOKEN - The token is a duplicate of one that has already been received and processed. Only contexts that claim to provide replay detection may set this bit. GSS_S_OLD_TOKEN - The token is too old to determine whether or not it is a duplicate. Contexts supporting out-of-sequence detection but not replay detection should always set this bit if GSS_S_UNSEQ_TOKEN is set; contexts that support replay detection should only set this bit if the token is so old that it cannot be checked for duplication. GSS_S_UNSEQ_TOKEN - A later token has already been processed. GSS_S_GAP_TOKEN - An earlier token has not yet been received.

GSS_S_DUPLICATE_令牌-该令牌是已接收和处理的令牌的副本。只有声称提供重播检测的上下文才能设置此位。GSS_S_OLD_令牌-令牌太旧,无法确定它是否重复。如果设置了GSS_S_UNSEQ_令牌,则支持无序检测但不支持重放检测的上下文应始终设置此位;支持重播检测的上下文只应在令牌太旧以至于无法检查其重复时设置此位。GSS_S_UNSEQ_令牌-已处理一个更高的令牌。GSS_S_GAP_令牌-尚未收到早期令牌。

A mechanism need not maintain a list of all tokens that have been processed in order to support these status codes. A typical mechanism might retain information about only the most recent "N" tokens processed, allowing it to distinguish duplicates and missing tokens within the most recent "N" messages; the receipt of a token older than the most recent "N" would result in a GSS_S_OLD_TOKEN status.

为了支持这些状态代码,机制不需要维护已处理的所有令牌的列表。典型的机制可能只保留有关最近处理的“N”令牌的信息,允许它在最近的“N”消息中区分重复的和丢失的令牌;收到比最近的“N”旧的令牌将导致GSS_S_OLD_令牌状态。

4.4. Anonymous Authentication
4.4. 匿名验证

In certain situations, an application may wish to initiate the authentication process to authenticate a peer, without revealing its own identity. As an example, consider an application providing access to a database containing medical information, and offering unrestricted access to the service. A client of such a service might wish to authenticate the service (in order to establish trust in any information retrieved from it), but might not wish the service to be able to obtain the client's identity (perhaps due to privacy concerns about the specific inquiries, or perhaps simply to avoid being placed on mailing-lists).

在某些情况下,应用程序可能希望启动身份验证过程以对对等方进行身份验证,而不透露其自身的身份。作为一个例子,考虑一个应用程序,提供对包含医疗信息的数据库的访问,并提供对服务的无限制访问。此类服务的客户可能希望验证该服务(以便对从中检索到的任何信息建立信任),但可能不希望该服务能够获得客户的身份(可能是由于对特定查询的隐私问题,或者可能只是为了避免被列入邮件列表)。

In normal use of the GSS-API, the initiator's identity is made available to the acceptor as a result of the context establishment process. However, context initiators may request that their identity not be revealed to the context acceptor. Many mechanisms do not support anonymous authentication, and for such mechanisms the request will not be honored. An authentication token will be still be generated, but the application is always informed if a requested service is unavailable, and has the option to abort context establishment if anonymity is valued above the other security services that would require a context to be established.

在GSS-API的正常使用中,作为上下文建立过程的结果,发起者的身份可供接受者使用。然而,上下文发起者可以请求不向上下文接受者透露其身份。许多机制不支持匿名身份验证,对于此类机制,请求将不会得到满足。仍将生成身份验证令牌,但如果请求的服务不可用,应用程序始终会得到通知,并且如果匿名性的价值高于需要建立上下文的其他安全服务,则应用程序可以选择中止上下文建立。

In addition to informing the application that a context is established anonymously (via the ret_flags outputs from gss_init_sec_context and gss_accept_sec_context), the optional src_name output from gss_accept_sec_context and gss_inquire_context will, for such contexts, return a reserved internal-form name, defined by the implementation.

除了通知应用程序上下文是匿名建立的(通过gss_init_secu_context和gss_accept_secu_context的ret_标志输出),gss_accept_secu_context和gss_inquire_context的可选src_name输出将返回由实现定义的保留内部表单名称。

When presented to gss_display_name, this reserved internal-form name will result in a printable name that is syntactically distinguishable from any valid principal name supported by the implementation, associated with a name-type object identifier with the value GSS_C_NT_ANONYMOUS, whose value us given in Appendix A. The printable form of an anonymous name should be chosen such that it implies anonymity, since this name may appear in, for example, audit logs. For example, the string "<anonymous>" might be a good choice, if no valid printable names supported by the implementation can begin with "<" and end with ">".

当呈现给gss_display_name时,此保留内部表单名称将产生一个可打印名称,该名称在语法上可与实现支持的任何有效主体名称区分,并与值为gss_C_NT_ANONYMOUS的名称类型对象标识符相关联,其值在附录A中给出。应选择匿名名称的可打印形式,以使其暗示匿名性,因为该名称可能出现在例如审计日志中。例如,如果实现不支持以“<”开头并以“>”结尾的有效可打印名称,那么字符串“<anonymous>”可能是一个不错的选择。

4.5. Confidentiality
4.5. 保密性

If a context supports the confidentiality service, gss_wrap may be used to encrypt application messages. Messages are selectively encrypted, under the control of the conf_req_flag input parameter to gss_wrap.

如果上下文支持保密服务,则可以使用gss_wrap对应用程序消息进行加密。在gss_wrap的conf_req_flag输入参数的控制下,消息被选择性地加密。

4.6. Inter-process context transfer
4.6. 进程间上下文转移

GSS-API V2 provides routines (gss_export_sec_context and gss_import_sec_context) which allow a security context to be transferred between processes on a single machine. The most common use for such a feature is a client-server design where the server is implemented as a single process that accepts incoming security contexts, which then launches child processes to deal with the data on these contexts. In such a design, the child processes must have access to the security context data structure created within the parent by its call to gss_accept_sec_context so that they can use per-message protection services and delete the security context when the communication session ends.

GSS-API V2提供例程(GSS_导出_秒_上下文和GSS_导入_秒_上下文),允许在单个计算机上的进程之间传输安全上下文。这种特性最常见的用途是客户机-服务器设计,其中服务器被实现为单个进程,该进程接受传入的安全上下文,然后启动子进程来处理这些上下文中的数据。在这种设计中,子进程必须能够访问通过调用gss_accept_sec_context在父进程内创建的安全上下文数据结构,以便它们可以使用每消息保护服务,并在通信会话结束时删除安全上下文。

Since the security context data structure is expected to contain sequencing information, it is impractical in general to share a context between processes. Thus GSS-API provides a call (gss_export_sec_context) that the process which currently owns the context can call to declare that it has no intention to use the context subsequently, and to create an inter-process token containing information needed by the adopting process to successfully import the context. After successful completion of gss_export_sec_context, the original security context is made inaccessible to the calling process by GSS-API, and any context handles referring to this context are no longer valid. The originating process transfers the inter-process token to the adopting process, which passes it to gss_import_sec_context, and a fresh gss_ctx_id_t is created such that it is functionally identical to the original context.

由于安全上下文数据结构预期包含排序信息,因此在进程之间共享上下文通常是不切实际的。因此,GSS-API提供了一个调用(GSS_export_sec_context),当前拥有该上下文的进程可以调用该调用来声明它无意随后使用该上下文,并创建一个进程间令牌,该令牌包含采用进程成功导入上下文所需的信息。成功完成gss_导出_sec_上下文后,gss-API将使调用进程无法访问原始安全上下文,并且引用此上下文的任何上下文句柄都不再有效。发起进程将进程间令牌传输给采用进程,采用进程将其传递给gss_导入_sec_上下文,并创建一个新的gss_ctx_id,使其在功能上与原始上下文相同。

The inter-process token may contain sensitive data from the original security context (including cryptographic keys). Applications using inter-process tokens to transfer security contexts must take appropriate steps to protect these tokens in transit.

进程间令牌可能包含来自原始安全上下文(包括加密密钥)的敏感数据。使用进程间令牌传输安全上下文的应用程序必须采取适当的步骤来保护传输中的这些令牌。

Implementations are not required to support the inter-process transfer of security contexts. The ability to transfer a security context is indicated when the context is created, by gss_init_sec_context or gss_accept_sec_context setting the GSS_C_TRANS_FLAG bit in their ret_flags parameter.

实现不需要支持安全上下文的进程间传输。在创建上下文时,通过gss_init_sec_context或gss_accept_sec_context在其ret_flags参数中设置gss_C_TRANS_标志位来指示传输安全上下文的能力。

4.7. The use of incomplete contexts
4.7. 不完全语境的使用

Some mechanisms may allow the per-message services to be used before the context establishment process is complete. For example, a mechanism may include sufficient information in its initial context-level token for the context acceptor to immediately decode messages protected with gss_wrap or gss_get_mic. For such a mechanism, the initiating application need not wait until subsequent context-level

某些机制可能允许在上下文建立过程完成之前使用每消息服务。例如,机制可以在其初始上下文级别令牌中包括足够的信息,以便上下文接受者立即解码由gss_wrap或gss_get_mic保护的消息。对于这种机制,启动应用程序不需要等到后续的上下文级别

tokens have been sent and received before invoking the per-message protection services.

在调用每消息保护服务之前,已发送和接收令牌。

The ability of a context to provide per-message services in advance of complete context establishment is indicated by the setting of the GSS_C_PROT_READY_FLAG bit in the ret_flags parameter from gss_init_sec_context and gss_accept_sec_context. Applications wishing to use per-message protection services on partially-established contexts should check this flag before attempting to invoke gss_wrap or gss_get_mic.

在完整上下文建立之前,上下文提供每条消息服务的能力通过在GSS_init_sec_context和GSS_accept_sec_context的ret_flags参数中设置GSS_C_PROT_READY_标志位来表示。希望在部分建立的上下文上使用每消息保护服务的应用程序应在尝试调用gss_wrap或gss_get_mic之前检查此标志。

5. GSS-API Routine Descriptions
5. GSS-API例程说明

In addition to the explicit major status codes documented here, the code GSS_S_FAILURE may be returned by any routine, indicating an implementation-specific or mechanism-specific error condition, further details of which are reported via the minor_status parameter.

除了此处记录的明确的主要状态代码外,任何例程都可能返回代码GSS_S_FAILURE,表示特定于实现或特定于机制的错误条件,其进一步细节通过次要_status参数报告。

5.1. gss_accept_sec_context
5.1. gss_接受_秒_上下文

OM_uint32 gss_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, const 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)

OM_uint32 gss_接受_秒_上下文(OM_uint32*次要_状态、gss_ctx_id_t*上下文_句柄、const gss_cred_id_t acceptor_cred_句柄、const gss_buffer_t input_token_buffer、const gss_channel_输入绑定、const gss_name_t*src_name、GSuin_OID*mech_类型、gss_buffer______t output_token_、OM_标记、OM_ret_标记、时间_cred_记录)

Purpose:

目的:

Allows a remotely initiated security context between the application and a remote peer to be established. The routine may return a output_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 argument to 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 when the reply token is received from the peer application, passing the token to gss_accept_sec_context via the input_token parameters.

允许在应用程序和远程对等方之间建立远程启动的安全上下文。该例程可能会返回一个输出令牌,该令牌应传输到对等应用程序,对等应用程序将在其中向gss_init_sec_上下文显示该令牌。如果不需要发送令牌,gss_accept_sec_上下文将通过将output_令牌参数的长度字段设置为零来指示这一点。为了完成上下文建立,对等应用程序可能需要一个或多个应答令牌;如果是这样,gss_accept_secu_context将返回gss_S_CONTINUE_NEEDED的状态标志,在这种情况下,当从对等应用程序接收到应答令牌时,应再次调用它,并通过输入令牌参数将令牌传递给gss_accept_secu_context。

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

便携式应用程序应该使用令牌长度和返回状态来确定令牌是需要发送还是等待。因此,典型的便携式调用者应始终在循环中调用gss_accept_sec_上下文:

gss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT;

gss\u ctx\u id\u t context\u hdl=gss\u C\u NO\u 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);
        
   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);
        
       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 fully established and the following restrictions apply to the output parameters:

每当例程返回包含所需GSS_S_CONTINUE_值的主要状态时,上下文未完全建立,以下限制适用于输出参数:

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

通过time_rec参数返回的值未定义,除非随附的ret_flags参数包含位GSS_C_PROT_READY_标志,这表示在成功完成状态之前可以应用每条消息服务,在例程返回GSS_S_COMPLETE的主要状态值之前,通过mech_type参数返回的值可能未定义。

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 contain the values that the implementation expects would be valid if context establishment were to succeed.

GSS_C_DELEG_标志、GSS_C_MUTUAL_标志、GSS_C_REPLAY_标志、GSS_C_SEQUENCE_标志、GSS_C_CONF_标志、GSS_C_INTEG_标志和通过ret_flags参数返回的GSS_C_ANON_标志位的值应包含实现预期的有效值(如果上下文建立成功)。

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

ret_标志中GSS_C_PROT_READY_标志和GSS_C_TRANS_标志位的值应指示GSS_accept_sec_上下文返回时的实际状态,无论上下文是否完全建立。

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

尽管这要求GSS-API实现在返回给调用者的最终ret_标志中设置GSS_C_PROT_READY_标志(即,伴随GSS_S_完成状态代码时),但应用程序不应依赖此行为,因为GSS-API版本1中未定义该标志。相反,根据GSS_C_INTEG_标志和GSS_C_CONF_标志值,应用程序应该准备在成功建立上下文后使用每消息服务。

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 the established context.

ret_flags参数中的所有其他位都应设置为零。当例程返回GSS_S_CONTINUE_NEEDED时,通过ret_flags参数返回的值表示实现期望从已建立的上下文中可用的服务。

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

如果gss_accept_sec_context()的初始调用失败,则实现不应创建上下文对象,而应将context_handle参数的值设置为gss_C_NO_context以指示这一点。在后续调用失败的情况下,允许实现删除“半构建”安全上下文(在这种情况下,它应该将context_handle参数设置为GSS_C_NO_context),但首选行为是保持安全上下文(和context_handle参数)不变,以便应用程序删除(使用gss_delete_sec_上下文)。

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

在上下文建立过程中,信息状态位GSS_S_OLD_TOKEN和GSS_DUPLICATE_TOKEN表示致命错误,GSS-API机制应始终将其与GSS_S_故障的常规错误关联返回。GSS-API规范的版本1中不存在这种配对要求,因此希望在版本1实现上运行的应用程序必须在这些代码的特殊情况下运行。

Parameters:

参数:

context_handle gss_ctx_id_t, read/modify context handle for new context. Supply GSS_C_NO_CONTEXT for first call; use value returned in subsequent calls. Once gss_accept_sec_context() has returned a value via this parameter, resources have been assigned to the corresponding context, and must be freed by the application after use with a call to gss_delete_sec_context().

上下文句柄gss\U ctx\U id\t,读取/修改新上下文的上下文句柄。为第一次呼叫提供GSS_C_NO_上下文;使用在后续调用中返回的值。一旦gss_accept_sec_context()通过此参数返回值,资源就被分配到相应的上下文,并且在与gss_delete_sec_context()调用一起使用后,应用程序必须释放这些资源。

acceptor_cred_handle gss_cred_id_t, read Credential handle claimed by context acceptor. Specify GSS_C_NO_CREDENTIAL to accept the context as a default principal. If GSS_C_NO_CREDENTIAL is specified, but no default acceptor principal is defined, GSS_S_NO_CRED will be returned.

acceptor_cred_handle gss_cred_id_t,读取上下文acceptor声明的凭据句柄。指定GSS_C_NO_凭据以接受上下文作为默认主体。如果指定了GSS_C_NO_凭证,但未定义默认的接受者主体,则将返回GSS_S_NO_凭证。

input_token_buffer buffer, opaque, read token obtained from remote application.

输入\令牌\缓冲区,不透明,读取从远程应用程序获取的令牌。

input_chan_bindings channel bindings, read, optional Application-specified bindings. Allows application to securely bind channel identification information to the security context. If channel bindings are not used, specify GSS_C_NO_CHANNEL_BINDINGS.

输入通道绑定、读取、可选应用程序指定的绑定。允许应用程序将通道标识信息安全地绑定到安全上下文。如果未使用通道绑定,请指定GSS_C_NO_channel_绑定。

src_name gss_name_t, modify, optional Authenticated name of context initiator. After use, this name should be deallocated by passing it to gss_release_name(). If not required, specify NULL.

src_name gss_name_t,modify,可选的上下文启动器身份验证名称。使用后,应通过将此名称传递给gss_release_name()来解除分配此名称。如果不是必需的,请指定NULL。

mech_type Object ID, modify, optional Security mechanism used. The returned OID value will be a pointer into static storage, and should be treated as read-only by the caller (in particular, it does not need to be freed). If not required, specify NULL.

mech_类型对象ID,修改,使用可选安全机制。返回的OID值将是指向静态存储的指针,调用者应将其视为只读(特别是,它不需要释放)。如果不是必需的,请指定NULL。

output_token buffer, opaque, modify Token to be passed to peer application. If the length field of the returned token buffer is 0, then no token need be passed to the peer application. If a non-zero length field is returned, the associated storage must be freed after use by the application with a call to gss_release_buffer().

输出令牌缓冲区,不透明,修改要传递给对等应用程序的令牌。如果返回的令牌缓冲区的长度字段为0,则不需要将令牌传递给对等应用程序。如果返回长度非零的字段,则在应用程序调用gss_release_buffer()使用后,必须释放关联的存储。

ret_flags bit-mask, modify, optional Contains various independent flags, each of which indicates that the context supports a specific service option. If not needed, specify NULL. Symbolic names are provided for each flag, and the symbolic names corresponding to the required flags should be logically-ANDed with the ret_flags value to test whether a given option is supported by the context. The flags are: 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 authentication 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

ret_标志位掩码、修改、可选包含各种独立标志,其中每个标志都表示上下文支持特定的服务选项。如果不需要,请指定NULL。为每个标志提供符号名,与所需标志对应的符号名应与ret_flags值逻辑and,以测试上下文是否支持给定选项。标志为:GSS_C_DELEG_标志True-委派凭据可通过委派的\u cred_handle参数False获得-未委派凭据GSS_C_MUTUAL_标志True-远程对等方请求相互身份验证False-远程对等方未请求相互身份验证GSS_C_REPLAY_标志True-将恢复受保护消息的重播检测到错误-不会检测到重播的消息GSS_C_SEQUENCE_FLAG True-会检测到无序受保护的消息False-不会检测到无序消息GSS_C_CONF_FLAG True-可以通过调用GSS_wrap例程False调用保密服务-没有可用的保密服务(通过GSS_wrap)。gss_wrap将仅提供消息封装、数据源身份验证和完整性服务。GSS_C_INTEG_FLAG True-可以通过调用GSS_get_mic或GSS_wrap例程来调用完整性服务。False-每条消息完整性服务不可用。GSS_C_ANON_标志True-发起方不希望被验证;src_name参数(如果请求)包含

an anonymous internal name. 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 available 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 available only 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.

匿名的内部名称。False-启动器已正常通过身份验证。GSS_C_PROT_READY_FLAG True-保护服务(由GSS_C_CONF_FLAG和GSS_C_INTEG_FLAG的状态指定)在伴随的主要状态返回值为GSS_S_COMPLETE或GSS_S_CONTINUE_NEEDED时可用。False-仅当伴随的主要状态返回值为GSS_S_COMPLETE时,保护服务(由GSS_C_CONF_标志和GSS_INTEG_标志的状态指定)才可用。GSS_C_TRANS_FLAG True-生成的安全上下文可以通过调用GSS_export_sec_context()传输到其他进程。False-安全上下文不可转让。所有其他位应设置为零。

time_rec Integer, modify, optional number of seconds for which the context will remain valid. Specify NULL if not required.

time_rec Integer,modify,上下文保持有效的可选秒数。如果不需要,请指定NULL。

delegated_cred_handle gss_cred_id_t, modify, optional credential handle for credentials received from context initiator. Only valid if deleg_flag in ret_flags is true, in which case an explicit credential handle (i.e. not GSS_C_NO_CREDENTIAL) will be returned; if deleg_flag is false, gss_accept_context() will set this parameter to GSS_C_NO_CREDENTIAL. If a credential handle is returned, the associated resources must be released by the application after use with a call to gss_release_cred(). Specify NULL if not required.

从上下文启动器接收的凭据的委派凭据句柄gss\U凭据id\t、修改、可选凭据句柄。仅当ret_标志中的deleg_标志为真时有效,在这种情况下,将返回显式凭证句柄(即非GSS_C_NO_凭证);如果deleg_标志为false,则gss_accept_context()将此参数设置为gss_C_NO_凭证。如果返回凭证句柄,则应用程序必须在调用gss_release_cred()后释放相关资源。如果不需要,请指定NULL。

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

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

GSS_S_CONTINUE_required表示需要来自对等应用程序的令牌来完成上下文,并且必须使用该令牌再次调用GSS_accept_sec_上下文。

GSS_S_DEFECTIVE_TOKEN Indicates that consistency checks performed on the input_token failed.

GSS_S_缺陷_令牌表示对输入_令牌执行的一致性检查失败。

GSS_S_DEFECTIVE_CREDENTIAL Indicates that consistency checks performed on the credential failed.

GSS_S_缺陷_凭证表示对凭证执行的一致性检查失败。

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

GSS_S_NO__CRED提供的凭据对于上下文接受无效,或者凭据句柄未引用任何凭据。

GSS_S_CREDENTIALS_EXPIRED The referenced credentials have expired.

GSS\u S\u凭据\u已过期引用的凭据已过期。

GSS_S_BAD_BINDINGS The input_token contains different channel bindings to those specified via the input_chan_bindings parameter.

GSS_S_BAD_绑定输入_令牌包含通过输入_chan_BINDINGS参数指定的不同通道绑定。

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

GSS_S_NO_CONTEXT表示提供的上下文句柄未引用有效的上下文。

GSS_S_BAD_SIG The input_token contains an invalid MIC.

GSS_S_BAD_SIG输入_令牌包含无效麦克风。

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

GSS_S_OLD_令牌输入_令牌太旧。这是上下文建立过程中的一个致命错误。

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

GSS_S_DUPLICATE_TOKEN输入_TOKEN有效,但是已处理的令牌的副本。这是上下文建立过程中的一个致命错误。

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

GSS_S_BAD_MECH收到的令牌指定了实现或提供的凭据不支持的机制。

5.2. gss_acquire_cred
5.2. gss_收购_信用

OM_uint32 gss_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)

OM_uint32 gss_获取_cred(OM_uint32*次要_状态、const gss_name_t desired_name、OM_uint32 time_req、const gss_Old_set desired_Mechanch、gss_cred_usage_cred_Use_用法、gss_cred_id_t*输出_cred_手柄、gss_Old_set*实际_机械、OM_uint32*time_rec)

Purpose:

目的:

Allows an application to acquire a handle for a pre-existing credential by name. GSS-API implementations must impose a local access-control policy on callers of this routine to prevent unauthorized callers from acquiring credentials 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 credentials rather than merely acquiring a handle to existing credentials. Such functions, if required, should be defined in implementation-specific extensions to the API.

允许应用程序按名称获取预先存在的凭据的句柄。GSS-API实现必须对此例程的调用者实施本地访问控制策略,以防止未经授权的调用者获取他们无权获得的凭据。此例程不打算提供“登录到网络”功能,因为此类功能将涉及创建新凭据,而不仅仅是获取现有凭据的句柄。如果需要,这些函数应该在API的特定于实现的扩展中定义。

If desired_name is GSS_C_NO_NAME, the call is interpreted as a request for a credential handle that will invoke default behavior 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).

如果所需的_名称是GSS_C_NO_name,则调用将被解释为请求凭证句柄,该句柄将在传递给GSS_init_sec_context()时调用默认行为(如果cred_用法是GSS_C_INITIATE或GSS_C_两者)或GSS_accept_sec_context()(如果cred_用法是GSS_C_accept或GSS_C_两者)。

Mechanisms should honor the desired_mechs parameter, and return a credential that is suitable to use only with the requested mechanisms. 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. If desired_mechs is an empty set, behavior is undefined.

机构应遵守所需的_mechs参数,并返回仅适用于所请求机构的凭证。例外情况是,一个基础凭证元素可以由多个机制共享;在这种情况下,允许实现指示凭证元素可以使用的所有机制。如果所需的机械为空集,则行为未定义。

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 therefore not support the acquisition of GSS_C_INITIATE or GSS_C_BOTH credentials via gss_acquire_cred for any name other than GSS_C_NO_NAME, or a name produced by applying either gss_inquire_cred to a valid credential, or gss_inquire_context to an active context.

该例程预计主要由上下文接受者使用,因为实现可能提供从系统登录过程获取GSS-API启动器凭据的机制特定方法。因此,某些实现可能不支持通过GSS_acquire_cred获取GSS_C_NO_name以外的任何名称的GSS_C_INITIATE或GSS_C_这两个凭据,或通过将GSS_inquire_cred应用于有效凭据或将GSS_inquire_上下文应用于活动上下文而生成的名称。

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

如果某个机制的凭证获取非常耗时,则该机制可以选择延迟实际获取,直到需要凭证为止(例如,通过gss_init_sec_上下文或gss_accept_sec_上下文)。这种特定于机制的实现决策应该对调用应用程序不可见;因此,紧接着gss_acquire_cred调用之后的gss_inquire_cred调用必须返回有效的凭证数据,因此可能导致延迟凭证获取的开销。

Parameters:

参数:

desired_name gss_name_t, read Name of principal whose credential should be acquired

所需名称gss\U名称\t,读取应获取其凭证的主体的名称

time_req Integer, read, optional number of seconds that credentials should remain valid. Specify GSS_C_INDEFINITE to request that the credentials have the maximum permitted lifetime.

time_req Integer,read,凭证应保持有效的可选秒数。指定GSS_C_unfinite以请求凭据具有允许的最大生存期。

desired_mechs Set of Object IDs, read, optional set of underlying security mechanisms that may be used. GSS_C_NO_OID_SET may be used to obtain an implementation-specific default.

所需的\u mechs对象ID集、读取、可使用的可选底层安全机制集。GSS_C_NO_OID_集合可用于获取特定于实现的默认值。

cred_usage gss_cred_usage_t, read GSS_C_BOTH - Credentials may be used either to initiate or accept security contexts. GSS_C_INITIATE - Credentials will only be used to initiate security contexts. GSS_C_ACCEPT - Credentials will only be used to accept security contexts.

cred_用法gss_cred_用法,read gss_C_两者-凭据可用于启动或接受安全上下文。GSS_C_INITIATE-凭据将仅用于启动安全上下文。GSS_C_ACCEPT-凭据将仅用于接受安全上下文。

output_cred_handle gss_cred_id_t, modify The returned credential handle. Resources associated with this credential handle must be released by the application after use with a call to gss_release_cred().

输出\u凭证\u句柄gss\u凭证\u id\u,修改返回的凭证句柄。与此凭据句柄关联的资源必须在与gss_release_cred()调用一起使用后由应用程序释放。

actual_mechs Set of Object IDs, modify, optional The set of mechanisms for which the credential is valid. Storage associated with the returned OID-set must be released by the application after use with a call to gss_release_oid_set(). Specify NULL if not required.

实际\u mechs对象ID集,修改凭证有效的机制集(可选)。与返回的OID集关联的存储必须在与gss_release_OID_set()调用一起使用后由应用程序释放。如果不需要,请指定NULL。

time_rec Integer, modify, optional Actual number of seconds for which the returned credentials will remain valid. If the implementation does not support expiration of credentials, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required

time_rec Integer,modify,可选返回的凭据保持有效的实际秒数。如果实现不支持凭据过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_MECH Unavailable mechanism requested

请求GSS_S_坏_机械不可用机制

GSS_S_BAD_NAMETYPE Type contained within desired_name parameter is not supported

不支持所需名称参数中包含的GSS\U S\U BAD\U name类型

GSS_S_BAD_NAME Value supplied for desired_name parameter is ill formed.

为所需的\u NAME参数提供的GSS\u S\u BAD\u NAME值格式错误。

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

GSS\u S\u凭据\u已过期无法获取凭据,因为它们已过期。

GSS_S_NO_CRED No credentials were found for the specified name.

GSS_S_NO_CRED未找到指定名称的凭据。

5.3. gss_add_cred
5.3. gss_添加_cred

OM_uint32 gss_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)

OM_uint32 gss_添加_cred(OM_uint32*次要_状态、常量gss_cred_id_输入_cred_句柄、常量gss_name_期望_name、常量gss_OID期望_机械、gss_cred_用法_cred_用法、OM_uint32启动器时间请求、OM_uint32接收器时间请求、gss_cred_id_id_输出_cred_句柄、gss_OID u集合*实际机械、OM_2启动器时间、接收器时间)

Purpose:

目的:

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 callers from 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 acquiring a GSS-API handle to existing data. Such functions, if required, should be defined in implementation-specific extensions to the API.

将凭证元素添加到凭证。凭证元素由其引用的主体的名称标识。GSS-API实现必须对此例程的调用方强制实施本地访问控制策略,以防止未经授权的调用方获取其无权访问的凭据元素。此例程不打算提供“登录到网络”功能,因为此类功能将涉及创建新的机制特定的身份验证数据,而不仅仅是获取现有数据的GSS-API句柄。如果需要,这些函数应该在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 behavior 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).

如果所需的_名称是GSS_C_NO_name,则调用将被解释为添加凭证元素的请求,该凭证元素将在传递到GSS_init_secu context()时调用默认行为(如果cred_用法是GSS_C_INITIATE或GSS_C_两者)或GSS_accept_secu context()(如果cred_用法是GSS_C_accept或GSS_两者)。

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 therefore not support the acquisition of GSS_C_INITIATE or GSS_C_BOTH credentials via gss_acquire_cred for any name other than GSS_C_NO_NAME, or a name produced by applying either gss_inquire_cred to a valid credential, or gss_inquire_context to an active context.

该例程预计主要由上下文接受者使用,因为实现可能提供从系统登录过程获取GSS-API启动器凭据的机制特定方法。因此,某些实现可能不支持通过GSS_acquire_cred获取GSS_C_NO_name以外的任何名称的GSS_C_INITIATE或GSS_C_这两个凭据,或通过将GSS_inquire_cred应用于有效凭据或将GSS_inquire_上下文应用于活动上下文而生成的名称。

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

如果某个机制的凭证获取非常耗时,则该机制可以选择延迟实际获取,直到需要凭证为止(例如,通过gss_init_sec_上下文或gss_accept_sec_上下文)。这种特定于机制的实现决策应该对调用应用程序不可见;因此,在gss_add_cred调用之后立即调用gss_inquire_cred必须返回有效的凭证数据,因此可能会导致延迟凭证获取的开销。

This routine can be used to either compose a new credential containing all credential-elements of the original in addition to the newly-acquire credential-element, or to add the new credential-element to an existing credential. If NULL is specified for the output_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.

此例程可用于编写一个新凭证,该凭证除包含新获取凭证元素外,还包含原始凭证的所有凭证元素,或将新凭证元素添加到现有凭证中。如果为output_cred_handle参数参数指定NULL,则新的凭证元素将添加到由input_cred_handle标识的凭证中;如果为output\u cred\u handle参数指定了有效指针,则将创建新的凭证句柄。

If GSS_C_NO_CREDENTIAL is specified as the input_cred_handle, gss_add_cred will compose a credential (and set the output_cred_handle parameter accordingly) based on default behavior. That is, the call will have the same effect as if the application had first made a call to gss_acquire_cred(), specifying the same usage and passing GSS_C_NO_NAME as the desired_name parameter 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.

如果将GSS_C_NO_CREDENTIAL指定为输入\u cred_句柄,则GSS_add_cred将根据默认行为组成一个凭据(并相应地设置输出\u cred_句柄参数)。也就是说,调用的效果与应用程序首先调用gss_acquire_cred()、指定相同的用法并将gss_C_NO_NAME作为所需的_NAME参数传递以获取体现默认行为的显式凭证句柄、将此凭证句柄传递给gss_add_cred()、最后调用gss_release_cred()的效果相同在第一个凭证句柄上。

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

如果GSS_C_NO_CREDENTIAL被指定为input_cred_handle参数,则必须提供非空的output_cred_handle。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

input_cred_handle gss_cred_id_t, read, optional The credential to which a credential-element will be added. If GSS_C_NO_CREDENTIAL is specified, the routine will compose the new credential based on default behavior (see description above). Note that, while the credential-handle is not modified by gss_add_cred(), the underlying credential will be modified if output_credential_handle is NULL.

输入\u cred\u handle gss\u cred\u id\t,read,可选凭证将添加凭证元素。如果指定了GSS_C_NO_凭证,则例程将根据默认行为组成新凭证(请参见上面的说明)。请注意,虽然gss_add_cred()不修改凭证句柄,但如果输出_credential_句柄为NULL,则将修改基础凭证。

desired_name gss_name_t, read. Name of principal whose credential should be acquired.

所需名称gss\u name\t,读取。应获取其凭据的主体的名称。

desired_mech Object ID, read Underlying security mechanism with which the credential may be used.

所需的\u mech对象ID,读取可使用凭证的基础安全机制。

cred_usage gss_cred_usage_t, read GSS_C_BOTH - Credential may be used either to initiate or accept security contexts. GSS_C_INITIATE - Credential will only be used to initiate security contexts. GSS_C_ACCEPT - Credential will only be used to accept security contexts.

cred_用法gss_cred_用法,read gss_C_两者-凭证可用于启动或接受安全上下文。GSS_C_INITIATE-凭证将仅用于启动安全上下文。GSS_C_ACCEPT-凭据将仅用于接受安全上下文。

initiator_time_req Integer, read, optional number of seconds that the credential should remain valid for initiating security contexts. This argument is ignored if the composed credentials are of type GSS_C_ACCEPT. Specify GSS_C_INDEFINITE to request that the credentials have the maximum permitted initiator lifetime.

启动器\u时间\u请求整数,读取,凭证在启动安全上下文时应保持有效的可选秒数。如果组合的凭据的类型为GSS_C_ACCEPT,则忽略此参数。指定GSS_C_unfinite以请求凭据具有允许的最大启动器生存期。

acceptor_time_req Integer, read, optional number of seconds that the credential should remain valid for accepting security contexts. This argument is ignored if the composed credentials are of type GSS_C_INITIATE.

acceptor_time_req Integer,read,凭证在接受安全上下文时应保持有效的可选秒数。如果组合的凭据类型为GSS_C_INITIATE,则忽略此参数。

Specify GSS_C_INDEFINITE to request that the credentials have the maximum permitted initiator lifetime.

指定GSS_C_unfinite以请求凭据具有允许的最大启动器生存期。

output_cred_handle gss_cred_id_t, modify, optional The returned credential handle, containing the new credential-element and all the credential-elements from input_cred_handle. If a valid pointer to a gss_cred_id_t is supplied for this parameter, gss_add_cred creates a new credential handle containing all credential-elements from the input_cred_handle and the newly acquired credential-element; if NULL is specified for this parameter, the newly acquired credential-element will be added to the credential identified by input_cred_handle.

输出凭据句柄gss\u cred\u id\t,修改,可选返回的凭据句柄,包含新凭据元素和输入凭据句柄中的所有凭据元素。如果为该参数提供了指向gss_cred_id_t的有效指针,则gss_add_cred将创建一个新的凭证句柄,其中包含来自输入凭证句柄和新获取凭证元素的所有凭证元素;如果为此参数指定NULL,则新获取的凭证元素将添加到由input_cred_handle标识的凭证中。

The resources associated with any credential handle returned via this parameter must be released by the application after use with a call to gss_release_cred().

与通过此参数返回的任何凭据句柄关联的资源必须在与gss_release_cred()调用一起使用后由应用程序释放。

actual_mechs Set of Object IDs, modify, optional The complete set of mechanisms for which the new credential is valid. Storage for the returned OID-set must be freed by the application after use with a call to gss_release_oid_set(). Specify NULL if not required.

实际\u mechs对象ID集,修改,可选新凭证有效的完整机制集。在调用gss_release_OID_set()使用后,应用程序必须释放返回OID集的存储。如果不需要,请指定NULL。

initiator_time_rec Integer, modify, optional Actual number of seconds for which the returned credentials will remain valid for initiating contexts using the specified mechanism. If the implementation or mechanism does not support expiration of credentials, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required

initiator_time_rec Integer,modify,可选的实际秒数,返回的凭据在使用指定机制初始化上下文时保持有效。如果实现或机制不支持凭据过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL

acceptor_time_rec Integer, modify, optional Actual number of seconds for which the returned credentials will remain valid for accepting security contexts using the specified mechanism. If the implementation or mechanism does not support expiration of credentials, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required

acceptor_time_rec Integer,modify,可选的实际秒数,返回的凭据在使用指定机制接受安全上下文时保持有效。如果实现或机制不支持凭据过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_MECH Unavailable mechanism requested

请求GSS_S_坏_机械不可用机制

GSS_S_BAD_NAMETYPE Type contained within desired_name parameter is not supported

不支持所需名称参数中包含的GSS\U S\U BAD\U name类型

GSS_S_BAD_NAME Value supplied for desired_name parameter is ill-formed.

为所需的\u NAME参数提供的GSS\u S\u BAD\u NAME值格式错误。

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

GSS_S_DUPLICATE_元素凭证已包含所请求机制的元素,其使用和有效期重叠。

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

GSS\u S\u凭据\u已过期无法添加所需凭据,因为它们已过期。

GSS_S_NO_CRED No credentials were found for the specified name.

GSS_S_NO_CRED未找到指定名称的凭据。

5.4. gss_add_oid_set_member
5.4. gss_添加_oid_集合_成员

OM_uint32 gss_add_oid_set_member ( OM_uint32 *minor_status, const gss_OID member_oid, gss_OID_set *oid_set)

OM_uint32 gss_添加_oid_集_成员(OM_uint32*次要_状态、常量gss_oid成员_oid、gss_oid_集*oid_集)

Purpose:

目的:

Add an Object Identifier to an Object Identifier set. This routine is intended for use in conjunction with gss_create_empty_oid_set when constructing a set of mechanism OIDs for input to gss_acquire_cred. The oid_set parameter must refer to an OID-set that 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 and inserts this copy into the set, expanding the storage allocated to the OID-set's elements array if necessary. The routine may add the new member OID anywhere within the elements array, and implementations should verify that the new member_oid is not already contained within the elements array; if the member_oid is already present, the oid_set should remain unchanged.

将对象标识符添加到对象标识符集中。当构造一组机制oid以输入gss\U acquire\U cred时,此例程将与gss\U create\U empty\U oid\U set一起使用。oid_set参数必须引用由GSS-API创建的oid集(例如,由GSS_create_empty_oid_set()返回的集)。GSS-API创建成员oid的副本并将此副本插入到集合中,如有必要,扩展分配给oid集合的元素数组的存储。该例程可以在元素数组中的任何位置添加新成员OID,实现应验证新成员OID尚未包含在元素数组中;如果成员oid已经存在,oid集合应保持不变。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

member_oid Object ID, read The object identifier to copied into the set.

成员\ oid对象ID,读取要复制到集合中的对象标识符。

oid_set Set of Object ID, modify The set in which the object identifier should be inserted.

oid_对象ID集,修改应插入对象标识符的集合。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

5.5. gss_canonicalize_name
5.5. gss_规范化_名称

OM_uint32 gss_canonicalize_name ( OM_uint32 *minor_status, const gss_name_t input_name, const gss_OID mech_type, gss_name_t *output_name)

OM_uint32 gss_规范化_名称(OM_uint32*次要_状态、常量gss_名称、常量gss_OID机械类型、gss_名称*输出_名称)

Purpose:

目的:

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

从任意内部名称生成规范机制名称(MN)。机制名称是成功验证上下文时将返回给上下文接受者的名称,其中发起者在成功调用gss_acquire_cred时使用输入_名称,指定包含<mech_type>作为其唯一成员的OID集,然后调用gss_init_sec_context,指定<mech_type>作为身份验证机制。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

input_name gss_name_t, read The name for which a canonical form is desired

输入\u name gss\u name\t,读取需要标准格式的名称

mech_type Object ID, read The authentication mechanism for which the canonical form of the name is desired. The desired mechanism must be specified explicitly; no default is provided.

mech_类型对象ID,读取需要名称规范形式的身份验证机制。必须明确指定所需的机制;没有提供默认值。

output_name gss_name_t, modify The resultant canonical name. Storage associated with this name must be freed by the application after use with a call to gss_release_name().

输出\u name gss\u name\t,修改生成的规范名称。与此名称关联的存储必须在与gss_release_name()调用一起使用后由应用程序释放。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion.

GSS__成功完成。

GSS_S_BAD_MECH The identified mechanism is not supported.

GSS_S_BAD_MECH不支持识别的机制。

GSS_S_BAD_NAMETYPE The provided internal name contains no elements that could be processed by the specified mechanism.

GSS_S_BAD_NAMETYPE提供的内部名称不包含可由指定机制处理的元素。

GSS_S_BAD_NAME The provided internal name was ill-formed.

GSS_S_BAD_NAME提供的内部名称格式错误。

5.6. gss_compare_name
5.6. gss\u比较\u名称

OM_uint32 gss_compare_name ( OM_uint32 *minor_status, const gss_name_t name1, const gss_name_t name2, int *name_equal)

OM_uint32 gss_比较_名称(OM_uint32*次要_状态、常量gss_名称_名称1、常量gss_名称_名称2、整数*名称_相等)

Purpose:

目的:

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 names do not refer to the same identity.

如果呈现给gss_compare_name的任何一个名称表示匿名主体,则例程应指示这两个名称不引用相同的标识。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

name1 gss_name_t, read internal-form name

名称1 gss\u名称\u t,读取内部表单名称

name2 gss_name_t, read internal-form name

名称2 gss\u名称\u t,读取内部表单名称

name_equal boolean, modify non-zero - names refer to same entity zero - names refer to different entities (strictly, the names are not known to refer to the same identity).

name_equal boolean,modify non-zero-名称指的是相同的实体零-名称指的是不同的实体(严格来说,这些名称指的不是相同的标识)。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_NAMETYPE The two names were of incomparable types.

GSS_S_BAD_NAMETYPE这两个名称是不可比较的类型。

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

GSS_S_BAD_NAME name1或name2中的一个或两个格式错误。

5.7. gss_context_time
5.7. gss_上下文_时间

OM_uint32 gss_context_time ( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, OM_uint32 *time_rec)

OM_uint32 gss_上下文_时间(OM_uint32*次要_状态、const gss_ctx_id_t上下文_句柄、OM_uint32*时间记录)

Purpose:

目的:

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

确定指定上下文保持有效的秒数。

Parameters:

参数:

minor_status Integer, modify Implementation specific status code.

次要_状态整数,修改特定于实现的状态代码。

context_handle gss_ctx_id_t, read Identifies the context to be interrogated.

context_handle gss_ctx_id_t,read标识要查询的上下文。

time_rec Integer, modify Number of seconds that the context will remain valid. If the context has already expired, zero will be returned.

time_rec Integer,修改上下文保持有效的秒数。如果上下文已过期,则返回零。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_CONTEXT_EXPIRED The context has already expired

GSS\u S\u上下文\u已过期上下文已过期

GSS_S_NO_CONTEXT The context_handle parameter did not identify a valid context

GSS_S_NO_CONTEXT上下文上下文句柄参数未标识有效上下文

5.8. gss_create_empty_oid_set
5.8. gss\u创建\u空\u旧\u集

OM_uint32 gss_create_empty_oid_set ( OM_uint32 *minor_status, gss_OID_set *oid_set)

OM_uint32 gss_创建_空_oid_集(OM_uint32*次要_状态,gss_oid_集*oid_集)

Purpose:

目的:

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.

创建不包含对象标识符的对象标识符集,随后可以使用gss_add_oid_set_member()例程将成员添加到该对象标识符集中。这些例程用于构造机制对象标识符集,以输入gss_acquire_cred。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

oid_set Set of Object IDs, modify The empty object identifier set. The routine will allocate the gss_OID_set_desc object, which the application must free after use with a call to gss_release_oid_set().

oid_设置对象ID集,修改空对象标识符集。该例程将分配gss_OID_set_desc对象,应用程序在调用gss_release_OID_set()后必须释放该对象。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

5.9. gss_delete_sec_context
5.9. gss_删除_秒_上下文

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

OM_uint32 gss_delete_sec_上下文(OM_uint32*次要_状态、gss_ctx_id_t*上下文_句柄、gss_缓冲区_t输出_令牌)

Purpose:

目的:

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

删除安全上下文。gss_delete_sec_context将删除与指定安全上下文关联的本地数据结构,并可能生成输出_令牌,当传递给对等gss_进程_context_令牌时,该令牌将指示其执行类似操作。如果机制不需要令牌,GSS-API应将输出令牌(如果提供)的长度字段设置为零。使用context\u handle指定的上下文无法获得进一步的安全服务。

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

除了删除已建立的安全上下文外,gss_delete_sec_context还必须能够删除由于gss_init_sec_context()/gss_accept_sec_context()调用序列不完整而导致的“半构建”安全上下文。

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

保留output_令牌参数是为了与GSS-API的版本1兼容。建议两个对等应用程序调用gss_delete_sec_context,传递输出_令牌参数的值gss_C_NO_BUFFER,指示不需要令牌,并且gss_delete_sec_context应该只删除本地上下文数据结构。如果应用程序确实将有效缓冲区传递给gss_delete_sec_上下文,则鼓励机制返回零长度令牌,指示不需要对等操作,并且应用程序不应传输令牌。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

context_handle gss_ctx_id_t, modify context handle identifying context to delete. After deleting the context, the GSS-API will set this context handle to GSS_C_NO_CONTEXT.

上下文句柄gss\U ctx\U id\t,修改标识要删除的上下文的上下文句柄。删除上下文后,GSS-API将此上下文句柄设置为GSS_C_NO_context。

output_token buffer, opaque, modify, optional token to be sent to remote application to instruct it to also delete the context. It is recommended that applications specify GSS_C_NO_BUFFER for this parameter, requesting local deletion only. If a buffer parameter is provided by the application, the mechanism may return a token in it; mechanisms that implement only local deletion should set the length field of this token to zero to indicate to the application that no token is to be sent to the peer.

输出\令牌缓冲区,不透明,修改,可选令牌发送到远程应用程序,以指示它也删除上下文。建议应用程序为此参数指定GSS_C_NO_缓冲区,仅请求本地删除。如果应用程序提供了缓冲区参数,则该机制可以返回其中的令牌;仅实现本地删除的机制应将此令牌的长度字段设置为零,以向应用程序指示不向对等方发送令牌。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_NO_CONTEXT No valid context was supplied

GSS_S_无上下文未提供有效上下文

5.10.gss_display_name

5.10.gss\u显示\u名称

OM_uint32 gss_display_name ( OM_uint32 *minor_status, const gss_name_t input_name, gss_buffer_t output_name_buffer, gss_OID *output_name_type)

OM_uint32 gss_显示_名称(OM_uint32*次要_状态、常量gss_名称_t输入_名称、gss_缓冲区_t输出_名称_缓冲区、gss_OID*输出_名称_类型)

Purpose:

目的:

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

允许应用程序获取不透明内部表单名称的文本表示,以便于显示。可打印名称的语法由GSS-API实现定义。

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

如果input_name表示匿名主体,则实现应返回gss_OID值gss_C_NT_anonymous作为output_name_类型,以及一个在语法上与output_name_buffer中所有有效支持的可打印名称不同的文本名称。

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

如果输入名称是通过调用gss\u import\u name创建的,并将gss\u C\u NO\u OID指定为名称类型,则在名称类型之间采用延迟转换的实现可能会通过output\u name\u type参数返回gss\u C\u NO\u OID。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

input_name gss_name_t, read name to be displayed

输入\u name gss\u name\t,读取要显示的名称

output_name_buffer buffer, character-string, modify buffer to receive textual name string. The application must free storage associated with this name after use with a call to gss_release_buffer().

输出\名称\缓冲区、字符串、修改缓冲区以接收文本名称字符串。在调用gss_release_buffer()后,应用程序必须释放与此名称关联的存储。

output_name_type Object ID, modify, optional The type of the returned name. The returned gss_OID will be a pointer into static storage, and should be treated as read-only by the caller (in particular, the application should not attempt to free it). Specify NULL if not required.

输出\名称\类型对象ID,修改,可选返回名称的类型。返回的gss_OID将是指向静态存储的指针,调用者应将其视为只读(特别是,应用程序不应尝试释放它)。如果不需要,请指定NULL。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_NAME input_name was ill-formed

GSS\u S\u错误\u名称输入\u名称格式错误

5.11.gss_display_status

5.11.gss_显示_状态

OM_uint32 gss_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)

OM_uint32 gss_显示_状态(OM_uint32*次要_状态、OM_uint32状态_值、int状态_类型、常量gss_OID机械类型、OM_uint32*消息_上下文、gss_缓冲区状态_字符串)

Purpose:

目的:

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, each call generating a single text string. The message_context parameter is used by gss_display_status to store state information about which error messages have already been extracted from a given status_value; message_context must be initialized to 0 by the application prior to the first call, and gss_display_status will return a non-zero value in this parameter if there are further messages to extract.

允许应用程序获取GSS-API状态代码的文本表示,以便向用户显示或记录。由于某些状态值可能指示多个条件,应用程序可能需要多次调用gss_display_status,每次调用生成一个文本字符串。message_context参数由gss_display_status使用,用于存储关于已从给定状态_值提取的错误消息的状态信息;在第一次调用之前,应用程序必须将message_context初始化为0,如果还有更多消息要提取,则gss_display_status将在此参数中返回非零值。

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

message_context参数包含gss_display_status所需的所有状态信息,以便从status_值提取更多消息;即使此参数中返回非零值,应用程序也不需要再次调用gss_display_status,除非需要后续消息。以下代码从给定的状态代码中提取所有消息,并将其打印到stderr:

   OM_uint32 message_context;
   OM_uint32 status_code;
   OM_uint32 maj_status;
   OM_uint32 min_status;
   gss_buffer_desc status_string;
        
   OM_uint32 message_context;
   OM_uint32 status_code;
   OM_uint32 maj_status;
   OM_uint32 min_status;
   gss_buffer_desc status_string;
        

...

...

message_context = 0;

消息上下文=0;

do {

做{

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

主要状态=gss\U显示状态(&min\U状态、状态代码、gss\U C\U gss\U代码、gss\U C\U编号、消息上下文和状态字符串)

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

fprintf(stderr,“%.*s\n”,(int)状态\u string.length,

(char *)status_string.value);

(字符*)状态(字符串值);

gss_release_buffer(&min_status, &status_string);

gss_释放_缓冲区(&min_状态,&status_字符串);

   } while (message_context != 0);
        
   } while (message_context != 0);
        

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

status_value Integer, read Status value to be converted

状态\u值整数,读取要转换的状态值

status_type Integer, read GSS_C_GSS_CODE - status_value is a GSS status code

状态\类型整数,读取GSS\ U C\ GSS\ U代码-状态\ U值是GSS状态代码

GSS_C_MECH_CODE - status_value is a mechanism status code

GSS_C_机械代码-状态值是一个机构状态代码

mech_type Object ID, read, optional Underlying mechanism (used to interpret a minor status value) Supply GSS_C_NO_OID to obtain the system default.

mech_类型对象ID,read,可选基础机制(用于解释次要状态值)提供GSS_C_NO_OID以获取系统默认值。

message_context Integer, read/modify Should be initialized to zero by the application prior to the first call. On return from gss_display_status(), a non-zero status_value parameter indicates that additional messages may be extracted from the status code via subsequent calls

在第一次调用之前,应用程序应将message_context Integer,read/modify初始化为零。从gss_display_status()返回时,非零status_值参数表示可以通过后续调用从状态代码中提取其他消息

to gss_display_status(), passing the same status_value, status_type, mech_type, and message_context parameters.

到gss_display_status(),传递相同的状态值、状态类型、机械类型和消息上下文参数。

status_string buffer, character string, modify textual interpretation of the status_value. Storage associated with this parameter must be freed by the application after use with a call to gss_release_buffer().

状态字符串缓冲区,字符串,修改状态值的文本解释。与此参数关联的存储必须在与gss_release_buffer()调用一起使用后由应用程序释放。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

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

GSS_S_BAD_MECH表示请求按照不支持的机制类型进行转换

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_S_BAD_状态未识别状态值,或者状态类型既不是GSS_C_GSS_代码也不是GSS_C_机械代码。

5.12. gss_duplicate_name
5.12. gss_重复_名称

OM_uint32 gss_duplicate_name ( OM_uint32 *minor_status, const gss_name_t src_name, gss_name_t *dest_name)

OM_uint32 gss_重复_名称(OM_uint32*次要_状态、const gss_名称、gss_名称*目的地名称)

Purpose:

目的:

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).

创建现有内部名称src_name的精确副本。新的目的地名称将独立于src_名称(即src_名称和目的地名称必须同时发布,其中一个的发布不得影响另一个的有效性)。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

src_name gss_name_t, read internal name to be duplicated.

src_name gss_name_t,读取要复制的内部名称。

dest_name gss_name_t, modify The resultant copy of <src_name>. Storage associated with this name must be freed by the application after use with a call to gss_release_name().

dest\u name gss\u name\t,修改<src\u name>的结果副本。与此名称关联的存储必须在与gss_release_name()调用一起使用后由应用程序释放。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_NAME The src_name parameter was ill-formed.

GSS_S_BAD_NAME src_NAME参数格式错误。

5.13. gss_export_name
5.13. gss\u导出\u名称

OM_uint32 gss_export_name ( OM_uint32 *minor_status, const gss_name_t input_name, gss_buffer_t exported_name)

OM_uint32 gss_导出_名称(OM_uint32*次要_状态、常量gss_名称、输入_名称、gss_缓冲区_导出_名称)

Purpose:

目的:

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

生成机制名称(MN)的规范连续字符串表示形式,适用于直接比较(如与memcmp)以用于授权功能(如访问控制列表中的匹配项)。<input\u name>参数必须指定有效的MN(即由gss\u accept\u sec\u上下文或gss\u规范化\u name生成的内部名称)。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

input_name gss_name_t, read The MN to be exported

输入\u name gss\u name\t,读取要导出的MN

exported_name gss_buffer_t, octet-string, modify The canonical contiguous string form of <input_name>. Storage associated with this string must freed by the application after use with gss_release_buffer().

导出的\u name gss\u buffer\t,八位字节字符串,修改<input\u name>的规范连续字符串形式。在与gss_release_buffer()一起使用后,应用程序必须释放与此字符串关联的存储。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_NAME_NOT_MN The provided internal name was not a mechanism name.

GSS_S_NAME_NOT_MN提供的内部名称不是机制名称。

GSS_S_BAD_NAME The provided internal name was ill-formed.

GSS_S_BAD_NAME提供的内部名称格式错误。

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

GSS_S_BAD_NAMETYPE内部名称属于GSS-API实现不支持的类型。

5.14. gss_export_sec_context
5.14. gss_导出_秒_上下文

OM_uint32 gss_export_sec_context ( OM_uint32 *minor_status, gss_ctx_id_t *context_handle, gss_buffer_t interprocess_token)

OM_uint32 gss_导出_秒_上下文(OM_uint32*次要_状态、gss_ctx_id_t*上下文_句柄、gss_缓冲区_t进程间_令牌)

Purpose:

目的:

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, then passes the established context to one or more other processes for message exchange. gss_export_sec_context() deactivates the security context for the calling process and creates an interprocess token which, when passed to gss_import_sec_context in another process, will re-activate the context in the second process. Only a single instantiation of a given context may be active at any one time; a subsequent attempt by a context exporter to access the exported security context will fail.

用于支持多个流程之间的工作共享。此例程通常由上下文接受者使用,在应用程序中,单个进程接收传入的连接请求并通过它们接受安全上下文,然后将建立的上下文传递给一个或多个其他进程以进行消息交换。gss_export_sec_context()停用调用进程的安全上下文,并创建进程间令牌,该令牌在另一个进程中传递给gss_import_sec_context时,将在第二个进程中重新激活上下文。在任何时候,只有一个给定上下文的实例化是活动的;上下文导出器随后尝试访问导出的安全上下文将失败。

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

作为本地安全策略的功能或作为实现决策的结果,实现可约束可通过其导入进程间令牌的一组进程。例如,某些实现可能会将上下文限制为仅在同一帐户下运行的进程之间传递,或是在同一进程组中传递。

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

进程间令牌可能包含安全敏感信息(例如加密密钥)。虽然鼓励机制避免在进程间令牌中放置此类敏感信息,或在将令牌返回应用程序之前对其进行加密,但在典型的对象库GSS-API实现中,这可能是不可能的。因此,应用程序必须注意保护进程间令牌,并确保令牌传输到的任何进程都是可信的。

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

如果成功创建进程间令牌,则实现应释放与安全上下文相关联的所有进程范围资源,并将上下文句柄设置为GSS\U C\U NO\U上下文。如果出现无法完成安全上下文导出的错误,则实现不得返回进程间令牌,并应努力保持context_handle参数所引用的安全上下文不变。如果这是不可能的,则允许实现删除安全上下文,前提是它还将context\u handle参数设置为GSS\u C\u NO\u context。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

context_handle gss_ctx_id_t, modify context handle identifying the context to transfer.

上下文句柄gss\U ctx\U id\t,修改标识要传输的上下文的上下文句柄。

interprocess_token buffer, opaque, modify token to be transferred to target process. Storage associated with this token must be freed by the application after use with a call to gss_release_buffer().

进程间令牌缓冲区,不透明,修改要传输到目标进程的令牌。与此令牌关联的存储必须在与gss_release_buffer()调用一起使用后由应用程序释放。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_CONTEXT_EXPIRED The context has expired

GSS\u S\u上下文\u已过期上下文已过期

GSS_S_NO_CONTEXT The context was invalid

GSS_S_无上下文上下文上下文无效

GSS_S_UNAVAILABLE The operation is not supported.

GSS_不可用该操作不受支持。

5.15. gss_get_mic
5.15. gss_获取_麦克风

OM_uint32 gss_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 msg_token)

OM_uint32 gss_get_mic(OM_uint32*次要_状态、常量gss_ctx_id_t上下文_句柄、gss_qop_t qop_请求、常量gss_缓冲区消息_缓冲区、gss_缓冲区消息_令牌)

Purpose:

目的:

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

为提供的消息生成加密MIC,并将MIC放置在令牌中,以便传输到对等应用程序。如果所选机制支持,qop_req参数允许在几种加密算法之间进行选择。

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

由于一些应用程序级协议可能希望使用gss_wrap()发出的令牌来提供“安全帧”,因此实现必须支持从零长度消息派生MIC。

Parameters:

参数:

minor_status Integer, modify Implementation specific status code.

次要_状态整数,修改特定于实现的状态代码。

context_handle gss_ctx_id_t, read identifies the context on which the message will be sent

context\u handle gss\u ctx\u id\t,read标识消息将在其上发送的上下文

qop_req gss_qop_t, read, optional Specifies requested quality of protection. Callers are encouraged, on portability grounds, to accept the default quality of protection offered by the chosen mechanism, which may be requested by specifying GSS_C_QOP_DEFAULT for this parameter. If an unsupported protection strength is requested, gss_get_mic will return a major_status of GSS_S_BAD_QOP.

qop_req gss_qop_t,读取,可选指定请求的保护质量。出于可移植性的考虑,鼓励呼叫者接受所选机制提供的默认保护质量,这可以通过为此参数指定GSS_C_QOP_default来请求。如果请求不受支持的保护强度,gss_get_mic将返回gss_S_BAD_QOP的主要_状态。

message_buffer buffer, opaque, read message to be protected

消息缓冲区,不透明,要保护的读取消息

msg_token buffer, opaque, modify buffer to receive token. The application must free storage associated with this buffer after use with a call to gss_release_buffer().

msg_令牌缓冲区,不透明,修改缓冲区以接收令牌。在调用gss_release_buffer()后,应用程序必须释放与此缓冲区关联的存储。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_CONTEXT_EXPIRED The context has already expired

GSS\u S\u上下文\u已过期上下文已过期

GSS_S_NO_CONTEXT The context_handle parameter did not identify a valid context

GSS_S_NO_CONTEXT上下文上下文句柄参数未标识有效上下文

GSS_S_BAD_QOP The specified QOP is not supported by the mechanism.

GSS_S_BAD_QOP机制不支持指定的QOP。

5.16. gss_import_name
5.16. gss\u导入\u名称

OM_uint32 gss_import_name ( OM_uint32 *minor_status, const gss_buffer_t input_name_buffer, const gss_OID input_name_type, gss_name_t *output_name)

OM_uint32 gss_导入_名称(OM_uint32*次要_状态,常量gss_缓冲区输入_名称_缓冲区,常量gss_OID输入_名称_类型,gss_名称_输出_名称)

Purpose:

目的:

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 the <input_name_buffer> parameter is of type GSS_C_NT_EXPORT_NAME, in which case the returned internal name will be an MN for the mechanism that exported the name.

将连续字符串名称转换为内部格式。通常,返回的内部名称(通过<output\u name>参数)将不是MN;例外情况是,如果<input\u name\u type>指示通过<input\u name\u buffer>参数提供的连续字符串的类型为GSS\u C\u NT\u EXPORT\u name,则返回的内部名称将是导出名称的机制的MN。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

input_name_buffer buffer, octet-string, read buffer containing contiguous string name to convert

输入\名称\缓冲区、八位字节字符串、包含要转换的连续字符串名称的读取缓冲区

input_name_type Object ID, read, optional Object ID specifying type of printable name. Applications may specify either GSS_C_NO_OID to use a mechanism-specific default printable syntax, or an OID recognized by the GSS-API implementation to name a specific namespace.

输入\名称\类型对象ID,读取,可选对象ID,指定可打印名称的类型。应用程序可以指定GSS_C_NO_OID来使用特定于机制的默认可打印语法,或者指定GSS-API实现识别的OID来命名特定命名空间。

output_name gss_name_t, modify returned name in internal form. Storage associated with this name must be freed by the application after use with a call to gss_release_name().

输出\u name gss\u name\t,修改内部表单中返回的名称。与此名称关联的存储必须在与gss_release_name()调用一起使用后由应用程序释放。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_NAMETYPE The input_name_type was unrecognized

GSS\u S\u错误\u名称类型无法识别输入\u名称\u类型

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

GSS_S_BAD_NAME无法将输入_NAME参数解释为指定类型的名称

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_S_BAD_MECH输入名称类型为GSS_C_NT_EXPORT_name,但不支持输入名称中包含的机制

5.17. gss_import_sec_context
5.17. gss_导入_秒_上下文

OM_uint32 gss_import_sec_context ( OM_uint32 *minor_status, const gss_buffer_t interprocess_token, gss_ctx_id_t *context_handle)

OM_uint32 gss_导入_sec_上下文(OM_uint32*次要_状态、常量gss_缓冲区_t进程间_令牌、gss_ctx_id_t*上下文_句柄)

Purpose:

目的:

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

允许一个进程导入由另一个进程建立的安全上下文。给定的进程间令牌只能导入一次。请参阅gss_导出第二节上下文。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

interprocess_token buffer, opaque, modify token received from exporting process

进程间\u令牌缓冲区,不透明,修改从导出进程收到的令牌

context_handle gss_ctx_id_t, modify context handle of newly reactivated context. Resources associated with this context handle must be released by the application after use with a call to gss_delete_sec_context().

上下文句柄gss\U ctx\U id\t,修改新重新激活的上下文的上下文句柄。在调用gss_delete_sec_context()后,应用程序必须释放与此上下文句柄关联的资源。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion.

GSS__成功完成。

GSS_S_NO_CONTEXT The token did not contain a valid context reference.

GSS_S_NO_上下文令牌未包含有效的上下文引用。

GSS_S_DEFECTIVE_TOKEN The token was invalid.

GSS_S_缺陷_令牌令牌无效。

GSS_S_UNAVAILABLE The operation is unavailable.

GSS_S_不可用操作不可用。

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

GSS_未经授权的本地策略阻止当前进程导入此上下文。

5.18. gss_indicate_mechs
5.18. gss_指示_机械

OM_uint32 gss_indicate_mechs ( OM_uint32 *minor_status, gss_OID_set *mech_set)

OM_uint32 gss_指示机械(OM_uint32*次要状态,gss_旧设置*机械设置)

Purpose:

目的:

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

允许应用程序确定可用的底层安全机制。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

mech_set set of Object IDs, modify set of implementation-supported mechanisms. The returned gss_OID_set value will be a dynamically-allocated OID set, that should be released by the caller after use with a call to gss_release_oid_set().

mech_设置对象ID集,修改实现支持的机制集。返回的gss_OID_集值将是一个动态分配的OID集,调用方应在调用gss_release_OID_set()后释放该OID集。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

5.19. gss_init_sec_context
5.19. gss_初始_秒_上下文

OM_uint32 gss_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 )

OM_uint32 gss_初始_秒_上下文(OM_uint32*次要_状态、常量gss_cred_id_t initiator_cred_handle、gss_ctx_id_t*上下文_handle、常量gss_name_t target_name、常量gss_OID机械类型、OM_uint32请求标志、OM_uint32时间请求、常量gss_通道绑定输入更改绑定、常量gss_缓冲区输入令牌S_OID类型、实际GSU缓存、输出令牌2)ags,OM_uint32*时间记录)

Purpose:

目的:

Initiates the establishment of a security context between the application and a remote peer. Initially, the input_token parameter should be specified either as GSS_C_NO_BUFFER, or as a pointer to a gss_buffer_desc object whose length field contains the value zero. The routine may return a output_token which should be transferred to the peer application, where the peer application will present it to gss_accept_sec_context. If no token need be sent, gss_init_sec_context will indicate this by setting the length field

启动在应用程序和远程对等方之间建立安全上下文。最初,输入_标记参数应指定为GSS_C_NO_BUFFER,或指定为指向长度字段包含值为零的GSS_BUFFER_desc对象的指针。该例程可能会返回一个输出令牌,该令牌应传输到对等应用程序,对等应用程序将在gss_accept_sec_上下文中显示该令牌。如果不需要发送令牌,gss_init_sec_上下文将通过设置长度字段来指示这一点

of the output_token argument to zero. To complete the context establishment, one or more reply tokens may be required from the peer application; if so, gss_init_sec_context will return a status containing the supplementary information bit GSS_S_CONTINUE_NEEDED. In this case, gss_init_sec_context should be called again when the reply token is received from the peer application, passing the reply token to gss_init_sec_context via the input_token parameters.

将输出标记参数的值设置为零。为了完成上下文建立,对等应用程序可能需要一个或多个应答令牌;如果是这样,gss_init_sec_context将返回一个包含所需补充信息位gss_S_CONTINUE_的状态。在这种情况下,当从对等应用程序接收到应答令牌时,应再次调用gss_init_sec_上下文,并通过输入令牌参数将应答令牌传递给gss_init_sec_上下文。

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

便携式应用程序应该使用令牌长度和返回状态来确定令牌是需要发送还是等待。因此,典型的便携式调用者应始终在循环中调用gss_init_sec_上下文:

   int context_established = 0;
   gss_ctx_id_t context_hdl = GSS_C_NO_CONTEXT;
          ...
   input_token->length = 0;
        
   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);
     };
        
   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 (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 (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;
     };
   };
        
     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 fully established and the following restrictions apply to the output parameters:

每当例程返回包含所需GSS_S_CONTINUE_值的主要状态时,上下文未完全建立,以下限制适用于输出参数:

The value returned via the time_rec parameter is undefined Unless the accompanying ret_flags parameter contains the bit GSS_C_PROT_READY_FLAG, indicating that per-message services may be applied in advance of a successful completion status, the value returned via the actual_mech_type parameter is undefined until the routine returns a major status value of GSS_S_COMPLETE.

通过time_rec参数返回的值未定义,除非随附的ret_flags参数包含位GSS_C_PROT_READY_标志,这表示在成功完成状态之前可以应用每条消息服务,在例程返回GSS_S_COMPLETE的主要状态值之前,通过actual_mech_type参数返回的值是未定义的。

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 contain the values that the implementation expects would be valid if context establishment were to succeed. In particular, if the application has requested a service such as delegation or anonymous authentication via the req_flags argument, and such a service is unavailable from the underlying mechanism, gss_init_sec_context should generate a token that will not provide the service, and indicate via the ret_flags argument that the service will not be supported. The application may choose to abort the context establishment by calling gss_delete_sec_context (if it cannot continue in the absence of the service), or it may choose to transmit the token and continue context establishment (if the service was merely desired but not mandatory).

GSS_C_DELEG_标志、GSS_C_MUTUAL_标志、GSS_C_REPLAY_标志、GSS_C_SEQUENCE_标志、GSS_C_CONF_标志、GSS_C_INTEG_标志和通过ret_flags参数返回的GSS_C_ANON_标志位的值应包含实现预期的有效值(如果上下文建立成功)。特别是,如果应用程序通过req_flags参数请求了诸如委托或匿名身份验证之类的服务,并且这种服务无法从底层机制获得,那么gss_init_sec_context应该生成一个不会提供该服务的令牌,并通过ret_flags参数指示该服务将不受支持。应用程序可以选择通过调用gss_delete_sec_context中止上下文建立(如果在没有服务的情况下无法继续),或者可以选择传输令牌并继续上下文建立(如果服务只是需要的,但不是必需的)。

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

ret_标志中GSS_C_PROT_READY_标志和GSS_C_TRANS_标志位的值应指示GSS_init_sec_上下文返回时的实际状态,无论上下文是否完全建立。

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

鼓励支持每条消息保护的GSS-API实现在返回给调用者的最终ret_标志中设置GSS_C_PROT_READY_标志(即,当伴随GSS_S_完整状态代码时)。但是,应用程序不应依赖此行为,因为GSS-API的版本1中未定义该标志。相反,应用程序应该根据GSS_C_INTEG_标志和GSS_C_CONF_标志值确定成功建立上下文后可用的每消息服务。

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

ret_flags参数中的所有其他位都应设置为零。

If the initial call of gss_init_sec_context() fails, the implementation should not create a context object, and should leave the value of the context_handle parameter set to GSS_C_NO_CONTEXT to indicate this. In the event of a failure on a subsequent call, the implementation is permitted to delete the "half-built" security context (in which case it should set the context_handle parameter to 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).

如果gss_init_sec_context()的初始调用失败,则实现不应创建上下文对象,而应将context_handle参数的值设置为gss_C_NO_context以指示这一点。在后续调用失败的情况下,允许实现删除“半构建”安全上下文(在这种情况下,它应该将context_handle参数设置为GSS_C_NO_context),但首选行为是保持安全上下文不变,以便应用程序删除(使用GSS_delete_sec_context)。

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

在上下文建立过程中,信息状态位GSS_S_OLD_TOKEN和GSS_DUPLICATE_TOKEN表示致命错误,GSS-API机制应始终将其与GSS_S_故障的常规错误关联返回。GSS-API规范的版本1中不存在这种配对要求,因此希望在版本1实现上运行的应用程序必须在这些代码的特殊情况下运行。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

initiator_cred_handle gss_cred_id_t, read, optional handle for credentials claimed. Supply GSS_C_NO_CREDENTIAL to act as a default initiator principal. If no default initiator is defined, the function will return GSS_S_NO_CRED.

发起人\u凭据\u句柄gss\u凭据\u id\u t,已读,声明凭据的可选句柄。提供GSS_C_NO_凭据以充当默认启动器主体。如果未定义默认启动器,则函数将返回GSS\U S\U no\U CRED。

context_handle gss_ctx_id_t, read/modify context handle for new context. Supply GSS_C_NO_CONTEXT for first call; use value returned by first call in continuation calls. Resources associated with this context-handle must be released by the application after use with a call to gss_delete_sec_context().

上下文句柄gss\U ctx\U id\t,读取/修改新上下文的上下文句柄。为第一次呼叫提供GSS_C_NO_上下文;在继续调用中使用第一个调用返回的值。在调用gss_delete_sec_context()后,应用程序必须释放与此上下文句柄关联的资源。

target_name gss_name_t, read Name of target

目标名称gss\U名称\t,读取目标名称

mech_type OID, read, optional Object ID of desired mechanism. Supply GSS_C_NO_OID to obtain an implementation specific default

机械类型OID,读取,所需机构的可选对象ID。提供GSS_C_NO_OID以获取特定于实现的默认值

req_flags bit-mask, read Contains various independent flags, each of which requests that the context support a specific service option. Symbolic names are provided for each flag, and the symbolic names corresponding to the required flags should be logically-ORed together to form the bit-mask value. The flags are:

req_标志位掩码,read包含各种独立标志,每个标志都请求上下文支持特定的服务选项。为每个标志提供符号名,与所需标志对应的符号名应逻辑地或合在一起,以形成位掩码值。旗为:

GSS_C_DELEG_FLAG True - Delegate credentials to remote peer False - Don't delegate

GSS_C_DELEG_标志True-将凭据委托给远程对等方False-不委托

GSS_C_MUTUAL_FLAG True - Request that remote peer authenticate itself False - Authenticate self to remote peer only

GSS_C_MUTUAL_FLAG True-请求远程对等方对自身进行身份验证False-仅对远程对等方进行自我身份验证

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_REPLAY_标志为True-对受GSS_wrap或GSS_get_mic False保护的邮件启用REPLAY检测-不要尝试检测重播邮件

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_SEQUENCE_FLAG True-启用对受顺序保护的消息的检测False-不要尝试检测顺序错误的消息

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_CONF_FLAG True-请求提供保密服务(通过GSS_wrap)False-不需要每封邮件的保密服务。

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.

GSS_C_INTEG_FLAG True-请求提供完整性服务(通过GSS_wrap或GSS_get_mic)False-不需要每个消息的完整性服务。

GSS_C_ANON_FLAG True - Do not reveal the initiator's identity to the acceptor. False - Authenticate normally.

GSS_C_ANON_标志True-不要向接受方透露发起方的身份。False-正常进行身份验证。

time_req Integer, read, optional Desired number of seconds for which context should remain valid. Supply 0 to request a default validity period.

time_req Integer,read,可选,上下文应保持有效的所需秒数。提供0以请求默认有效期。

input_chan_bindings channel bindings, read, optional Application-specified bindings. Allows application to securely bind channel identification information to the security context. Specify GSS_C_NO_CHANNEL_BINDINGS if channel bindings are not used.

输入通道绑定、读取、可选应用程序指定的绑定。允许应用程序将通道标识信息安全地绑定到安全上下文。如果未使用通道绑定,请指定GSS_C_NO_通道绑定。

input_token buffer, opaque, read, optional (see text) Token received from peer application. Supply GSS_C_NO_BUFFER, or a pointer to a buffer containing the value GSS_C_EMPTY_BUFFER on initial call.

从对等应用程序接收的输入\令牌缓冲区,不透明,读取,可选(见文本)令牌。提供GSS_C_NO_BUFFER,或在初始调用时指向包含值GSS_C_EMPTY_BUFFER的缓冲区的指针。

actual_mech_type OID, modify, optional Actual mechanism used. The OID returned via this parameter will be a pointer to static storage that should be treated as read-only; In particular the application should not attempt to free it. Specify NULL if not required.

实际机械类型OID,修改,使用可选的实际机械。通过此参数返回的OID将是指向静态存储的指针,该存储应被视为只读;尤其是应用程序不应尝试释放它。如果不需要,请指定NULL。

output_token buffer, opaque, modify token to be sent to peer application. If the length field of the returned buffer is zero, no token need be sent to the peer application. Storage associated with this buffer must be freed by the application after use with a call to gss_release_buffer().

输出令牌缓冲区,不透明,修改要发送到对等应用程序的令牌。如果返回缓冲区的长度字段为零,则无需向对等应用程序发送令牌。与此缓冲区关联的存储必须在与gss_release_buffer()调用一起使用后由应用程序释放。

ret_flags bit-mask, modify, optional Contains various independent flags, each of which indicates that the context supports a specific service option. Specify NULL if not required. Symbolic names are provided for each flag, and the symbolic names corresponding to the required flags should be logically-ANDed with the ret_flags value to test whether a given option is supported by the context. The flags are:

ret_标志位掩码、修改、可选包含各种独立标志,其中每个标志都表示上下文支持特定的服务选项。如果不需要,请指定NULL。为每个标志提供符号名,与所需标志对应的符号名应与ret_flags值逻辑and,以测试上下文是否支持给定选项。旗为:

GSS_C_DELEG_FLAG True - Credentials were delegated to the remote peer False - No credentials were delegated

GSS_C_DELEG_标志True-凭据已委派给远程对等方False-未委派凭据

GSS_C_MUTUAL_FLAG True - The remote peer has authenticated itself. False - Remote peer has not authenticated itself.

GSS_C_MUTUAL_标志True-远程对等方已对其自身进行身份验证。False-远程对等方未对其自身进行身份验证。

GSS_C_REPLAY_FLAG True - replay of protected messages will be detected False - replayed messages will not be detected

GSS_C_REPLAY_标志为真-将检测到受保护邮件的重播为假-不会检测到重播的邮件

GSS_C_SEQUENCE_FLAG True - out-of-sequence protected messages will be detected False - out-of-sequence messages will not be detected

GSS_C_SEQUENCE_标志True-将检测到顺序外保护消息False-将不会检测到顺序外消息

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 authentication and integrity services only.

GSS_C_CONF_FLAG True-可以通过调用GSS_wrap例程False调用保密服务-没有可用的保密服务(通过GSS_wrap)。gss_wrap将仅提供消息封装、数据源身份验证和完整性服务。

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_INTEG_FLAG True-可以通过调用GSS_get_mic或GSS_wrap例程来调用完整性服务。False-每条消息完整性服务不可用。

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_ANON_FLAG True-未显示发起方的身份,如果将任何发出的令牌传递给接收方,则不会显示发起方的身份。False-启动器的身份已经或将被正常验证。

GSS_C_PROT_READY_FLAG

GSS\U C\U保护准备就绪\U标志

True - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are available for 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 available only if the accompanying major status return value is GSS_S_COMPLETE.

True-如果附带的主要状态返回值为GSS_S_完成或GSS_继续,则可以使用保护服务(由GSS_配置标志和GSS_集成标志的状态指定)。False-仅当伴随的主要状态返回值为GSS_S_COMPLETE时,保护服务(由GSS_C_CONF_标志和GSS_INTEG_标志的状态指定)才可用。

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.

GSS_C_TRANS_FLAG True-生成的安全上下文可以通过调用GSS_export_sec_context()传输到其他进程。False-安全上下文不可转让。

All other bits should be set to zero.

所有其他位应设置为零。

time_rec Integer, modify, optional number of seconds for which the context will remain valid. If the implementation does not support context expiration, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required.

time_rec Integer,modify,上下文保持有效的可选秒数。如果实现不支持上下文过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

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

GSS_S_CONTINUE_NEEDED表示需要来自对等应用程序的令牌来完成上下文,并且必须使用该令牌再次调用GSS_init_sec_上下文。

GSS_S_DEFECTIVE_TOKEN Indicates that consistency checks performed on the input_token failed

GSS_S_缺陷_令牌表示对输入_令牌执行的一致性检查失败

GSS_S_DEFECTIVE_CREDENTIAL Indicates that consistency checks performed on the credential failed.

GSS_S_缺陷_凭证表示对凭证执行的一致性检查失败。

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

GSS_S_NO__CRED提供的凭据对于上下文启动无效,或者凭据句柄未引用任何凭据。

GSS_S_CREDENTIALS_EXPIRED The referenced credentials have expired

GSS\u S\u凭据\u已过期引用的凭据已过期

GSS_S_BAD_BINDINGS The input_token contains different channel bindings to those specified via the input_chan_bindings parameter

GSS_S_BAD_绑定输入_令牌包含通过输入_chan_绑定参数指定的不同通道绑定

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

GSS_S_BAD_SIG输入_令牌包含无效麦克风或无法验证的麦克风

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

GSS_S_OLD_令牌输入_令牌太旧。这是上下文建立过程中的一个致命错误

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

GSS_S_DUPLICATE_TOKEN输入_TOKEN有效,但是已处理的令牌的副本。这是上下文建立过程中的一个致命错误。

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

GSS_S_NO_CONTEXT表示提供的上下文句柄未引用有效的上下文

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

GSS_S_BAD_NAMETYPE提供的目标名称参数包含无效或不受支持的名称类型

GSS_S_BAD_NAME The provided target_name parameter was ill-formed.

GSS_S_BAD_NAME提供的目标名称参数格式不正确。

GSS_S_BAD_MECH The specified mechanism is not supported by the provided credential, or is unrecognized by the implementation.

GSS_S_BAD_MECH提供的凭据不支持指定的机制,或者实现无法识别该机制。

5.20. gss_inquire_context
5.20. 查询上下文

OM_uint32 gss_inquire_context ( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, 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 )

OM_uint32 gss_inquire_上下文(OM_uint32*次要_状态、常量gss_ctx_id_t上下文_句柄、gss_名称_t*src_名称、gss_名称_t*目标名称、OM_uint32*寿命_记录、gss_OID*机械类型、OM_uint32*ctx_标志、int*本地启动、int*打开)

Purpose:

目的:

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

获取有关安全上下文的信息。调用方必须已经获得引用上下文的句柄,尽管上下文不需要完全建立。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

context_handle gss_ctx_id_t, read A handle that refers to the security context.

上下文\u句柄gss\u ctx\u id\t,读取引用安全上下文的句柄。

src_name gss_name_t, modify, optional The name of the context initiator. If the context was established using anonymous authentication, and if the application invoking gss_inquire_context is the context acceptor, an anonymous name will be returned. Storage associated with this name must be freed by the application after use with a call to gss_release_name(). Specify NULL if not required.

src_name gss_name_t,modify,可选上下文启动器的名称。如果上下文是使用匿名身份验证建立的,并且如果调用gss_inquire_上下文的应用程序是上下文接受程序,则将返回匿名名称。与此名称关联的存储必须在与gss_release_name()调用一起使用后由应用程序释放。如果不需要,请指定NULL。

targ_name gss_name_t, modify, optional The name of the context acceptor. Storage associated with this name must be freed by the application after use with a call to gss_release_name(). If the context acceptor did not authenticate itself, and if the initiator did not specify a target name in its call to gss_init_sec_context(), the value GSS_C_NO_NAME will be returned. Specify NULL if not required.

target_name gss_name_t,modify,可选上下文接受器的名称。与此名称关联的存储必须在与gss_release_name()调用一起使用后由应用程序释放。如果上下文接受器未对自身进行身份验证,并且如果启动器在其对gss_init_sec_context()的调用中未指定目标名称,则将返回值gss_C_NO_name。如果不需要,请指定NULL。

lifetime_rec Integer, modify, optional The number of seconds for which the context will remain valid. If the context has expired, this parameter will be set to zero. If the implementation does not support context expiration, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required.

lifetime_rec Integer,modify,可选上下文保持有效的秒数。如果上下文已过期,则此参数将设置为零。如果实现不支持上下文过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL。

mech_type gss_OID, modify, optional The security mechanism providing the context. The returned OID will be a pointer to static storage that should be treated as read-only by the application; in particular the application should not attempt to free it. Specify NULL if not required.

mech_类型gss_OID,修改,可选提供上下文的安全机制。返回的OID将是指向应用程序应视为只读的静态存储的指针;尤其是应用程序不应尝试释放它。如果不需要,请指定NULL。

ctx_flags bit-mask, modify, optional Contains various independent flags, each of which indicates that the context supports (or is expected to support, if ctx_open is false) a specific service option. If not needed, specify NULL. Symbolic names are provided for each flag, and the symbolic names corresponding to the required flags should be logically-ANDed with the ret_flags value to test whether a given option is supported by the context. The flags are:

ctx_标志位掩码、修改、可选包含各种独立标志,其中每个标志表示上下文支持(或如果ctx_open为false,则预期支持)特定服务选项。如果不需要,请指定NULL。为每个标志提供符号名,与所需标志对应的符号名应与ret_flags值逻辑and,以测试上下文是否支持给定选项。旗为:

GSS_C_DELEG_FLAG True - Credentials were delegated from the initiator to the acceptor. False - No credentials were delegated

GSS_C_DELEG_标志True-凭据已从发起方委派给接受方。False-未委派任何凭据

GSS_C_MUTUAL_FLAG True - The acceptor was authenticated to the initiator False - The acceptor did not authenticate itself.

GSS_C_MUTUAL_标志True-接受方已向发起方进行身份验证False-接受方未进行自身身份验证。

GSS_C_REPLAY_FLAG True - replay of protected messages will be detected False - replayed messages will not be detected

GSS_C_REPLAY_标志为真-将检测到受保护邮件的重播为假-不会检测到重播的邮件

GSS_C_SEQUENCE_FLAG True - out-of-sequence protected messages will be detected False - out-of-sequence messages will not be detected

GSS_C_SEQUENCE_标志True-将检测到顺序外保护消息False-将不会检测到顺序外消息

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 authentication and integrity services only.

GSS_C_CONF_FLAG True-可以通过调用GSS_wrap例程False调用保密服务-没有可用的保密服务(通过GSS_wrap)。gss_wrap将仅提供消息封装、数据源身份验证和完整性服务。

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

GSS_C_INTEG_FLAG True-可以通过调用GSS_get_mic或GSS_wrap例程来调用完整性服务。

False - Per-message integrity service unavailable.

False-每条消息完整性服务不可用。

GSS_C_ANON_FLAG True - The initiator's identity will not be revealed to the acceptor. The src_name parameter (if requested) contains an anonymous internal name. False - The initiator has been authenticated normally.

GSS_C_ANON_标志为真-发起人的身份不会透露给接受人。src_name参数(如果请求)包含匿名内部名称。False-启动器已正常通过身份验证。

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 available for use. False - Protection services (as specified by the states of the GSS_C_CONF_FLAG and GSS_C_INTEG_FLAG) are available only if the context is fully established (i.e. if the open parameter is non-zero).

GSS_C_PROT_READY_FLAG True-保护服务(由GSS_C_CONF_FLAG和GSS_C_INTEG_FLAG的状态指定)可供使用。False-只有在完全建立上下文(即,如果open参数为非零)的情况下,保护服务(由GSS_C_CONF_标志和GSS_C_INTEG_标志的状态指定)才可用。

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.

GSS_C_TRANS_FLAG True-生成的安全上下文可以通过调用GSS_export_sec_context()传输到其他进程。False-安全上下文不可转让。

locally_initiated Boolean, modify Non-zero if the invoking application is the context initiator. Specify NULL if not required.

本地启动布尔值,如果调用应用程序是上下文启动器,则修改非零。如果不需要,请指定NULL。

open Boolean, modify Non-zero if the context is fully established; Zero if a context-establishment token is expected from the peer application. Specify NULL if not required.

打开布尔值,如果上下文已完全建立,则修改非零;如果对等应用程序需要上下文建立令牌,则为零。如果不需要,请指定NULL。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_NO_CONTEXT The referenced context could not be accessed.

GSS_S_NO_上下文无法访问引用的上下文。

5.21. gss_inquire_cred
5.21. gss\u查询\u信用卡

OM_uint32 gss_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 )

OM_uint32 gss_inquire_cred_(OM_uint32*次要_状态、const gss_cred_id_cred_句柄、gss_名称_t*名称、OM_uint32*生命周期、gss_cred_使用情况_t_cred_使用情况、gss_OID_set*机制)

Purpose:

目的:

Obtains information about a credential.

获取有关凭据的信息。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

cred_handle gss_cred_id_t, read A handle that refers to the target credential. Specify GSS_C_NO_CREDENTIAL to inquire about the default initiator principal.

cred_handle gss_cred_id_t,读取引用目标凭据的句柄。指定GSS_C_NO_凭据以查询默认启动器主体。

name gss_name_t, modify, optional The name whose identity the credential asserts. Storage associated with this name should be freed by the application after use with a call to gss_release_name(). Specify NULL if not required.

name gss_name_t,modify,可选凭证断言其身份的名称。与此名称关联的存储应在与gss_release_name()调用一起使用后由应用程序释放。如果不需要,请指定NULL。

lifetime Integer, modify, optional The number of seconds for which the credential will remain valid. If the credential has expired, this parameter will be set to zero. If the implementation does not support credential expiration, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required.

生存期整数,修改,可选凭据将保持有效的秒数。如果凭证已过期,此参数将设置为零。如果实现不支持凭据过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL。

cred_usage gss_cred_usage_t, modify, optional How the credential may be used. One of the following: GSS_C_INITIATE GSS_C_ACCEPT GSS_C_BOTH Specify NULL if not required.

凭据使用gss\U凭据使用,修改,可选如何使用凭据。以下选项之一:GSS_C_INITIATE GSS_C_ACCEPT GSS_C_都指定NULL(如果不需要)。

mechanisms gss_OID_set, modify, optional Set of mechanisms supported by the credential. Storage associated with this OID set must be freed by the application after use with a call to gss_release_oid_set(). Specify NULL if not required.

机制gss_OID_设置、修改、凭证支持的可选机制集。与此OID集关联的存储必须在与gss_release_OID_set()调用一起使用后由应用程序释放。如果不需要,请指定NULL。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_NO_CRED The referenced credentials could not be accessed.

GSS\u S\u NO\u CRED无法访问引用的凭据。

GSS_S_DEFECTIVE_CREDENTIAL The referenced credentials were invalid.

GSS_S_有缺陷的_凭据引用的凭据无效。

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

GSS\u S\u凭据\u已过期引用的凭据已过期。如果未将生存期参数作为NULL传递,则将其设置为0。

5.22. gss_inquire_cred_by_mech
5.22. gss由机械部查询信用卡

OM_uint32 gss_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 )

OM_uint32 gss_inquire_cred_by_mech(OM_uint32*次要_状态、const gss_cred_id_cred_句柄、const gss_OID mech_类型、gss_名称_t*名称、OM_uint32*发起人_寿命、OM_uint32*接受者_寿命、gss_cred_使用情况_cred_使用情况)

Purpose:

目的:

Obtains per-mechanism information about a credential.

获取有关凭据的每个机制的信息。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

cred_handle gss_cred_id_t, read A handle that refers to the target credential. Specify GSS_C_NO_CREDENTIAL to inquire about the default initiator principal.

cred_handle gss_cred_id_t,读取引用目标凭据的句柄。指定GSS_C_NO_凭据以查询默认启动器主体。

mech_type gss_OID, read The mechanism for which information should be returned.

机械类型gss OID,读取应返回信息的机构。

name gss_name_t, modify, optional The name whose identity the credential asserts. Storage associated with this name must be freed by the application after use with a call to gss_release_name(). Specify NULL if not required.

name gss_name_t,modify,可选凭证断言其身份的名称。与此名称关联的存储必须在与gss_release_name()调用一起使用后由应用程序释放。如果不需要,请指定NULL。

initiator_lifetime Integer, modify, optional The number of seconds for which the credential will remain capable of initiating security contexts under the specified mechanism. If the credential can no longer be used to initiate contexts, or if the credential usage for this mechanism is GSS_C_ACCEPT, this parameter will be set to zero. If the implementation does not support expiration of initiator credentials, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required.

initiator_lifetime Integer,modify,可选凭据在指定机制下能够启动安全上下文的秒数。如果凭证不能再用于启动上下文,或者如果此机制的凭证使用为GSS_C_ACCEPT,则此参数将设置为零。如果实现不支持启动器凭据过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL。

acceptor_lifetime Integer, modify, optional The number of seconds for which the credential will remain capable of accepting security contexts under the specified mechanism. If the credential can no longer be used to accept contexts, or if the credential usage for this mechanism is GSS_C_INITIATE, this parameter will be set to zero.

acceptor_lifetime Integer,modify,可选凭据在指定机制下能够接受安全上下文的秒数。如果凭证不能再用于接受上下文,或者如果此机制的凭证使用为GSS_C_INITIATE,则此参数将设置为零。

If the implementation does not support expiration of acceptor credentials, the value GSS_C_INDEFINITE will be returned. Specify NULL if not required.

如果实现不支持接受方凭据过期,将返回值GSS_C_unfinite。如果不需要,请指定NULL。

cred_usage gss_cred_usage_t, modify, optional How the credential may be used with the specified mechanism. One of the following: GSS_C_INITIATE GSS_C_ACCEPT GSS_C_BOTH Specify NULL if not required.

cred_用法gss_cred_用法,修改,可选如何使用指定机制使用凭据。以下选项之一:GSS_C_INITIATE GSS_C_ACCEPT GSS_C_都指定NULL(如果不需要)。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_NO_CRED The referenced credentials could not be accessed.

GSS\u S\u NO\u CRED无法访问引用的凭据。

GSS_S_DEFECTIVE_CREDENTIAL The referenced credentials were invalid.

GSS_S_有缺陷的_凭据引用的凭据无效。

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

GSS\u S\u凭据\u已过期引用的凭据已过期。如果未将生存期参数作为NULL传递,则将其设置为0。

5.23. gss_inquire_mechs_for_name
5.23. gss\u查询\u机械\u以获取\u名称

OM_uint32 gss_inquire_mechs_for_name ( OM_uint32 *minor_status, const gss_name_t input_name, gss_OID_set *mech_types )

OM\U uint32 gss\U查询\U机械\U名称(OM\U uint32*次要\U状态、常量gss\U名称\U输入\U名称、gss\U旧设置*机械类型)

Purpose:

目的:

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

返回GSS-API实现支持的机制集,这些机制可能能够处理指定的名称。

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

返回的每个机制将至少识别名称中的一个元素。允许在独立于机制的GSS-API层中实现此例程,使用所提供名称中包含的类型信息,并基于各个机制实现提供的注册信息。这意味着返回的mech_types集合可能表示某个特定机制将理解该名称,而实际上它将拒绝接受该名称作为gss_规范化_name、gss_init_sec_context、gss_acquire_cred或gss_add_cred的输入(由于特定名称的某些属性,而不是名称类型)。因此,此例程应仅用作调用后续机制特定例程的预过滤器。

Parameters:

参数:

minor_status Integer, modify Implementation specific status code.

次要_状态整数,修改特定于实现的状态代码。

input_name gss_name_t, read The name to which the inquiry relates.

输入\u name gss\u name\t,读取与查询相关的名称。

mech_types gss_OID_set, modify Set of mechanisms that may support the specified name. The returned OID set must be freed by the caller after use with a call to gss_release_oid_set().

mech_类型gss_OID_集合,修改可能支持指定名称的机制集合。调用方必须在调用gss_release_OID_set()后释放返回的OID集。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_NAME The input_name parameter was ill-formed.

GSS_S_BAD_NAME输入_NAME参数格式不正确。

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

GSS_S_BAD_NAMETYPE输入_name参数包含无效或不受支持的名称类型

5.24. gss_inquire_names_for_mech
5.24. gss\u询问\u机械的名称\u

OM_uint32 gss_inquire_names_for_mech ( OM_uint32 *minor_status, const gss_OID mechanism, gss_OID_set *name_types)

OM_uint32 gss_查询_机械的名称(OM_uint32*次要_状态、const gss_OID机构、gss_OID_集合*名称_类型)

Purpose:

目的:

Returns the set of nametypes supported by the specified mechanism.

返回指定机制支持的名称类型集。

Parameters:

参数:

minor_status Integer, modify Implementation specific status code.

次要_状态整数,修改特定于实现的状态代码。

mechanism gss_OID, read The mechanism to be interrogated.

机构gss_OID,读取要询问的机构。

name_types gss_OID_set, modify Set of name-types supported by the specified mechanism. The returned OID set must be freed by the application after use with a call to gss_release_oid_set().

name_types gss_OID_set,修改指定机制支持的名称类型集。在使用gss_release_OID_set()调用后,应用程序必须释放返回的OID集。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

5.25. gss_process_context_token
5.25. gss\u进程\u上下文\u令牌

OM_uint32 gss_process_context_token ( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_buffer_t token_buffer)

OM_uint32 gss_进程_上下文_令牌(OM_uint32*次要_状态,常量gss_ctx_id_上下文_句柄,常量gss_缓冲区_令牌_缓冲区)

Purpose:

目的:

Provides a way to pass an asynchronous token to the security service. Most context-level tokens are emitted and processed synchronously by gss_init_sec_context and gss_accept_sec_context, and the application is informed as to whether further tokens are 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

提供将异步令牌传递给安全服务的方法。大多数上下文级别的令牌由gss_init_sec_context和gss_accept_sec_context同步发出和处理,并通知应用程序gss_C_CONTINUE_所需的主要状态位是否会预期更多令牌。有时,当对等实体不需要令牌时,机制可能需要在某个点发出上下文级令牌。例如,发起人的最终

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

对gss_init_secu_context的调用可能会发出令牌并返回gss_secu COMPLETE状态,但接受者对gss_accept_secu_context的调用可能会失败。接受者的机制可能希望向发起者发送包含错误指示的令牌,但发起者认为上下文已完全建立,因此此时不需要令牌。Gss_进程_上下文_令牌提供了一种随时将此类令牌传递给机制的方法。

Parameters:

参数:

minor_status Integer, modify Implementation specific status code.

次要_状态整数,修改特定于实现的状态代码。

context_handle gss_ctx_id_t, read context handle of context on which token is to be processed

context\u handle gss\u ctx\u id\t,读取要处理令牌的上下文的上下文句柄

token_buffer buffer, opaque, read token to process

令牌\缓冲区,不透明,读取要处理的令牌

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_DEFECTIVE_TOKEN Indicates that consistency checks performed on the token failed

GSS_S_缺陷_令牌表示对令牌执行的一致性检查失败

GSS_S_NO_CONTEXT The context_handle did not refer to a valid context

GSS_S_NO_上下文上下文上下文句柄未引用有效上下文

5.26. gss_release_buffer
5.26. gss_释放_缓冲区

OM_uint32 gss_release_buffer ( OM_uint32 *minor_status, gss_buffer_t buffer)

OM_uint32 gss_释放_缓冲区(OM_uint32*次要_状态,gss_缓冲区t缓冲区)

Purpose:

目的:

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

与缓冲区关联的可用存储。存储必须由GSS-API例程分配。除了释放相关存储之外,例程还将使缓冲区参数引用的描述符中的长度字段为零,并且鼓励实现将描述符中的指针字段另外设置为NULL。GSS-API例程返回的任何缓冲区对象都可以传递给GSS_release_buffer(即使没有与该缓冲区关联的存储)。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

buffer buffer, modify The storage associated with the buffer will be deleted. The gss_buffer_desc object will not be freed, but its length field will be zeroed.

缓冲区,修改与缓冲区关联的存储将被删除。gss_buffer_desc对象将不会被释放,但其长度字段将为零。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

5.27. gss_release_cred
5.27. gss_发布_信用卡

OM_uint32 gss_release_cred ( OM_uint32 *minor_status, gss_cred_id_t *cred_handle)

OM_uint32 gss_发布_凭证(OM_uint32*次要_凭证状态、gss_凭证id_凭证句柄)

Purpose:

目的:

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

通知GSS-API应用程序不再需要指定的凭据句柄,并释放相关资源。鼓励实现在成功完成此调用时将cred_句柄设置为GSS_C_NO_凭证。

Parameters:

参数:

cred_handle gss_cred_id_t, modify, optional Opaque handle identifying credential to be released. If GSS_C_NO_CREDENTIAL is supplied, the routine will complete successfully, but will do nothing.

cred_句柄gss_cred_id_t,modify,可选不透明句柄,标识要发布的凭证。如果提供了GSS_C_NO_凭证,则例程将成功完成,但不会执行任何操作。

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_NO_CRED Credentials could not be accessed.

无法访问GSS_S_NO_CRED凭据。

5.28. gss_release_name
5.28. gss_发布_名称

OM_uint32 gss_release_name ( OM_uint32 *minor_status, gss_name_t *name)

OM_uint32 gss_发布_名称(OM_uint32*次要_状态,gss_名称_t*名称)

Purpose:

目的:

Free GSSAPI-allocated storage associated with an internal-form name. Implementations are encouraged to set the name to GSS_C_NO_NAME on successful completion of this call.

与内部表单名称关联的可用GSSAPI分配存储。鼓励实现在成功完成此调用时将名称设置为GSS_C_NO_name。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

name gss_name_t, modify The name to be deleted

名称gss_name_t,修改要删除的名称

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_BAD_NAME The name parameter did not contain a valid name

GSS_S_BAD_NAME NAME NAME参数未包含有效名称

5.29. gss_release_oid_set
5.29. gss\U释放\U旧集

OM_uint32 gss_release_oid_set ( OM_uint32 *minor_status, gss_OID_set *set)

OM_uint32 gss_释放_oid_集(OM_uint32*次要_状态,gss_oid_集*集)

Purpose:

目的:

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

与GSSAPI生成的gss_OID_集合对象关联的可用存储。set参数必须引用从GSS-API例程返回的OID集。gss_release_oid_set()将释放与每个单独的成员oid、oid集的元素数组和gss_oid_set_desc关联的存储。

Implementations are encouraged to set the gss_OID_set parameter to GSS_C_NO_OID_SET on successful completion of this routine.

成功完成此例程后,鼓励实施将gss_OID_set参数设置为gss_C_NO_OID_set。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

set Set of Object IDs, modify The storage associated with the gss_OID_set will be deleted.

设置对象ID集时,修改与gss_OID_集关联的存储将被删除。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

5.30. gss_test_oid_set_member
5.30. gss_测试_oid_集合_成员

OM_uint32 gss_test_oid_set_member ( OM_uint32 *minor_status, const gss_OID member, const gss_OID_set set, int *present)

OM_uint32 gss_测试_oid_集合_成员(OM_uint32*次要_状态,常量gss_oid成员,常量gss_oid_集合,int*存在)

Purpose:

目的:

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

询问对象标识符集以确定指定的对象标识符是否为成员。此例程用于gss_indicate_mechs()、gss_acquire_cred()和gss_inquire_cred()返回的OID集,但也可用于用户生成的集。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

member Object ID, read The object identifier whose presence is to be tested.

成员对象ID,读取要测试其存在性的对象标识符。

set Set of Object ID, read The Object Identifier set.

设置对象ID集,读取对象标识符集。

present Boolean, modify non-zero if the specified OID is a member of the set, zero if not.

显示布尔值,如果指定的OID是集合的成员,则修改非零;如果不是,则修改零。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

5.31. gss_unwrap
5.31. gss_展开

OM_uint32 gss_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)

OM_uint32 gss_展开(OM_uint32*次要_状态、常量gss_ctx_id_t上下文_句柄、常量gss_缓冲区输入_消息_缓冲区、gss_缓冲区输出_消息_缓冲区、int*配置_状态、gss_qop_状态)

Purpose:

目的:

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

将以前受gss_wrap保护的消息转换回可用形式,验证嵌入式麦克风。conf_state参数指示消息是否加密;qop_状态参数表示用于提供机密性和完整性服务的保护强度。

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

由于一些应用程序级协议可能希望使用gss_wrap()发出的令牌来提供“安全帧”,因此实现必须支持零长度消息的包装和展开。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

context_handle gss_ctx_id_t, read Identifies the context on which the message arrived

context\u handle gss\u ctx\u id\t,read标识消息到达的上下文

input_message_buffer buffer, opaque, read protected message

输入\消息\缓冲区,不透明,读保护消息

output_message_buffer buffer, opaque, modify Buffer to receive unwrapped message. Storage associated with this buffer must be freed by the application after use use with a call to gss_release_buffer().

输出消息缓冲区,不透明,修改缓冲区以接收未包装消息。在调用gss_release_buffer()使用后,应用程序必须释放与此缓冲区关联的存储。

conf_state boolean, modify, optional Non-zero - Confidentiality and integrity protection were used Zero - Integrity service only was used Specify NULL if not required

conf_state boolean、modify、可选的非零机密性和完整性保护被使用。仅使用零完整性服务。如果不需要,则指定NULL

qop_state gss_qop_t, modify, optional Quality of protection provided. Specify NULL if not required

qop_状态gss_qop_t,修改,提供可选保护质量。如果不需要,请指定NULL

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_DEFECTIVE_TOKEN The token failed consistency checks

GSS_S_缺陷_令牌令牌一致性检查失败

GSS_S_BAD_SIG The MIC was incorrect

GSS_S_BAD_SIG话筒不正确

GSS_S_DUPLICATE_TOKEN The token was valid, and contained a correct MIC for the message, but it had already been processed

GSS_S_DUPLICATE_令牌令牌令牌有效,并包含消息的正确MIC,但已对其进行处理

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

GSS_S_OLD_令牌该令牌有效,并且包含消息的正确MIC,但它太旧,无法检查重复。

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

GSS_S_UNSEQ_令牌令牌令牌有效,并包含消息的正确MIC,但已按顺序验证;已收到较新的令牌。

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_GAP_令牌令牌令牌有效,并包含消息的正确MIC,但已按顺序验证;尚未收到先前预期的令牌。

GSS_S_CONTEXT_EXPIRED The context has already expired

GSS\u S\u上下文\u已过期上下文已过期

GSS_S_NO_CONTEXT The context_handle parameter did not identify a valid context

GSS_S_NO_CONTEXT上下文上下文句柄参数未标识有效上下文

5.32. gss_verify_mic
5.32. gss\u验证\u话筒

OM_uint32 gss_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)

OM_uint32 gss_验证_mic(OM_uint32*次要_状态、常量gss_ctx_id_t上下文_句柄、常量gss_缓冲区消息_缓冲区、常量gss_缓冲区令牌_缓冲区、gss_qop_t*qop_状态)

Purpose:

目的:

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

验证令牌参数中包含的加密麦克风是否适合提供的消息。qop_状态参数允许邮件收件人确定应用于邮件的保护强度。

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

由于一些应用程序级协议可能希望使用gss_wrap()发出的令牌来提供“安全帧”,因此实现必须支持计算和验证零长度消息上的MIC。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

context_handle gss_ctx_id_t, read Identifies the context on which the message arrived

context\u handle gss\u ctx\u id\t,read标识消息到达的上下文

message_buffer buffer, opaque, read Message to be verified

消息缓冲区,不透明,待验证的读取消息

token_buffer buffer, opaque, read Token associated with message

令牌\缓冲区,不透明,与消息关联的读取令牌

qop_state gss_qop_t, modify, optional quality of protection gained from MIC Specify NULL if not required

qop_状态gss_qop_t,修改,从MIC获得的可选保护质量如果不需要,请指定NULL

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_DEFECTIVE_TOKEN The token failed consistency checks

GSS_S_缺陷_令牌令牌一致性检查失败

GSS_S_BAD_SIG The MIC was incorrect

GSS_S_BAD_SIG话筒不正确

GSS_S_DUPLICATE_TOKEN The token was valid, and contained a correct MIC for the message, but it had already been processed

GSS_S_DUPLICATE_令牌令牌令牌有效,并包含消息的正确MIC,但已对其进行处理

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

GSS_S_OLD_令牌该令牌有效,并且包含消息的正确MIC,但它太旧,无法检查重复。

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

GSS_S_UNSEQ_令牌令牌令牌有效,并包含消息的正确MIC,但已按顺序验证;已收到较新的令牌。

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_GAP_令牌令牌令牌有效,并包含消息的正确MIC,但已按顺序验证;尚未收到先前预期的令牌。

GSS_S_CONTEXT_EXPIRED The context has already expired

GSS\u S\u上下文\u已过期上下文已过期

GSS_S_NO_CONTEXT The context_handle parameter did not identify a valid context

GSS_S_NO_CONTEXT上下文上下文句柄参数未标识有效上下文

5.33. gss_wrap
5.33. gss_包装

OM_uint32 gss_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 )

OM_uint32 gss_包装(OM_uint32*次要_状态、常量gss_ctx_id_t上下文_句柄、int conf_req_标志、gss_qop_t qop_req const gss_缓冲区输入_消息缓冲区、int*conf_状态、gss_缓冲区输出_消息缓冲区)

Purpose:

目的:

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

附加加密麦克风并可选地加密指定的输入消息。输出_消息包含麦克风和消息。如果所选机制支持,qop_req参数允许在几种加密算法之间进行选择。

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

由于某些应用程序级协议可能希望使用gss_wrap()发出的令牌来提供“安全帧”,因此实现必须支持零长度消息的包装。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code.

次要_状态整数,修改机构特定状态代码。

context_handle gss_ctx_id_t, read Identifies the context on which the message will be sent

context\u handle gss\u ctx\u id\t,read标识消息将在其上发送的上下文

conf_req_flag boolean, read Non-zero - Both confidentiality and integrity services are requested Zero - Only integrity service is requested

conf_req_标志布尔值,读取非零-请求机密性和完整性服务-仅请求零完整性服务

qop_req gss_qop_t, read, optional Specifies required quality of protection. A mechanism-specific default may be requested by setting qop_req to GSS_C_QOP_DEFAULT. If an unsupported protection strength is requested, gss_wrap will return a major_status of GSS_S_BAD_QOP.

qop_req gss_qop_t,读取,可选指定所需的保护质量。通过将qop_req设置为GSS_C_qop_default,可以请求特定于机制的默认值。如果请求不支持的保护强度,gss_wrap将返回gss_S_BAD_QOP的主要_状态。

input_message_buffer buffer, opaque, read Message to be protected

输入\消息\缓冲区,不透明,要保护的读取消息

conf_state boolean, modify, optional Non-zero - Confidentiality, data origin authentication and integrity services have been applied Zero - Integrity and data origin services only has been applied. Specify NULL if not required

conf_state boolean、modify、可选非零机密性、数据源身份验证和完整性服务已应用零完整性,仅应用数据源服务。如果不需要,请指定NULL

output_message_buffer buffer, opaque, modify Buffer to receive protected message. Storage associated with this message must be freed by the application after use with a call to gss_release_buffer().

输出消息缓冲区,不透明,修改缓冲区以接收受保护的消息。与此消息关联的存储必须在与gss_release_buffer()调用一起使用后由应用程序释放。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_CONTEXT_EXPIRED The context has already expired

GSS\u S\u上下文\u已过期上下文已过期

GSS_S_NO_CONTEXT The context_handle parameter did not identify a valid context

GSS_S_NO_CONTEXT上下文上下文句柄参数未标识有效上下文

GSS_S_BAD_QOP The specified QOP is not supported by the mechanism.

GSS_S_BAD_QOP机制不支持指定的QOP。

5.34. gss_wrap_size_limit
5.34. gss_包装_尺寸_限制

OM_uint32 gss_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)

OM_uint32 gss_包装_大小_限制(OM_uint32*次要_状态、常量gss_ctx_id_t上下文_句柄、int conf_req_标志、gss_qop_t qop_要求、OM_uint32 req_输出_大小、OM_uint32*最大输入_大小)

Purpose:

目的:

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

允许应用程序确定最大消息大小,如果使用相同的conf_req_标志和qop_req参数呈现给gss_wrap,将导致输出令牌包含不超过req_output_size字节。

This call is intended for use by applications that communicate over protocols that impose a maximum message size. It enables the 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.

建议使用GSS-API实现,但不要求在调用GSS_wrap_size_limit()时检测无效的QOP值。此例程仅保证最大消息大小,而不保证用于消息保护的特定QOP值的可用性。

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

成功完成此调用并不保证gss_wrap能够保护长度为max_input_size字节的消息,因为此功能可能取决于调用gss_wrap时系统资源的可用性。但是,如果实现本身对gss_wrap可能处理的消息长度施加了上限,则实现不应通过max_input_bytes返回大于此长度的值。

Parameters:

参数:

minor_status Integer, modify Mechanism specific status code

次要_状态整数,修改机构特定状态代码

context_handle gss_ctx_id_t, read A handle that refers to the security over which the messages will be sent.

context_handle gss_ctx_id_t,读取引用消息将通过其发送的安全性的句柄。

conf_req_flag Boolean, read Indicates whether gss_wrap will be asked to apply confidentiality protection in

conf_req_标志布尔值,read表示是否要求gss_wrap在

addition to integrity protection. See the routine description for gss_wrap for more details.

除了完整性保护。有关更多详细信息,请参阅gss_wrap的例程描述。

qop_req gss_qop_t, read Indicates the level of protection that gss_wrap will be asked to provide. See the routine description for gss_wrap for more details.

qop_req gss_qop_t,read表示要求gss_wrap提供的保护级别。有关更多详细信息,请参阅gss_wrap的例程描述。

req_output_size Integer, read The desired maximum size for tokens emitted by gss_wrap.

req_output_size Integer,读取gss_wrap发出的令牌的所需最大大小。

max_input_size Integer, modify The maximum input message size that may be presented to gss_wrap in order to guarantee that the emitted token shall be no larger than req_output_size bytes.

max_input_size Integer,修改可能呈现给gss_wrap的最大输入消息大小,以确保发出的令牌不大于req_output_size字节。

Function value: GSS status code

功能值:GSS状态代码

GSS_S_COMPLETE Successful completion

GSS_S_完成成功完成

GSS_S_NO_CONTEXT The referenced context could not be accessed.

GSS_S_NO_上下文无法访问引用的上下文。

GSS_S_CONTEXT_EXPIRED The context has expired.

GSS\u S\u上下文\u已过期上下文已过期。

GSS_S_BAD_QOP The specified QOP is not supported by the mechanism.

GSS_S_BAD_QOP机制不支持指定的QOP。

6. Security Considerations
6. 安全考虑

This document specifies a service interface for security facilities and services; as such, security considerations appear throughout the specification. Nonetheless, it is appropriate to summarize certain specific points relevant to GSS-API implementors and calling applications. Usage of the GSS-API interface does not in itself provide security services or assurance; instead, these attributes are dependent on the underlying mechanism(s) which support a GSS-API implementation. Callers must be attentive to the requests made to GSS-API calls and to the status indicators returned by GSS-API, as these specify the security service characteristics which GSS-API will provide. When the interprocess context transfer facility is used, appropriate local controls should be applied to constrain access to interprocess tokens and to the sensitive data which they contain.

本文件规定了安全设施和服务的服务接口;因此,安全注意事项贯穿整个规范。尽管如此,总结与GSS-API实现者和调用应用程序相关的某些特定要点是合适的。GSS-API接口的使用本身并不提供安全服务或保证;相反,这些属性依赖于支持GSS-API实现的底层机制。调用者必须注意对GSS-API调用的请求和GSS-API返回的状态指示器,因为它们指定了GSS-API将提供的安全服务特性。使用进程间上下文传输工具时,应应用适当的本地控件来限制对进程间令牌及其包含的敏感数据的访问。

Appendix A. GSS-API C header file gssapi.h

附录A.GSS-API C头文件gssapi.h

C-language GSS-API implementations should include a copy of the following header-file.

C语言GSS-API实现应包括以下头文件的副本。

#ifndef GSSAPI_H_ #define GSSAPI_H_

#如果不确定GSSAPI_H#定义GSSAPI_H_

   /*
    * First, include stddef.h to get size_t defined.
    */
   #include <stddef.h>
        
   /*
    * First, include stddef.h to get size_t defined.
    */
   #include <stddef.h>
        
   /*
    * If the platform supports the xom.h header file, it should be
    * included here.
    */
   #include <xom.h>
        
   /*
    * If the platform supports the xom.h header file, it should be
    * included here.
    */
   #include <xom.h>
        
   /*
    * Now define the three implementation-dependent types.
    */
   typedef <platform-specific> gss_ctx_id_t;
   typedef <platform-specific> gss_cred_id_t;
   typedef <platform-specific> gss_name_t;
        
   /*
    * Now define the three implementation-dependent types.
    */
   typedef <platform-specific> gss_ctx_id_t;
   typedef <platform-specific> gss_cred_id_t;
   typedef <platform-specific> gss_name_t;
        
   /*
    * The following type must be defined as the smallest natural
    * unsigned integer supported by the platform that has at least
    * 32 bits of precision.
    */
   typedef <platform-specific> gss_uint32;
        
   /*
    * The following type must be defined as the smallest natural
    * unsigned integer supported by the platform that has at least
    * 32 bits of precision.
    */
   typedef <platform-specific> gss_uint32;
        
   #ifdef OM_STRING
   /*
    * We have included the xom.h header file.  Verify that OM_uint32
    * is defined correctly.
    */
        
   #ifdef OM_STRING
   /*
    * We have included the xom.h header file.  Verify that OM_uint32
    * is defined correctly.
    */
        
   #if sizeof(gss_uint32) != sizeof(OM_uint32)
   #error Incompatible definition of OM_uint32 from xom.h
   #endif
        
   #if sizeof(gss_uint32) != sizeof(OM_uint32)
   #error Incompatible definition of OM_uint32 from xom.h
   #endif
        

typedef OM_object_identifier gss_OID_desc, *gss_OID;

类型定义OM_对象标识符gss_OID_desc,*gss_OID;

#else

#否则

   /*
    * We can't use X/Open definitions, so roll our own.
    */
        
   /*
    * We can't use X/Open definitions, so roll our own.
    */
        

typedef gss_uint32 OM_uint32;

类型定义gss_uint32 OM_uint32;

   typedef struct gss_OID_desc_struct {
     OM_uint32 length;
     void      *elements;
   } gss_OID_desc, *gss_OID;
        
   typedef struct gss_OID_desc_struct {
     OM_uint32 length;
     void      *elements;
   } gss_OID_desc, *gss_OID;
        

#endif

#恩迪夫

   typedef struct gss_OID_set_desc_struct  {
     size_t     count;
     gss_OID    elements;
   } gss_OID_set_desc, *gss_OID_set;
        
   typedef struct gss_OID_set_desc_struct  {
     size_t     count;
     gss_OID    elements;
   } gss_OID_set_desc, *gss_OID_set;
        
   typedef struct gss_buffer_desc_struct {
     size_t length;
     void *value;
   } gss_buffer_desc, *gss_buffer_t;
        
   typedef struct gss_buffer_desc_struct {
     size_t length;
     void *value;
   } gss_buffer_desc, *gss_buffer_t;
        
   typedef struct gss_channel_bindings_struct {
     OM_uint32 initiator_addrtype;
     gss_buffer_desc initiator_address;
     OM_uint32 acceptor_addrtype;
     gss_buffer_desc acceptor_address;
     gss_buffer_desc application_data;
   } *gss_channel_bindings_t;
        
   typedef struct gss_channel_bindings_struct {
     OM_uint32 initiator_addrtype;
     gss_buffer_desc initiator_address;
     OM_uint32 acceptor_addrtype;
     gss_buffer_desc acceptor_address;
     gss_buffer_desc application_data;
   } *gss_channel_bindings_t;
        
   /*
    * For now, define a QOP-type as an OM_uint32
    */
   typedef OM_uint32 gss_qop_t;
        
   /*
    * For now, define a QOP-type as an OM_uint32
    */
   typedef OM_uint32 gss_qop_t;
        

typedef int gss_cred_usage_t;

typedef int gss_cred_usage_t;

   /*
    * Flag bits for context-level services.
    */
        
   /*
    * Flag bits for context-level services.
    */
        

#define GSS_C_DELEG_FLAG 1 #define GSS_C_MUTUAL_FLAG 2 #define GSS_C_REPLAY_FLAG 4 #define GSS_C_SEQUENCE_FLAG 8 #define GSS_C_CONF_FLAG 16 #define GSS_C_INTEG_FLAG 32 #define GSS_C_ANON_FLAG 64 #define GSS_C_PROT_READY_FLAG 128 #define GSS_C_TRANS_FLAG 256

#定义GSS#U C#U DELEG#U标志1#定义GSS#U C#U相互#U标志2#定义GSS#U C#U回放#标志4#定义GSS#U C35U序列#标志8#定义GSS#U配置#标志16#定义GSS#U集成#标志32#定义GSS#U C#U ANON#标志64#定义GSS#U保护标志128#准备就绪#定义GSU标志256#

   /*
    * Credential usage options
    */
   #define GSS_C_BOTH     0
   #define GSS_C_INITIATE 1
   #define GSS_C_ACCEPT   2
        
   /*
    * Credential usage options
    */
   #define GSS_C_BOTH     0
   #define GSS_C_INITIATE 1
   #define GSS_C_ACCEPT   2
        
   /*
    * Status code types for gss_display_status
    */
   #define GSS_C_GSS_CODE  1
   #define GSS_C_MECH_CODE 2
        
   /*
    * Status code types for gss_display_status
    */
   #define GSS_C_GSS_CODE  1
   #define GSS_C_MECH_CODE 2
        
   /*
    * The constant definitions for channel-bindings address families
    */
   #define GSS_C_AF_UNSPEC     0
   #define GSS_C_AF_LOCAL      1
   #define GSS_C_AF_INET       2
   #define GSS_C_AF_IMPLINK    3
   #define GSS_C_AF_PUP        4
   #define GSS_C_AF_CHAOS      5
   #define GSS_C_AF_NS         6
   #define GSS_C_AF_NBS        7
   #define GSS_C_AF_ECMA       8
   #define GSS_C_AF_DATAKIT    9
   #define GSS_C_AF_CCITT      10
   #define GSS_C_AF_SNA        11
   #define GSS_C_AF_DECnet     12
   #define GSS_C_AF_DLI        13
   #define GSS_C_AF_LAT        14
   #define GSS_C_AF_HYLINK     15
   #define GSS_C_AF_APPLETALK  16
   #define GSS_C_AF_BSC        17
   #define GSS_C_AF_DSS        18
   #define GSS_C_AF_OSI        19
   #define GSS_C_AF_X25        21
        
   /*
    * The constant definitions for channel-bindings address families
    */
   #define GSS_C_AF_UNSPEC     0
   #define GSS_C_AF_LOCAL      1
   #define GSS_C_AF_INET       2
   #define GSS_C_AF_IMPLINK    3
   #define GSS_C_AF_PUP        4
   #define GSS_C_AF_CHAOS      5
   #define GSS_C_AF_NS         6
   #define GSS_C_AF_NBS        7
   #define GSS_C_AF_ECMA       8
   #define GSS_C_AF_DATAKIT    9
   #define GSS_C_AF_CCITT      10
   #define GSS_C_AF_SNA        11
   #define GSS_C_AF_DECnet     12
   #define GSS_C_AF_DLI        13
   #define GSS_C_AF_LAT        14
   #define GSS_C_AF_HYLINK     15
   #define GSS_C_AF_APPLETALK  16
   #define GSS_C_AF_BSC        17
   #define GSS_C_AF_DSS        18
   #define GSS_C_AF_OSI        19
   #define GSS_C_AF_X25        21
        

#define GSS_C_AF_NULLADDR 255

#定义GSS_C_AF_NULLADDR 255

   /*
    * Various Null values
    */
   #define GSS_C_NO_NAME ((gss_name_t) 0)
   #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
   #define GSS_C_NO_OID ((gss_OID) 0)
   #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
   #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
   #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
   #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
   #define GSS_C_EMPTY_BUFFER {0, NULL}
        
   /*
    * Various Null values
    */
   #define GSS_C_NO_NAME ((gss_name_t) 0)
   #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
   #define GSS_C_NO_OID ((gss_OID) 0)
   #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
   #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
   #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
   #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
   #define GSS_C_EMPTY_BUFFER {0, NULL}
        
   /*
    * Some alternate names for a couple of the above
    * values.  These are defined for V1 compatibility.
    */
   #define GSS_C_NULL_OID GSS_C_NO_OID
   #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
        
   /*
    * Some alternate names for a couple of the above
    * values.  These are defined for V1 compatibility.
    */
   #define GSS_C_NULL_OID GSS_C_NO_OID
   #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
        
   /*
    * Define the default Quality of Protection for per-message
    * services.  Note that an implementation that offers multiple
    * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
    * (as done here) to mean "default protection", or to a specific
    * explicit QOP value.  However, a value of 0 should always be
    * interpreted by a GSS-API implementation as a request for the
    * default protection level.
    */
   #define GSS_C_QOP_DEFAULT 0
        
   /*
    * Define the default Quality of Protection for per-message
    * services.  Note that an implementation that offers multiple
    * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
    * (as done here) to mean "default protection", or to a specific
    * explicit QOP value.  However, a value of 0 should always be
    * interpreted by a GSS-API implementation as a request for the
    * default protection level.
    */
   #define GSS_C_QOP_DEFAULT 0
        
   /*
    * Expiration time of 2^32-1 seconds means infinite lifetime for a
    * credential or security context
    */
   #define GSS_C_INDEFINITE 0xfffffffful
        
   /*
    * Expiration time of 2^32-1 seconds means infinite lifetime for a
    * credential or security context
    */
   #define GSS_C_INDEFINITE 0xfffffffful
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    * "\x01\x02\x01\x01"},
    * corresponding to an object-identifier value of
    * {iso(1) member-body(2) United States(840) mit(113554)
    * infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
    * GSS_C_NT_USER_NAME should be initialized to point
    * to that gss_OID_desc.
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    * "\x01\x02\x01\x01"},
    * corresponding to an object-identifier value of
    * {iso(1) member-body(2) United States(840) mit(113554)
    * infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
    * GSS_C_NT_USER_NAME should be initialized to point
    * to that gss_OID_desc.
        

*/ extern gss_OID GSS_C_NT_USER_NAME;

*/外部gss_OID gss_C_NT_用户名;

   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    *              "\x01\x02\x01\x02"},
    * corresponding to an object-identifier value of
    * {iso(1) member-body(2) United States(840) mit(113554)
    * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
    * The constant GSS_C_NT_MACHINE_UID_NAME should be
    * initialized to point to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    *              "\x01\x02\x01\x02"},
    * corresponding to an object-identifier value of
    * {iso(1) member-body(2) United States(840) mit(113554)
    * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
    * The constant GSS_C_NT_MACHINE_UID_NAME should be
    * initialized to point to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    *              "\x01\x02\x01\x03"},
    * corresponding to an object-identifier value of
    * {iso(1) member-body(2) United States(840) mit(113554)
    * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
    * The constant GSS_C_NT_STRING_UID_NAME should be
    * initialized to point to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_STRING_UID_NAME;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    *              "\x01\x02\x01\x03"},
    * corresponding to an object-identifier value of
    * {iso(1) member-body(2) United States(840) mit(113554)
    * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
    * The constant GSS_C_NT_STRING_UID_NAME should be
    * initialized to point to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_STRING_UID_NAME;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
    * corresponding to an object-identifier value of
    * {iso(1) org(3) dod(6) internet(1) security(5)
    * nametypes(6) gss-host-based-services(2)).  The constant
    * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
    * to that gss_OID_desc.  This is a deprecated OID value, and
    * implementations wishing to support hostbased-service names
    * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
    * defined below, to identify such names;
    * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
    * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
    * parameter, but should not be emitted by GSS-API
    * implementations
    */
   extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
    * corresponding to an object-identifier value of
    * {iso(1) org(3) dod(6) internet(1) security(5)
    * nametypes(6) gss-host-based-services(2)).  The constant
    * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
    * to that gss_OID_desc.  This is a deprecated OID value, and
    * implementations wishing to support hostbased-service names
    * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
    * defined below, to identify such names;
    * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
    * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
    * parameter, but should not be emitted by GSS-API
    * implementations
    */
   extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    *              "\x01\x02\x01\x04"}, corresponding to an
    * object-identifier value of {iso(1) member-body(2)
    * Unites States(840) mit(113554) infosys(1) gssapi(2)
    * generic(1) service_name(4)}.  The constant
    * GSS_C_NT_HOSTBASED_SERVICE should be initialized
    * to point to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
    *              "\x01\x02\x01\x04"}, corresponding to an
    * object-identifier value of {iso(1) member-body(2)
    * Unites States(840) mit(113554) infosys(1) gssapi(2)
    * generic(1) service_name(4)}.  The constant
    * GSS_C_NT_HOSTBASED_SERVICE should be initialized
    * to point to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
    * corresponding to an object identifier value of
    * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
    * 6(nametypes), 3(gss-anonymous-name)}.  The constant
    * and GSS_C_NT_ANONYMOUS should be initialized to point
    * to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_ANONYMOUS;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
    * corresponding to an object identifier value of
    * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
    * 6(nametypes), 3(gss-anonymous-name)}.  The constant
    * and GSS_C_NT_ANONYMOUS should be initialized to point
    * to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_ANONYMOUS;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
    * corresponding to an object-identifier value of
    * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
    * 6(nametypes), 4(gss-api-exported-name)}.  The constant
    * GSS_C_NT_EXPORT_NAME should be initialized to point
    * to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_EXPORT_NAME;
        
   /*
    * The implementation must reserve static storage for a
    * gss_OID_desc object containing the value
    * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
    * corresponding to an object-identifier value of
    * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
    * 6(nametypes), 4(gss-api-exported-name)}.  The constant
    * GSS_C_NT_EXPORT_NAME should be initialized to point
    * to that gss_OID_desc.
    */
   extern gss_OID GSS_C_NT_EXPORT_NAME;
        
   /* Major status codes */
        
   /* Major status codes */
        

#define GSS_S_COMPLETE 0

#定义GSS_S_完成0

   /*
    * Some "helper" definitions to make the status code macros obvious.
    */
   #define GSS_C_CALLING_ERROR_OFFSET 24
   #define GSS_C_ROUTINE_ERROR_OFFSET 16
        
   /*
    * Some "helper" definitions to make the status code macros obvious.
    */
   #define GSS_C_CALLING_ERROR_OFFSET 24
   #define GSS_C_ROUTINE_ERROR_OFFSET 16
        

#define GSS_C_SUPPLEMENTARY_OFFSET 0 #define GSS_C_CALLING_ERROR_MASK 0377ul #define GSS_C_ROUTINE_ERROR_MASK 0377ul #define GSS_C_SUPPLEMENTARY_MASK 0177777ul

#定义GSS_C_补充_偏移量0#定义GSS_C_调用_错误_掩码0377ul#定义GSS_C_例程_错误_掩码0377ul#定义GSS_C_补充_掩码0177777ul

   /*
    * The macros that test status codes for error conditions.
    * Note that the GSS_ERROR() macro has changed slightly from
    * the V1 GSS-API so that it now evaluates its argument
    * only once.
    */
   #define GSS_CALLING_ERROR(x) \
    (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
   #define GSS_ROUTINE_ERROR(x) \
    (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
   #define GSS_SUPPLEMENTARY_INFO(x) \
    (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
   #define GSS_ERROR(x) \
    (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
          (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
        
   /*
    * The macros that test status codes for error conditions.
    * Note that the GSS_ERROR() macro has changed slightly from
    * the V1 GSS-API so that it now evaluates its argument
    * only once.
    */
   #define GSS_CALLING_ERROR(x) \
    (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
   #define GSS_ROUTINE_ERROR(x) \
    (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
   #define GSS_SUPPLEMENTARY_INFO(x) \
    (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
   #define GSS_ERROR(x) \
    (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
          (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
        
   /*
    * Now the actual status code definitions
    */
        
   /*
    * Now the actual status code definitions
    */
        
   /*
    * Calling errors:
        
   /*
    * Calling errors:
        
    */
   #define GSS_S_CALL_INACCESSIBLE_READ \
   (1ul << GSS_C_CALLING_ERROR_OFFSET)
   #define GSS_S_CALL_INACCESSIBLE_WRITE \
   (2ul << GSS_C_CALLING_ERROR_OFFSET)
   #define GSS_S_CALL_BAD_STRUCTURE \
   (3ul << GSS_C_CALLING_ERROR_OFFSET)
        
    */
   #define GSS_S_CALL_INACCESSIBLE_READ \
   (1ul << GSS_C_CALLING_ERROR_OFFSET)
   #define GSS_S_CALL_INACCESSIBLE_WRITE \
   (2ul << GSS_C_CALLING_ERROR_OFFSET)
   #define GSS_S_CALL_BAD_STRUCTURE \
   (3ul << GSS_C_CALLING_ERROR_OFFSET)
        
   /*
    * Routine errors:
    */
   #define GSS_S_BAD_MECH             (1ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_NAME             (2ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_NAMETYPE         (3ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_BINDINGS         (4ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_STATUS           (5ul <<
        
   /*
    * Routine errors:
    */
   #define GSS_S_BAD_MECH             (1ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_NAME             (2ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_NAMETYPE         (3ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_BINDINGS         (4ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_STATUS           (5ul <<
        
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_SIG              (6ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_MIC GSS_S_BAD_SIG
   #define GSS_S_NO_CRED              (7ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_NO_CONTEXT           (8ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_DEFECTIVE_TOKEN      (9ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_DEFECTIVE_CREDENTIAL (10ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_CREDENTIALS_EXPIRED  (11ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_CONTEXT_EXPIRED      (12ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_FAILURE              (13ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_QOP              (14ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_UNAUTHORIZED         (15ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_UNAVAILABLE          (16ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_DUPLICATE_ELEMENT    (17ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_NAME_NOT_MN          (18ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
        
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_SIG              (6ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_MIC GSS_S_BAD_SIG
   #define GSS_S_NO_CRED              (7ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_NO_CONTEXT           (8ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_DEFECTIVE_TOKEN      (9ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_DEFECTIVE_CREDENTIAL (10ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_CREDENTIALS_EXPIRED  (11ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_CONTEXT_EXPIRED      (12ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_FAILURE              (13ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_BAD_QOP              (14ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_UNAUTHORIZED         (15ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_UNAVAILABLE          (16ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_DUPLICATE_ELEMENT    (17ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
   #define GSS_S_NAME_NOT_MN          (18ul <<
   GSS_C_ROUTINE_ERROR_OFFSET)
        
   /*
    * Supplementary info bits:
    */
   #define GSS_S_CONTINUE_NEEDED \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
   #define GSS_S_DUPLICATE_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
   #define GSS_S_OLD_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
   #define GSS_S_UNSEQ_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
   #define GSS_S_GAP_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
        
   /*
    * Supplementary info bits:
    */
   #define GSS_S_CONTINUE_NEEDED \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
   #define GSS_S_DUPLICATE_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
   #define GSS_S_OLD_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
   #define GSS_S_UNSEQ_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
   #define GSS_S_GAP_TOKEN \
            (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
        
   /*
    * Finally, function prototypes for the GSS-API routines.
    */
        
   /*
    * Finally, function prototypes for the GSS-API routines.
    */
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_release_cred
                 (OM_uint32 ,             /* minor_status */
                  gss_cred_id_t *         /* cred_handle */
                 );
        
   OM_uint32 gss_release_cred
                 (OM_uint32 ,             /* minor_status */
                  gss_cred_id_t *         /* cred_handle */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_process_context_token
                 (OM_uint32 ,             /* minor_status */
                  const gss_ctx_id_t,     /* context_handle */
                  const gss_buffer_t      /* token_buffer */
                 );
        
   OM_uint32 gss_process_context_token
                 (OM_uint32 ,             /* minor_status */
                  const gss_ctx_id_t,     /* context_handle */
                  const gss_buffer_t      /* token_buffer */
                 );
        
   OM_uint32 gss_delete_sec_context
                 (OM_uint32 ,             /* minor_status */
                  gss_ctx_id_t ,          /* context_handle */
                  gss_buffer_t            /* output_token */
                 );
        
   OM_uint32 gss_delete_sec_context
                 (OM_uint32 ,             /* minor_status */
                  gss_ctx_id_t ,          /* context_handle */
                  gss_buffer_t            /* output_token */
                 );
        
   OM_uint32 gss_context_time
                 (OM_uint32 ,             /* minor_status */
                  const gss_ctx_id_t,     /* context_handle */
                  OM_uint32 *             /* time_rec */
                 );
        
   OM_uint32 gss_context_time
                 (OM_uint32 ,             /* minor_status */
                  const gss_ctx_id_t,     /* context_handle */
                  OM_uint32 *             /* time_rec */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_indicate_mechs
                 (OM_uint32 ,             /* minor_status */
                  gss_OID_set *           /* mech_set */
                 );
        
   OM_uint32 gss_indicate_mechs
                 (OM_uint32 ,             /* minor_status */
                  gss_OID_set *           /* mech_set */
                 );
        
   OM_uint32 gss_compare_name
                 (OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* name1 */
                  const gss_name_t,       /* name2 */
                  int *                   /* name_equal */
                 );
        
   OM_uint32 gss_compare_name
                 (OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* name1 */
                  const gss_name_t,       /* name2 */
                  int *                   /* name_equal */
                 );
        
   OM_uint32 gss_display_name
                 (OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* input_name */
                  gss_buffer_t,           /* output_name_buffer */
                  gss_OID *               /* output_name_type */
                 );
        
   OM_uint32 gss_display_name
                 (OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* input_name */
                  gss_buffer_t,           /* output_name_buffer */
                  gss_OID *               /* output_name_type */
                 );
        
   OM_uint32 gss_import_name
                 (OM_uint32 ,             /* minor_status */
                  const gss_buffer_t,     /* input_name_buffer */
                  const gss_OID,          /* input_name_type */
                  gss_name_t *            /* output_name */
                 );
        
   OM_uint32 gss_import_name
                 (OM_uint32 ,             /* minor_status */
                  const gss_buffer_t,     /* input_name_buffer */
                  const gss_OID,          /* input_name_type */
                  gss_name_t *            /* output_name */
                 );
        
   OM_uint32 gss_export_name
                 (OM_uint32,              /* minor_status */
                  const gss_name_t,       /* input_name */
                  gss_buffer_t            /* exported_name */
                 );
        
   OM_uint32 gss_export_name
                 (OM_uint32,              /* minor_status */
                  const gss_name_t,       /* input_name */
                  gss_buffer_t            /* exported_name */
                 );
        
   OM_uint32 gss_release_name
                 (OM_uint32 *,            /* minor_status */
                  gss_name_t *            /* input_name */
                 );
        
   OM_uint32 gss_release_name
                 (OM_uint32 *,            /* minor_status */
                  gss_name_t *            /* input_name */
                 );
        
   OM_uint32 gss_release_buffer
                 (OM_uint32 ,             /* minor_status */
                  gss_buffer_t            /* buffer */
                 );
        
   OM_uint32 gss_release_buffer
                 (OM_uint32 ,             /* minor_status */
                  gss_buffer_t            /* buffer */
                 );
        
   OM_uint32 gss_release_oid_set
                 (OM_uint32 ,             /* minor_status */
                  gss_OID_set *           /* set */
                 );
        
   OM_uint32 gss_release_oid_set
                 (OM_uint32 ,             /* minor_status */
                  gss_OID_set *           /* set */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_inquire_context (
                  OM_uint32 ,             /* minor_status */
                  const gss_ctx_id_t,     /* context_handle */
                  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 */
                 );
        
   OM_uint32 gss_inquire_context (
                  OM_uint32 ,             /* minor_status */
                  const gss_ctx_id_t,     /* context_handle */
                  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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_export_sec_context (
                  OM_uint32 ,             /* minor_status */
                  gss_ctx_id_t ,          /* context_handle */
                  gss_buffer_t            /* interprocess_token */
                 );
        
   OM_uint32 gss_export_sec_context (
                  OM_uint32 ,             /* minor_status */
                  gss_ctx_id_t ,          /* context_handle */
                  gss_buffer_t            /* interprocess_token */
                 );
        
   OM_uint32 gss_import_sec_context (
                  OM_uint32 ,             /* minor_status */
                  const gss_buffer_t,     /* interprocess_token */
                  gss_ctx_id_t *          /* context_handle */
                 );
        
   OM_uint32 gss_import_sec_context (
                  OM_uint32 ,             /* minor_status */
                  const gss_buffer_t,     /* interprocess_token */
                  gss_ctx_id_t *          /* context_handle */
                 );
        
   OM_uint32 gss_create_empty_oid_set (
                  OM_uint32 ,             /* minor_status */
                  gss_OID_set *           /* oid_set */
                 );
        
   OM_uint32 gss_create_empty_oid_set (
                  OM_uint32 ,             /* minor_status */
                  gss_OID_set *           /* oid_set */
                 );
        
   OM_uint32 gss_add_oid_set_member (
                  OM_uint32 ,             /* minor_status */
                  const gss_OID,          /* member_oid */
                  gss_OID_set *           /* oid_set */
                 );
        
   OM_uint32 gss_add_oid_set_member (
                  OM_uint32 ,             /* minor_status */
                  const gss_OID,          /* member_oid */
                  gss_OID_set *           /* oid_set */
                 );
        
   OM_uint32 gss_test_oid_set_member (
                  OM_uint32 ,             /* minor_status */
                  const gss_OID,          /* member */
                  const gss_OID_set,      /* set */
                  int *                   /* present */
                 );
        
   OM_uint32 gss_test_oid_set_member (
                  OM_uint32 ,             /* minor_status */
                  const gss_OID,          /* member */
                  const gss_OID_set,      /* set */
                  int *                   /* present */
                 );
        
   OM_uint32 gss_inquire_names_for_mech (
                  OM_uint32 ,             /* minor_status */
                  const gss_OID,          /* mechanism */
                  gss_OID_set *           /* name_types */
                 );
        
   OM_uint32 gss_inquire_names_for_mech (
                  OM_uint32 ,             /* minor_status */
                  const gss_OID,          /* mechanism */
                  gss_OID_set *           /* name_types */
                 );
        
   OM_uint32 gss_inquire_mechs_for_name (
                  OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* input_name */
                  gss_OID_set *           /* mech_types */
                 );
        
   OM_uint32 gss_inquire_mechs_for_name (
                  OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* input_name */
                  gss_OID_set *           /* mech_types */
                 );
        
   OM_uint32 gss_canonicalize_name (
                  OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* input_name */
                  const gss_OID,          /* mech_type */
                  gss_name_t *            /* output_name */
                 );
        
   OM_uint32 gss_canonicalize_name (
                  OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* input_name */
                  const gss_OID,          /* mech_type */
                  gss_name_t *            /* output_name */
                 );
        
   OM_uint32 gss_duplicate_name (
                  OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* src_name */
                  gss_name_t *            /* dest_name */
                 );
        
   OM_uint32 gss_duplicate_name (
                  OM_uint32 ,             /* minor_status */
                  const gss_name_t,       /* src_name */
                  gss_name_t *            /* dest_name */
                 );
        
   /*
    * The following routines are obsolete variants of gss_get_mic,
    * gss_verify_mic, gss_wrap and gss_unwrap.  They should be
    * provided by GSS-API V2 implementations for backwards
    * compatibility with V1 applications.  Distinct entrypoints
        
   /*
    * The following routines are obsolete variants of gss_get_mic,
    * gss_verify_mic, gss_wrap and gss_unwrap.  They should be
    * provided by GSS-API V2 implementations for backwards
    * compatibility with V1 applications.  Distinct entrypoints
        

* (as opposed to #defines) should be provided, both to allow * GSS-API V1 applications to link against GSS-API V2 implementations, * and to retain the slight parameter type differences between the * obsolete versions of these routines and their current forms. */

* (与#定义相反)应提供,既允许*GSS-API V1应用程序链接到GSS-API V2实现,*又保留这些例程的*过时版本与其当前形式之间的细微参数类型差异*/

   OM_uint32 gss_sign
                 (OM_uint32 ,        /* minor_status */
                  gss_ctx_id_t,      /* context_handle */
                  int,               /* qop_req */
                  gss_buffer_t,      /* message_buffer */
                  gss_buffer_t       /* message_token */
                 );
        
   OM_uint32 gss_sign
                 (OM_uint32 ,        /* minor_status */
                  gss_ctx_id_t,      /* context_handle */
                  int,               /* qop_req */
                  gss_buffer_t,      /* message_buffer */
                  gss_buffer_t       /* message_token */
                 );
        
   OM_uint32 gss_verify
                 (OM_uint32 ,        /* minor_status */
                  gss_ctx_id_t,      /* context_handle */
                  gss_buffer_t,      /* message_buffer */
                  gss_buffer_t,      /* token_buffer */
                  int *              /* qop_state */
                 );
        
   OM_uint32 gss_verify
                 (OM_uint32 ,        /* minor_status */
                  gss_ctx_id_t,      /* context_handle */
                  gss_buffer_t,      /* message_buffer */
                  gss_buffer_t,      /* token_buffer */
                  int *              /* qop_state */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   OM_uint32 gss_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 */
                 );
        
   #endif /* GSSAPI_H_ */
        
   #endif /* GSSAPI_H_ */
        
Appendix B. Additional constraints for application binary portability
附录B.应用程序二进制可移植性的附加约束

The purpose of this C-bindings document is to encourage source-level portability of applications across GSS-API implementations on different platforms and atop different mechanisms. Additional goals that have not been explicitly addressed by this document are link-time and run-time portability.

本C-bindings文档旨在鼓励应用程序在不同平台和不同机制上跨GSS-API实现的源代码级可移植性。本文档未明确说明的其他目标是链接时和运行时可移植性。

Link-time portability provides the ability to compile an application against one implementation of GSS-API, and then link it against a different implementation on the same platform. It is a stricter requirement than source-level portability.

链接时可移植性提供了针对GSS-API的一个实现编译应用程序,然后针对同一平台上的不同实现进行链接的能力。这是比源代码级可移植性更严格的要求。

Run-time portability differs from link-time portability only on those platforms that implement dynamically loadable GSS-API implementations, but do not offer load-time symbol resolution. On such platforms, run-time portability is a stricter requirement than link-time portability, and will typically include the precise placement of the various GSS-API routines within library entrypoint vectors.

运行时可移植性不同于链路时可移植性,仅在那些实现动态可加载GSS-API实现但不提供加载时符号解析的平台上。在这样的平台上,运行时可移植性比链路时可移植性要求更严格,通常包括在库入口点向量中精确放置各种GSS-API例程。

Individual platforms will impose their own rules that must be followed to achieve link-time (and run-time, if different) portability. In order to ensure either form of binary portability, an ABI specification must be written for GSS-API implementations on that platform. However, it is recognized that there are some issues that are likely to be common to all such ABI specifications. This appendix is intended to be a repository for such common issues, and contains some suggestions that individual ABI specifications may choose to reference. Since machine architectures vary greatly, it may not be possible or desirable to follow these suggestions on all platforms.

各个平台将实施它们自己的规则,必须遵守这些规则才能实现链接时间(以及运行时,如果不同的话)的可移植性。为了确保任何一种形式的二进制可移植性,必须为该平台上的GSS-API实现编写ABI规范。然而,人们认识到,所有此类ABI规范都可能存在一些共同的问题。本附录旨在作为此类常见问题的存储库,并包含一些建议,供个别ABI规范参考。由于机器体系结构差异很大,在所有平台上遵循这些建议可能是不可能或不可取的。

B.1. Pointers
B.1. 指针

While ANSI-C provides a single pointer type for each declared type, plus a single (void *) type, some platforms (notably those using segmented memory architectures) augment this with various modified pointer types (e.g. far pointers, near pointers). These language bindings assume ANSI-C, and thus do not address such non-standard implementations. GSS-API implementations for such platforms must choose an appropriate memory model, and should use it consistently throughout. For example, if a memory model is chosen that requires the use of far pointers when passing routine parameters, then far pointers should also be used within the structures defined by GSS-API.

尽管ANSI-C为每个声明的类型提供了一个指针类型,加上一个(void*)类型,但一些平台(尤其是使用分段内存体系结构的平台)通过各种修改的指针类型(例如远指针、近指针)对此进行了补充。这些语言绑定采用ANSI-C,因此不处理此类非标准实现。用于此类平台的GSS-API实现必须选择适当的内存模型,并且在整个过程中应始终一致地使用它。例如,如果选择的内存模型在传递例程参数时需要使用远指针,那么远指针也应该在GSS-API定义的结构中使用。

B.2. Internal structure alignment
B.2. 内部结构调整

GSS-API defines several data-structures containing differently-sized fields. An ABI specification should include a detailed description of how the fields of such structures are aligned, and if there is any internal padding in these data structures. The use of compiler defaults for the platform is recommended.

GSS-API定义了几个包含不同大小字段的数据结构。ABI规范应该包括如何对齐此类结构的字段的详细描述,以及这些数据结构中是否存在任何内部填充。建议对平台使用编译器默认值。

B.3. Handle types
B.3. 手柄类型

The C bindings specify that the gss_cred_id_t and gss_ctx_id_t types should be implemented as either pointer or arithmetic types, and that if pointer types are used, care should be taken to ensure that two handles may be compared with the == operator. Note that ANSI-C does not guarantee that two pointer values may be compared with the == operator unless either the two pointers point to members of a single array, or at least one of the pointers contains a NULL value.

C绑定指定gss_cred_id_t和gss_ctx_id_t类型应实现为指针或算术类型,并且如果使用指针类型,应注意确保两个句柄可以与==运算符进行比较。请注意,ANSI-C不保证两个指针值可以与==运算符进行比较,除非两个指针指向单个数组的成员,或者至少一个指针包含空值。

For binary portability, additional constraints are required. The following is an attempt at defining platform-independent constraints.

对于二进制可移植性,需要附加约束。以下是定义平台无关约束的尝试。

The size of the handle type must be the same as sizeof(void *), using the appropriate memory model.

使用适当的内存模型,句柄类型的大小必须与sizeof(void*)相同。

The == operator for the chosen type must be a simple bit-wise comparison. That is, for two in-memory handle objects h1 and h2, the boolean value of the expression

所选类型的==运算符必须是简单的逐位比较。也就是说,对于两个内存句柄对象h1和h2,表达式的布尔值

(h1 == h2)

(h1==h2)

should always be the same as the boolean value of the expression

应始终与表达式的布尔值相同

      (memcmp(&h1, &h2, sizeof(h1)) == 0)
        
      (memcmp(&h1, &h2, sizeof(h1)) == 0)
        

The actual use of the type (void *) for handle types is discouraged, not for binary portability reasons, but since it effectively disables much of the compile-time type-checking that the compiler can otherwise perform, and is therefore not "programmer-friendly". If a pointer implementation is desired, and if the platform's implementation of pointers permits, the handles should be implemented as pointers to distinct implementation-defined types.

不鼓励将类型(void*)实际用于句柄类型,这不是出于二进制可移植性的原因,而是因为它实际上禁用了编译器可以执行的大部分编译时类型检查,因此不是“程序员友好的”。如果需要指针实现,并且平台的指针实现允许,那么句柄应该作为指向不同实现定义类型的指针来实现。

B.4. The gss_name_t type
B.4. gss\u名称\u t类型

The gss_name_t type, representing the internal name object, should be implemented as a pointer type. The use of the (void *) type is discouraged as it does not allow the compiler to perform strong type-checking. However, the pointer type chosen should be of the

表示内部名称对象的gss_name_t类型应实现为指针类型。不鼓励使用(void*)类型,因为它不允许编译器执行强类型检查。但是,所选的指针类型应为

same size as the (void *) type. Provided this rule is obeyed, ABI specifications need not further constrain the implementation of gss_name_t objects.

与(void*)类型的大小相同。只要遵守这条规则,ABI规范就不需要进一步约束gss_name_t对象的实现。

B.5. The int and size_t types
B.5. int和size\t类型

Some platforms may support differently sized implementations of the "int" and "size_t" types, perhaps chosen through compiler switches, and perhaps dependent on memory model. An ABI specification for such a platform should include required implementations for these types. It is recommended that the default implementation (for the chosen memory model, if appropriate) is chosen.

一些平台可能支持不同大小的“int”和“size_t”类型的实现,可能通过编译器开关选择,也可能依赖于内存模型。这种平台的ABI规范应该包括这些类型所需的实现。建议选择默认实现(对于所选的内存模型,如果合适)。

B.6. Procedure-calling conventions
B.6. 过程调用约定

Some platforms support a variety of different binary conventions for calling procedures. Such conventions cover things like the format of the stack frame, the order in which the routine parameters are pushed onto the stack, whether or not a parameter count is pushed onto the stack, whether some argument(s) or return values are to be passed in registers, and whether the called routine or the caller is responsible for removing the stack frame on return. For such platforms, an ABI specification should specify which calling convention is to be used for GSS-API implementations.

一些平台支持各种不同的二进制约定来调用过程。这些约定包括堆栈帧的格式、例程参数推送到堆栈上的顺序、是否将参数计数推送到堆栈上、是否将一些参数或返回值传递到寄存器中、,以及被调用例程还是调用方负责在返回时删除堆栈帧。对于这样的平台,ABI规范应该指定GSS-API实现将使用哪种调用约定。

References

工具书类

[GSSAPI] Linn, J., "Generic Security Service Application Program Interface Version 2, Update 1", RFC 2743, January 2000.

[GSSAPI]Linn,J.,“通用安全服务应用程序接口版本2,更新1”,RFC 2743,2000年1月。

[XOM] OSI Object Management API Specification, Version 2.0 t", X.400 API Association & X/Open Company Limited, August 24, 1990 Specification of datatypes and routines for manipulating information objects.

[XOM]OSI对象管理API规范,版本2.0 t”,X.400 API协会和X/Open有限公司,1990年8月24日,操作信息对象的数据类型和例程规范。

Author's Address

作者地址

John Wray Iris Associates 5 Technology Park Drive, Westford, MA 01886 USA

美国马萨诸塞州韦斯特福德科技园大道5号John Wray Iris Associates邮编01886

   Phone: +1-978-392-6689
   EMail: John_Wray@Iris.com
        
   Phone: +1-978-392-6689
   EMail: John_Wray@Iris.com
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (2000). All Rights Reserved.

版权所有(C)互联网协会(2000年)。版权所有。

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。

Acknowledgement

确认

Funding for the RFC Editor function is currently provided by the Internet Society.

RFC编辑功能的资金目前由互联网协会提供。