Network Working Group J. Linn Request for Comments: 1508 Geer Zolot Associates September 1993 Generic Security Service Application Program Interface Status of this Memo This RFC 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" for the standardization state and status of this protocol. Distribution of this memo is unlimited. Abstract This Generic Security Service Application Program Interface (GSS-API) definition provides security services to callers in a generic fashion, supportable with a range of underlying mechanisms and technologies and hence allowing source-level portability of applications to different environments. This specification defines GSS-API services and primitives at a level independent of underlying mechanism and programming language environment, and is to be complemented by other, related specifications: documents defining specific parameter bindings for particular language environments documents defining token formats, protocols, and procedures to be implemented in order to realize GSS-API services atop particular security mechanisms Table of Contents 1. GSS-API Characteristics and Concepts ....................... 2 1.1. GSS-API Constructs ....................................... 5 1.1.1. Credentials ........................................... 5 1.1.2. Tokens ................................................ 6 1.1.3. Security Contexts ..................................... 7 1.1.4. Mechanism Types ....................................... 8 1.1.5. Naming ................................................ 9 1.1.6. Channel Bindings ...................................... 10 1.2. GSS-API Features and Issues ............................. 11 1.2.1. Status Reporting ...................................... 11 1.2.2. Per-Message Security Service Availability ............. 12 1.2.3. Per-Message Replay Detection and Sequencing ........... 13 1.2.4. Quality of Protection ................................. 15 Linn [Page 1] RFC 1508 Generic Security Interface September 1993 2. Interface Descriptions ..................................... 15 2.1. Credential management calls ............................. 17 2.1.1. GSS_Acquire_cred call ................................. 17 2.1.2. GSS_Release_cred call ................................. 19 2.1.3. GSS_Inquire_cred call ................................. 20 2.2. Context-level calls ..................................... 21 2.2.1. GSS_Init_sec_context call ............................. 21 2.2.2. GSS_Accept_sec_context call ........................... 26 2.2.3. GSS_Delete_sec_context call ........................... 29 2.2.4. GSS_Process_context_token call ........................ 30 2.2.5. GSS_Context_time call ................................. 31 2.3. Per-message calls ....................................... 32 2.3.1. GSS_Sign call ......................................... 32 2.3.2. GSS_Verify call ....................................... 33 2.3.3. GSS_Seal call ......................................... 35 2.3.4. GSS_Unseal call ....................................... 36 2.4. Support calls ........................................... 37 2.4.1. GSS_Display_status call ............................... 37 2.4.2. GSS_Indicate_mechs call ............................... 38 2.4.3. GSS_Compare_name call ................................. 38 2.4.4. GSS_Display_name call ................................. 39 2.4.5. GSS_Import_name call .................................. 40 2.4.6. GSS_Release_name call ................................. 41 2.4.7. GSS_Release_buffer call ............................... 41 2.4.8. GSS_Release_oid_set call .............................. 42 3. Mechanism-Specific Example Scenarios ....................... 42 3.1. Kerberos V5, single-TGT ................................. 43 3.2. Kerberos V5, double-TGT ................................. 43 3.3. X.509 Authentication Framework .......................... 44 4. Related Activities ......................................... 45 5. Acknowledgments ............................................ 46 6. Security Considerations .................................... 46 7. Author's Address ........................................... 46 Appendix A .................................................... 47 Appendix B .................................................... 48 Appendix C .................................................... 49 1. GSS-API Characteristics and Concepts The operational paradigm in which GSS-API operates is as follows. A typical GSS-API caller is itself a communications protocol, calling on GSS-API in order to protect its communications with authentication, integrity, and/or confidentiality security services. A GSS-API caller accepts tokens provided to it by its local GSS-API implementation and transfers the tokens to a peer on a remote system; that peer passes the received tokens to its local GSS-API implementation for processing. The security services available through GSS-API in this fashion are implementable (and have been Linn [Page 2] RFC 1508 Generic Security Interface September 1993 implemented) over a range of underlying mechanisms based on secret- key and public-key cryptographic technologies. The GSS-API separates the operations of initializing a security context between peers, achieving peer entity authentication (This security service definition, and other definitions used in this document, corresponds to that provided in International Standard ISO 7498-2-1988(E), Security Architecture.) (GSS_Init_sec_context() and GSS_Accept_sec_context() calls), from the operations of providing per-message data origin authentication and data integrity protection (GSS_Sign() and GSS_Verify() calls) for messages subsequently transferred in conjunction with that context. Per-message GSS_Seal() and GSS_Unseal() calls provide the data origin authentication and data integrity services which GSS_Sign() and GSS_Verify() offer, and also support selection of confidentiality services as a caller option. Additional calls provide supportive functions to the GSS- API's users. The following paragraphs provide an example illustrating the dataflows involved in use of the GSS-API by a client and server in a mechanism-independent fashion, establishing a security context and transferring a protected message. The example assumes that credential acquisition has already been completed. The example assumes that the underlying authentication technology is capable of authenticating a client to a server using elements carried within a single token, and of authenticating the server to the client (mutual authentication) with a single returned token; this assumption holds for presently- documented CAT mechanisms but is not necessarily true for other cryptographic technologies and associated protocols. The client calls GSS_Init_sec_context() to establish a security context to the server identified by targ_name, and elects to set the mutual_req_flag so that mutual authentication is performed in the course of context establishment. GSS_Init_sec_context() returns an output_token to be passed to the server, and indicates GSS_CONTINUE_NEEDED status pending completion of the mutual authentication sequence. Had mutual_req_flag not been set, the initial call to GSS_Init_sec_context() would have returned GSS_COMPLETE status. The client sends the output_token to the server. The server passes the received token as the input_token parameter to GSS_Accept_sec_context(). GSS_Accept_sec_context indicates GSS_COMPLETE status, provides the client's authenticated identity in the src_name result, and provides an output_token to be passed to the client. The server sends the output_token to the client. The client passes the received token as the input_token parameter to a successor call to GSS_Init_sec_context(), which processes data Linn [Page 3] RFC 1508 Generic Security Interface September 1993 included in the token in order to achieve mutual authentication from the client's viewpoint. This call to GSS_Init_sec_context() returns GSS_COMPLETE status, indicating successful mutual authentication and the completion of context establishment for this example. The client generates a data message and passes it to GSS_Seal(). GSS_Seal() performs data origin authentication, data integrity, and (optionally) confidentiality processing on the message and encapsulates the result into output_message, indicating GSS_COMPLETE status. The client sends the output_message to the server. The server passes the received message to GSS_Unseal(). GSS_Unseal inverts the encapsulation performed by GSS_Seal(), deciphers the message if the optional confidentiality feature was applied, and validates the data origin authentication and data integrity checking quantities. GSS_Unseal() indicates successful validation by returning GSS_COMPLETE status along with the resultant output_message. For purposes of this example, we assume that the server knows by out-of-band means that this context will have no further use after one protected message is transferred from client to server. Given this premise, the server now calls GSS_Delete_sec_context() to flush context-level information. GSS_Delete_sec_context() returns a context_token for the server to pass to the client. The client passes the returned context_token to GSS_Process_context_token(), which returns GSS_COMPLETE status after deleting context-level information at the client system. The GSS-API design assumes and addresses several basic goals, including: Mechanism independence: The GSS-API defines an interface to cryptographically implemented strong authentication and other security services at a generic level which is independent of particular underlying mechanisms. For example, GSS-API-provided services can be implemented by secret-key technologies (e.g., Kerberos) or public-key approaches (e.g., X.509). Protocol environment independence: The GSS-API is independent of the communications protocol suites with which it is employed, permitting use in a broad range of protocol environments. In appropriate environments, an intermediate implementation "veneer" which is oriented to a particular communication protocol (e.g., Remote Procedure Call (RPC)) may be interposed between applications which call that protocol and the GSS-API, thereby invoking GSS-API facilities in conjunction with that protocol's Linn [Page 4] RFC 1508 Generic Security Interface September 1993 communications invocations. Protocol association independence: The GSS-API's security context construct is independent of communications protocol association constructs. This characteristic allows a single GSS-API implementation to be utilized by a variety of invoking protocol modules on behalf of those modules' calling applications. GSS-API services can also be invoked directly by applications, wholly independent of protocol associations. Suitability to a range of implementation placements: GSS-API clients are not constrained to reside within any Trusted Computing Base (TCB) perimeter defined on a system where the GSS-API is implemented; security services are specified in a manner suitable to both intra-TCB and extra-TCB callers. 1.1. GSS-API Constructs This section describes the basic elements comprising the GSS-API. 1.1.1. Credentials Credentials structures provide the prerequisites enabling peers to establish security contexts with each other. A caller may designate that its default credential be used for context establishment calls without presenting an explicit handle to that credential. Alternately, those GSS-API callers which need to make explicit selection of particular credentials structures may make references to those credentials through GSS-API-provided credential handles ("cred_handles"). A single credential structure may be used for initiation of outbound contexts and acceptance of inbound contexts. Callers needing to operate in only one of these modes may designate this fact when credentials are acquired for use, allowing underlying mechanisms to optimize their processing and storage requirements. The credential elements defined by a particular mechanism may contain multiple cryptographic keys, e.g., to enable authentication and message encryption to be performed with different algorithms. A single credential structure may accommodate credential information associated with multiple underlying mechanisms (mech_types); a credential structure's contents will vary depending on the set of mech_types supported by a particular GSS-API implementation. Commonly, a single mech_type will be used for all security contexts established by a particular initiator to a particular target; the primary motivation for supporting credential sets representing multiple mech_types is to allow initiators on systems which are Linn [Page 5] RFC 1508 Generic Security Interface September 1993 equipped to handle multiple types to initiate contexts to targets on other systems which can accommodate only a subset of the set supported at the initiator's system. It is the responsibility of underlying system-specific mechanisms and OS functions below the GSS-API to ensure that the ability to acquire and use credentials associated with a given identity is constrained to appropriate processes within a system. This responsibility should be taken seriously by implementors, as the ability for an entity to utilize a principal's credentials is equivalent to the entity's ability to successfully assert that principal's identity. Once a set of GSS-API credentials is established, the transferability of that credentials set to other processes or analogous constructs within a system is a local matter, not defined by the GSS-API. An example local policy would be one in which any credentials received as a result of login to a given user account, or of delegation of rights to that account, are accessible by, or transferable to, processes running under that account. The credential establishment process (particularly when performed on behalf of users rather than server processes) is likely to require access to passwords or other quantities which should be protected locally and exposed for the shortest time possible. As a result, it will often be appropriate for preliminary credential establishment to be performed through local means at user login time, with the result(s) cached for subsequent reference. These preliminary credentials would be set aside (in a system-specific fashion) for subsequent use, either: to be accessed by an invocation of the GSS-API GSS_Acquire_cred() call, returning an explicit handle to reference that credential as the default credentials installed on behalf of a process 1.1.2. Tokens Tokens are data elements transferred between GSS-API callers, and are divided into two classes. Context-level tokens are exchanged in order to establish and manage a security context between peers. Per-message tokens are exchanged in conjunction with an established context to provide protective security services for corresponding data messages. The internal contents of both classes of tokens are specific to the particular underlying mechanism used to support the GSS-API; Appendix B of this document provides a uniform recommendation for designers of GSS-API support mechanisms, encapsulating mechanism-specific information along with a globally-interpretable mechanism identifier. Linn [Page 6] RFC 1508 Generic Security Interface September 1993 Tokens are opaque from the viewpoint of GSS-API callers. They are generated within the GSS-API implementation at an end system, provided to a GSS-API caller to be transferred to the peer GSS-API caller at a remote end system, and processed by the GSS-API implementation at that remote end system. Tokens may be output by GSS-API primitives (and are to be transferred to GSS-API peers) independent of the status indications which those primitives indicate. Token transfer may take place in an in-band manner, integrated into the same protocol stream used by the GSS-API callers for other data transfers, or in an out-of-band manner across a logically separate channel. Development of GSS-API support primitives based on a particular underlying cryptographic technique and protocol does not necessarily imply that GSS-API callers invoking that GSS-API mechanism type will be able to interoperate with peers invoking the same technique and protocol outside the GSS-API paradigm. For example, the format of GSS-API tokens defined in conjunction with a particular mechanism, and the techniques used to integrate those tokens into callers' protocols, may not be the same as those used by non-GSS-API callers of the same underlying technique. 1.1.3. Security Contexts Security contexts are established between peers, using credentials established locally in conjunction with each peer or received by peers via delegation. Multiple contexts may exist simultaneously between a pair of peers, using the same or different sets of credentials. Coexistence of multiple contexts using different credentials allows graceful rollover when credentials expire. Distinction among multiple contexts based on the same credentials serves applications by distinguishing different message streams in a security sense. The GSS-API is independent of underlying protocols and addressing structure, and depends on its callers to transport GSS-API-provided data elements. As a result of these factors, it is a caller responsibility to parse communicated messages, separating GSS-API- related data elements from caller-provided data. The GSS-API is independent of connection vs. connectionless orientation of the underlying communications service. No correlation between security context and communications protocol association is dictated. (The optional channel binding facility, discussed in Section 1.1.6 of this document, represents an intentional exception to this rule, supporting additional protection features within GSS-API supporting mechanisms.) This separation allows the GSS-API to be used in a wide range of communications Linn [Page 7] RFC 1508 Generic Security Interface September 1993 environments, and also simplifies the calling sequences of the individual calls. In many cases (depending on underlying security protocol, associated mechanism, and availability of cached information), the state information required for context setup can be sent concurrently with initial signed user data, without interposing additional message exchanges. 1.1.4. Mechanism Types In order to successfully establish a security context with a target peer, it is necessary to identify an appropriate underlying mechanism type (mech_type) which both initiator and target peers support. The definition of a mechanism embodies not only the use of a particular cryptographic technology (or a hybrid or choice among alternative cryptographic technologies), but also definition of the syntax and semantics of data element exchanges which that mechanism will employ in order to support security services. It is recommended that callers initiating contexts specify the "default" mech_type value, allowing system-specific functions within or invoked by the GSS-API implementation to select the appropriate mech_type, but callers may direct that a particular mech_type be employed when necessary. The means for identifying a shared mech_type to establish a security context with a peer will vary in different environments and circumstances; examples include (but are not limited to): use of a fixed mech_type, defined by configuration, within an environment syntactic convention on a target-specific basis, through examination of a target's name lookup of a target's name in a naming service or other database in order to identify mech_types supported by that target explicit negotiation between GSS-API callers in advance of security context setup When transferred between GSS-API peers, mech_type specifiers (per Appendix B, represented as Object Identifiers (OIDs)) serve to qualify the interpretation of associated tokens. (The structure and encoding of Object Identifiers is defined in ISO/IEC 8824, "Specification of Abstract Syntax Notation One (ASN.1)" and in ISO/IEC 8825, "Specification of Basic Encoding Rules for Abstract Syntax Notation One (ASN.1)".) Use of hierarchically structured OIDs serves to preclude ambiguous interpretation of mech_type specifiers. Linn [Page 8] RFC 1508 Generic Security Interface September 1993 The OID representing the DASS MechType, for example, is 1.3.12.2.1011.7.5. 1.1.5. Naming The GSS-API avoids prescription of naming structures, treating the names transferred across the interface in order to initiate and accept security contexts as opaque octet string quantities. This approach supports the GSS-API's goal of implementability atop a range of underlying security mechanisms, recognizing the fact that different mechanisms process and authenticate names which are presented in different forms. Generalized services offering translation functions among arbitrary sets of naming environments are outside the scope of the GSS-API; availability and use of local conversion functions to translate among the naming formats supported within a given end system is anticipated. Two distinct classes of name representations are used in conjunction with different GSS-API parameters: a printable form (denoted by OCTET STRING), for acceptance from and presentation to users; printable name forms are accompanied by OID tags identifying the namespace to which they correspond an internal form (denoted by INTERNAL NAME), opaque to callers and defined by individual GSS-API implementations; GSS-API implementations supporting multiple namespace types are responsible for maintaining internal tags to disambiguate the interpretation of particular names Tagging of printable names allows GSS-API callers and underlying GSS-API mechanisms to disambiguate name types and to determine whether an associated name's type is one which they are capable of processing, avoiding aliasing problems which could result from misinterpreting a name of one type as a name of another type. In addition to providing means for names to be tagged with types, this specification defines primitives to support a level of naming environment independence for certain calling applications. To provide basic services oriented towards the requirements of callers which need not themselves interpret the internal syntax and semantics of names, GSS-API calls for name comparison (GSS_Compare_name()), human-readable display (GSS_Display_name()), input conversion (GSS_Import_name()), and internal name deallocation (GSS_Release_name()) functions are defined. (It is anticipated that these proposed GSS-API calls will be implemented in many end systems based on system-specific name manipulation primitives already extant within those end systems; inclusion within the GSS-API is intended to Linn [Page 9] RFC 1508 Generic Security Interface September 1993 offer GSS-API callers a portable means to perform specific operations, supportive of authorization and audit requirements, on authenticated names.) GSS_Import_name() implementations can, where appropriate, support more than one printable syntax corresponding to a given namespace (e.g., alternative printable representations for X.500 Distinguished Names), allowing flexibility for their callers to select among alternative representations. GSS_Display_name() implementations output a printable syntax selected as appropriate to their operational environments; this selection is a local matter. Callers desiring portability across alternative printable syntaxes should refrain from implementing comparisons based on printable name forms and should instead use the GSS_Compare_name() call to determine whether or not one internal-format name matches another. 1.1.6. Channel Bindings The GSS-API accommodates the concept of caller-provided channel binding ("chan_binding") information, used by GSS-API callers to bind the establishment of a security context to relevant characteristics (e.g., addresses, transformed representations of encryption keys) of the underlying communications channel and of protection mechanisms applied to that communications channel. Verification by one peer of chan_binding information provided by the other peer to a context serves to protect against various active attacks. The caller initiating a security context must determine the chan_binding values before making the GSS_Init_sec_context() call, and consistent values must be provided by both peers to a context. Callers should not assume that underlying mechanisms provide confidentiality protection for channel binding information. Use or non-use of the GSS-API channel binding facility is a caller option, and GSS-API supporting mechanisms can support operation in an environment where NULL channel bindings are presented. When non-NULL channel bindings are used, certain mechanisms will offer enhanced security value by interpreting the bindings' content (rather than simply representing those bindings, or signatures computed on them, within tokens) and will therefore depend on presentation of specific data in a defined format. To this end, agreements among mechanism implementors are defining conventional interpretations for the contents of channel binding arguments, including address specifiers (with content dependent on communications protocol environment) for context initiators and acceptors. (These conventions are being incorporated into related documents.) In order for GSS-API callers to be portable across multiple mechanisms and achieve the full security functionality available from each mechanism, it is strongly recommended that GSS-API callers provide channel bindings consistent Linn [Page 10] RFC 1508 Generic Security Interface September 1993 with these conventions and those of the networking environment in which they operate. 1.2. GSS-API Features and Issues This section describes aspects of GSS-API operations, of the security services which the GSS-API provides, and provides commentary on design issues. 1.2.1. Status Reporting Each GSS-API call provides two status return values. Major_status values provide a mechanism-independent indication of call status (e.g., GSS_COMPLETE, GSS_FAILURE, GSS_CONTINUE_NEEDED), sufficient to drive normal control flow within the caller in a generic fashion. Table 1 summarizes the defined major_status return codes in tabular fashion. Table 1: GSS-API Major Status Codes FATAL ERROR CODES GSS_BAD_BINDINGS channel binding mismatch GSS_BAD_MECH unsupported mechanism requested GSS_BAD_NAME invalid name provided GSS_BAD_NAMETYPE name of unsupported type provided GSS_BAD_STATUS invalid input status selector GSS_BAD_SIG token had invalid signature GSS_CONTEXT_EXPIRED specified security context expired GSS_CREDENTIALS_EXPIRED expired credentials detected GSS_DEFECTIVE_CREDENTIAL defective credential detected GSS_DEFECTIVE_TOKEN defective token detected GSS_FAILURE failure, unspecified at GSS-API level GSS_NO_CONTEXT no valid security context specified GSS_NO_CRED no valid credentials provided INFORMATORY STATUS CODES GSS_COMPLETE normal completion GSS_CONTINUE_NEEDED continuation call to routine required GSS_DUPLICATE_TOKEN duplicate per-message token detected GSS_OLD_TOKEN timed-out per-message token detected GSS_UNSEQ_TOKEN out-of-order per-message token detected Linn [Page 11] RFC 1508 Generic Security Interface September 1993 Minor_status provides more detailed status information which may include status codes specific to the underlying security mechanism. Minor_status values are not specified in this document. GSS_CONTINUE_NEEDED major_status returns, and optional message outputs, are provided in GSS_Init_sec_context() and GSS_Accept_sec_context() calls so that different mechanisms' employment of different numbers of messages within their authentication sequences need not be reflected in separate code paths within calling applications. Instead, such cases are accomodated with sequences of continuation calls to GSS_Init_sec_context() and GSS_Accept_sec_context(). The same mechanism is used to encapsulate mutual authentication within the GSS-API's context initiation calls. For mech_types which require interactions with third-party servers in order to establish a security context, GSS-API context establishment calls may block pending completion of such third-party interactions. On the other hand, no GSS-API calls pend on serialized interactions with GSS-API peer entities. As a result, local GSS-API status returns cannot reflect unpredictable or asynchronous exceptions occurring at remote peers, and reflection of such status information is a caller responsibility outside the GSS-API. 1.2.2. Per-Message Security Service Availability When a context is established, two flags are returned to indicate the set of per-message protection security services which will be available on the context: the integ_avail flag indicates whether per-message integrity and data origin authentication services are available the conf_avail flag indicates whether per-message confidentiality services are available, and will never be returned TRUE unless the integ_avail flag is also returned TRUE GSS-API callers desiring per-message security services should check the values of these flags at context establishment time, and must be aware that a returned FALSE value for integ_avail means that invocation of GSS_Sign() or GSS_Seal() primitives on the associated context will apply no cryptographic protection to user data messages. The GSS-API per-message protection service primitives, as the category name implies, are oriented to operation at the granularity of protocol data units. They perform cryptographic operations on the data units, transfer cryptographic control information in tokens, and, in the case of GSS_Seal(), encapsulate the protected data unit. Linn [Page 12] RFC 1508 Generic Security Interface September 1993 As such, these primitives are not oriented to efficient data protection for stream-paradigm protocols (e.g., Telnet) if cryptography must be applied on an octet-by-octet basis. 1.2.3. Per-Message Replay Detection and Sequencing Certain underlying mech_types are expected to offer support for replay detection and/or sequencing of messages transferred on the contexts they support. These optionally-selectable protection features are distinct from replay detection and sequencing features applied to the context establishment operation itself; the presence or absence of context-level replay or sequencing features is wholly a function of the underlying mech_type's capabilities, and is not selected or omitted as a caller option. The caller initiating a context provides flags (replay_det_req_flag and sequence_req_flag) to specify whether the use of per-message replay detection and sequencing features is desired on the context being established. The GSS-API implementation at the initiator system can determine whether these features are supported (and whether they are optionally selectable) as a function of mech_type, without need for bilateral negotiation with the target. When enabled, these features provide recipients with indicators as a result of GSS-API processing of incoming messages, identifying whether those messages were detected as duplicates or out-of-sequence. Detection of such events does not prevent a suspect message from being provided to a recipient; the appropriate course of action on a suspect message is a matter of caller policy. The semantics of the replay detection and sequencing services applied to received messages, as visible across the interface which the GSS- API provides to its clients, are as follows: When replay_det_state is TRUE, the possible major_status returns for well-formed and correctly signed messages are as follows: 1. GSS_COMPLETE indicates that the message was within the window (of time or sequence space) allowing replay events to be detected, and that the message was not a replay of a previously-processed message within that window. 2. GSS_DUPLICATE_TOKEN indicates that the signature on the received message was correct, but that the message was recognized as a duplicate of a previously-processed message. 3. GSS_OLD_TOKEN indicates that the signature on the received message was correct, but that the message is too old to be checked for duplication. Linn [Page 13] RFC 1508 Generic Security Interface September 1993 When sequence_state is TRUE, the possible major_status returns for well-formed and correctly signed messages are as follows: 1. GSS_COMPLETE indicates that the message was within the window (of time or sequence space) allowing replay events to be detected, and that the message was not a replay of a previously-processed message within that window. 2. GSS_DUPLICATE_TOKEN indicates that the signature on the received message was correct, but that the message was recognized as a duplicate of a previously-processed message. 3. GSS_OLD_TOKEN indicates that the signature on the received message was correct, but that the token is too old to be checked for duplication. 4. GSS_UNSEQ_TOKEN indicates that the signature on the received message was correct, but that it is earlier in a sequenced stream than a message already processed on the context. [Note: Mechanisms can be architected to provide a stricter form of sequencing service, delivering particular messages to recipients only after all predecessor messages in an ordered stream have been delivered. This type of support is incompatible with the GSS-API paradigm in which recipients receive all messages, whether in order or not, and provide them (one at a time, without intra-GSS- API message buffering) to GSS-API routines for validation. GSS- API facilities provide supportive functions, aiding clients to achieve strict message stream integrity in an efficient manner in conjunction with sequencing provisions in communications protocols, but the GSS-API does not offer this level of message stream integrity service by itself.] As the message stream integrity features (especially sequencing) may interfere with certain applications' intended communications paradigms, and since support for such features is likely to be resource intensive, it is highly recommended that mech_types supporting these features allow them to be activated selectively on initiator request when a context is established. A context initiator and target are provided with corresponding indicators (replay_det_state and sequence_state), signifying whether these features are active on a given context. An example mech_type supporting per-message replay detection could (when replay_det_state is TRUE) implement the feature as follows: The underlying mechanism would insert timestamps in data elements output by GSS_Sign() and GSS_Seal(), and would maintain (within a time- limited window) a cache (qualified by originator-recipient pair) identifying received data elements processed by GSS_Verify() and Linn [Page 14] RFC 1508 Generic Security Interface September 1993 GSS_Unseal(). When this feature is active, exception status returns (GSS_DUPLICATE_TOKEN, GSS_ OLD_TOKEN) will be provided when GSS_Verify() or GSS_Unseal() is presented with a message which is either a detected duplicate of a prior message or which is too old to validate against a cache of recently received messages. 1.2.4. Quality of Protection Some mech_types will provide their users with fine granularity control over the means used to provide per-message protection, allowing callers to trade off security processing overhead dynamically against the protection requirements of particular messages. A per-message quality-of-protection parameter (analogous to quality-of-service, or QOS) selects among different QOP options supported by that mechanism. On context establishment for a multi-QOP mech_type, context-level data provides the prerequisite data for a range of protection qualities. It is expected that the majority of callers will not wish to exert explicit mechanism-specific QOP control and will therefore request selection of a default QOP. Definitions of, and choices among, non- default QOP values are mechanism-specific, and no ordered sequences of QOP values can be assumed equivalent across different mechanisms. Meaningful use of non-default QOP values demands that callers be familiar with the QOP definitions of an underlying mechanism or mechanisms, and is therefore a non-portable construct. 2. Interface Descriptions This section describes the GSS-API's service interface, dividing the set of calls offered into four groups. Credential management calls are related to the acquisition and release of credentials by principals. Context-level calls are related to the management of security contexts between principals. Per-message calls are related to the protection of individual messages on established security contexts. Support calls provide ancillary functions useful to GSS-API callers. Table 2 groups and summarizes the calls in tabular fashion. Linn [Page 15] RFC 1508 Generic Security Interface September 1993 Table 2: GSS-API Calls CREDENTIAL MANAGEMENT GSS_Acquire_cred acquire credentials for use GSS_Release_cred release credentials after use GSS_Inquire_cred display information about credentials CONTEXT-LEVEL CALLS GSS_Init_sec_context initiate outbound security context GSS_Accept_sec_context accept inbound security context GSS_Delete_sec_context flush context when no longer needed GSS_Process_context_token process received control token on context GSS_Context_time indicate validity time remaining on context PER-MESSAGE CALLS GSS_Sign apply signature, receive as token separate from message GSS_Verify validate signature token along with message GSS_Seal sign, optionally encrypt, encapsulate GSS_Unseal decapsulate, decrypt if needed, validate signature SUPPORT CALLS GSS_Display_status translate status codes to printable form GSS_Indicate_mechs indicate mech_types supported on local system GSS_Compare_name compare two names for equality GSS_Display_name translate name to printable form GSS_Import_name convert printable name to normalized form GSS_Release_name free storage of normalized-form name GSS_Release_buffer free storage of printable name GSS_Release_oid_set free storage of OID set object Linn [Page 16] RFC 1508 Generic Security Interface September 1993 2.1. Credential management calls These GSS-API calls provide functions related to the management of credentials. Their characterization with regard to whether or not they may block pending exchanges with other network entities (e.g., directories or authentication servers) depends in part on OS-specific (extra-GSS-API) issues, so is not specified in this document. The GSS_Acquire_cred() call is defined within the GSS-API in support of application portability, with a particular orientation towards support of portable server applications. It is recognized that (for certain systems and mechanisms) credentials for interactive users may be managed differently from credentials for server processes; in such environments, it is the GSS-API implementation's responsibility to distinguish these cases and the procedures for making this distinction are a local matter. The GSS_Release_cred() call provides a means for callers to indicate to the GSS-API that use of a credentials structure is no longer required. The GSS_Inquire_cred() call allows callers to determine information about a credentials structure. 2.1.1. GSS_Acquire_cred call Inputs: o desired_name INTERNAL NAME, -NULL requests locally-determined default o lifetime_req INTEGER,-in seconds; 0 requests default o desired_mechs SET OF OBJECT IDENTIFIER,-empty set requests system-selected default o cred_usage INTEGER-0=INITIATE-AND-ACCEPT, 1=INITIATE-ONLY, 2=ACCEPT-ONLY Outputs: o major_status INTEGER, o minor_status INTEGER, o output_cred_handle OCTET STRING, o actual_mechs SET OF OBJECT IDENTIFIER, o lifetime_rec INTEGER -in seconds, or reserved value for INDEFINITE Linn [Page 17] RFC 1508 Generic Security Interface September 1993 Return major_status codes: o GSS_COMPLETE indicates that requested credentials were successfully established, for the duration indicated in lifetime_rec, suitable for the usage requested in cred_usage, for the set of mech_types indicated in actual_mechs, and that those credentials can be referenced for subsequent use with the handle returned in output_cred_handle. o GSS_BAD_MECH indicates that a mech_type unsupported by the GSS-API implementation type was requested, causing the credential establishment operation to fail. o GSS_BAD_NAMETYPE indicates that the provided desired_name is uninterpretable or of a type unsupported by the supporting GSS-API implementation, so no credentials could be established for the accompanying desired_name. o GSS_BAD_NAME indicates that the provided desired_name is inconsistent in terms of internally-incorporated type specifier information, so no credentials could be established for the accompanying desired_name. o GSS_FAILURE indicates that credential establishment failed for reasons unspecified at the GSS-API level, including lack of authorization to establish and use credentials associated with the identity named in the input desired_name argument. GSS_Acquire_cred() is used to acquire credentials so that a principal can (as a function of the input cred_usage parameter) initiate and/or accept security contexts under the identity represented by the desired_name input argument. On successful completion, the returned output_cred_handle result provides a handle for subsequent references to the acquired credentials. Typically, single-user client processes using only default credentials for context establishment purposes will have no need to invoke this call. A caller may provide the value NULL for desired_name, signifying a request for credentials corresponding to a default principal identity. The procedures used by GSS-API implementations to select the appropriate principal identity in response to this form of request are local matters. It is possible that multiple pre- established credentials may exist for the same principal identity (for example, as a result of multiple user login sessions) when GSS_Acquire_cred() is called; the means used in such cases to select a specific credential are local matters. The input lifetime_req argument to GSS_Acquire_cred() may provide useful information for local GSS-API implementations to employ in making this disambiguation Linn [Page 18] RFC 1508 Generic Security Interface September 1993 in a manner which will best satisfy a caller's intent. The lifetime_rec result indicates the length of time for which the acquired credentials will be valid, as an offset from the present. A mechanism may return a reserved value indicating INDEFINITE if no constraints on credential lifetime are imposed. A caller of GSS_Acquire_cred() can request a length of time for which acquired credentials are to be valid (lifetime_req argument), beginning at the present, or can request credentials with a default validity interval. (Requests for postdated credentials are not supported within the GSS-API.) Certain mechanisms and implementations may bind in credential validity period specifiers at a point preliminary to invocation of the GSS_Acquire_c