Update gnulib files.
[shishi.git] / doc / specifications / draft-ietf-cat-kerberos-pk-init-16.txt
blobdc0fb811c56c36ee7c7e5cbe6654c84225aa5bdf
2 INTERNET-DRAFT                                                Brian Tung
3 draft-ietf-cat-kerberos-pk-init-16.txt                   Clifford Neuman
4 Updates: RFC 1510bis                                             USC/ISI
5 expires March 12, 2002                                       Matthew Hur
6                                                    Microsoft Corporation
7                                                            Ari Medvinsky
8                                                    Liberate Technologies
9                                                          Sasha Medvinsky
10                                                           Motorola, Inc.
11                                                                John Wray
12                                                    Iris Associates, Inc.
13                                                         Jonathan Trostle
15     Public Key Cryptography for Initial Authentication in Kerberos
17 0.  Status Of This Memo
19     This document is an Internet-Draft and is in full conformance with
20     all provisions of Section 10 of RFC 2026.  Internet-Drafts are
21     working documents of the Internet Engineering Task Force (IETF),
22     its areas, and its working groups.  Note that other groups may also
23     distribute working documents as Internet-Drafts.
25     Internet-Drafts are draft documents valid for a maximum of six
26     months and may be updated, replaced, or obsoleted by other
27     documents at any time.  It is inappropriate to use Internet-Drafts
28     as reference material or to cite them other than as "work in
29     progress."
31     The list of current Internet-Drafts can be accessed at
32     http://www.ietf.org/ietf/1id-abstracts.txt
34     The list of Internet-Draft Shadow Directories can be accessed at
35     http://www.ietf.org/shadow.html.
37     To learn the current status of any Internet-Draft, please check
38     the "1id-abstracts.txt" listing contained in the Internet-Drafts
39     Shadow Directories on ftp.ietf.org (US East Coast),
40     nic.nordu.net (Europe), ftp.isi.edu (US West Coast), or
41     munnari.oz.au (Pacific Rim).
43     The distribution of this memo is unlimited.  It is filed as
44     draft-ietf-cat-kerberos-pk-init-16.txt, and expires March 12,
45     2002.  Please send comments to the authors.
47 1.  Abstract
49     This document defines extensions (PKINIT) to the Kerberos protocol
50     specification (RFC 1510bis [1]) to provide a method for using public
51     key cryptography during initial authentication.  The methods
52     defined specify the ways in which preauthentication data fields and
53     error data fields in Kerberos messages are to be used to transport
54     public key data.
56 2.  Introduction
58     The popularity of public key cryptography has produced a desire for
59     its support in Kerberos [2].  The advantages provided by public key
60     cryptography include simplified key management (from the Kerberos
61     perspective) and the ability to leverage existing and developing
62     public key certification infrastructures.
64     Public key cryptography can be integrated into Kerberos in a number
65     of ways.  One is to associate a key pair with each realm, which can
66     then be used to facilitate cross-realm authentication; this is the
67     topic of another draft proposal.  Another way is to allow users with
68     public key certificates to use them in initial authentication.  This
69     is the concern of the current document.
71     PKINIT utilizes ephemeral-ephemeral Diffie-Hellman keys in
72     combination with RSA keys as the primary, required mechanism.  Note
73     that PKINIT supports the use of separate signature and encryption
74     keys.
76     PKINIT enables access to Kerberos-secured services based on initial
77     authentication utilizing public key cryptography.  PKINIT utilizes
78     standard public key signature and encryption data formats within the
79     standard Kerberos messages.  The basic mechanism is as follows:  The
80     user sends an AS-REQ message to the KDC as before, except that if that
81     user is to use public key cryptography in the initial authentication
82     step, his certificate and a signature accompany the initial request
83     in the preauthentication fields.  Upon receipt of this request, the
84     KDC verifies the certificate and issues a ticket granting ticket
85     (TGT) as before, except that the encPart from the AS-REP message
86     carrying the TGT is now encrypted utilizing either a Diffie-Hellman
87     derived key or the user's public key.  This message is authenticated
88     utilizing the public key signature of the KDC.
90     Note that PKINIT does not require the use of certificates.  A KDC
91     may store the public key of a principal as part of that principal's
92     record.  In this scenario, the KDC is the trusted party that vouches
93     for the principal (as in a standard, non-cross realm, Kerberos
94     environment).  Thus, for any principal, the KDC may maintain a
95     symmetric key, a public key, or both.
97     The PKINIT specification may also be used as a building block for
98     other specifications.  PKINIT may be utilized to establish
99     inter-realm keys for the purposes of issuing cross-realm service
100     tickets.  It may also be used to issue anonymous Kerberos tickets
101     using the Diffie-Hellman option.  Efforts are under way to draft
102     specifications for these two application protocols.
104     Additionally, the PKINIT specification may be used for direct peer
105     to peer authentication without contacting a central KDC. This
106     application of PKINIT is based on concepts introduced in [6, 7].
107     For direct client-to-server authentication, the client uses PKINIT
108     to authenticate to the end server (instead of a central KDC), which
109     then issues a ticket for itself.  This approach has an advantage
110     over TLS [5] in that the server does not need to save state (cache
111     session keys).  Furthermore, an additional benefit is that Kerberos
112     tickets can facilitate delegation (see [6]).
114 3.  Proposed Extensions
116     This section describes extensions to RFC 1510bis for supporting the
117     use of public key cryptography in the initial request for a ticket
118     granting ticket (TGT).
120     In summary, the following change to RFC 1510bis is proposed:
122         * Users may authenticate using either a public key pair or a
123           conventional (symmetric) key.  If public key cryptography is
124           used, public key data is transported in preauthentication
125           data fields to help establish identity.  The user presents
126           a public key certificate and obtains an ordinary TGT that may
127           be used for subsequent authentication, with such
128           authentication using only conventional cryptography.
130     Section 3.1 provides definitions to help specify message formats.
131     Section 3.2 describes the extensions for the initial authentication
132     method.
134 3.1.  Definitions
136     The extensions involve new preauthentication fields; we introduce
137     the following preauthentication types:
139         PA-PK-AS-REQ                            14
140         PA-PK-AS-REP                            15
142     The extensions also involve new error types; we introduce the
143     following types:
145         KDC_ERR_CLIENT_NOT_TRUSTED              62
146         KDC_ERR_KDC_NOT_TRUSTED                 63
147         KDC_ERR_INVALID_SIG                     64
148         KDC_ERR_KEY_TOO_WEAK                    65
149         KDC_ERR_CERTIFICATE_MISMATCH            66
150         KDC_ERR_CANT_VERIFY_CERTIFICATE         70
151         KDC_ERR_INVALID_CERTIFICATE             71
152         KDC_ERR_REVOKED_CERTIFICATE             72
153         KDC_ERR_REVOCATION_STATUS_UNKNOWN       73
154         KDC_ERR_REVOCATION_STATUS_UNAVAILABLE   74
155         KDC_ERR_CLIENT_NAME_MISMATCH            75
156         KDC_ERR_KDC_NAME_MISMATCH               76
158     We utilize the following typed data for errors:
160         TD-PKINIT-CMS-CERTIFICATES             101
161         TD-DH-PARAMETERS                       102
162         TD-TRUSTED-CERTIFIERS                  104
163         TD-CERTIFICATE-INDEX                   105
165     We utilize the following encryption types (which map directly to
166     OIDs):
168         dsaWithSHA1-CmsOID                       9
169         md5WithRSAEncryption-CmsOID             10
170         sha1WithRSAEncryption-CmsOID            11
171         rc2CBC-EnvOID                           12
172         rsaEncryption-EnvOID (PKCS#1 v1.5)      13
173         rsaES-OAEP-ENV-OID   (PKCS#1 v2.0)      14
174         des-ede3-cbc-Env-OID                    15
176     These mappings are provided so that a client may send the
177     appropriate enctypes in the AS-REQ message in order to indicate
178     support for the corresponding OIDs (for performing PKINIT).  The
179     above encryption types are utilized only within CMS structures
180     within the PKINIT preauthentication fields. Their use within
181     the Kerberos EncryptedData structure is unspecified.
183     In many cases, PKINIT requires the encoding of the X.500 name of a
184     certificate authority as a Realm.  When such a name appears as
185     a realm it will be represented using the "Other" form of the realm
186     name as specified in the naming constraints section of RFC 1510bis.
187     For a realm derived from an X.500 name, NAMETYPE will have the value
188     X500-RFC2253.  The full realm name will appear as follows:
190         <nametype> + ":" + <string>
192     where nametype is "X500-RFC2253" and string is the result of doing
193     an RFC2253 encoding of the distinguished name, i.e.
195         "X500-RFC2253:" + RFC2253Encode(DistinguishedName)
197     where DistinguishedName is an X.500 name, and RFC2253Encode is a
198     function returing a readable UTF encoding of an X.500 name, as
199     defined by RFC 2253 [11] (part of LDAPv3 [15]).
201     Each component of a DistinguishedName is called a
202     RelativeDistinguishedName, where a RelativeDistinguishedName is a
203     SET OF AttributeTypeAndValue.  RFC 2253 does not specify the order
204     in which to encode the elements of the RelativeDistinguishedName and
205     so to ensure that this encoding is unique, we add the following rule
206     to those specified by RFC 2253:
207      
208         When converting a multi-valued RelativeDistinguishedName
209         to a string, the output consists of the string encodings
210         of each AttributeTypeAndValue, in the same order as
211         specified by the DER encoding.    
213     Similarly, in cases where the KDC does not provide a specific
214     policy-based mapping from the X.500 name or X.509 Version 3
215     SubjectAltName extension in the user's certificate to a Kerberos
216     principal name, PKINIT requires the direct encoding of the X.500
217     name as a PrincipalName.  In this case, the name-type of the
218     principal name MUST be set to KRB_NT-X500-PRINCIPAL.  This new
219     name type is defined in RFC 1510bis as:
221         KRB_NT_X500_PRINCIPAL    6
223     For this type, the name-string MUST be set as follows:
225         RFC2253Encode(DistinguishedName)
227     as described above.  When this name type is used, the principal's
228     realm MUST be set to the certificate authority's distinguished
229     name using the X500-RFC2253 realm name format described earlier in
230     this section.
232     Note that the same string may be represented using several different
233     ASN.1 data types.  As the result, the reverse conversion from an
234     RFC2253-encoded principal name back to an X.500 name may not be
235     unique and may result in an X.500 name that is not the same as the
236     original X.500 name found in the client certificate.
238     RFC 1510bis describes an alternate encoding of an X.500 name into a
239     realm name.  However, as described in RFC 1510bis, the alternate
240     encoding does not guarantee a unique mapping from a
241     DistinguishedName inside a certificate into a realm name and
242     similarly cannot be used to produce a unique principal name.  PKINIT
243     therefore uses an RFC 2253-based name mapping approach, as specified
244     above.
246     RFC 1510bis specifies the ASN.1 structure for PrincipalName as follows:
248         PrincipalName ::=   SEQUENCE {
249                         name-type[0]     INTEGER,
250                         name-string[1]   SEQUENCE OF GeneralString
251         }
253     The following rules relate to the the matching of PrincipalNames
254     with regard to the PKI name constraints for CAs as laid out in RFC
255     2459 [12].  In order to be regarded as a match (for permitted and
256     excluded name trees), the following MUST be satisfied.
258         1.  If the constraint is given as a user plus realm name, or
259             as a client principal name plus realm name (as specified in
260             RFC 1510bis), the realm name MUST be valid (see 2.a-d below)
261             and the match MUST be exact, byte for byte.
263         2.  If the constraint is given only as a realm name, matching
264             depends on the type of the realm:
266             a.  If the realm contains a colon (':') before any equal
267                 sign ('='), it is treated as a realm of type Other,
268                 and MUST match exactly, byte for byte.
270             b.  Otherwise, if the realm name conforms to rules regarding
271                 the format of DNS names, it is considered a realm name of
272                 type Domain.  The constraint may be given as a realm
273                 name 'FOO.BAR', which matches any PrincipalName within
274                 the realm 'FOO.BAR' but not those in subrealms such as
275                 'CAR.FOO.BAR'.  A constraint of the form '.FOO.BAR'
276                 matches PrincipalNames in subrealms of the form
277                 'CAR.FOO.BAR' but not the realm 'FOO.BAR' itself.
279             c.  Otherwise, the realm name is invalid and does not match
280                 under any conditions.
282 3.1.1.  Encryption and Key Formats
284     In the exposition below, we use the terms public key and private
285     key generically.  It should be understood that the term "public
286     key" may be used to refer to either a public encryption key or a
287     signature verification key, and that the term "private key" may be
288     used to refer to either a private decryption key or a signature
289     generation key.  The fact that these are logically distinct does
290     not preclude the assignment of bitwise identical keys for RSA
291     keys.
293     In the case of Diffie-Hellman, the key is produced from the agreed
294     bit string as follows:
296         * Truncate the bit string to the required length.
297         * Apply the specific cryptosystem's random-to-key function.
299     Appropriate key constraints for each valid cryptosystem are given
300     in RFC 1510bis.
302 3.1.2. Algorithm Identifiers
304     PKINIT does not define, but does permit, the algorithm identifiers
305     listed below.
307 3.1.2.1. Signature Algorithm Identifiers
309     The following signature algorithm identifiers specified in [8] and
310     in [12] are used with PKINIT:
312     sha-1WithRSAEncryption (RSA with SHA1)
313     md5WithRSAEncryption   (RSA with MD5)
314     id-dsa-with-sha1       (DSA with SHA1)
316 3.1.2.2 Diffie-Hellman Key Agreement Algorithm Identifier
318     The following algorithm identifier shall be used within the
319     SubjectPublicKeyInfo data structure: dhpublicnumber
321     This identifier and the associated algorithm parameters are
322     specified in RFC 2459 [12].
324 3.1.2.3. Algorithm Identifiers for RSA Encryption
326     These algorithm identifiers are used inside the EnvelopedData data
327     structure, for encrypting the temporary key with a public key:
329         rsaEncryption (RSA encryption, PKCS#1 v1.5)
330         id-RSAES-OAEP (RSA encryption, PKCS#1 v2.0)
332     Both of the above RSA encryption schemes are specified in [13].
333     Currently, only PKCS#1 v1.5 is specified by CMS [8], although the
334     CMS specification says that it will likely include PKCS#1 v2.0 in
335     the future.  (PKCS#1 v2.0 addresses adaptive chosen ciphertext
336     vulnerability discovered in PKCS#1 v1.5.)
338 3.1.2.4. Algorithm Identifiers for Encryption with Secret Keys
340     These algorithm identifiers are used inside the EnvelopedData data
341     structure in the PKINIT Reply, for encrypting the reply key with the
342     temporary key:
343         des-ede3-cbc (3-key 3-DES, CBC mode)
344         rc2-cbc      (RC2, CBC mode)
346     The full definition of the above algorithm identifiers and their
347     corresponding parameters (an IV for block chaining) is provided in
348     the CMS specification [8].
350 3.2.  Public Key Authentication
352     Implementation of the changes in this section is REQUIRED for
353     compliance with PKINIT.
355 3.2.1.  Client Request
357     Public keys may be signed by some certification authority (CA), or
358     they may be maintained by the KDC in which case the KDC is the
359     trusted authority.  Note that the latter mode does not require the
360     use of certificates.
362     The initial authentication request is sent as per RFC 1510bis, except
363     that a preauthentication field containing data signed by the user's
364     private key accompanies the request:
366     PA-PK-AS-REQ ::= SEQUENCE {
367                                 -- PA TYPE 14
368         signedAuthPack          [0] ContentInfo,
369                                     -- Defined in CMS [8];
370                                     -- SignedData OID is {pkcs7 2}
371                                     -- AuthPack (below) defines the
372                                     -- data that is signed.
373         trustedCertifiers       [1] SEQUENCE OF TrustedCas OPTIONAL,
374                                     -- This is a list of CAs that the
375                                     -- client trusts and that certify
376                                     -- KDCs.
377         kdcCert                 [2] IssuerAndSerialNumber OPTIONAL
378                                     -- As defined in CMS [8];
379                                     -- specifies a particular KDC
380                                     -- certificate if the client
381                                     -- already has it.
382         encryptionCert          [3] IssuerAndSerialNumber OPTIONAL
383                                     -- For example, this may be the
384                                     -- client's Diffie-Hellman
385                                     -- certificate, or it may be the
386                                     -- client's RSA encryption
387                                     -- certificate.
388     }
390     TrustedCas ::= CHOICE {
391         principalName         [0] KerberosName,
392                                   -- as defined below
393         caName                [1] Name
394                                   -- fully qualified X.500 name
395                                   -- as defined by X.509
396         issuerAndSerial       [2] IssuerAndSerialNumber
397                                   -- Since a CA may have a number of
398                                   -- certificates, only one of which
399                                   -- a client trusts
400     }
402     The type of the ContentInfo in the signedAuthPack is SignedData.
403     Its usage is as follows:
405         The SignedData data type is specified in the Cryptographic
406         Message Syntax, a product of the S/MIME working group of the
407         IETF.  The following describes how to fill in the fields of
408         this data:
410         1.  The encapContentInfo field MUST contain the PKAuthenticator
411             and, optionally, the client's Diffie Hellman public value.
413             a.  The eContentType field MUST contain the OID value for
414                 pkauthdata: iso (1) org (3) dod (6) internet (1)
415                 security (5) kerberosv5 (2) pkinit (3) pkauthdata (1)
417             b.  The eContent field is data of the type AuthPack (below).
419         2.  The signerInfos field contains the signature of AuthPack.
421         3.  The Certificates field, when non-empty, contains the client's
422             certificate chain.  If present, the KDC uses the public key
423             from the client's certificate to verify the signature in the
424             request.  Note that the client may pass different certificate
425             chains that are used for signing or for encrypting.  Thus,
426             the KDC may utilize a different client certificate for
427             signature verification than the one it uses to encrypt the
428             reply to the client.  For example, the client may place a
429             Diffie-Hellman certificate in this field in order to convey
430             its static Diffie Hellman certificate to the KDC to enable
431             static-ephemeral Diffie-Hellman mode for the reply; in this
432             case, the client does NOT place its public value in the
433             AuthPack (defined below).  As another example, the client may
434             place an RSA encryption certificate in this field.  However,
435             there MUST always be (at least) a signature certificate.
437         4.  When a DH key is being used, the public exponent is provided
438             in the subjectPublicKey field of the SubjectPublicKeyInfo and
439             the DH parameters are supplied as a DomainParameters in the
440             AlgorithmIdentitfier parameters.  The DH paramters SHOULD be
441             chosen from the First and Second defined Oakley Groups [The
442             Internet Key Exchange (IKE) RFC-2409], if a server will not
443             accept either of these groups, it will respond with a krb-
444             error of KDC_ERR_KEY_TOO_WEAK.  The accompanying e-data is
445             a SEQUENCE of TypedData that includes type 
446             TD-DH-PARAMETERS (102) whose data-value is DomainParameters
447             with appropriate Diffie-Hellman parameters for the client to
448             use.
450         5.  The KDC may wish to use cached Diffie-Hellman parameters
451             (see Section 3.2.2, KDC Response).  To indicate acceptance
452             of cached parameters, the client sends zero in the nonce
453             field of the PKAuthenticator.  Zero is not a valid value
454             for this field under any other circumstances.  If cached
455             parameters are used, the client and the KDC MUST perform
456             key derivation (for the appropriate cryptosystem) on the
457             resulting encryption key, as specified in RFC 1510bis.  (With
458             a zero nonce, message binding is performed using the nonce
459             in the main request, which must be encrypted using the
460             encapsulated reply key.)
462     AuthPack ::= SEQUENCE {
463         pkAuthenticator         [0] PKAuthenticator,
464         clientPublicValue       [1] SubjectPublicKeyInfo OPTIONAL
465                                     -- if client is using Diffie-Hellman
466                                     -- (ephemeral-ephemeral only)
467     }
469     PKAuthenticator ::= SEQUENCE {
470         cusec                   [0] INTEGER,
471                                     -- for replay prevention as in RFC 1510bis
472         ctime                   [1] KerberosTime,
473                                     -- for replay prevention as in RFC 1510bis
474         nonce                   [2] INTEGER,
475                                     -- zero only if client will accept
476                                     -- cached DH parameters from KDC;
477                                     -- must be non-zero otherwise
478         pachecksum              [3] Checksum
479                                     -- Checksum over KDC-REQ-BODY
480                                     -- Defined by Kerberos spec;
481                                     -- must be unkeyed, e.g. sha1 or rsa-md5
482     }
484     SubjectPublicKeyInfo ::= SEQUENCE {
485         algorithm                   AlgorithmIdentifier,
486                                     -- dhPublicNumber
487         subjectPublicKey            BIT STRING
488                                     -- for DH, equals
489                                     -- public exponent (INTEGER encoded
490                                     -- as payload of BIT STRING)
491     }   -- as specified by the X.509 recommendation [7]
493     AlgorithmIdentifier ::= SEQUENCE {
494         algorithm                   OBJECT IDENTIFIER,
495                                     -- for dhPublicNumber, this is
496                                     -- { iso (1) member-body (2) US (840)
497                                     -- ansi-x942(10046) number-type(2) 1 }
498                                     -- from RFC 2459 [12]
499         parameters                  ANY DEFINED by algorithm OPTIONAL
500                                     -- for dhPublicNumber, this is
501                                     -- DomainParameters
502     }   -- as specified by the X.509 recommendation [7]
504     DomainParameters ::= SEQUENCE {
505         p                           INTEGER, -- odd prime, p=jq +1
506         g                           INTEGER, -- generator, g
507         q                           INTEGER, -- factor of p-1
508         j                           INTEGER OPTIONAL, -- subgroup factor
509         validationParms             ValidationParms OPTIONAL
510     }   -- as defined in RFC 2459 [12]
512     ValidationParms ::= SEQUENCE {
513         seed                        BIT STRING,
514                                     -- seed for the system parameter
515                                     -- generation process
516         pgenCounter                 INTEGER
517                                     -- integer value output as part
518                                     -- of the of the system parameter
519                                     -- prime generation process
520     }   -- as defined in RFC 2459 [12]
522     If the client passes an issuer and serial number in the request,
523     the KDC is requested to use the referred-to certificate.  If none
524     exists, then the KDC returns an error of type
525     KDC_ERR_CERTIFICATE_MISMATCH.  It also returns this error if, on the
526     other hand, the client does not pass any trustedCertifiers,
527     believing that it has the KDC's certificate, but the KDC has more
528     than one certificate.  The KDC should include information in the
529     KRB-ERROR message that indicates the KDC certificate(s) that a
530     client may utilize.  This data is specified in the e-data, which
531     is defined in RFC 1510bis revisions as a SEQUENCE of TypedData:
533     TypedData ::=  SEQUENCE {
534                     data-type      [0] INTEGER,
535                     data-value     [1] OCTET STRING,
536     } -- per Kerberos RFC 1510bis
538     where one of the TypedData elements is:
539     data-type = TD-PKINIT-CMS-CERTIFICATES = 101
540     data-value = CertificateSet // as specified by CMS [8]
542     The PKAuthenticator carries information to foil replay attacks, to
543     bind the pre-authentication data to the KDC-REQ-BODY, and to bind the
544     request and response.  The PKAuthenticator is signed with the client's
545     signature key.
547 3.2.2.  KDC Response
549     Upon receipt of the AS_REQ with PA-PK-AS-REQ pre-authentication
550     type, the KDC attempts to verify the client's certificate chain, if
551     one is provided in the request.  This is done by verifying the
552     certification path against the KDC's policy of legitimate
553     certifiers.
555     If the KDC cannot find a trusted client certificate chain within
556     the PA-PK-AS-REQ, then the KDC sends back an error message of type
557     KDC_ERR_CANT_VERIFY_CERTIFICATE.  Certificate chain validation is
558     defined in RFC 2459 [12].  The accompanying e-data for this error
559     code is a SEQUENCE of TypedData that includes type
560     TD-TRUSTED-CERTIFIERS (104) whose data-value is an OCTET STRING
561     which is the DER encoding of
563         TrustedCertifiers ::= SEQUENCE OF PrincipalName
564                               -- X.500 name encoded as a principal name
565                               -- see Section 3.1
567     If while verifying a certificate chain the KDC determines that the
568     signature on one of the certificates in the CertificateSet from
569     the signedAuthPack fails verification, then the KDC returns an
570     error of type KDC_ERR_INVALID_CERTIFICATE.  The accompanying
571     e-data is a SEQUENCE of TypedData that includes type
572     TD-CERTIFICATE-INDEX (105) whose data-value is an OCTET STRING
573     which is the DER encoding of the index into the CertificateSet
574     ordered as sent by the client.
576         CertificateIndex  ::= INTEGER
577                               -- 0 = 1st certificate,
578                               --     (in order of encoding)
579                               -- 1 = 2nd certificate, etc
581     The KDC may also check whether any of the certificates in the
582     client's chain has been revoked.  If one of the certificates has
583     been revoked, then the KDC returns an error of type
584     KDC_ERR_REVOKED_CERTIFICATE; if such a query reveals that
585     the certificate's revocation status is unknown or not
586     available, then if required by policy, the KDC returns the
587     appropriate error of type KDC_ERR_REVOCATION_STATUS_UNKNOWN or
588     KDC_ERR_REVOCATION_STATUS_UNAVAILABLE.  In any of these three
589     cases, the affected certificate is identified by the accompanying
590     e-data, which contains a CertificateIndex as described for
591     KDC_ERR_INVALID_CERTIFICATE.
593     If the certificate chain can be verified, but the name of the
594     client in the certificate does not match the client's name in the
595     request, then the KDC returns an error of type
596     KDC_ERR_CLIENT_NAME_MISMATCH.  There is no accompanying e-data
597     field in this case.
599     Even if all succeeds, the KDC may--for policy reasons--decide not
600     to trust the client.  In this case, the KDC returns an error message
601     of type KDC_ERR_CLIENT_NOT_TRUSTED.  One specific case of this is
602     the presence or absence of an Enhanced Key Usage (EKU) OID within
603     the certificate extensions.  The rules regarding acceptability of
604     an EKU sequence (or the absence of any sequence) are a matter of
605     local policy.  For the benefit of implementers, we define a PKINIT
606     EKU OID as the following: iso (1) org (3) dod (6) internet (1)
607     security (5) kerberosv5 (2) pkinit (3) pkekuoid (2).
609     If a trust relationship exists, the KDC then verifies the client's
610     signature on AuthPack.  If that fails, the KDC returns an error
611     message of type KDC_ERR_INVALID_SIG.  Otherwise, the KDC uses the
612     timestamp (ctime and cusec) in the PKAuthenticator to assure that
613     the request is not a replay.  The KDC also verifies that its name
614     is specified in the PKAuthenticator.
616     If the clientPublicValue field is filled in, indicating that the
617     client wishes to use Diffie-Hellman key agreement, then the KDC
618     checks to see that the parameters satisfy its policy.  If they do
619     not (e.g., the prime size is insufficient for the expected
620     encryption type), then the KDC sends back an error message of type
621     KDC_ERR_KEY_TOO_WEAK.  The accompanying e-data is a SEQUENCE of
622     TypedData that includes type TD-DH-PARAMETERS (102) whose data-value
623     is DomainParameters with appropriate Diffie-Hellman parameters for
624     the client to retry the request.  Otherwise, it generates its own
625     public and private values for the response.
627     The KDC also checks that the timestamp in the PKAuthenticator is
628     within the allowable window and that the principal name and realm
629     are correct.  If the local (server) time and the client time in the
630     authenticator differ by more than the allowable clock skew, then the
631     KDC returns an error message of type KRB_AP_ERR_SKEW as defined in
632     RFC 1510bis.
634     Assuming no errors, the KDC replies as per RFC 1510bis, except as
635     follows.  The user's name in the ticket is determined by the
636     following decision algorithm:
638         1.  If the KDC has a mapping from the name in the certificate
639             to a Kerberos name, then use that name.
640             Else
641         2.  If the certificate contains the SubjectAltName extention
642             and the local KDC policy defines a mapping from the
643             SubjectAltName to a Kerberos name, then use that name.
644             Else
645         3.  Use the name as represented in the certificate, mapping
646             as necessary (e.g., as per RFC 2253 for X.500 names).  In
647             this case the realm in the ticket MUST be the name of the
648             certifier that issued the user's certificate.
650     Note that a principal name may be carried in the subjectAltName
651     field of a certificate. This name may be mapped to a principal
652     record in a security database based on local policy, for example
653     the subjectAltName may be kerberos/principal@realm format.  In
654     this case the realm name is not that of the CA but that of the
655     local realm doing the mapping (or some realm name chosen by that
656     realm).
658     If a non-KDC X.509 certificate contains the principal name within
659     the subjectAltName version 3 extension, that name may utilize
660     KerberosName as defined below, or, in the case of an S/MIME
661     certificate [14], may utilize the email address.  If the KDC
662     is presented with an S/MIME certificate, then the email address
663     within subjectAltName will be interpreted as a principal and realm
664     separated by the "@" sign, or as a name that needs to be mapped
665     according to local policy.  If the resulting name does not correspond
666     to a registered principal name, then the principal name is formed as
667     defined in section 3.1.
669     The trustedCertifiers field contains a list of certification
670     authorities trusted by the client, in the case that the client does
671     not possess the KDC's public key certificate.  If the KDC has no
672     certificate signed by any of the trustedCertifiers, then it returns
673     an error of type KDC_ERR_KDC_NOT_TRUSTED.
675     KDCs should try to (in order of preference):
676     1. Use the KDC certificate identified by the serialNumber included
677        in the client's request.
678     2. Use a certificate issued to the KDC by one of the client's
679        trustedCertifier(s);
680     If the KDC is unable to comply with any of these options, then the
681     KDC returns an error message of type KDC_ERR_KDC_NOT_TRUSTED to the
682     client.
684     The KDC encrypts the reply not with the user's long-term key, but
685     with the Diffie Hellman derived key or a random key generated
686     for this particular response which is carried in the padata field of
687     the TGS-REP message.
689     PA-PK-AS-REP ::= CHOICE {
690                             -- PA TYPE 15
691         dhSignedData       [0] ContentInfo,
692                             -- Defined in CMS [8] and used only with
693                             -- Diffie-Hellman key exchange (if the
694                             -- client public value was present in the
695                             -- request).
696                             -- SignedData OID is {pkcs7 2}
697                             -- This choice MUST be supported
698                             -- by compliant implementations.
699         encKeyPack         [1] ContentInfo
700                             -- Defined in CMS [8].
701                             -- The temporary key is encrypted
702                             -- using the client public key
703                             -- key.
704                             -- EnvelopedData OID is {pkcs7 3}
705                             -- SignedReplyKeyPack, encrypted
706                             -- with the temporary key, is also
707                             -- included.
708     }
710     The type of the ContentInfo in the dhSignedData is SignedData.
711     Its usage is as follows:
713         When the Diffie-Hellman option is used, dhSignedData in
714         PA-PK-AS-REP provides authenticated Diffie-Hellman parameters
715         of the KDC.  The reply key used to encrypt part of the KDC reply
716         message is derived from the Diffie-Hellman exchange:
718         1.  Both the KDC and the client calculate a secret value
719             (g^ab mod p), where a is the client's private exponent and
720             b is the KDC's private exponent.
722         2.  Both the KDC and the client take the first N bits of this
723             secret value and convert it into a reply key.  N depends on
724             the reply key type.
726             a.  For example, if the reply key is DES, N=64 bits, where
727                 some of the bits are replaced with parity bits, according
728                 to FIPS PUB 74.
730             b.  As another example, if the reply key is (3-key) 3-DES,
731                 N=192 bits, where some of the bits are replaced with
732                 parity bits, according to FIPS PUB 74.
734         3.  The encapContentInfo field MUST contain the KdcDHKeyInfo as
735             defined below.
737             a.  The eContentType field MUST contain the OID value for
738                 pkdhkeydata: iso (1) org (3) dod (6) internet (1)
739                 security (5) kerberosv5 (2) pkinit (3) pkdhkeydata (2)
741             b.  The eContent field is data of the type KdcDHKeyInfo
742                 (below).
744         4.  The certificates field MUST contain the certificates
745             necessary for the client to establish trust in the KDC's
746             certificate based on the list of trusted certifiers sent by
747             the client in the PA-PK-AS-REQ.  This field may be empty if
748             the client did not send to the KDC a list of trusted
749             certifiers (the trustedCertifiers field was empty, meaning
750             that the client already possesses the KDC's certificate).
752         5.  The signerInfos field is a SET that MUST contain at least
753             one member, since it contains the actual signature.
755         6.  If the client indicated acceptance of cached Diffie-Hellman
756             parameters from the KDC, and the KDC supports such an option
757             (for performance reasons), the KDC should return a zero in
758             the nonce field and include the expiration time of the
759             parameters in the dhKeyExpiration field.  If this time is
760             exceeded, the client SHOULD NOT use the reply.  If the time
761             is absent, the client SHOULD NOT use the reply and MAY
762             resubmit a request with a non-zero nonce (thus indicating
763             non-acceptance of cached Diffie-Hellman parameters).  As
764             indicated above in Section 3.2.1, Client Request, when the
765             KDC uses cached parameters, the client and the KDC MUST
766             perform key derivation (for the appropriate cryptosystem)
767             on the resulting encryption key, as specified in RFC 1510bis.
769     KdcDHKeyInfo ::= SEQUENCE {
770                               -- used only when utilizing Diffie-Hellman
771       subjectPublicKey      [0] BIT STRING,
772                                 -- Equals public exponent (g^a mod p)
773                                 -- INTEGER encoded as payload of
774                                 -- BIT STRING
775       nonce                 [1] INTEGER,
776                                 -- Binds response to the request
777                                 -- Exception: Set to zero when KDC
778                                 -- is using a cached DH value
779       dhKeyExpiration       [2] KerberosTime OPTIONAL
780                                 -- Expiration time for KDC's cached
781                                 -- DH value
782     }
784     The type of the ContentInfo in the encKeyPack is EnvelopedData.  Its
785     usage is as follows:
787         The EnvelopedData data type is specified in the Cryptographic
788         Message Syntax, a product of the S/MIME working group of the
789         IETF.  It contains a temporary key encrypted with the PKINIT
790         client's public key.  It also contains a signed and encrypted
791         reply key.
793         1.  The originatorInfo field is not required, since that
794             information may be presented in the signedData structure
795             that is encrypted within the encryptedContentInfo field.
797         2.  The optional unprotectedAttrs field is not required for
798             PKINIT.
800         3.  The recipientInfos field is a SET which MUST contain exactly
801             one member of the KeyTransRecipientInfo type for encryption
802             with a public key.
804             a.  The encryptedKey field (in KeyTransRecipientInfo)
805                 contains the temporary key which is encrypted with the
806                 PKINIT client's public key.
808         4.  The encryptedContentInfo field contains the signed and
809             encrypted reply key.
811             a.  The contentType field MUST contain the OID value for
812                 id-signedData: iso (1) member-body (2) us (840)
813                 rsadsi (113549) pkcs (1) pkcs7 (7) signedData (2)
815             b.  The encryptedContent field is encrypted data of the CMS
816                 type signedData as specified below.
818                 i.  The encapContentInfo field MUST contains the
819                     ReplyKeyPack.
821                     * The eContentType field MUST contain the OID value
822                       for pkrkeydata: iso (1) org (3) dod (6) internet (1)
823                       security (5) kerberosv5 (2) pkinit (3) pkrkeydata (3)
825                     * The eContent field is data of the type ReplyKeyPack
826                       (below).
828                 ii.  The certificates field MUST contain the certificates
829                      necessary for the client to establish trust in the
830                      KDC's certificate based on the list of trusted
831                      certifiers sent by the client in the PA-PK-AS-REQ.
832                      This field may be empty if the client did not send
833                      to the KDC a list of trusted certifiers (the
834                      trustedCertifiers field was empty, meaning that the
835                      client already possesses the KDC's certificate).
837                 iii.  The signerInfos field is a SET that MUST contain at
838                       least one member, since it contains the actual
839                       signature.
841     ReplyKeyPack ::= SEQUENCE {
842                               -- not used for Diffie-Hellman
843         replyKey             [0] EncryptionKey,
844                                  -- from RFC 1510bis
845                                  -- used to encrypt main reply
846                                  -- ENCTYPE is at least as strong as
847                                  -- ENCTYPE of session key
848         nonce                [1] INTEGER,
849                                  -- binds response to the request
850                                  -- must be same as the nonce
851                                  -- passed in the PKAuthenticator
852     }
855 3.2.2.1. Use of transited Field
857     Since each certifier in the certification path of a user's
858     certificate is equivalent to a separate Kerberos realm, the name
859     of each certifier in the certificate chain MUST be added to the
860     transited field of the ticket.  The format of these realm names is
861     defined in Section 3.1 of this document.  If applicable, the
862     transit-policy-checked flag should be set in the issued ticket.
865 3.2.2.2. Kerberos Names in Certificates
867     The KDC's certificate(s) MUST bind the public key(s) of the KDC to
868     a name derivable from the name of the realm for that KDC.  X.509
869     certificates MUST contain the principal name of the KDC (defined in
870     RFC 1510bis) as the SubjectAltName version 3 extension.  Below is
871     the definition of this version 3 extension, as specified by the
872     X.509 standard:
874         subjectAltName EXTENSION ::= {
875             SYNTAX GeneralNames
876             IDENTIFIED BY id-ce-subjectAltName
877         }
879         GeneralNames ::= SEQUENCE SIZE(1..MAX) OF GeneralName
881         GeneralName ::= CHOICE {
882             otherName       [0] OtherName,
883             ...
884         }
886         OtherName ::= SEQUENCE {
887             type-id         OBJECT IDENTIFIER,
888             value           [0] EXPLICIT ANY DEFINED BY type-id
889         }
891     For the purpose of specifying a Kerberos principal name, the value
892     in OtherName MUST be a KerberosName, defined as follows:
894         KerberosName ::= SEQUENCE {
895             realm           [0] Realm,
896             principalName   [1] PrincipalName
897         }
899     This specific syntax is identified within subjectAltName by setting
900     the type-id in OtherName to krb5PrincipalName, where (from the
901     Kerberos specification) we have
903         krb5 OBJECT IDENTIFIER ::= { iso (1)
904                                      org (3)
905                                      dod (6)
906                                      internet (1)
907                                      security (5)
908                                      kerberosv5 (2) }
910         krb5PrincipalName OBJECT IDENTIFIER ::= { krb5 2 }
912     (This specification may also be used to specify a Kerberos name
913     within the user's certificate.)  The KDC's certificate may be signed
914     directly by a CA, or there may be intermediaries if the server resides
915     within a large organization, or it may be unsigned if the client
916     indicates possession (and trust) of the KDC's certificate.
918     Note that the KDC's principal name has the instance equal to the
919     realm, and those fields should be appropriately set in the realm
920     and principalName fields of the KerberosName.  This is the case
921     even when obtaining a cross-realm ticket using PKINIT.
924 3.2.3. Client Extraction of Reply
926     The client then extracts the random key used to encrypt the main
927     reply.  This random key (in encPaReply) is encrypted with either the
928     client's public key or with a key derived from the DH values
929     exchanged between the client and the KDC.  The client uses this
930     random key to decrypt the main reply, and subsequently proceeds as
931     described in RFC 1510bis.
933 3.2.4. Required Algorithms
935     Not all of the algorithms in the PKINIT protocol specification have
936     to be implemented in order to comply with the proposed standard.
937     Below is a list of the required algorithms:
939     * Diffie-Hellman public/private key pairs
940         * utilizing Diffie-Hellman ephemeral-ephemeral mode
941     * SHA1 digest and RSA for signatures
942     * SHA1 digest for the Checksum in the PKAuthenticator
943         * using Kerberos checksum type 'sha1'
944     * 3-key triple DES keys derived from the Diffie-Hellman Exchange
945     * 3-key triple DES Temporary and Reply keys
947 4.  Logistics and Policy
949     This section describes a way to define the policy on the use of
950     PKINIT for each principal and request.
952     The KDC is not required to contain a database record for users
953     who use public key authentication.  However, if these users are
954     registered with the KDC, it is recommended that the database record
955     for these users be modified to an additional flag in the attributes
956     field to indicate that the user should authenticate using PKINIT.
957     If this flag is set and a request message does not contain the
958     PKINIT preauthentication field, then the KDC sends back as error of
959     type KDC_ERR_PREAUTH_REQUIRED indicating that a preauthentication
960     field of type PA-PK-AS-REQ must be included in the request.
962 5.  Security Considerations
964     PKINIT raises a few security considerations, which we will address
965     in this section.
967     First of all, PKINIT extends the cross-realm model to the public
968     key infrastructure.  Anyone using PKINIT must be aware of how the
969     certification infrastructure they are linking to works.
971     Also, as in standard Kerberos, PKINIT presents the possibility of
972     interactions between different cryptosystems of varying strengths,
973     and this now includes public-key cryptosystems.  Many systems, for
974     instance, allow the use of 512-bit public keys.  Using such keys
975     to wrap data encrypted under strong conventional cryptosystems,
976     such as triple-DES, may be inappropriate.
978     Care should be taken in how certificates are choosen for the purposes
979     of authentication using PKINIT. Some local policies require that key
980     escrow be applied for certain certificate types. People deploying
981     PKINIT should be aware of the implications of using certificates that
982     have escrowed keys for the purposes of authentication.
984     As described in Section 3.2, PKINIT allows for the caching of the
985     Diffie-Hellman parameters on the KDC side, for performance reasons.
986     For similar reasons, the signed data in this case does not vary from
987     message to message, until the cached parameters expire.  Because of
988     the persistence of these parameters, the client and the KDC are to
989     use the appropriate key derivation measures (as described in RFC
990     1510bis) when using cached DH parameters.
992     PKINIT does not provide for a "return routability test" to prevent
993     attackers from mounting a denial of service attack on the KDC by
994     causing it to perform needless expensive cryptographic operations.
995     Strictly speaking, this is also true of base Kerberos, although the
996     potential cost is not as great in base Kerberos, because it does
997     not make use of public key cryptography.
999     Lastly, PKINIT calls for randomly generated keys for conventional
1000     cryptosystems.  Many such systems contain systematically "weak"
1001     keys.  For recommendations regarding these weak keys, see RFC
1002     1510bis.
1004 6.  Transport Issues
1006     Certificate chains can potentially grow quite large and span several
1007     UDP packets; this in turn increases the probability that a Kerberos
1008     message involving PKINIT extensions will be broken in transit.  In
1009     light of the possibility that the Kerberos specification will
1010     require KDCs to accept requests using TCP as a transport mechanism,
1011     we make the same recommendation with respect to the PKINIT
1012     extensions as well.
1014 7.  Bibliography
1016     [1] J. Kohl, C. Neuman.  The Kerberos Network Authentication Service
1017     (V5).  Request for Comments 1510.
1019     [2] B.C. Neuman, Theodore Ts'o. Kerberos: An Authentication Service
1020     for Computer Networks, IEEE Communications, 32(9):33-38.  September
1021     1994.
1023     [3] M. Sirbu, J. Chuang.  Distributed Authentication in Kerberos
1024     Using Public Key Cryptography.  Symposium On Network and Distributed
1025     System Security, 1997.
1027     [4] B. Cox, J.D. Tygar, M. Sirbu.  NetBill Security and Transaction
1028     Protocol.  In Proceedings of the USENIX Workshop on Electronic
1029     Commerce, July 1995.
1031     [5] T. Dierks, C. Allen.  The TLS Protocol, Version 1.0
1032     Request for Comments 2246, January 1999.
1034     [6] B.C. Neuman, Proxy-Based Authorization and Accounting for
1035     Distributed Systems.  In Proceedings of the 13th International
1036     Conference on Distributed Computing Systems, May 1993.
1038     [7] ITU-T (formerly CCITT) Information technology - Open Systems
1039     Interconnection - The Directory: Authentication Framework
1040     Recommendation X.509 ISO/IEC 9594-8
1042     [8] R. Housley. Cryptographic Message Syntax.
1043     draft-ietf-smime-cms-13.txt, April 1999, approved for publication
1044     as RFC.
1046     [9] PKCS #7: Cryptographic Message Syntax Standard,
1047     An RSA Laboratories Technical Note Version 1.5
1048     Revised November 1, 1993
1050     [10] R. Rivest, MIT Laboratory for Computer Science and RSA Data
1051     Security, Inc. A Description of the RC2(r) Encryption Algorithm
1052     March 1998.
1053     Request for Comments 2268.
1055     [11] M. Wahl, S. Kille, T. Howes. Lightweight Directory Access
1056     Protocol (v3): UTF-8 String Representation of Distinguished Names.
1057     Request for Comments 2253.
1059     [12] R. Housley, W. Ford, W. Polk, D. Solo. Internet X.509 Public
1060     Key Infrastructure, Certificate and CRL Profile, January 1999.
1061     Request for Comments 2459.
1063     [13] B. Kaliski, J. Staddon. PKCS #1: RSA Cryptography
1064     Specifications, October 1998.  Request for Comments 2437.
1066     [14] S. Dusse, P. Hoffman, B. Ramsdell, J. Weinstein.  S/MIME
1067     Version 2 Certificate Handling, March 1998.  Request for
1068     Comments 2312.
1070     [15] M. Wahl, T. Howes, S. Kille.  Lightweight Directory Access
1071     Protocol (v3), December 1997.  Request for Comments 2251.
1073     [16] ITU-T (formerly CCITT) Information Processing Systems - Open
1074     Systems Interconnection - Specification of Abstract Syntax Notation
1075     One (ASN.1) Rec. X.680 ISO/IEC 8824-1
1077     [17] PKCS #3: Diffie-Hellman Key-Agreement Standard, An RSA
1078     Laboratories Technical Note, Version 1.4, Revised November 1, 1993.
1080 8.  Acknowledgements
1082     Some of the ideas on which this proposal is based arose during
1083     discussions over several years between members of the SAAG, the IETF
1084     CAT working group, and the PSRG, regarding integration of Kerberos
1085     and SPX.  Some ideas have also been drawn from the DASS system.
1086     These changes are by no means endorsed by these groups.  This is an
1087     attempt to revive some of the goals of those groups, and this
1088     proposal approaches those goals primarily from the Kerberos
1089     perspective.  Lastly, comments from groups working on similar ideas
1090     in DCE have been invaluable.
1092 9.  Expiration Date
1094     This draft expires March 12, 2002.
1096 10. Authors
1098     Brian Tung
1099     Clifford Neuman
1100     USC Information Sciences Institute
1101     4676 Admiralty Way Suite 1001
1102     Marina del Rey CA 90292-6695
1103     Phone: +1 310 822 1511
1104     E-mail: {brian, bcn}@isi.edu
1106     Matthew Hur
1107     Microsoft Corporation
1108     One Microsoft Way
1109     Redmond WA 98052
1110     Phone: +1 425 707 3336
1111     E-mail: matthur@microsoft.com
1113     Ari Medvinsky
1114     Liberate Technologies
1115     2 Circle Star Way
1116     San Carlos CA 94070
1117     E-mail: ari@liberate.com
1119     Sasha Medvinsky
1120     Motorola, Inc.
1121     6450 Sequence Drive
1122     San Diego, CA 92121
1123     +1 858 404 2367
1124     E-mail: smedvinsky@gi.com
1126     John Wray
1127     Iris Associates, Inc.
1128     5 Technology Park Dr.
1129     Westford, MA 01886
1130     E-mail: John_Wray@iris.com
1132     Jonathan Trostle
1133     E-mail: jtrostle@world.std.com