rfc-8353

Generic Security Service API Version 2: Java Bindings Update

M. Upadhyay, S. Malkani, W. Wang
date2018-05 streamIETF areasec wgkitten statusPROPOSED STANDARD pages96 canonicalhttps://www.rfc-editor.org/rfc/rfc8353 doi10.17487/RFC8353
The Generic Security Services Application Programming Interface (GSS-API) offers application programmers uniform access to security services atop a variety of underlying cryptographic mechanisms. This document updates the Java bindings for the GSS-API that are specified in "Generic Security Service API Version 2: Java Bindings Update" (RFC 5653). This document obsoletes RFC 5653 by adding a new output token field to the GSSException class so that when the initSecContext or acceptSecContext methods of the GSSContext class fail, it has a chance to emit an error token that can be sent to the peer for debugging or informational purpose. The stream-based GSSContext methods are also removed in this version. The GSS-API is described at a language-independent conceptual level in "Generic Security Service Application Program Interface Version 2, Update 1" (RFC 2743). The GSS-API allows a caller application to authenticate a principal identity, to delegate rights to a peer, and to apply security services such as confidentiality and integrity on a per-message basis. Examples of security mechanisms defined for GSS-API are "The Simple Public-Key GSS-API Mechanism (SPKM)" (RFC 2025) and "The Kerberos Version 5 Generic Security Service Application Program Interface (GSS-API) Mechanism: Version 2" (RFC 4121).

obsoletes

Extracted elements (30)

design-rationale §5.12

Java exceptions replace the C-bindings major/minor status code return mechanism for signaling fatal errors. Supplementary non-fatal status (duplicate/old/out-of-sequence tokens) is returned via the MessageProp object rather than exceptions, since exceptions are not appropriate for informational or warning-level conditions.

security

design-rationale §5.7

Java's automatic garbage collection and immutable Oid objects eliminate the need for several C-binding routines: gss_release_name, gss_duplicate_name, gss_create_empty_oid_set, gss_release_oid_set, and gss_add_oid_set_member are not present in the Java API.

security

design-rationale §1

RFC 8353 obsoletes RFC 5653 by adding a new output token field to the GSSException class, so that when initSecContext or acceptSecContext fail, the mechanism has a chance to emit an error token that can be sent to the peer for debugging or informational purposes.

security, crypto

design-rationale §11

Stream-based GSSContext methods are removed in this version. This simplifies the API by eliminating overloads that accepted InputStream/OutputStream parameters, which duplicated functionality available through byte-array variants.

security, crypto

design-rationale §5.2

The GSS-API Java bindings leverage the Java Cryptography Architecture (JCA) provider model to support plugability of security mechanisms. Mechanisms can be added system-wide or per-instance of the GSS-API, allowing seamless switching between implementations without application changes.

security, crypto

interoperability-note §11

RFC 8353 obsoletes RFC 5653. The two changes are: (1) a new getOutputToken() method on GSSException enabling error tokens from failed initSecContext/acceptSecContext to be forwarded to the peer, and (2) removal of all stream-based GSSContext methods that accepted InputStream/OutputStream parameters.

security

interoperability-note §6.4

The GSSContext interface does not include gss_process_context_token functionality, and gss_delete_sec_context is modified to not return any peer tokens, in accordance with RFC 2743 recommendations.

security

normative-requirement §5.8 SHOULD

All principal identities asserted by a single GSS-API credential SHOULD belong to the same entity. A GSSName object MAY contain multiple names from different namespaces, but all names SHOULD refer to the same entity.

security

normative-requirement §5.14 SHOULD NOT

Applications SHOULD NOT use confidential data as channel-binding components because some mechanisms may include the actual channel-binding data (not just a MIC) in the token, potentially exposing it to the peer.

security, crypto

normative-requirement §4.6 MUST

Applications using inter-process tokens to transfer security contexts MUST take appropriate steps to protect these tokens in transit, as they MAY contain sensitive data including cryptographic keys.

security, crypto

normative-requirement §5.12 MUST

If a GSSException is thrown during context establishment, the context negotiation has failed and the GSSContext object MUST be abandoned. If thrown in a per-message call, the context MAY remain useful.

security

normative-requirement §5.9 SHOULD

If any retrieved context attribute does not match the desired value but is necessary for the application protocol, the application SHOULD destroy the security context and not use it for application traffic.

security

normative-requirement §4.1 MUST NOT

If the application instructs the GSSContext object that delegation is not desired, the implementation MUST NOT permit delegation to occur. Delegation may only be provided at the explicit request of the application; this overrides the general rule that mechanisms may enable unrequested services.

security

normative-requirement §7.1 REQUIRED

Platform providers of GSS are REQUIRED not to add any constructors to the GSSManager class (whether private, public, or protected), ensuring that all subclasses invoke only the default constructor provided by the compiler.

security

normative-requirement §4.4 MUST

When using the equals method of GSSName and one operand is a GSSName representing an anonymous entity, the method MUST return 'false'.

security, privacy

normative-requirement §5.15 SHALL

Whenever the application wishes to omit an optional parameter, the 'null' value SHALL be used. Method overloading is also used as a technique to indicate default parameters.

security

privacy-consideration §4.4

Anonymous authentication (requestAnonymity) allows a context initiator to authenticate without revealing its identity to the acceptor. The printable form of an anonymous GSSName SHOULD imply anonymity (e.g., '<anonymous>'), and the associated name-type OID MUST be NT_ANONYMOUS. Anonymous names MUST compare unequal to all other names including other anonymous names.

privacy, security

protocol-element §5.1

All GSS-API classes and interfaces reside in the package 'org.ietf.jgss'. Applications must import this package to use the API.

security

protocol-element §7.6

ChannelBinding encapsulates channel-binding information (optional InetAddress for initiator/acceptor and application-specific byte array) to bind a GSS-API context to a specific communications channel. The mechanism computes a MIC over the concatenated binding data and includes it in the context-establishment token.

security, crypto

protocol-element §5.12.1

GSS Status Codes are static integer constants in GSSException ranging from BAD_BINDINGS (1) to NAME_NOT_MN (18) for fatal generic errors, plus DUPLICATE_TOKEN (19), OLD_TOKEN (20), UNSEQ_TOKEN (21), and GAP_TOKEN (22) which are fatal only during context establishment and supplementary during per-message calls.

security

protocol-element §7.4

GSSContext is the central interface encapsulating security context state for one peer, including cryptographic keys and sequence numbers. It provides initSecContext and acceptSecContext for establishment, wrap/unwrap and getMIC/verifyMIC for per-message protection, and export for inter-process transfer.

security, crypto

protocol-element §7.3

GSSCredential represents GSS-API credentials and may contain multiple mechanism-specific credential elements. It provides getName, getRemainingLifetime, getUsage, getMechs, and add methods; the interface implements Cloneable.

security, crypto

protocol-element §7.8

GSSException extends Exception and signals fatal GSS-API errors via major status codes (BAD_BINDINGS=1 through NAME_NOT_MN=18, and DUPLICATE_TOKEN=19 through GAP_TOKEN=22) and mechanism-specific minor codes. A new getOutputToken() method (added by RFC 8353) returns an optional error token to send to the peer.

security

protocol-element §7.1

GSSManager is an abstract factory class that instantiates GSSName, GSSCredential, and GSSContext objects, and provides mechanism query methods (getMechs, getNamesForMech, getMechsForName). A default instance is obtained via getInstance(); subclasses may be provided for custom implementations.

security, crypto

protocol-element §7.2

GSSName represents principal identities and may contain multiple names from different namespaces referring to the same entity. Key operations are equals (name comparison), canonicalize (convert to mechanism name), export (produce byte-array MN form importable as NT_EXPORT_NAME), and toString.

security

protocol-element §7.5

MessageProp is a helper class passed into per-message calls (wrap, unwrap, getMIC, verifyMIC) to convey QOP, privacy (confidentiality) settings, and supplementary status: isDuplicateToken, isOldToken, isUnseqToken, isGapToken.

security

protocol-element §7.7

The Oid class represents ASN.1 Object Identifiers in immutable form, constructable from dot-notation strings (e.g., '1.3.6.1.5.6.2') or DER encoding. Its immutability allows safe sharing across threads. The containedIn method implements gss_test_oid_set_member.

security

security-consideration §9

Inter-process tokens exported via GSSContext.export() may contain sensitive security context data including cryptographic session keys. Applications must ensure these tokens are transmitted only to trustworthy processes and protected against interception during transfer.

security, crypto

security-consideration §9

The new output token returned by GSSException.getOutputToken() when initSecContext or acceptSecContext fail may contain mechanism-specific diagnostic information. Implementations and applications should consider whether transmitting this error token to the peer could leak sensitive information about the failure cause.

security

state-machine §3

GSS-API usage follows four stages: (1) credential acquisition, where the application obtains credentials proving its identity; (2) security context establishment between peers using initSecContext/acceptSecContext; (3) per-message protection using getMIC/wrap/verifyMIC/unwrap; (4) context invalidation via dispose to release cryptographic resources.

security, crypto