Warning
This is a work in progress, largely intended to solicit the opinion of interested parties.
Introduction¶
GSSAPI is a standard for secure communications between two parties. Notably, it has become the de-facto standard portable API for Kerberos, so much so that “GSSAPI” often implies “Kerberos” despite the existence of things like SPKM and LIPKEY.
GSSAPI is, at its core, an online client/server (“initiator” and “acceptor” in its terminology) architecture. The basic flow of communication is to initiate a “context” (and have that context be accepted) before messages may be passed within that context, using, optionally, confidentiality and integrity mechanisms provided by the underlying cryptographic mechanism. That is, Alice may establish a context for secure communication with Bob, and another for Carol, and so on. (Other things are possible, including delegation of identity or rights and replay detection on the stream of messages, but these are not germane to this document.)
However, GSSAPI has no intrinsic mechanism for asynchronous communication with another party; there is no mechanism, Alice having established a context with Bob (and, optionally, Carol), for Alice (or Bob) to seal or box a message such that it can be passed to Carol, who can then forward it to Bob in a verifiable, confidential way. Bob should be able to verify that
Alice sealed this message,
Bob was indeed the intended recipient,
(optionally) that Carol was the intended relaying party,
(optionally) that the message was sealed recently, and
(optionally) that the message has not been replayed by Carol (or another agent).
Neither Carol nor any other agent should be able to learn anything about the message body (except an approximation of its length) or the identities of Alice, Bob, or Carol from the message itself.
Another way to think about the intended use of sealing is that Alice may wish to allow Carol to prove to Bob that Alice and Carol are in communication and to reliably prove Alice’s opinions of that communication to Bob. For intuition, imagine Alice as something akin to a Kerberos TGS, having active contexts with both Bob and Carol; Alice’s sealing of a message for Carol to give to Bob is akin to granting a service ticket. The key is that the sealed message carries the identities of its originator (Alice) and relaying party (Carol) and may only be unsealed by its recipient (Bob).
API Calls¶
GSS_Wrap2(as performed by Alice):Inputs:
recipient_context_handleCONTEXT HANDLE(with Bob),relaying_context_handleCONTEXT HANDLE(with Carol, optional),freshness_stampINTEGER,input_messageOCTET STRING
Outputs:
major_statusINTEGER,minor_statusINTEGER,output_messageOCTET STRING– caller to release withGSS_Release_buffer()
The
freshness_stampparameter is one ofGSS_WRAP_FRESH_TIMESERIAL,GSS_WRAP_FRESH_TIMEONLY, orGSS_WRAP_FRESH_NONE.The existing
GSS_Wrapcall is equivalent toGSS_Wrap2withrelaying_context_handle = NULLandfreshness_stamp = GSS_WRAP_FRESH_NONE, and a call toGSS_Wrap2satisfying these conditions may not fail unless the equivalent call toGSS_Wrapwould.GSS_Unwrap2(as performed by Bob):Inputs:
context_handleCONTEXT HANDLE(with Carol),req_freshnessINTEGER,input_messageOCTET STRING(from Carol, originally produced by Alice)
Outputs:
major_statusINTEGER,minor_statusINTEGER,output_messageOCTET STRING– caller to release withGSS_Release_buffer()cred_nameINTERNAL NAME– caller to release withGSS_Release_name()is_relayerINTEGER
is_relayerindicates whether the remote credential ofcontext_handleis the same credential as the remote credential of therelaying_context_handlegiven toGSS_Wrap2. Possible values areGSS_WRAP_ISRELAY_POSITIVE, indicating explicit confirmation;GSS_WRAP_ISRELAY_NEGATIVE, indicating explicit denial; orGSS_WRAP_ISRELAY_UNSPECIFIED, indicating that norelaying_context_handlewas given toGSS_Wrap2.
If
GSS_Unwrap2is successful,output_messagemust match theinput_messageused in the call toGSS_Wrap2to produce theinput_messagefed toGSS_Unwrap2andcred_namemust describe Alice. (In particular,cred_nameshould be equal to the name that would be obtained as the remote half of Bob’s half of Alice’srecipient_context_handle.)Note that
GSS_Unwrap2is a superset ofGSS_Unwrap. If theinput_messagetoGSS_Unwrap2was produced withGSS_Wrapor with an equivalentGSS_Wrap2call,cred_namemust be NULL andis_relayermust beGSS_WRAP_ISRELAY_UNSPECIFIED.