Initial import from FreeBSD RELENG_4:
[dragonfly.git] / crypto / heimdal / doc / standardisation / draft-ietf-cat-kerberos-revisions-01.txt
1
2 INTERNET-DRAFT                                          Clifford Neuman
3                                                               John Kohl
4                                                           Theodore Ts'o
5                                                        21 November 1997
6
7 The Kerberos Network Authentication Service (V5)
8
9 STATUS OF THIS MEMO
10
11 This document is an Internet-Draft. Internet-Drafts are working documents of
12 the Internet Engineering Task Force (IETF), its areas, and its working
13 groups. Note that other groups may also distribute working documents as
14 Internet-Drafts.
15
16 Internet-Drafts are draft documents valid for a maximum of six months and
17 may be updated, replaced, or obsoleted by other documents at any time. It is
18 inappropriate to use Internet-Drafts as reference material or to cite them
19 other than as 'work in progress.'
20
21 To learn the current status of any Internet-Draft, please check the
22 '1id-abstracts.txt' listing contained in the Internet-Drafts Shadow
23 Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe),
24 ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim).
25
26 The distribution of this memo is unlimited. It is filed as
27 draft-ietf-cat-kerberos-r-01.txt, and expires 21 May 1998. Please send
28 comments to: krb-protocol@MIT.EDU
29
30 ABSTRACT
31
32 This document provides an overview and specification of Version 5 of the
33 Kerberos protocol, and updates RFC1510 to clarify aspects of the protocol
34 and its intended use that require more detailed or clearer explanation than
35 was provided in RFC1510. This document is intended to provide a detailed
36 description of the protocol, suitable for implementation, together with
37 descriptions of the appropriate use of protocol messages and fields within
38 those messages.
39
40 This document is not intended to describe Kerberos to the end user, system
41 administrator, or application developer. Higher level papers describing
42 Version 5 of the Kerberos system [NT94] and documenting version 4 [SNS88],
43 are available elsewhere.
44
45 OVERVIEW
46
47 This INTERNET-DRAFT describes the concepts and model upon which the Kerberos
48 network authentication system is based. It also specifies Version 5 of the
49 Kerberos protocol.
50
51 The motivations, goals, assumptions, and rationale behind most design
52 decisions are treated cursorily; they are more fully described in a paper
53 available in IEEE communications [NT94] and earlier in the Kerberos portion
54 of the Athena Technical Plan [MNSS87]. The protocols have been a proposed
55
56
57 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
58
59 standard and are being considered for advancement for draft standard through
60 the IETF standard process. Comments are encouraged on the presentation, but
61 only minor refinements to the protocol as implemented or extensions that fit
62 within current protocol framework will be considered at this time.
63
64 Requests for addition to an electronic mailing list for discussion of
65 Kerberos, kerberos@MIT.EDU, may be addressed to kerberos-request@MIT.EDU.
66 This mailing list is gatewayed onto the Usenet as the group
67 comp.protocols.kerberos. Requests for further information, including
68 documents and code availability, may be sent to info-kerberos@MIT.EDU.
69
70 BACKGROUND
71
72 The Kerberos model is based in part on Needham and Schroeder's trusted
73 third-party authentication protocol [NS78] and on modifications suggested by
74 Denning and Sacco [DS81]. The original design and implementation of Kerberos
75 Versions 1 through 4 was the work of two former Project Athena staff
76 members, Steve Miller of Digital Equipment Corporation and Clifford Neuman
77 (now at the Information Sciences Institute of the University of Southern
78 California), along with Jerome Saltzer, Technical Director of Project
79 Athena, and Jeffrey Schiller, MIT Campus Network Manager. Many other members
80 of Project Athena have also contributed to the work on Kerberos.
81
82 Version 5 of the Kerberos protocol (described in this document) has evolved
83 from Version 4 based on new requirements and desires for features not
84 available in Version 4. The design of Version 5 of the Kerberos protocol was
85 led by Clifford Neuman and John Kohl with much input from the community. The
86 development of the MIT reference implementation was led at MIT by John Kohl
87 and Theodore T'so, with help and contributed code from many others.
88 Reference implementations of both version 4 and version 5 of Kerberos are
89 publicly available and commercial implementations have been developed and
90 are widely used.
91
92 Details on the differences between Kerberos Versions 4 and 5 can be found in
93 [KNT92].
94
95 1. Introduction
96
97 Kerberos provides a means of verifying the identities of principals, (e.g. a
98 workstation user or a network server) on an open (unprotected) network. This
99 is accomplished without relying on assertions by the host operating system,
100 without basing trust on host addresses, without requiring physical security
101 of all the hosts on the network, and under the assumption that packets
102 traveling along the network can be read, modified, and inserted at will[1].
103 Kerberos performs authentication under these conditions as a trusted
104 third-party authentication service by using conventional (shared secret key
105 [2] cryptography. Kerberos extensions have been proposed and implemented
106 that provide for the use of public key cryptography during certain phases of
107 the authentication protocol. These extensions provide for authentication of
108 users registered with public key certification authorities, and allow the
109 system to provide certain benefits of public key cryptography in situations
110 where they are needed.
111
112 The basic Kerberos authentication process proceeds as follows: A client
113
114
115 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
116
117 sends a request to the authentication server (AS) requesting 'credentials'
118 for a given server. The AS responds with these credentials, encrypted in the
119 client's key. The credentials consist of 1) a 'ticket' for the server and 2)
120 a temporary encryption key (often called a "session key"). The client
121 transmits the ticket (which contains the client's identity and a copy of the
122 session key, all encrypted in the server's key) to the server. The session
123 key (now shared by the client and server) is used to authenticate the
124 client, and may optionally be used to authenticate the server. It may also
125 be used to encrypt further communication between the two parties or to
126 exchange a separate sub-session key to be used to encrypt further
127 communication.
128
129 Implementation of the basic protocol consists of one or more authentication
130 servers running on physically secure hosts. The authentication servers
131 maintain a database of principals (i.e., users and servers) and their secret
132 keys. Code libraries provide encryption and implement the Kerberos protocol.
133 In order to add authentication to its transactions, a typical network
134 application adds one or two calls to the Kerberos library directly or
135 through the Generic Security Services Application Programming Interface,
136 GSSAPI, described in separate document. These calls result in the
137 transmission of the necessary messages to achieve authentication.
138
139 The Kerberos protocol consists of several sub-protocols (or exchanges).
140 There are two basic methods by which a client can ask a Kerberos server for
141 credentials. In the first approach, the client sends a cleartext request for
142 a ticket for the desired server to the AS. The reply is sent encrypted in
143 the client's secret key. Usually this request is for a ticket-granting
144 ticket (TGT) which can later be used with the ticket-granting server (TGS).
145 In the second method, the client sends a request to the TGS. The client uses
146 the TGT to authenticate itself to the TGS in the same manner as if it were
147 contacting any other application server that requires Kerberos
148 authentication. The reply is encrypted in the session key from the TGT.
149 Though the protocol specification describes the AS and the TGS as separate
150 servers, they are implemented in practice as different protocol entry points
151 within a single Kerberos server.
152
153 Once obtained, credentials may be used to verify the identity of the
154 principals in a transaction, to ensure the integrity of messages exchanged
155 between them, or to preserve privacy of the messages. The application is
156 free to choose whatever protection may be necessary.
157
158 To verify the identities of the principals in a transaction, the client
159 transmits the ticket to the application server. Since the ticket is sent "in
160 the clear" (parts of it are encrypted, but this encryption doesn't thwart
161 replay) and might be intercepted and reused by an attacker, additional
162 information is sent to prove that the message originated with the principal
163 to whom the ticket was issued. This information (called the authenticator)
164 is encrypted in the session key, and includes a timestamp. The timestamp
165 proves that the message was recently generated and is not a replay.
166 Encrypting the authenticator in the session key proves that it was generated
167 by a party possessing the session key. Since no one except the requesting
168 principal and the server know the session key (it is never sent over the
169 network in the clear) this guarantees the identity of the client.
170
171
172
173 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
174
175 The integrity of the messages exchanged between principals can also be
176 guaranteed using the session key (passed in the ticket and contained in the
177 credentials). This approach provides detection of both replay attacks and
178 message stream modification attacks. It is accomplished by generating and
179 transmitting a collision-proof checksum (elsewhere called a hash or digest
180 function) of the client's message, keyed with the session key. Privacy and
181 integrity of the messages exchanged between principals can be secured by
182 encrypting the data to be passed using the session key contained in the
183 ticket or the subsession key found in the authenticator.
184
185 The authentication exchanges mentioned above require read-only access to the
186 Kerberos database. Sometimes, however, the entries in the database must be
187 modified, such as when adding new principals or changing a principal's key.
188 This is done using a protocol between a client and a third Kerberos server,
189 the Kerberos Administration Server (KADM). There is also a protocol for
190 maintaining multiple copies of the Kerberos database. Neither of these
191 protocols are described in this document.
192
193 1.1. Cross-Realm Operation
194
195 The Kerberos protocol is designed to operate across organizational
196 boundaries. A client in one organization can be authenticated to a server in
197 another. Each organization wishing to run a Kerberos server establishes its
198 own 'realm'. The name of the realm in which a client is registered is part
199 of the client's name, and can be used by the end-service to decide whether
200 to honor a request.
201
202 By establishing 'inter-realm' keys, the administrators of two realms can
203 allow a client authenticated in the local realm to prove its identity to
204 servers in other realms[3]. The exchange of inter-realm keys (a separate key
205 may be used for each direction) registers the ticket-granting service of
206 each realm as a principal in the other realm. A client is then able to
207 obtain a ticket-granting ticket for the remote realm's ticket-granting
208 service from its local realm. When that ticket-granting ticket is used, the
209 remote ticket-granting service uses the inter-realm key (which usually
210 differs from its own normal TGS key) to decrypt the ticket-granting ticket,
211 and is thus certain that it was issued by the client's own TGS. Tickets
212 issued by the remote ticket-granting service will indicate to the
213 end-service that the client was authenticated from another realm.
214
215 A realm is said to communicate with another realm if the two realms share an
216 inter-realm key, or if the local realm shares an inter-realm key with an
217 intermediate realm that communicates with the remote realm. An
218 authentication path is the sequence of intermediate realms that are
219 transited in communicating from one realm to another.
220
221 Realms are typically organized hierarchically. Each realm shares a key with
222 its parent and a different key with each child. If an inter-realm key is not
223 directly shared by two realms, the hierarchical organization allows an
224 authentication path to be easily constructed. If a hierarchical organization
225 is not used, it may be necessary to consult a database in order to construct
226 an authentication path between realms.
227
228 Although realms are typically hierarchical, intermediate realms may be
229
230
231 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
232
233 bypassed to achieve cross-realm authentication through alternate
234 authentication paths (these might be established to make communication
235 between two realms more efficient). It is important for the end-service to
236 know which realms were transited when deciding how much faith to place in
237 the authentication process. To facilitate this decision, a field in each
238 ticket contains the names of the realms that were involved in authenticating
239 the client.
240
241 The application server is ultimately responsible for accepting or rejecting
242 authentication and should check the transited field. The application server
243 may choose to rely on the KDC for the application server's realm to check
244 the transited field. The application server's KDC will set the
245 TRANSITED-POLICY-CHECKED flag in this case. The KDC's for intermediate
246 realms may also check the transited field as they issue
247 ticket-granting-tickets for other realms, but they are encouraged not to do
248 so. A client may request that the KDC's not check the transited field by
249 setting the DISABLE-TRANSITED-CHECK flag. KDC's are encouraged but not
250 required to honor this flag.
251
252 1.2. Authorization
253
254 As an authentication service, Kerberos provides a means of verifying the
255 identity of principals on a network. Authentication is usually useful
256 primarily as a first step in the process of authorization, determining
257 whether a client may use a service, which objects the client is allowed to
258 access, and the type of access allowed for each. Kerberos does not, by
259 itself, provide authorization. Possession of a client ticket for a service
260 provides only for authentication of the client to that service, and in the
261 absence of a separate authorization procedure, it should not be considered
262 by an application as authorizing the use of that service.
263
264 Such separate authorization methods may be implemented as application
265 specific access control functions and may be based on files such as the
266 application server, or on separately issued authorization credentials such
267 as those based on proxies [Neu93] , or on other authorization services.
268
269 Applications should not be modified to accept the issuance of a service
270 ticket by the Kerberos server (even by an modified Kerberos server) as
271 granting authority to use the service, since such applications may become
272 vulnerable to the bypass of this authorization check in an environment if
273 they interoperate with other KDCs or where other options for application
274 authentication (e.g. the PKTAPP proposal) are provided.
275
276 1.3. Environmental assumptions
277
278 Kerberos imposes a few assumptions on the environment in which it can
279 properly function:
280
281    * 'Denial of service' attacks are not solved with Kerberos. There are
282      places in these protocols where an intruder can prevent an application
283      from participating in the proper authentication steps. Detection and
284      solution of such attacks (some of which can appear to be nnot-uncommon
285      'normal' failure modes for the system) is usually best left to the
286      human administrators and users.
287
288
289 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
290
291    * Principals must keep their secret keys secret. If an intruder somehow
292      steals a principal's key, it will be able to masquerade as that
293      principal or impersonate any server to the legitimate principal.
294    * 'Password guessing' attacks are not solved by Kerberos. If a user
295      chooses a poor password, it is possible for an attacker to successfully
296      mount an offline dictionary attack by repeatedly attempting to decrypt,
297      with successive entries from a dictionary, messages obtained which are
298      encrypted under a key derived from the user's password.
299    * Each host on the network must have a clock which is 'loosely
300      synchronized' to the time of the other hosts; this synchronization is
301      used to reduce the bookkeeping needs of application servers when they
302      do replay detection. The degree of "looseness" can be configured on a
303      per-server basis, but is typically on the order of 5 minutes. If the
304      clocks are synchronized over the network, the clock synchronization
305      protocol must itself be secured from network attackers.
306    * Principal identifiers are not recycled on a short-term basis. A typical
307      mode of access control will use access control lists (ACLs) to grant
308      permissions to particular principals. If a stale ACL entry remains for
309      a deleted principal and the principal identifier is reused, the new
310      principal will inherit rights specified in the stale ACL entry. By not
311      re-using principal identifiers, the danger of inadvertent access is
312      removed.
313
314 1.4. Glossary of terms
315
316 Below is a list of terms used throughout this document.
317
318 Authentication
319      Verifying the claimed identity of a principal.
320 Authentication header
321      A record containing a Ticket and an Authenticator to be presented to a
322      server as part of the authentication process.
323 Authentication path
324      A sequence of intermediate realms transited in the authentication
325      process when communicating from one realm to another.
326 Authenticator
327      A record containing information that can be shown to have been recently
328      generated using the session key known only by the client and server.
329 Authorization
330      The process of determining whether a client may use a service, which
331      objects the client is allowed to access, and the type of access allowed
332      for each.
333 Capability
334      A token that grants the bearer permission to access an object or
335      service. In Kerberos, this might be a ticket whose use is restricted by
336      the contents of the authorization data field, but which lists no
337      network addresses, together with the session key necessary to use the
338      ticket.
339 Ciphertext
340      The output of an encryption function. Encryption transforms plaintext
341      into ciphertext.
342 Client
343      A process that makes use of a network service on behalf of a user. Note
344      that in some cases a Server may itself be a client of some other server
345
346
347 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
348
349      (e.g. a print server may be a client of a file server).
350 Credentials
351      A ticket plus the secret session key necessary to successfully use that
352      ticket in an authentication exchange.
353 KDC
354      Key Distribution Center, a network service that supplies tickets and
355      temporary session keys; or an instance of that service or the host on
356      which it runs. The KDC services both initial ticket and ticket-granting
357      ticket requests. The initial ticket portion is sometimes referred to as
358      the Authentication Server (or service). The ticket-granting ticket
359      portion is sometimes referred to as the ticket-granting server (or
360      service).
361 Kerberos
362      Aside from the 3-headed dog guarding Hades, the name given to Project
363      Athena's authentication service, the protocol used by that service, or
364      the code used to implement the authentication service.
365 Plaintext
366      The input to an encryption function or the output of a decryption
367      function. Decryption transforms ciphertext into plaintext.
368 Principal
369      A uniquely named client or server instance that participates in a
370      network communication.
371 Principal identifier
372      The name used to uniquely identify each different principal.
373 Seal
374      To encipher a record containing several fields in such a way that the
375      fields cannot be individually replaced without either knowledge of the
376      encryption key or leaving evidence of tampering.
377 Secret key
378      An encryption key shared by a principal and the KDC, distributed
379      outside the bounds of the system, with a long lifetime. In the case of
380      a human user's principal, the secret key is derived from a password.
381 Server
382      A particular Principal which provides a resource to network clients.
383      The server is sometimes refered to as the Application Server.
384 Service
385      A resource provided to network clients; often provided by more than one
386      server (for example, remote file service).
387 Session key
388      A temporary encryption key used between two principals, with a lifetime
389      limited to the duration of a single login "session".
390 Sub-session key
391      A temporary encryption key used between two principals, selected and
392      exchanged by the principals using the session key, and with a lifetime
393      limited to the duration of a single association.
394 Ticket
395      A record that helps a client authenticate itself to a server; it
396      contains the client's identity, a session key, a timestamp, and other
397      information, all sealed using the server's secret key. It only serves
398      to authenticate a client when presented along with a fresh
399      Authenticator.
400
401 2. Ticket flag uses and requests
402
403
404
405 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
406
407 Each Kerberos ticket contains a set of flags which are used to indicate
408 various attributes of that ticket. Most flags may be requested by a client
409 when the ticket is obtained; some are automatically turned on and off by a
410 Kerberos server as required. The following sections explain what the various
411 flags mean, and gives examples of reasons to use such a flag.
412
413 2.1. Initial and pre-authenticated tickets
414
415 The INITIAL flag indicates that a ticket was issued using the AS protocol
416 and not issued based on a ticket-granting ticket. Application servers that
417 want to require the demonstrated knowledge of a client's secret key (e.g. a
418 password-changing program) can insist that this flag be set in any tickets
419 they accept, and thus be assured that the client's key was recently
420 presented to the application client.
421
422 The PRE-AUTHENT and HW-AUTHENT flags provide addition information about the
423 initial authentication, regardless of whether the current ticket was issued
424 directly (in which case INITIAL will also be set) or issued on the basis of
425 a ticket-granting ticket (in which case the INITIAL flag is clear, but the
426 PRE-AUTHENT and HW-AUTHENT flags are carried forward from the
427 ticket-granting ticket).
428
429 2.2. Invalid tickets
430
431 The INVALID flag indicates that a ticket is invalid. Application servers
432 must reject tickets which have this flag set. A postdated ticket will
433 usually be issued in this form. Invalid tickets must be validated by the KDC
434 before use, by presenting them to the KDC in a TGS request with the VALIDATE
435 option specified. The KDC will only validate tickets after their starttime
436 has passed. The validation is required so that postdated tickets which have
437 been stolen before their starttime can be rendered permanently invalid
438 (through a hot-list mechanism) (see section 3.3.3.1).
439
440 2.3. Renewable tickets
441
442 Applications may desire to hold tickets which can be valid for long periods
443 of time. However, this can expose their credentials to potential theft for
444 equally long periods, and those stolen credentials would be valid until the
445 expiration time of the ticket(s). Simply using short-lived tickets and
446 obtaining new ones periodically would require the client to have long-term
447 access to its secret key, an even greater risk. Renewable tickets can be
448 used to mitigate the consequences of theft. Renewable tickets have two
449 "expiration times": the first is when the current instance of the ticket
450 expires, and the second is the latest permissible value for an individual
451 expiration time. An application client must periodically (i.e. before it
452 expires) present a renewable ticket to the KDC, with the RENEW option set in
453 the KDC request. The KDC will issue a new ticket with a new session key and
454 a later expiration time. All other fields of the ticket are left unmodified
455 by the renewal process. When the latest permissible expiration time arrives,
456 the ticket expires permanently. At each renewal, the KDC may consult a
457 hot-list to determine if the ticket had been reported stolen since its last
458 renewal; it will refuse to renew such stolen tickets, and thus the usable
459 lifetime of stolen tickets is reduced.
460
461
462
463 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
464
465 The RENEWABLE flag in a ticket is normally only interpreted by the
466 ticket-granting service (discussed below in section 3.3). It can usually be
467 ignored by application servers. However, some particularly careful
468 application servers may wish to disallow renewable tickets.
469
470 If a renewable ticket is not renewed by its expiration time, the KDC will
471 not renew the ticket. The RENEWABLE flag is reset by default, but a client
472 may request it be set by setting the RENEWABLE option in the KRB_AS_REQ
473 message. If it is set, then the renew-till field in the ticket contains the
474 time after which the ticket may not be renewed.
475
476 2.4. Postdated tickets
477
478 Applications may occasionally need to obtain tickets for use much later,
479 e.g. a batch submission system would need tickets to be valid at the time
480 the batch job is serviced. However, it is dangerous to hold valid tickets in
481 a batch queue, since they will be on-line longer and more prone to theft.
482 Postdated tickets provide a way to obtain these tickets from the KDC at job
483 submission time, but to leave them "dormant" until they are activated and
484 validated by a further request of the KDC. If a ticket theft were reported
485 in the interim, the KDC would refuse to validate the ticket, and the thief
486 would be foiled.
487
488 The MAY-POSTDATE flag in a ticket is normally only interpreted by the
489 ticket-granting service. It can be ignored by application servers. This flag
490 must be set in a ticket-granting ticket in order to issue a postdated ticket
491 based on the presented ticket. It is reset by default; it may be requested
492 by a client by setting the ALLOW-POSTDATE option in the KRB_AS_REQ message.
493 This flag does not allow a client to obtain a postdated ticket-granting
494 ticket; postdated ticket-granting tickets can only by obtained by requesting
495 the postdating in the KRB_AS_REQ message. The life (endtime-starttime) of a
496 postdated ticket will be the remaining life of the ticket-granting ticket at
497 the time of the request, unless the RENEWABLE option is also set, in which
498 case it can be the full life (endtime-starttime) of the ticket-granting
499 ticket. The KDC may limit how far in the future a ticket may be postdated.
500
501 The POSTDATED flag indicates that a ticket has been postdated. The
502 application server can check the authtime field in the ticket to see when
503 the original authentication occurred. Some services may choose to reject
504 postdated tickets, or they may only accept them within a certain period
505 after the original authentication. When the KDC issues a POSTDATED ticket,
506 it will also be marked as INVALID, so that the application client must
507 present the ticket to the KDC to be validated before use.
508
509 2.5. Proxiable and proxy tickets
510
511 At times it may be necessary for a principal to allow a service to perform
512 an operation on its behalf. The service must be able to take on the identity
513 of the client, but only for a particular purpose. A principal can allow a
514 service to take on the principal's identity for a particular purpose by
515 granting it a proxy.
516
517 The process of granting a proxy using the proxy and proxiable flags is used
518 to provide credentials for use with specific services. Though conceptually
519
520
521 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
522
523 also a proxy, user's wishing to delegate their identity for ANY purpose must
524 use the ticket forwarding mechanism described in the next section to forward
525 a ticket granting ticket.
526
527 The PROXIABLE flag in a ticket is normally only interpreted by the
528 ticket-granting service. It can be ignored by application servers. When set,
529 this flag tells the ticket-granting server that it is OK to issue a new
530 ticket (but not a ticket-granting ticket) with a different network address
531 based on this ticket. This flag is set if requested by the client on initial
532 authentication. By default, the client will request that it be set when
533 requesting a ticket granting ticket, and reset when requesting any other
534 ticket.
535
536 This flag allows a client to pass a proxy to a server to perform a remote
537 request on its behalf, e.g. a print service client can give the print server
538 a proxy to access the client's files on a particular file server in order to
539 satisfy a print request.
540
541 In order to complicate the use of stolen credentials, Kerberos tickets are
542 usually valid from only those network addresses specifically included in the
543 ticket[4]. When granting a proxy, the client must specify the new network
544 address from which the proxy is to be used, or indicate that the proxy is to
545 be issued for use from any address.
546
547 The PROXY flag is set in a ticket by the TGS when it issues a proxy ticket.
548 Application servers may check this flag and at their option they may require
549 additional authentication from the agent presenting the proxy in order to
550 provide an audit trail.
551
552 2.6. Forwardable tickets
553
554 Authentication forwarding is an instance of a proxy where the service is
555 granted complete use of the client's identity. An example where it might be
556 used is when a user logs in to a remote system and wants authentication to
557 work from that system as if the login were local.
558
559 The FORWARDABLE flag in a ticket is normally only interpreted by the
560 ticket-granting service. It can be ignored by application servers. The
561 FORWARDABLE flag has an interpretation similar to that of the PROXIABLE
562 flag, except ticket-granting tickets may also be issued with different
563 network addresses. This flag is reset by default, but users may request that
564 it be set by setting the FORWARDABLE option in the AS request when they
565 request their initial ticket- granting ticket.
566
567 This flag allows for authentication forwarding without requiring the user to
568 enter a password again. If the flag is not set, then authentication
569 forwarding is not permitted, but the same result can still be achieved if
570 the user engages in the AS exchange specifying the requested network
571 addresses and supplies a password.
572
573 The FORWARDED flag is set by the TGS when a client presents a ticket with
574 the FORWARDABLE flag set and requests a forwarded ticket by specifying the
575 FORWARDED KDC option and supplying a set of addresses for the new ticket. It
576 is also set in all tickets issued based on tickets with the FORWARDED flag
577
578
579 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
580
581 set. Application servers may choose to process FORWARDED tickets differently
582 than non-FORWARDED tickets.
583
584 2.7. Other KDC options
585
586 There are two additional options which may be set in a client's request of
587 the KDC. The RENEWABLE-OK option indicates that the client will accept a
588 renewable ticket if a ticket with the requested life cannot otherwise be
589 provided. If a ticket with the requested life cannot be provided, then the
590 KDC may issue a renewable ticket with a renew-till equal to the the
591 requested endtime. The value of the renew-till field may still be adjusted
592 by site-determined limits or limits imposed by the individual principal or
593 server.
594
595 The ENC-TKT-IN-SKEY option is honored only by the ticket-granting service.
596 It indicates that the ticket to be issued for the end server is to be
597 encrypted in the session key from the a additional second ticket-granting
598 ticket provided with the request. See section 3.3.3 for specific details.
599
600 3. Message Exchanges
601
602 The following sections describe the interactions between network clients and
603 servers and the messages involved in those exchanges.
604
605 3.1. The Authentication Service Exchange
606
607                           Summary
608       Message direction       Message type    Section
609       1. Client to Kerberos   KRB_AS_REQ      5.4.1
610       2. Kerberos to client   KRB_AS_REP or   5.4.2
611                               KRB_ERROR       5.9.1
612
613 The Authentication Service (AS) Exchange between the client and the Kerberos
614 Authentication Server is initiated by a client when it wishes to obtain
615 authentication credentials for a given server but currently holds no
616 credentials. In its basic form, the client's secret key is used for
617 encryption and decryption. This exchange is typically used at the initiation
618 of a login session to obtain credentials for a Ticket-Granting Server which
619 will subsequently be used to obtain credentials for other servers (see
620 section 3.3) without requiring further use of the client's secret key. This
621 exchange is also used to request credentials for services which must not be
622 mediated through the Ticket-Granting Service, but rather require a
623 principal's secret key, such as the password-changing service[5]. This
624 exchange does not by itself provide any assurance of the the identity of the
625 user[6].
626
627 The exchange consists of two messages: KRB_AS_REQ from the client to
628 Kerberos, and KRB_AS_REP or KRB_ERROR in reply. The formats for these
629 messages are described in sections 5.4.1, 5.4.2, and 5.9.1.
630
631 In the request, the client sends (in cleartext) its own identity and the
632 identity of the server for which it is requesting credentials. The response,
633 KRB_AS_REP, contains a ticket for the client to present to the server, and a
634 session key that will be shared by the client and the server. The session
635
636
637 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
638
639 key and additional information are encrypted in the client's secret key. The
640 KRB_AS_REP message contains information which can be used to detect replays,
641 and to associate it with the message to which it replies. Various errors can
642 occur; these are indicated by an error response (KRB_ERROR) instead of the
643 KRB_AS_REP response. The error message is not encrypted. The KRB_ERROR
644 message contains information which can be used to associate it with the
645 message to which it replies. The lack of encryption in the KRB_ERROR message
646 precludes the ability to detect replays, fabrications, or modifications of
647 such messages.
648
649 Without preautentication, the authentication server does not know whether
650 the client is actually the principal named in the request. It simply sends a
651 reply without knowing or caring whether they are the same. This is
652 acceptable because nobody but the principal whose identity was given in the
653 request will be able to use the reply. Its critical information is encrypted
654 in that principal's key. The initial request supports an optional field that
655 can be used to pass additional information that might be needed for the
656 initial exchange. This field may be used for preauthentication as described
657 in section [hl<>].
658
659 3.1.1. Generation of KRB_AS_REQ message
660
661 The client may specify a number of options in the initial request. Among
662 these options are whether pre-authentication is to be performed; whether the
663 requested ticket is to be renewable, proxiable, or forwardable; whether it
664 should be postdated or allow postdating of derivative tickets; and whether a
665 renewable ticket will be accepted in lieu of a non-renewable ticket if the
666 requested ticket expiration date cannot be satisfied by a non-renewable
667 ticket (due to configuration constraints; see section 4). See section A.1
668 for pseudocode.
669
670 The client prepares the KRB_AS_REQ message and sends it to the KDC.
671
672 3.1.2. Receipt of KRB_AS_REQ message
673
674 If all goes well, processing the KRB_AS_REQ message will result in the
675 creation of a ticket for the client to present to the server. The format for
676 the ticket is described in section 5.3.1. The contents of the ticket are
677 determined as follows.
678
679 3.1.3. Generation of KRB_AS_REP message
680
681 The authentication server looks up the client and server principals named in
682 the KRB_AS_REQ in its database, extracting their respective keys. If
683 required, the server pre-authenticates the request, and if the
684 pre-authentication check fails, an error message with the code
685 KDC_ERR_PREAUTH_FAILED is returned. If the server cannot accommodate the
686 requested encryption type, an error message with code KDC_ERR_ETYPE_NOSUPP
687 is returned. Otherwise it generates a 'random' session key[7].
688
689 If there are multiple encryption keys registered for a client in the
690 Kerberos database (or if the key registered supports multiple encryption
691 types; e.g. DES-CBC-CRC and DES-CBC-MD5), then the etype field from the AS
692 request is used by the KDC to select the encryption method to be used for
693
694
695 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
696
697 encrypting the response to the client. If there is more than one supported,
698 strong encryption type in the etype list, the first valid etype for which an
699 encryption key is available is used. The encryption method used to respond
700 to a TGS request is taken from the keytype of the session key found in the
701 ticket granting ticket.
702
703 When the etype field is present in a KDC request, whether an AS or TGS
704 request, the KDC will attempt to assign the type of the random session key
705 from the list of methods in the etype field. The KDC will select the
706 appropriate type using the list of methods provided together with
707 information from the Kerberos database indicating acceptable encryption
708 methods for the application server. The KDC will not issue tickets with a
709 weak session key encryption type.
710
711 If the requested start time is absent, indicates a time in the past, or is
712 within the window of acceptable clock skew for the KDC and the POSTDATE
713 option has not been specified, then the start time of the ticket is set to
714 the authentication server's current time. If it indicates a time in the
715 future beyond the acceptable clock skew, but the POSTDATED option has not
716 been specified then the error KDC_ERR_CANNOT_POSTDATE is returned. Otherwise
717 the requested start time is checked against the policy of the local realm
718 (the administrator might decide to prohibit certain types or ranges of
719 postdated tickets), and if acceptable, the ticket's start time is set as
720 requested and the INVALID flag is set in the new ticket. The postdated
721 ticket must be validated before use by presenting it to the KDC after the
722 start time has been reached.
723
724 The expiration time of the ticket will be set to the minimum of the
725 following:
726
727    * The expiration time (endtime) requested in the KRB_AS_REQ message.
728    * The ticket's start time plus the maximum allowable lifetime associated
729      with the client principal (the authentication server's database
730      includes a maximum ticket lifetime field in each principal's record;
731      see section 4).
732    * The ticket's start time plus the maximum allowable lifetime associated
733      with the server principal.
734    * The ticket's start time plus the maximum lifetime set by the policy of
735      the local realm.
736
737 If the requested expiration time minus the start time (as determined above)
738 is less than a site-determined minimum lifetime, an error message with code
739 KDC_ERR_NEVER_VALID is returned. If the requested expiration time for the
740 ticket exceeds what was determined as above, and if the 'RENEWABLE-OK'
741 option was requested, then the 'RENEWABLE' flag is set in the new ticket,
742 and the renew-till value is set as if the 'RENEWABLE' option were requested
743 (the field and option names are described fully in section 5.4.1).
744
745 If the RENEWABLE option has been requested or if the RENEWABLE-OK option has
746 been set and a renewable ticket is to be issued, then the renew-till field
747 is set to the minimum of:
748
749    * Its requested value.
750    * The start time of the ticket plus the minimum of the two maximum
751
752
753 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
754
755      renewable lifetimes associated with the principals' database entries.
756    * The start time of the ticket plus the maximum renewable lifetime set by
757      the policy of the local realm.
758
759 The flags field of the new ticket will have the following options set if
760 they have been requested and if the policy of the local realm allows:
761 FORWARDABLE, MAY-POSTDATE, POSTDATED, PROXIABLE, RENEWABLE. If the new
762 ticket is post-dated (the start time is in the future), its INVALID flag
763 will also be set.
764
765 If all of the above succeed, the server formats a KRB_AS_REP message (see
766 section 5.4.2), copying the addresses in the request into the caddr of the
767 response, placing any required pre-authentication data into the padata of
768 the response, and encrypts the ciphertext part in the client's key using the
769 requested encryption method, and sends it to the client. See section A.2 for
770 pseudocode.
771
772 3.1.4. Generation of KRB_ERROR message
773
774 Several errors can occur, and the Authentication Server responds by
775 returning an error message, KRB_ERROR, to the client, with the error-code
776 and e-text fields set to appropriate values. The error message contents and
777 details are described in Section 5.9.1.
778
779 3.1.5. Receipt of KRB_AS_REP message
780
781 If the reply message type is KRB_AS_REP, then the client verifies that the
782 cname and crealm fields in the cleartext portion of the reply match what it
783 requested. If any padata fields are present, they may be used to derive the
784 proper secret key to decrypt the message. The client decrypts the encrypted
785 part of the response using its secret key, verifies that the nonce in the
786 encrypted part matches the nonce it supplied in its request (to detect
787 replays). It also verifies that the sname and srealm in the response match
788 those in the request (or are otherwise expected values), and that the host
789 address field is also correct. It then stores the ticket, session key, start
790 and expiration times, and other information for later use. The
791 key-expiration field from the encrypted part of the response may be checked
792 to notify the user of impending key expiration (the client program could
793 then suggest remedial action, such as a password change). See section A.3
794 for pseudocode.
795
796 Proper decryption of the KRB_AS_REP message is not sufficient to verify the
797 identity of the user; the user and an attacker could cooperate to generate a
798 KRB_AS_REP format message which decrypts properly but is not from the proper
799 KDC. If the host wishes to verify the identity of the user, it must require
800 the user to present application credentials which can be verified using a
801 securely-stored secret key for the host. If those credentials can be
802 verified, then the identity of the user can be assured.
803
804 3.1.6. Receipt of KRB_ERROR message
805
806 If the reply message type is KRB_ERROR, then the client interprets it as an
807 error and performs whatever application-specific tasks are necessary to
808 recover.
809
810
811 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
812
813
814 3.2. The Client/Server Authentication Exchange
815
816                              Summary
817 Message direction                         Message type    Section
818 Client to Application server              KRB_AP_REQ      5.5.1
819 [optional] Application server to client   KRB_AP_REP or   5.5.2
820                                           KRB_ERROR       5.9.1
821
822 The client/server authentication (CS) exchange is used by network
823 applications to authenticate the client to the server and vice versa. The
824 client must have already acquired credentials for the server using the AS or
825 TGS exchange.
826
827 3.2.1. The KRB_AP_REQ message
828
829 The KRB_AP_REQ contains authentication information which should be part of
830 the first message in an authenticated transaction. It contains a ticket, an
831 authenticator, and some additional bookkeeping information (see section
832 5.5.1 for the exact format). The ticket by itself is insufficient to
833 authenticate a client, since tickets are passed across the network in
834 cleartext[DS90], so the authenticator is used to prevent invalid replay of
835 tickets by proving to the server that the client knows the session key of
836 the ticket and thus is entitled to use the ticket. The KRB_AP_REQ message is
837 referred to elsewhere as the 'authentication header.'
838
839 3.2.2. Generation of a KRB_AP_REQ message
840
841 When a client wishes to initiate authentication to a server, it obtains
842 (either through a credentials cache, the AS exchange, or the TGS exchange) a
843 ticket and session key for the desired service. The client may re-use any
844 tickets it holds until they expire. To use a ticket the client constructs a
845 new Authenticator from the the system time, its name, and optionally an
846 application specific checksum, an initial sequence number to be used in
847 KRB_SAFE or KRB_PRIV messages, and/or a session subkey to be used in
848 negotiations for a session key unique to this particular session.
849 Authenticators may not be re-used and will be rejected if replayed to a
850 server[LGDSR87]. If a sequence number is to be included, it should be
851 randomly chosen so that even after many messages have been exchanged it is
852 not likely to collide with other sequence numbers in use.
853
854 The client may indicate a requirement of mutual authentication or the use of
855 a session-key based ticket by setting the appropriate flag(s) in the
856 ap-options field of the message.
857
858 The Authenticator is encrypted in the session key and combined with the
859 ticket to form the KRB_AP_REQ message which is then sent to the end server
860 along with any additional application-specific information. See section A.9
861 for pseudocode.
862
863 3.2.3. Receipt of KRB_AP_REQ message
864
865 Authentication is based on the server's current time of day (clocks must be
866 loosely synchronized), the authenticator, and the ticket. Several errors are
867
868
869 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
870
871 possible. If an error occurs, the server is expected to reply to the client
872 with a KRB_ERROR message. This message may be encapsulated in the
873 application protocol if its 'raw' form is not acceptable to the protocol.
874 The format of error messages is described in section 5.9.1.
875
876 The algorithm for verifying authentication information is as follows. If the
877 message type is not KRB_AP_REQ, the server returns the KRB_AP_ERR_MSG_TYPE
878 error. If the key version indicated by the Ticket in the KRB_AP_REQ is not
879 one the server can use (e.g., it indicates an old key, and the server no
880 longer possesses a copy of the old key), the KRB_AP_ERR_BADKEYVER error is
881 returned. If the USE-SESSION-KEY flag is set in the ap-options field, it
882 indicates to the server that the ticket is encrypted in the session key from
883 the server's ticket-granting ticket rather than its secret key[10]. Since it
884 is possible for the server to be registered in multiple realms, with
885 different keys in each, the srealm field in the unencrypted portion of the
886 ticket in the KRB_AP_REQ is used to specify which secret key the server
887 should use to decrypt that ticket. The KRB_AP_ERR_NOKEY error code is
888 returned if the server doesn't have the proper key to decipher the ticket.
889
890 The ticket is decrypted using the version of the server's key specified by
891 the ticket. If the decryption routines detect a modification of the ticket
892 (each encryption system must provide safeguards to detect modified
893 ciphertext; see section 6), the KRB_AP_ERR_BAD_INTEGRITY error is returned
894 (chances are good that different keys were used to encrypt and decrypt).
895
896 The authenticator is decrypted using the session key extracted from the
897 decrypted ticket. If decryption shows it to have been modified, the
898 KRB_AP_ERR_BAD_INTEGRITY error is returned. The name and realm of the client
899 from the ticket are compared against the same fields in the authenticator.
900 If they don't match, the KRB_AP_ERR_BADMATCH error is returned (they might
901 not match, for example, if the wrong session key was used to encrypt the
902 authenticator). The addresses in the ticket (if any) are then searched for
903 an address matching the operating-system reported address of the client. If
904 no match is found or the server insists on ticket addresses but none are
905 present in the ticket, the KRB_AP_ERR_BADADDR error is returned.
906
907 If the local (server) time and the client time in the authenticator differ
908 by more than the allowable clock skew (e.g., 5 minutes), the KRB_AP_ERR_SKEW
909 error is returned. If the server name, along with the client name, time and
910 microsecond fields from the Authenticator match any recently-seen such
911 tuples, the KRB_AP_ERR_REPEAT error is returned[11]. The server must
912 remember any authenticator presented within the allowable clock skew, so
913 that a replay attempt is guaranteed to fail. If a server loses track of any
914 authenticator presented within the allowable clock skew, it must reject all
915 requests until the clock skew interval has passed. This assures that any
916 lost or re-played authenticators will fall outside the allowable clock skew
917 and can no longer be successfully replayed (If this is not done, an attacker
918 could conceivably record the ticket and authenticator sent over the network
919 to a server, then disable the client's host, pose as the disabled host, and
920 replay the ticket and authenticator to subvert the authentication.). If a
921 sequence number is provided in the authenticator, the server saves it for
922 later use in processing KRB_SAFE and/or KRB_PRIV messages. If a subkey is
923 present, the server either saves it for later use or uses it to help
924 generate its own choice for a subkey to be returned in a KRB_AP_REP message.
925
926
927 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
928
929
930 The server computes the age of the ticket: local (server) time minus the
931 start time inside the Ticket. If the start time is later than the current
932 time by more than the allowable clock skew or if the INVALID flag is set in
933 the ticket, the KRB_AP_ERR_TKT_NYV error is returned. Otherwise, if the
934 current time is later than end time by more than the allowable clock skew,
935 the KRB_AP_ERR_TKT_EXPIRED error is returned.
936
937 If all these checks succeed without an error, the server is assured that the
938 client possesses the credentials of the principal named in the ticket and
939 thus, the client has been authenticated to the server. See section A.10 for
940 pseudocode.
941
942 Passing these checks provides only authentication of the named principal; it
943 does not imply authorization to use the named service. Applications must
944 make a separate authorization decisions based upon the authenticated name of
945 the user, the requested operation, local acces control information such as
946 that contained in a .k5login or .k5users file, and possibly a separate
947 distributed authorization service.
948
949 3.2.4. Generation of a KRB_AP_REP message
950
951 Typically, a client's request will include both the authentication
952 information and its initial request in the same message, and the server need
953 not explicitly reply to the KRB_AP_REQ. However, if mutual authentication
954 (not only authenticating the client to the server, but also the server to
955 the client) is being performed, the KRB_AP_REQ message will have
956 MUTUAL-REQUIRED set in its ap-options field, and a KRB_AP_REP message is
957 required in response. As with the error message, this message may be
958 encapsulated in the application protocol if its "raw" form is not acceptable
959 to the application's protocol. The timestamp and microsecond field used in
960 the reply must be the client's timestamp and microsecond field (as provided
961 in the authenticator)[12]. If a sequence number is to be included, it should
962 be randomly chosen as described above for the authenticator. A subkey may be
963 included if the server desires to negotiate a different subkey. The
964 KRB_AP_REP message is encrypted in the session key extracted from the
965 ticket. See section A.11 for pseudocode.
966
967 3.2.5. Receipt of KRB_AP_REP message
968
969 If a KRB_AP_REP message is returned, the client uses the session key from
970 the credentials obtained for the server[13] to decrypt the message, and
971 verifies that the timestamp and microsecond fields match those in the
972 Authenticator it sent to the server. If they match, then the client is
973 assured that the server is genuine. The sequence number and subkey (if
974 present) are retained for later use. See section A.12 for pseudocode.
975
976 3.2.6. Using the encryption key
977
978 After the KRB_AP_REQ/KRB_AP_REP exchange has occurred, the client and server
979 share an encryption key which can be used by the application. The 'true
980 session key' to be used for KRB_PRIV, KRB_SAFE, or other
981 application-specific uses may be chosen by the application based on the
982 subkeys in the KRB_AP_REP message and the authenticator[14]. In some cases,
983
984
985 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
986
987 the use of this session key will be implicit in the protocol; in others the
988 method of use must be chosen from several alternatives. We leave the
989 protocol negotiations of how to use the key (e.g. selecting an encryption or
990 checksum type) to the application programmer; the Kerberos protocol does not
991 constrain the implementation options, but an example of how this might be
992 done follows.
993
994 One way that an application may choose to negotiate a key to be used for
995 subequent integrity and privacy protection is for the client to propose a
996 key in the subkey field of the authenticator. The server can then choose a
997 key using the proposed key from the client as input, returning the new
998 subkey in the subkey field of the application reply. This key could then be
999 used for subsequent communication. To make this example more concrete, if
1000 the encryption method in use required a 56 bit key, and for whatever reason,
1001 one of the parties was prevented from using a key with more than 40 unknown
1002 bits, this method would allow the the party which is prevented from using
1003 more than 40 bits to either propose (if the client) an initial key with a
1004 known quantity for 16 of those bits, or to mask 16 of the bits (if the
1005 server) with the known quantity. The application implementor is warned,
1006 however, that this is only an example, and that an analysis of the
1007 particular crytosystem to be used, and the reasons for limiting the key
1008 length, must be made before deciding whether it is acceptable to mask bits
1009 of the key.
1010
1011 With both the one-way and mutual authentication exchanges, the peers should
1012 take care not to send sensitive information to each other without proper
1013 assurances. In particular, applications that require privacy or integrity
1014 should use the KRB_AP_REP response from the server to client to assure both
1015 client and server of their peer's identity. If an application protocol
1016 requires privacy of its messages, it can use the KRB_PRIV message (section
1017 3.5). The KRB_SAFE message (section 3.4) can be used to assure integrity.
1018
1019 3.3. The Ticket-Granting Service (TGS) Exchange
1020
1021                           Summary
1022       Message direction       Message type     Section
1023       1. Client to Kerberos   KRB_TGS_REQ      5.4.1
1024       2. Kerberos to client   KRB_TGS_REP or   5.4.2
1025                               KRB_ERROR        5.9.1
1026
1027 The TGS exchange between a client and the Kerberos Ticket-Granting Server is
1028 initiated by a client when it wishes to obtain authentication credentials
1029 for a given server (which might be registered in a remote realm), when it
1030 wishes to renew or validate an existing ticket, or when it wishes to obtain
1031 a proxy ticket. In the first case, the client must already have acquired a
1032 ticket for the Ticket-Granting Service using the AS exchange (the
1033 ticket-granting ticket is usually obtained when a client initially
1034 authenticates to the system, such as when a user logs in). The message
1035 format for the TGS exchange is almost identical to that for the AS exchange.
1036 The primary difference is that encryption and decryption in the TGS exchange
1037 does not take place under the client's key. Instead, the session key from
1038 the ticket-granting ticket or renewable ticket, or sub-session key from an
1039 Authenticator is used. As is the case for all application servers, expired
1040 tickets are not accepted by the TGS, so once a renewable or ticket-granting
1041
1042
1043 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1044
1045 ticket expires, the client must use a separate exchange to obtain valid
1046 tickets.
1047
1048 The TGS exchange consists of two messages: A request (KRB_TGS_REQ) from the
1049 client to the Kerberos Ticket-Granting Server, and a reply (KRB_TGS_REP or
1050 KRB_ERROR). The KRB_TGS_REQ message includes information authenticating the
1051 client plus a request for credentials. The authentication information
1052 consists of the authentication header (KRB_AP_REQ) which includes the
1053 client's previously obtained ticket-granting, renewable, or invalid ticket.
1054 In the ticket-granting ticket and proxy cases, the request may include one
1055 or more of: a list of network addresses, a collection of typed authorization
1056 data to be sealed in the ticket for authorization use by the application
1057 server, or additional tickets (the use of which are described later). The
1058 TGS reply (KRB_TGS_REP) contains the requested credentials, encrypted in the
1059 session key from the ticket-granting ticket or renewable ticket, or if
1060 present, in the sub-session key from the Authenticator (part of the
1061 authentication header). The KRB_ERROR message contains an error code and
1062 text explaining what went wrong. The KRB_ERROR message is not encrypted. The
1063 KRB_TGS_REP message contains information which can be used to detect
1064 replays, and to associate it with the message to which it replies. The
1065 KRB_ERROR message also contains information which can be used to associate
1066 it with the message to which it replies, but the lack of encryption in the
1067 KRB_ERROR message precludes the ability to detect replays or fabrications of
1068 such messages.
1069
1070 3.3.1. Generation of KRB_TGS_REQ message
1071
1072 Before sending a request to the ticket-granting service, the client must
1073 determine in which realm the application server is registered[15]. If the
1074 client does not already possess a ticket-granting ticket for the appropriate
1075 realm, then one must be obtained. This is first attempted by requesting a
1076 ticket-granting ticket for the destination realm from a Kerberos server for
1077 which the client does posess a ticket-granting ticket (using the KRB_TGS_REQ
1078 message recursively). The Kerberos server may return a TGT for the desired
1079 realm in which case one can proceed. Alternatively, the Kerberos server may
1080 return a TGT for a realm which is 'closer' to the desired realm (further
1081 along the standard hierarchical path), in which case this step must be
1082 repeated with a Kerberos server in the realm specified in the returned TGT.
1083 If neither are returned, then the request must be retried with a Kerberos
1084 server for a realm higher in the hierarchy. This request will itself require
1085 a ticket-granting ticket for the higher realm which must be obtained by
1086 recursively applying these directions.
1087
1088 Once the client obtains a ticket-granting ticket for the appropriate realm,
1089 it determines which Kerberos servers serve that realm, and contacts one. The
1090 list might be obtained through a configuration file or network service or it
1091 may be generated from the name of the realm; as long as the secret keys
1092 exchanged by realms are kept secret, only denial of service results from
1093 using a false Kerberos server.
1094
1095 As in the AS exchange, the client may specify a number of options in the
1096 KRB_TGS_REQ message. The client prepares the KRB_TGS_REQ message, providing
1097 an authentication header as an element of the padata field, and including
1098 the same fields as used in the KRB_AS_REQ message along with several
1099
1100
1101 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1102
1103 optional fields: the enc-authorization-data field for application server use
1104 and additional tickets required by some options.
1105
1106 In preparing the authentication header, the client can select a sub-session
1107 key under which the response from the Kerberos server will be encrypted[16].
1108 If the sub-session key is not specified, the session key from the
1109 ticket-granting ticket will be used. If the enc-authorization-data is
1110 present, it must be encrypted in the sub-session key, if present, from the
1111 authenticator portion of the authentication header, or if not present, using
1112 the session key from the ticket-granting ticket.
1113
1114 Once prepared, the message is sent to a Kerberos server for the destination
1115 realm. See section A.5 for pseudocode.
1116
1117 3.3.2. Receipt of KRB_TGS_REQ message
1118
1119 The KRB_TGS_REQ message is processed in a manner similar to the KRB_AS_REQ
1120 message, but there are many additional checks to be performed. First, the
1121 Kerberos server must determine which server the accompanying ticket is for
1122 and it must select the appropriate key to decrypt it. For a normal
1123 KRB_TGS_REQ message, it will be for the ticket granting service, and the
1124 TGS's key will be used. If the TGT was issued by another realm, then the
1125 appropriate inter-realm key must be used. If the accompanying ticket is not
1126 a ticket granting ticket for the current realm, but is for an application
1127 server in the current realm, the RENEW, VALIDATE, or PROXY options are
1128 specified in the request, and the server for which a ticket is requested is
1129 the server named in the accompanying ticket, then the KDC will decrypt the
1130 ticket in the authentication header using the key of the server for which it
1131 was issued. If no ticket can be found in the padata field, the
1132 KDC_ERR_PADATA_TYPE_NOSUPP error is returned.
1133
1134 Once the accompanying ticket has been decrypted, the user-supplied checksum
1135 in the Authenticator must be verified against the contents of the request,
1136 and the message rejected if the checksums do not match (with an error code
1137 of KRB_AP_ERR_MODIFIED) or if the checksum is not keyed or not
1138 collision-proof (with an error code of KRB_AP_ERR_INAPP_CKSUM). If the
1139 checksum type is not supported, the KDC_ERR_SUMTYPE_NOSUPP error is
1140 returned. If the authorization-data are present, they are decrypted using
1141 the sub-session key from the Authenticator.
1142
1143 If any of the decryptions indicate failed integrity checks, the
1144 KRB_AP_ERR_BAD_INTEGRITY error is returned.
1145
1146 3.3.3. Generation of KRB_TGS_REP message
1147
1148 The KRB_TGS_REP message shares its format with the KRB_AS_REP (KRB_KDC_REP),
1149 but with its type field set to KRB_TGS_REP. The detailed specification is in
1150 section 5.4.2.
1151
1152 The response will include a ticket for the requested server. The Kerberos
1153 database is queried to retrieve the record for the requested server
1154 (including the key with which the ticket will be encrypted). If the request
1155 is for a ticket granting ticket for a remote realm, and if no key is shared
1156 with the requested realm, then the Kerberos server will select the realm
1157
1158
1159 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1160
1161 "closest" to the requested realm with which it does share a key, and use
1162 that realm instead. This is the only case where the response from the KDC
1163 will be for a different server than that requested by the client.
1164
1165 By default, the address field, the client's name and realm, the list of
1166 transited realms, the time of initial authentication, the expiration time,
1167 and the authorization data of the newly-issued ticket will be copied from
1168 the ticket-granting ticket (TGT) or renewable ticket. If the transited field
1169 needs to be updated, but the transited type is not supported, the
1170 KDC_ERR_TRTYPE_NOSUPP error is returned.
1171
1172 If the request specifies an endtime, then the endtime of the new ticket is
1173 set to the minimum of (a) that request, (b) the endtime from the TGT, and
1174 (c) the starttime of the TGT plus the minimum of the maximum life for the
1175 application server and the maximum life for the local realm (the maximum
1176 life for the requesting principal was already applied when the TGT was
1177 issued). If the new ticket is to be a renewal, then the endtime above is
1178 replaced by the minimum of (a) the value of the renew_till field of the
1179 ticket and (b) the starttime for the new ticket plus the life
1180 (endtime-starttime) of the old ticket.
1181
1182 If the FORWARDED option has been requested, then the resulting ticket will
1183 contain the addresses specified by the client. This option will only be
1184 honored if the FORWARDABLE flag is set in the TGT. The PROXY option is
1185 similar; the resulting ticket will contain the addresses specified by the
1186 client. It will be honored only if the PROXIABLE flag in the TGT is set. The
1187 PROXY option will not be honored on requests for additional ticket-granting
1188 tickets.
1189
1190 If the requested start time is absent, indicates a time in the past, or is
1191 within the window of acceptable clock skew for the KDC and the POSTDATE
1192 option has not been specified, then the start time of the ticket is set to
1193 the authentication server's current time. If it indicates a time in the
1194 future beyond the acceptable clock skew, but the POSTDATED option has not
1195 been specified or the MAY-POSTDATE flag is not set in the TGT, then the
1196 error KDC_ERR_CANNOT_POSTDATE is returned. Otherwise, if the ticket-granting
1197 ticket has the MAY-POSTDATE flag set, then the resulting ticket will be
1198 postdated and the requested starttime is checked against the policy of the
1199 local realm. If acceptable, the ticket's start time is set as requested, and
1200 the INVALID flag is set. The postdated ticket must be validated before use
1201 by presenting it to the KDC after the starttime has been reached. However,
1202 in no case may the starttime, endtime, or renew-till time of a newly-issued
1203 postdated ticket extend beyond the renew-till time of the ticket-granting
1204 ticket.
1205
1206 If the ENC-TKT-IN-SKEY option has been specified and an additional ticket
1207 has been included in the request, the KDC will decrypt the additional ticket
1208 using the key for the server to which the additional ticket was issued and
1209 verify that it is a ticket-granting ticket. If the name of the requested
1210 server is missing from the request, the name of the client in the additional
1211 ticket will be used. Otherwise the name of the requested server will be
1212 compared to the name of the client in the additional ticket and if
1213 different, the request will be rejected. If the request succeeds, the
1214 session key from the additional ticket will be used to encrypt the new
1215
1216
1217 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1218
1219 ticket that is issued instead of using the key of the server for which the
1220 new ticket will be used[17].
1221
1222 If the name of the server in the ticket that is presented to the KDC as part
1223 of the authentication header is not that of the ticket-granting server
1224 itself, the server is registered in the realm of the KDC, and the RENEW
1225 option is requested, then the KDC will verify that the RENEWABLE flag is set
1226 in the ticket, that the INVALID flag is not set in the ticket, and that the
1227 renew_till time is still in the future. If the VALIDATE option is rqeuested,
1228 the KDC will check that the starttime has passed and the INVALID flag is
1229 set. If the PROXY option is requested, then the KDC will check that the
1230 PROXIABLE flag is set in the ticket. If the tests succeed, and the ticket
1231 passes the hotlist check described in the next paragraph, the KDC will issue
1232 the appropriate new ticket.
1233
1234 3.3.3.1. Checking for revoked tickets
1235
1236 Whenever a request is made to the ticket-granting server, the presented
1237 ticket(s) is(are) checked against a hot-list of tickets which have been
1238 canceled. This hot-list might be implemented by storing a range of issue
1239 timestamps for 'suspect tickets'; if a presented ticket had an authtime in
1240 that range, it would be rejected. In this way, a stolen ticket-granting
1241 ticket or renewable ticket cannot be used to gain additional tickets
1242 (renewals or otherwise) once the theft has been reported. Any normal ticket
1243 obtained before it was reported stolen will still be valid (because they
1244 require no interaction with the KDC), but only until their normal expiration
1245 time.
1246
1247 The ciphertext part of the response in the KRB_TGS_REP message is encrypted
1248 in the sub-session key from the Authenticator, if present, or the session
1249 key key from the ticket-granting ticket. It is not encrypted using the
1250 client's secret key. Furthermore, the client's key's expiration date and the
1251 key version number fields are left out since these values are stored along
1252 with the client's database record, and that record is not needed to satisfy
1253 a request based on a ticket-granting ticket. See section A.6 for pseudocode.
1254
1255 3.3.3.2. Encoding the transited field
1256
1257 If the identity of the server in the TGT that is presented to the KDC as
1258 part of the authentication header is that of the ticket-granting service,
1259 but the TGT was issued from another realm, the KDC will look up the
1260 inter-realm key shared with that realm and use that key to decrypt the
1261 ticket. If the ticket is valid, then the KDC will honor the request, subject
1262 to the constraints outlined above in the section describing the AS exchange.
1263 The realm part of the client's identity will be taken from the
1264 ticket-granting ticket. The name of the realm that issued the
1265 ticket-granting ticket will be added to the transited field of the ticket to
1266 be issued. This is accomplished by reading the transited field from the
1267 ticket-granting ticket (which is treated as an unordered set of realm
1268 names), adding the new realm to the set, then constructing and writing out
1269 its encoded (shorthand) form (this may involve a rearrangement of the
1270 existing encoding).
1271
1272 Note that the ticket-granting service does not add the name of its own
1273
1274
1275 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1276
1277 realm. Instead, its responsibility is to add the name of the previous realm.
1278 This prevents a malicious Kerberos server from intentionally leaving out its
1279 own name (it could, however, omit other realms' names).
1280
1281 The names of neither the local realm nor the principal's realm are to be
1282 included in the transited field. They appear elsewhere in the ticket and
1283 both are known to have taken part in authenticating the principal. Since the
1284 endpoints are not included, both local and single-hop inter-realm
1285 authentication result in a transited field that is empty.
1286
1287 Because the name of each realm transited is added to this field, it might
1288 potentially be very long. To decrease the length of this field, its contents
1289 are encoded. The initially supported encoding is optimized for the normal
1290 case of inter-realm communication: a hierarchical arrangement of realms
1291 using either domain or X.500 style realm names. This encoding (called
1292 DOMAIN-X500-COMPRESS) is now described.
1293
1294 Realm names in the transited field are separated by a ",". The ",", "\",
1295 trailing "."s, and leading spaces (" ") are special characters, and if they
1296 are part of a realm name, they must be quoted in the transited field by
1297 preced- ing them with a "\".
1298
1299 A realm name ending with a "." is interpreted as being prepended to the
1300 previous realm. For example, we can encode traversal of EDU, MIT.EDU,
1301 ATHENA.MIT.EDU, WASHINGTON.EDU, and CS.WASHINGTON.EDU as:
1302
1303      "EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.".
1304
1305 Note that if ATHENA.MIT.EDU, or CS.WASHINGTON.EDU were end-points, that they
1306 would not be included in this field, and we would have:
1307
1308      "EDU,MIT.,WASHINGTON.EDU"
1309
1310 A realm name beginning with a "/" is interpreted as being appended to the
1311 previous realm[18]. If it is to stand by itself, then it should be preceded
1312 by a space (" "). For example, we can encode traversal of /COM/HP/APOLLO,
1313 /COM/HP, /COM, and /COM/DEC as:
1314
1315      "/COM,/HP,/APOLLO, /COM/DEC".
1316
1317 Like the example above, if /COM/HP/APOLLO and /COM/DEC are endpoints, they
1318 they would not be included in this field, and we would have:
1319
1320      "/COM,/HP"
1321
1322 A null subfield preceding or following a "," indicates that all realms
1323 between the previous realm and the next realm have been traversed[19]. Thus,
1324 "," means that all realms along the path between the client and the server
1325 have been traversed. ",EDU, /COM," means that that all realms from the
1326 client's realm up to EDU (in a domain style hierarchy) have been traversed,
1327 and that everything from /COM down to the server's realm in an X.500 style
1328 has also been traversed. This could occur if the EDU realm in one hierarchy
1329 shares an inter-realm key directly with the /COM realm in another hierarchy.
1330
1331
1332
1333 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1334
1335 3.3.4. Receipt of KRB_TGS_REP message
1336
1337 When the KRB_TGS_REP is received by the client, it is processed in the same
1338 manner as the KRB_AS_REP processing described above. The primary difference
1339 is that the ciphertext part of the response must be decrypted using the
1340 session key from the ticket-granting ticket rather than the client's secret
1341 key. See section A.7 for pseudocode.
1342
1343 3.4. The KRB_SAFE Exchange
1344
1345 The KRB_SAFE message may be used by clients requiring the ability to detect
1346 modifications of messages they exchange. It achieves this by including a
1347 keyed collision-proof checksum of the user data and some control
1348 information. The checksum is keyed with an encryption key (usually the last
1349 key negotiated via subkeys, or the session key if no negotiation has
1350 occured).
1351
1352 3.4.1. Generation of a KRB_SAFE message
1353
1354 When an application wishes to send a KRB_SAFE message, it collects its data
1355 and the appropriate control information and computes a checksum over them.
1356 The checksum algorithm should be a keyed one-way hash function (such as the
1357 RSA- MD5-DES checksum algorithm specified in section 6.4.5, or the DES MAC),
1358 generated using the sub-session key if present, or the session key.
1359 Different algorithms may be selected by changing the checksum type in the
1360 message. Unkeyed or non-collision-proof checksums are not suitable for this
1361 use.
1362
1363 The control information for the KRB_SAFE message includes both a timestamp
1364 and a sequence number. The designer of an application using the KRB_SAFE
1365 message must choose at least one of the two mechanisms. This choice should
1366 be based on the needs of the application protocol.
1367
1368 Sequence numbers are useful when all messages sent will be received by one's
1369 peer. Connection state is presently required to maintain the session key, so
1370 maintaining the next sequence number should not present an additional
1371 problem.
1372
1373 If the application protocol is expected to tolerate lost messages without
1374 them being resent, the use of the timestamp is the appropriate replay
1375 detection mechanism. Using timestamps is also the appropriate mechanism for
1376 multi-cast protocols where all of one's peers share a common sub-session
1377 key, but some messages will be sent to a subset of one's peers.
1378
1379 After computing the checksum, the client then transmits the information and
1380 checksum to the recipient in the message format specified in section 5.6.1.
1381
1382 3.4.2. Receipt of KRB_SAFE message
1383
1384 When an application receives a KRB_SAFE message, it verifies it as follows.
1385 If any error occurs, an error code is reported for use by the application.
1386
1387 The message is first checked by verifying that the protocol version and type
1388 fields match the current version and KRB_SAFE, respectively. A mismatch
1389
1390
1391 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1392
1393 generates a KRB_AP_ERR_BADVERSION or KRB_AP_ERR_MSG_TYPE error. The
1394 application verifies that the checksum used is a collision-proof keyed
1395 checksum, and if it is not, a KRB_AP_ERR_INAPP_CKSUM error is generated. The
1396 recipient verifies that the operating system's report of the sender's
1397 address matches the sender's address in the message, and (if a recipient
1398 address is specified or the recipient requires an address) that one of the
1399 recipient's addresses appears as the recipient's address in the message. A
1400 failed match for either case generates a KRB_AP_ERR_BADADDR error. Then the
1401 timestamp and usec and/or the sequence number fields are checked. If
1402 timestamp and usec are expected and not present, or they are present but not
1403 current, the KRB_AP_ERR_SKEW error is generated. If the server name, along
1404 with the client name, time and microsecond fields from the Authenticator
1405 match any recently-seen (sent or received[20] ) such tuples, the
1406 KRB_AP_ERR_REPEAT error is generated. If an incorrect sequence number is
1407 included, or a sequence number is expected but not present, the
1408 KRB_AP_ERR_BADORDER error is generated. If neither a time-stamp and usec or
1409 a sequence number is present, a KRB_AP_ERR_MODIFIED error is generated.
1410 Finally, the checksum is computed over the data and control information, and
1411 if it doesn't match the received checksum, a KRB_AP_ERR_MODIFIED error is
1412 generated.
1413
1414 If all the checks succeed, the application is assured that the message was
1415 generated by its peer and was not modi- fied in transit.
1416
1417 3.5. The KRB_PRIV Exchange
1418
1419 The KRB_PRIV message may be used by clients requiring confidentiality and
1420 the ability to detect modifications of exchanged messages. It achieves this
1421 by encrypting the messages and adding control information.
1422
1423 3.5.1. Generation of a KRB_PRIV message
1424
1425 When an application wishes to send a KRB_PRIV message, it collects its data
1426 and the appropriate control information (specified in section 5.7.1) and
1427 encrypts them under an encryption key (usually the last key negotiated via
1428 subkeys, or the session key if no negotiation has occured). As part of the
1429 control information, the client must choose to use either a timestamp or a
1430 sequence number (or both); see the discussion in section 3.4.1 for
1431 guidelines on which to use. After the user data and control information are
1432 encrypted, the client transmits the ciphertext and some 'envelope'
1433 information to the recipient.
1434
1435 3.5.2. Receipt of KRB_PRIV message
1436
1437 When an application receives a KRB_PRIV message, it verifies it as follows.
1438 If any error occurs, an error code is reported for use by the application.
1439
1440 The message is first checked by verifying that the protocol version and type
1441 fields match the current version and KRB_PRIV, respectively. A mismatch
1442 generates a KRB_AP_ERR_BADVERSION or KRB_AP_ERR_MSG_TYPE error. The
1443 application then decrypts the ciphertext and processes the resultant
1444 plaintext. If decryption shows the data to have been modified, a
1445 KRB_AP_ERR_BAD_INTEGRITY error is generated. The recipient verifies that the
1446 operating system's report of the sender's address matches the sender's
1447
1448
1449 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1450
1451 address in the message, and (if a recipient address is specified or the
1452 recipient requires an address) that one of the recipient's addresses appears
1453 as the recipient's address in the message. A failed match for either case
1454 generates a KRB_AP_ERR_BADADDR error. Then the timestamp and usec and/or the
1455 sequence number fields are checked. If timestamp and usec are expected and
1456 not present, or they are present but not current, the KRB_AP_ERR_SKEW error
1457 is generated. If the server name, along with the client name, time and
1458 microsecond fields from the Authenticator match any recently-seen such
1459 tuples, the KRB_AP_ERR_REPEAT error is generated. If an incorrect sequence
1460 number is included, or a sequence number is expected but not present, the
1461 KRB_AP_ERR_BADORDER error is generated. If neither a time-stamp and usec or
1462 a sequence number is present, a KRB_AP_ERR_MODIFIED error is generated.
1463
1464 If all the checks succeed, the application can assume the message was
1465 generated by its peer, and was securely transmitted (without intruders able
1466 to see the unencrypted contents).
1467
1468 3.6. The KRB_CRED Exchange
1469
1470 The KRB_CRED message may be used by clients requiring the ability to send
1471 Kerberos credentials from one host to another. It achieves this by sending
1472 the tickets together with encrypted data containing the session keys and
1473 other information associated with the tickets.
1474
1475 3.6.1. Generation of a KRB_CRED message
1476
1477 When an application wishes to send a KRB_CRED message it first (using the
1478 KRB_TGS exchange) obtains credentials to be sent to the remote host. It then
1479 constructs a KRB_CRED message using the ticket or tickets so obtained,
1480 placing the session key needed to use each ticket in the key field of the
1481 corresponding KrbCredInfo sequence of the encrypted part of the the KRB_CRED
1482 message.
1483
1484 Other information associated with each ticket and obtained during the
1485 KRB_TGS exchange is also placed in the corresponding KrbCredInfo sequence in
1486 the encrypted part of the KRB_CRED message. The current time and, if
1487 specifically required by the application the nonce, s-address, and r-address
1488 fields, are placed in the encrypted part of the KRB_CRED message which is
1489 then encrypted under an encryption key previosuly exchanged in the KRB_AP
1490 exchange (usually the last key negotiated via subkeys, or the session key if
1491 no negotiation has occured).
1492
1493 3.6.2. Receipt of KRB_CRED message
1494
1495 When an application receives a KRB_CRED message, it verifies it. If any
1496 error occurs, an error code is reported for use by the application. The
1497 message is verified by checking that the protocol version and type fields
1498 match the current version and KRB_CRED, respectively. A mismatch generates a
1499 KRB_AP_ERR_BADVERSION or KRB_AP_ERR_MSG_TYPE error. The application then
1500 decrypts the ciphertext and processes the resultant plaintext. If decryption
1501 shows the data to have been modified, a KRB_AP_ERR_BAD_INTEGRITY error is
1502 generated.
1503
1504 If present or required, the recipient verifies that the operating system's
1505
1506
1507 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1508
1509 report of the sender's address matches the sender's address in the message,
1510 and that one of the recipient's addresses appears as the recipient's address
1511 in the message. A failed match for either case generates a
1512 KRB_AP_ERR_BADADDR error. The timestamp and usec fields (and the nonce field
1513 if required) are checked next. If the timestamp and usec are not present, or
1514 they are present but not current, the KRB_AP_ERR_SKEW error is generated.
1515
1516 If all the checks succeed, the application stores each of the new tickets in
1517 its ticket cache together with the session key and other information in the
1518 corresponding KrbCredInfo sequence from the encrypted part of the KRB_CRED
1519 message.
1520
1521 4. The Kerberos Database
1522
1523 The Kerberos server must have access to a database contain- ing the
1524 principal identifiers and secret keys of principals to be authenticated[21].
1525
1526 4.1. Database contents
1527
1528 A database entry should contain at least the following fields:
1529
1530 Field                Value
1531
1532 name                 Principal's identifier
1533 key                  Principal's secret key
1534 p_kvno               Principal's key version
1535 max_life             Maximum lifetime for Tickets
1536 max_renewable_life   Maximum total lifetime for renewable Tickets
1537
1538 The name field is an encoding of the principal's identifier. The key field
1539 contains an encryption key. This key is the principal's secret key. (The key
1540 can be encrypted before storage under a Kerberos "master key" to protect it
1541 in case the database is compromised but the master key is not. In that case,
1542 an extra field must be added to indicate the master key version used, see
1543 below.) The p_kvno field is the key version number of the principal's secret
1544 key. The max_life field contains the maximum allowable lifetime (endtime -
1545 starttime) for any Ticket issued for this principal. The max_renewable_life
1546 field contains the maximum allowable total lifetime for any renewable Ticket
1547 issued for this principal. (See section 3.1 for a description of how these
1548 lifetimes are used in determining the lifetime of a given Ticket.)
1549
1550 A server may provide KDC service to several realms, as long as the database
1551 representation provides a mechanism to distinguish between principal records
1552 with identifiers which differ only in the realm name.
1553
1554 When an application server's key changes, if the change is routine (i.e. not
1555 the result of disclosure of the old key), the old key should be retained by
1556 the server until all tickets that had been issued using that key have
1557 expired. Because of this, it is possible for several keys to be active for a
1558 single principal. Ciphertext encrypted in a principal's key is always tagged
1559 with the version of the key that was used for encryption, to help the
1560 recipient find the proper key for decryption.
1561
1562 When more than one key is active for a particular principal, the principal
1563
1564
1565 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1566
1567 will have more than one record in the Kerberos database. The keys and key
1568 version numbers will differ between the records (the rest of the fields may
1569 or may not be the same). Whenever Kerberos issues a ticket, or responds to a
1570 request for initial authentication, the most recent key (known by the
1571 Kerberos server) will be used for encryption. This is the key with the
1572 highest key version number.
1573
1574 4.2. Additional fields
1575
1576 Project Athena's KDC implementation uses additional fields in its database:
1577
1578 Field        Value
1579
1580 K_kvno       Kerberos' key version
1581 expiration   Expiration date for entry
1582 attributes   Bit field of attributes
1583 mod_date     Timestamp of last modification
1584 mod_name     Modifying principal's identifier
1585
1586 The K_kvno field indicates the key version of the Kerberos master key under
1587 which the principal's secret key is encrypted.
1588
1589 After an entry's expiration date has passed, the KDC will return an error to
1590 any client attempting to gain tickets as or for the principal. (A database
1591 may want to maintain two expiration dates: one for the principal, and one
1592 for the principal's current key. This allows password aging to work
1593 independently of the principal's expiration date. However, due to the
1594 limited space in the responses, the KDC must combine the key expiration and
1595 principal expiration date into a single value called 'key_exp', which is
1596 used as a hint to the user to take administrative action.)
1597
1598 The attributes field is a bitfield used to govern the operations involving
1599 the principal. This field might be useful in conjunction with user
1600 registration procedures, for site-specific policy implementations (Project
1601 Athena currently uses it for their user registration process controlled by
1602 the system-wide database service, Moira [LGDSR87]), to identify whether a
1603 principal can play the role of a client or server or both, to note whether a
1604 server is appropriate trusted to recieve credentials delegated by a client,
1605 or to identify the 'string to key' conversion algorithm used for a
1606 principal's key[22]. Other bits are used to indicate that certain ticket
1607 options should not be allowed in tickets encrypted under a principal's key
1608 (one bit each): Disallow issuing postdated tickets, disallow issuing
1609 forwardable tickets, disallow issuing tickets based on TGT authentication,
1610 disallow issuing renewable tickets, disallow issuing proxiable tickets, and
1611 disallow issuing tickets for which the principal is the server.
1612
1613 The mod_date field contains the time of last modification of the entry, and
1614 the mod_name field contains the name of the principal which last modified
1615 the entry.
1616
1617 4.3. Frequently Changing Fields
1618
1619 Some KDC implementations may wish to maintain the last time that a request
1620 was made by a particular principal. Information that might be maintained
1621
1622
1623 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1624
1625 includes the time of the last request, the time of the last request for a
1626 ticket-granting ticket, the time of the last use of a ticket-granting
1627 ticket, or other times. This information can then be returned to the user in
1628 the last-req field (see section 5.2).
1629
1630 Other frequently changing information that can be maintained is the latest
1631 expiration time for any tickets that have been issued using each key. This
1632 field would be used to indicate how long old keys must remain valid to allow
1633 the continued use of outstanding tickets.
1634
1635 4.4. Site Constants
1636
1637 The KDC implementation should have the following configurable constants or
1638 options, to allow an administrator to make and enforce policy decisions:
1639
1640    * The minimum supported lifetime (used to determine whether the
1641      KDC_ERR_NEVER_VALID error should be returned). This constant should
1642      reflect reasonable expectations of round-trip time to the KDC,
1643      encryption/decryption time, and processing time by the client and
1644      target server, and it should allow for a minimum 'useful' lifetime.
1645    * The maximum allowable total (renewable) lifetime of a ticket
1646      (renew_till - starttime).
1647    * The maximum allowable lifetime of a ticket (endtime - starttime).
1648    * Whether to allow the issue of tickets with empty address fields
1649      (including the ability to specify that such tickets may only be issued
1650      if the request specifies some authorization_data).
1651    * Whether proxiable, forwardable, renewable or post-datable tickets are
1652      to be issued.
1653
1654 5. Message Specifications
1655
1656 The following sections describe the exact contents and encoding of protocol
1657 messages and objects. The ASN.1 base definitions are presented in the first
1658 subsection. The remaining subsections specify the protocol objects (tickets
1659 and authenticators) and messages. Specification of encryption and checksum
1660 techniques, and the fields related to them, appear in section 6.
1661
1662 5.1. ASN.1 Distinguished Encoding Representation
1663
1664 All uses of ASN.1 in Kerberos shall use the Distinguished Encoding
1665 Representation of the data elements as described in the X.509 specification,
1666 section 8.7 [X509-88].
1667
1668 5.2. ASN.1 Base Definitions
1669
1670 The following ASN.1 base definitions are used in the rest of this section.
1671 Note that since the underscore character (_) is not permitted in ASN.1
1672 names, the hyphen (-) is used in its place for the purposes of ASN.1 names.
1673
1674 Realm ::=           GeneralString
1675 PrincipalName ::=   SEQUENCE {
1676                     name-type[0]     INTEGER,
1677                     name-string[1]   SEQUENCE OF GeneralString
1678 }
1679
1680
1681 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1682
1683
1684 Kerberos realms are encoded as GeneralStrings. Realms shall not contain a
1685 character with the code 0 (the ASCII NUL). Most realms will usually consist
1686 of several components separated by periods (.), in the style of Internet
1687 Domain Names, or separated by slashes (/) in the style of X.500 names.
1688 Acceptable forms for realm names are specified in section 7. A PrincipalName
1689 is a typed sequence of components consisting of the following sub-fields:
1690
1691 name-type
1692      This field specifies the type of name that follows. Pre-defined values
1693      for this field are specified in section 7.2. The name-type should be
1694      treated as a hint. Ignoring the name type, no two names can be the same
1695      (i.e. at least one of the components, or the realm, must be different).
1696      This constraint may be eliminated in the future.
1697 name-string
1698      This field encodes a sequence of components that form a name, each
1699      component encoded as a GeneralString. Taken together, a PrincipalName
1700      and a Realm form a principal identifier. Most PrincipalNames will have
1701      only a few components (typically one or two).
1702
1703 KerberosTime ::=   GeneralizedTime
1704                    -- Specifying UTC time zone (Z)
1705
1706 The timestamps used in Kerberos are encoded as GeneralizedTimes. An encoding
1707 shall specify the UTC time zone (Z) and shall not include any fractional
1708 portions of the seconds. It further shall not include any separators.
1709 Example: The only valid format for UTC time 6 minutes, 27 seconds after 9 pm
1710 on 6 November 1985 is 19851106210627Z.
1711
1712 HostAddress ::=     SEQUENCE  {
1713                     addr-type[0]             INTEGER,
1714                     address[1]               OCTET STRING
1715 }
1716
1717 HostAddresses ::=   SEQUENCE OF HostAddress
1718
1719 The host adddress encodings consists of two fields:
1720
1721 addr-type
1722      This field specifies the type of address that follows. Pre-defined
1723      values for this field are specified in section 8.1.
1724 address
1725      This field encodes a single address of type addr-type.
1726
1727 The two forms differ slightly. HostAddress contains exactly one address;
1728 HostAddresses contains a sequence of possibly many addresses.
1729
1730 AuthorizationData ::=   SEQUENCE OF SEQUENCE {
1731                         ad-type[0]               INTEGER,
1732                         ad-data[1]               OCTET STRING
1733 }
1734
1735 ad-data
1736      This field contains authorization data to be interpreted according to
1737
1738
1739 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1740
1741      the value of the corresponding ad-type field.
1742 ad-type
1743      This field specifies the format for the ad-data subfield. All negative
1744      values are reserved for local use. Non-negative values are reserved for
1745      registered use.
1746
1747 Each sequence of type and data is refered to as an authorization element.
1748 Elements may be application specific, however, there is a common set of
1749 recursive elements that should be understood by all implementations. These
1750 elements contain other elements embedded within them, and the interpretation
1751 of the encapsulating element determines which of the embedded elements must
1752 be interpreted, and which may be ignored. Definitions for these common
1753 elements may be found in Appendix B.
1754
1755 TicketExtensions ::= SEQUENCE OF SEQUENCE {
1756            te-type[0]       INTEGER,
1757            te-data[1]       OCTET STRING
1758 }
1759
1760
1761
1762 te-data
1763      This field contains opaque data that must be caried with the ticket to
1764      support extensions to the Kerberos protocol including but not limited
1765      to some forms of inter-realm key exchange and plaintext authorization
1766      data. See appendix C for some common uses of this field.
1767 te-type
1768      This field specifies the format for the te-data subfield. All negative
1769      values are reserved for local use. Non-negative values are reserved for
1770      registered use.
1771
1772 APOptions ::=   BIT STRING {
1773                   reserved(0),
1774                   use-session-key(1),
1775                   mutual-required(2)
1776 }
1777
1778 TicketFlags ::= BIT STRING {
1779                   reserved(0),
1780                   forwardable(1),
1781                   forwarded(2),
1782                   proxiable(3),
1783                   proxy(4),
1784                   may-postdate(5),
1785                   postdated(6),
1786                   invalid(7),
1787                   renewable(8),
1788                   initial(9),
1789                   pre-authent(10),
1790                   hw-authent(11),
1791                   transited-policy-checked(12),
1792                   ok-as-delegate(13)
1793 }
1794
1795
1796
1797 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1798
1799 KDCOptions ::=   BIT STRING {
1800                   reserved(0),
1801                   forwardable(1),
1802                   forwarded(2),
1803                   proxiable(3),
1804                   proxy(4),
1805                   allow-postdate(5),
1806                   postdated(6),
1807                   unused7(7),
1808                   renewable(8),
1809                   unused9(9),
1810                   unused10(10),
1811                   unused11(11),
1812                   unused12(12),
1813                   unused13(13),
1814                   disable-transited-check(26),
1815                   renewable-ok(27),
1816                   enc-tkt-in-skey(28),
1817                   renew(30),
1818                   validate(31)
1819 }
1820
1821 ASN.1 Bit strings have a length and a value. When used in Kerberos for the
1822 APOptions, TicketFlags, and KDCOptions, the length of the bit string on
1823 generated values should be the smallest multiple of 32 bits needed to
1824 include the highest order bit that is set (1), but in no case less than 32
1825 bits. Implementations should accept values of bit strings of any length and
1826 treat the value of flags cooresponding to bits beyond the end of the bit
1827 string as if the bit were reset (0). Comparisonof bit strings of different
1828 length should treat the smaller string as if it were padded with zeros
1829 beyond the high order bits to the length of the longer string[23].
1830
1831 LastReq ::=   SEQUENCE OF SEQUENCE {
1832                lr-type[0]               INTEGER,
1833                lr-value[1]              KerberosTime
1834 }
1835
1836 lr-type
1837      This field indicates how the following lr-value field is to be
1838      interpreted. Negative values indicate that the information pertains
1839      only to the responding server. Non-negative values pertain to all
1840      servers for the realm. If the lr-type field is zero (0), then no
1841      information is conveyed by the lr-value subfield. If the absolute value
1842      of the lr-type field is one (1), then the lr-value subfield is the time
1843      of last initial request for a TGT. If it is two (2), then the lr-value
1844      subfield is the time of last initial request. If it is three (3), then
1845      the lr-value subfield is the time of issue for the newest
1846      ticket-granting ticket used. If it is four (4), then the lr-value
1847      subfield is the time of the last renewal. If it is five (5), then the
1848      lr-value subfield is the time of last request (of any type).
1849 lr-value
1850      This field contains the time of the last request. the time must be
1851      interpreted according to the contents of the accompanying lr-type
1852      subfield.
1853
1854
1855 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1856
1857
1858 See section 6 for the definitions of Checksum, ChecksumType, EncryptedData,
1859 EncryptionKey, EncryptionType, and KeyType.
1860
1861 5.3. Tickets and Authenticators
1862
1863 This section describes the format and encryption parameters for tickets and
1864 authenticators. When a ticket or authenticator is included in a protocol
1865 message it is treated as an opaque object.
1866
1867 5.3.1. Tickets
1868
1869 A ticket is a record that helps a client authenticate to a service. A Ticket
1870 contains the following information:
1871
1872 Ticket ::=        [APPLICATION 1] SEQUENCE {
1873                   tkt-vno[0]                   INTEGER,
1874                   realm[1]                     Realm,
1875                   sname[2]                     PrincipalName,
1876                   enc-part[3]                  EncryptedData,
1877                   extensions[4]                TicketExtensions OPTIONAL
1878 }
1879
1880 -- Encrypted part of ticket
1881 EncTicketPart ::= [APPLICATION 3] SEQUENCE {
1882                   flags[0]                     TicketFlags,
1883                   key[1]                       EncryptionKey,
1884                   crealm[2]                    Realm,
1885                   cname[3]                     PrincipalName,
1886                   transited[4]                 TransitedEncoding,
1887                   authtime[5]                  KerberosTime,
1888                   starttime[6]                 KerberosTime OPTIONAL,
1889                   endtime[7]                   KerberosTime,
1890                   renew-till[8]                KerberosTime OPTIONAL,
1891                   caddr[9]                     HostAddresses OPTIONAL,
1892                   authorization-data[10]       AuthorizationData OPTIONAL
1893 }
1894 -- encoded Transited field
1895 TransitedEncoding ::=   SEQUENCE {
1896                         tr-type[0]             INTEGER, -- must be registered
1897                         contents[1]            OCTET STRING
1898 }
1899
1900 The encoding of EncTicketPart is encrypted in the key shared by Kerberos and
1901 the end server (the server's secret key). See section 6 for the format of
1902 the ciphertext.
1903
1904 tkt-vno
1905      This field specifies the version number for the ticket format. This
1906      document describes version number 5.
1907 realm
1908      This field specifies the realm that issued a ticket. It also serves to
1909      identify the realm part of the server's principal identifier. Since a
1910      Kerberos server can only issue tickets for servers within its realm,
1911
1912
1913 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1914
1915      the two will always be identical.
1916 sname
1917      This field specifies the name part of the server's identity.
1918 enc-part
1919      This field holds the encrypted encoding of the EncTicketPart sequence.
1920 extensions
1921      This optional field contains a sequence of extentions that may be used
1922      to carry information that must be carried with the ticket to support
1923      several extensions, including but not limited to plaintext
1924      authorization data, tokens for exchanging inter-realm keys, and other
1925      information that must be associated with a ticket for use by the
1926      application server. See Appendix C for definitions of some common
1927      extensions.
1928
1929      Note that some older versions of Kerberos did not support this field.
1930      Because this is an optional field it will not break older clients, but
1931      older clients might strip this field from the ticket before sending it
1932      to the application server. This limits the usefulness of this ticket
1933      field to environments where the ticket will not be parsed and
1934      reconstructed by these older Kerberos clients.
1935
1936      If it is known that the client will strip this field from the ticket,
1937      as an interim measure the KDC may append this field to the end of the
1938      enc-part of the ticket and append a traler indicating the lenght of the
1939      appended extensions field. (this paragraph is open for discussion,
1940      including the form of the traler).
1941 flags
1942      This field indicates which of various options were used or requested
1943      when the ticket was issued. It is a bit-field, where the selected
1944      options are indicated by the bit being set (1), and the unselected
1945      options and reserved fields being reset (0). Bit 0 is the most
1946      significant bit. The encoding of the bits is specified in section 5.2.
1947      The flags are described in more detail above in section 2. The meanings
1948      of the flags are:
1949
1950           Bit(s)      Name         Description
1951
1952           0           RESERVED
1953                                    Reserved for future  expansion  of  this
1954                                    field.
1955
1956           1           FORWARDABLE
1957                                    The FORWARDABLE flag  is  normally  only
1958                                    interpreted  by  the  TGS,  and  can  be
1959                                    ignored by end servers.  When set,  this
1960                                    flag  tells  the  ticket-granting server
1961                                    that it is OK to  issue  a  new  ticket-
1962                                    granting ticket with a different network
1963                                    address based on the presented ticket.
1964
1965           2           FORWARDED
1966                                    When set, this flag indicates  that  the
1967                                    ticket  has either been forwarded or was
1968                                    issued based on authentication involving
1969
1970
1971 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
1972
1973                                    a forwarded ticket-granting ticket.
1974
1975           3           PROXIABLE
1976                                    The  PROXIABLE  flag  is  normally  only
1977                                    interpreted  by  the  TGS,  and  can  be
1978                                    ignored by end servers.   The  PROXIABLE
1979                                    flag  has an interpretation identical to
1980                                    that of  the  FORWARDABLE  flag,  except
1981                                    that   the   PROXIABLE  flag  tells  the
1982                                    ticket-granting server  that  only  non-
1983                                    ticket-granting  tickets  may  be issued
1984                                    with different network addresses.
1985
1986           4           PROXY
1987                                    When set, this  flag  indicates  that  a
1988                                    ticket is a proxy.
1989
1990           5           MAY-POSTDATE
1991                                    The MAY-POSTDATE flag is  normally  only
1992                                    interpreted  by  the  TGS,  and  can  be
1993                                    ignored by end servers.  This flag tells
1994                                    the  ticket-granting server that a post-
1995                                    dated ticket may be issued based on this
1996                                    ticket-granting ticket.
1997
1998           6           POSTDATED
1999                                    This flag indicates that this ticket has
2000                                    been  postdated.   The  end-service  can
2001                                    check the authtime field to see when the
2002                                    original authentication occurred.
2003
2004           7           INVALID
2005                                    This flag indicates  that  a  ticket  is
2006                                    invalid, and it must be validated by the
2007                                    KDC  before  use.   Application  servers
2008                                    must reject tickets which have this flag
2009                                    set.
2010
2011           8           RENEWABLE
2012                                    The  RENEWABLE  flag  is  normally  only
2013                                    interpreted  by the TGS, and can usually
2014                                    be ignored by end servers (some particu-
2015                                    larly careful servers may wish to disal-
2016                                    low  renewable  tickets).   A  renewable
2017                                    ticket  can be used to obtain a replace-
2018                                    ment ticket  that  expires  at  a  later
2019                                    date.
2020
2021           9           INITIAL
2022                                    This flag indicates that this ticket was
2023                                    issued  using  the  AS protocol, and not
2024                                    issued  based   on   a   ticket-granting
2025                                    ticket.
2026
2027
2028
2029 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2030
2031           10          PRE-AUTHENT
2032                                    This flag indicates that during  initial
2033                                    authentication, the client was authenti-
2034                                    cated by the KDC  before  a  ticket  was
2035                                    issued.    The   strength  of  the  pre-
2036                                    authentication method is not  indicated,
2037                                    but is acceptable to the KDC.
2038
2039           11          HW-AUTHENT
2040                                    This flag indicates  that  the  protocol
2041                                    employed   for   initial  authentication
2042                                    required the use of hardware expected to
2043                                    be possessed solely by the named client.
2044                                    The hardware  authentication  method  is
2045                                    selected  by the KDC and the strength of
2046                                    the method is not indicated.
2047
2048           12           TRANSITED   This flag indicates that the KDC for the
2049                   POLICY-CHECKED   realm has checked the transited field
2050                                    against a realm defined policy for
2051                                    trusted certifiers.  If this flag is
2052                                    reset (0), then the application server
2053                                    must check the transited field itself,
2054                                    and if unable to do so it must reject
2055                                    the authentication.  If the flag is set
2056                                    (1) then the application server may skip
2057                                    its own validation of the transited
2058                                    field, relying on the validation
2059                                    performed by the KDC.  At its option the
2060                                    application server may still apply its
2061                                    own validation based on a separate
2062                                    policy for acceptance.
2063
2064           13      OK-AS-DELEGATE   This flag indicates that the server (not
2065                                    the client) specified in the ticket has
2066                                    been determined by policy of the realm
2067                                    to be a suitable recipient of
2068                                    delegation.  A client can use the
2069                                    presence of this flag to help it make a
2070                                    decision whether to delegate credentials
2071                                    (either grant a proxy or a forwarded
2072                                    ticket granting ticket) to this server.
2073                                    The client is free to ignore the value
2074                                    of this flag.  When setting this flag,
2075                                    an administrator should consider the
2076                                    Security and placement of the server on
2077                                    which the service will run, as well as
2078                                    whether the service requires the use of
2079                                    delegated credentials.
2080
2081           14          ANONYMOUS
2082                                    This flag indicates that  the  principal
2083                                    named in the ticket is a generic princi-
2084                                    pal for the realm and does not  identify
2085
2086
2087 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2088
2089                                    the  individual  using  the ticket.  The
2090                                    purpose  of  the  ticket  is   only   to
2091                                    securely  distribute  a session key, and
2092                                    not to identify  the  user.   Subsequent
2093                                    requests  using the same ticket and ses-
2094                                    sion may be  considered  as  originating
2095                                    from  the  same  user, but requests with
2096                                    the same username but a different ticket
2097                                    are  likely  to originate from different
2098                                    users.
2099
2100           15-31       RESERVED
2101                                    Reserved for future use.
2102
2103 key
2104      This field exists in the ticket and the KDC response and is used to
2105      pass the session key from Kerberos to the application server and the
2106      client. The field's encoding is described in section 6.2.
2107 crealm
2108      This field contains the name of the realm in which the client is
2109      registered and in which initial authentication took place.
2110 cname
2111      This field contains the name part of the client's principal identifier.
2112 transited
2113      This field lists the names of the Kerberos realms that took part in
2114      authenticating the user to whom this ticket was issued. It does not
2115      specify the order in which the realms were transited. See section
2116      3.3.3.2 for details on how this field encodes the traversed realms.
2117 authtime
2118      This field indicates the time of initial authentication for the named
2119      principal. It is the time of issue for the original ticket on which
2120      this ticket is based. It is included in the ticket to provide
2121      additional information to the end service, and to provide the necessary
2122      information for implementation of a `hot list' service at the KDC. An
2123      end service that is particularly paranoid could refuse to accept
2124      tickets for which the initial authentication occurred "too far" in the
2125      past. This field is also returned as part of the response from the KDC.
2126      When returned as part of the response to initial authentication
2127      (KRB_AS_REP), this is the current time on the Ker- beros server[24].
2128 starttime
2129      This field in the ticket specifies the time after which the ticket is
2130      valid. Together with endtime, this field specifies the life of the
2131      ticket. If it is absent from the ticket, its value should be treated as
2132      that of the authtime field.
2133 endtime
2134      This field contains the time after which the ticket will not be honored
2135      (its expiration time). Note that individual services may place their
2136      own limits on the life of a ticket and may reject tickets which have
2137      not yet expired. As such, this is really an upper bound on the
2138      expiration time for the ticket.
2139 renew-till
2140      This field is only present in tickets that have the RENEWABLE flag set
2141      in the flags field. It indicates the maximum endtime that may be
2142      included in a renewal. It can be thought of as the absolute expiration
2143
2144
2145 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2146
2147      time for the ticket, including all renewals.
2148 caddr
2149      This field in a ticket contains zero (if omitted) or more (if present)
2150      host addresses. These are the addresses from which the ticket can be
2151      used. If there are no addresses, the ticket can be used from any
2152      location. The decision by the KDC to issue or by the end server to
2153      accept zero-address tickets is a policy decision and is left to the
2154      Kerberos and end-service administrators; they may refuse to issue or
2155      accept such tickets. The suggested and default policy, however, is that
2156      such tickets will only be issued or accepted when additional
2157      information that can be used to restrict the use of the ticket is
2158      included in the authorization_data field. Such a ticket is a
2159      capability.
2160
2161      Network addresses are included in the ticket to make it harder for an
2162      attacker to use stolen credentials. Because the session key is not sent
2163      over the network in cleartext, credentials can't be stolen simply by
2164      listening to the network; an attacker has to gain access to the session
2165      key (perhaps through operating system security breaches or a careless
2166      user's unattended session) to make use of stolen tickets.
2167
2168      It is important to note that the network address from which a
2169      connection is received cannot be reliably determined. Even if it could
2170      be, an attacker who has compromised the client's worksta- tion could
2171      use the credentials from there. Including the network addresses only
2172      makes it more difficult, not impossible, for an attacker to walk off
2173      with stolen credentials and then use them from a "safe" location.
2174 authorization-data
2175      The authorization-data field is used to pass authorization data from
2176      the principal on whose behalf a ticket was issued to the application
2177      service. If no authorization data is included, this field will be left
2178      out. Experience has shown that the name of this field is confusing, and
2179      that a better name for this field would be restrictions. Unfortunately,
2180      it is not possible to change the name of this field at this time.
2181
2182      This field contains restrictions on any authority obtained on the basis
2183      of authentication using the ticket. It is possible for any principal in
2184      posession of credentials to add entries to the authorization data field
2185      since these entries further restrict what can be done with the ticket.
2186      Such additions can be made by specifying the additional entries when a
2187      new ticket is obtained during the TGS exchange, or they may be added
2188      during chained delegation using the authorization data field of the
2189      authenticator.
2190
2191      Because entries may be added to this field by the holder of
2192      credentials, it is not allowable for the presence of an entry in the
2193      authorization data field of a ticket to amplify the priveleges one
2194      would obtain from using a ticket.
2195
2196      The data in this field may be specific to the end service; the field
2197      will contain the names of service specific objects, and the rights to
2198      those objects. The format for this field is described in section 5.2.
2199      Although Kerberos is not concerned with the format of the contents of
2200      the sub-fields, it does carry type information (ad-type).
2201
2202
2203 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2204
2205
2206      By using the authorization_data field, a principal is able to issue a
2207      proxy that is valid for a specific purpose. For example, a client
2208      wishing to print a file can obtain a file server proxy to be passed to
2209      the print server. By specifying the name of the file in the
2210      authorization_data field, the file server knows that the print server
2211      can only use the client's rights when accessing the particular file to
2212      be printed.
2213
2214      A separate service providing authorization or certifying group
2215      membership may be built using the authorization-data field. In this
2216      case, the entity granting authorization (not the authorized entity),
2217      obtains a ticket in its own name (e.g. the ticket is issued in the name
2218      of a privelege server), and this entity adds restrictions on its own
2219      authority and delegates the restricted authority through a proxy to the
2220      client. The client would then present this authorization credential to
2221      the application server separately from the authentication exchange.
2222
2223      Similarly, if one specifies the authorization-data field of a proxy and
2224      leaves the host addresses blank, the resulting ticket and session key
2225      can be treated as a capability. See [Neu93] for some suggested uses of
2226      this field.
2227
2228      The authorization-data field is optional and does not have to be
2229      included in a ticket.
2230
2231 5.3.2. Authenticators
2232
2233 An authenticator is a record sent with a ticket to a server to certify the
2234 client's knowledge of the encryption key in the ticket, to help the server
2235 detect replays, and to help choose a "true session key" to use with the
2236 particular session. The encoding is encrypted in the ticket's session key
2237 shared by the client and the server:
2238
2239 -- Unencrypted authenticator
2240 Authenticator ::= [APPLICATION 2] SEQUENCE  {
2241                   authenticator-vno[0]          INTEGER,
2242                   crealm[1]                     Realm,
2243                   cname[2]                      PrincipalName,
2244                   cksum[3]                      Checksum OPTIONAL,
2245                   cusec[4]                      INTEGER,
2246                   ctime[5]                      KerberosTime,
2247                   subkey[6]                     EncryptionKey OPTIONAL,
2248                   seq-number[7]                 INTEGER OPTIONAL,
2249                   authorization-data[8]         AuthorizationData OPTIONAL
2250 }
2251
2252
2253 authenticator-vno
2254      This field specifies the version number for the format of the
2255      authenticator. This document specifies version 5.
2256 crealm and cname
2257      These fields are the same as those described for the ticket in section
2258      5.3.1.
2259
2260
2261 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2262
2263 cksum
2264      This field contains a checksum of the the applica- tion data that
2265      accompanies the KRB_AP_REQ.
2266 cusec
2267      This field contains the microsecond part of the client's timestamp. Its
2268      value (before encryption) ranges from 0 to 999999. It often appears
2269      along with ctime. The two fields are used together to specify a
2270      reasonably accurate timestamp.
2271 ctime
2272      This field contains the current time on the client's host.
2273 subkey
2274      This field contains the client's choice for an encryption key which is
2275      to be used to protect this specific application session. Unless an
2276      application specifies otherwise, if this field is left out the session
2277      key from the ticket will be used.
2278 seq-number
2279      This optional field includes the initial sequence number to be used by
2280      the KRB_PRIV or KRB_SAFE messages when sequence numbers are used to
2281      detect replays (It may also be used by application specific messages).
2282      When included in the authenticator this field specifies the initial
2283      sequence number for messages from the client to the server. When
2284      included in the AP-REP message, the initial sequence number is that for
2285      messages from the server to the client. When used in KRB_PRIV or
2286      KRB_SAFE messages, it is incremented by one after each message is sent.
2287
2288      For sequence numbers to adequately support the detection of replays
2289      they should be non-repeating, even across connection boundaries. The
2290      initial sequence number should be random and uniformly distributed
2291      across the full space of possible sequence numbers, so that it cannot
2292      be guessed by an attacker and so that it and the successive sequence
2293      numbers do not repeat other sequences.
2294 authorization-data
2295      This field is the same as described for the ticket in section 5.3.1. It
2296      is optional and will only appear when additional restrictions are to be
2297      placed on the use of a ticket, beyond those carried in the ticket
2298      itself.
2299
2300 5.4. Specifications for the AS and TGS exchanges
2301
2302 This section specifies the format of the messages used in the exchange
2303 between the client and the Kerberos server. The format of possible error
2304 messages appears in section 5.9.1.
2305
2306 5.4.1. KRB_KDC_REQ definition
2307
2308 The KRB_KDC_REQ message has no type of its own. Instead, its type is one of
2309 KRB_AS_REQ or KRB_TGS_REQ depending on whether the request is for an initial
2310 ticket or an additional ticket. In either case, the message is sent from the
2311 client to the Authentication Server to request credentials for a service.
2312
2313 The message fields are:
2314
2315 AS-REQ ::=         [APPLICATION 10] KDC-REQ
2316 TGS-REQ ::=        [APPLICATION 12] KDC-REQ
2317
2318
2319 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2320
2321
2322 KDC-REQ ::=        SEQUENCE {
2323                    pvno[1]            INTEGER,
2324                    msg-type[2]        INTEGER,
2325                    padata[3]          SEQUENCE OF PA-DATA OPTIONAL,
2326                    req-body[4]        KDC-REQ-BODY
2327 }
2328
2329 PA-DATA ::=        SEQUENCE {
2330                    padata-type[1]     INTEGER,
2331                    padata-value[2]    OCTET STRING,
2332                                       -- might be encoded AP-REQ
2333 }
2334
2335 KDC-REQ-BODY ::=   SEQUENCE {
2336                     kdc-options[0]         KDCOptions,
2337                     cname[1]               PrincipalName OPTIONAL,
2338                                            -- Used only in AS-REQ
2339                     realm[2]               Realm, -- Server's realm
2340                                            -- Also client's in AS-REQ
2341                     sname[3]               PrincipalName OPTIONAL,
2342                     from[4]                KerberosTime OPTIONAL,
2343                     till[5]                KerberosTime OPTIONAL,
2344                     rtime[6]               KerberosTime OPTIONAL,
2345                     nonce[7]               INTEGER,
2346                     etype[8]               SEQUENCE OF INTEGER,
2347                                            -- EncryptionType,
2348                                            -- in preference order
2349                     addresses[9]           HostAddresses OPTIONAL,
2350                 enc-authorization-data[10] EncryptedData OPTIONAL,
2351                                            -- Encrypted AuthorizationData
2352                                            -- encoding
2353                     additional-tickets[11] SEQUENCE OF Ticket OPTIONAL
2354 }
2355
2356 The fields in this message are:
2357
2358 pvno
2359      This field is included in each message, and specifies the protocol
2360      version number. This document specifies protocol version 5.
2361 msg-type
2362      This field indicates the type of a protocol message. It will almost
2363      always be the same as the application identifier associated with a
2364      message. It is included to make the identifier more readily accessible
2365      to the application. For the KDC-REQ message, this type will be
2366      KRB_AS_REQ or KRB_TGS_REQ.
2367 padata
2368      The padata (pre-authentication data) field contains a sequence of
2369      authentication information which may be needed before credentials can
2370      be issued or decrypted. In the case of requests for additional tickets
2371      (KRB_TGS_REQ), this field will include an element with padata-type of
2372      PA-TGS-REQ and data of an authentication header (ticket-granting ticket
2373      and authenticator). The checksum in the authenticator (which must be
2374      collision-proof) is to be computed over the KDC-REQ-BODY encoding. In
2375
2376
2377 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2378
2379      most requests for initial authentication (KRB_AS_REQ) and most replies
2380      (KDC-REP), the padata field will be left out.
2381
2382      This field may also contain information needed by certain extensions to
2383      the Kerberos protocol. For example, it might be used to initially
2384      verify the identity of a client before any response is returned. This
2385      is accomplished with a padata field with padata-type equal to
2386      PA-ENC-TIMESTAMP and padata-value defined as follows:
2387
2388      padata-type     ::= PA-ENC-TIMESTAMP
2389      padata-value    ::= EncryptedData -- PA-ENC-TS-ENC
2390
2391      PA-ENC-TS-ENC   ::= SEQUENCE {
2392                      patimestamp[0]     KerberosTime, -- client's time
2393                      pausec[1]          INTEGER OPTIONAL
2394      }
2395
2396      with patimestamp containing the client's time and pausec containing the
2397      microseconds which may be omitted if a client will not generate more
2398      than one request per second. The ciphertext (padata-value) consists of
2399      the PA-ENC-TS-ENC sequence, encrypted using the client's secret key.
2400
2401      [use-specified-kvno item is here for discussion and may be removed] It
2402      may also be used by the client to specify the version of a key that is
2403      being used for accompanying preauthentication, and/or which should be
2404      used to encrypt the reply from the KDC.
2405
2406      PA-USE-SPECIFIED-KVNO  ::=  Integer
2407
2408      The KDC should only accept and abide by the value of the
2409      use-specified-kvno preauthentication data field when the specified key
2410      is still valid and until use of a new key is confirmed. This situation
2411      is likely to occur primarily during the period during which an updated
2412      key is propagating to other KDC's in a realm.
2413
2414      The padata field can also contain information needed to help the KDC or
2415      the client select the key needed for generating or decrypting the
2416      response. This form of the padata is useful for supporting the use of
2417      certain token cards with Kerberos. The details of such extensions are
2418      specified in separate documents. See [Pat92] for additional uses of
2419      this field.
2420 padata-type
2421      The padata-type element of the padata field indicates the way that the
2422      padata-value element is to be interpreted. Negative values of
2423      padata-type are reserved for unregistered use; non-negative values are
2424      used for a registered interpretation of the element type.
2425 req-body
2426      This field is a placeholder delimiting the extent of the remaining
2427      fields. If a checksum is to be calculated over the request, it is
2428      calculated over an encoding of the KDC-REQ-BODY sequence which is
2429      enclosed within the req-body field.
2430 kdc-options
2431      This field appears in the KRB_AS_REQ and KRB_TGS_REQ requests to the
2432      KDC and indicates the flags that the client wants set on the tickets as
2433
2434
2435 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2436
2437      well as other information that is to modify the behavior of the KDC.
2438      Where appropriate, the name of an option may be the same as the flag
2439      that is set by that option. Although in most case, the bit in the
2440      options field will be the same as that in the flags field, this is not
2441      guaranteed, so it is not acceptable to simply copy the options field to
2442      the flags field. There are various checks that must be made before
2443      honoring an option anyway.
2444
2445      The kdc_options field is a bit-field, where the selected options are
2446      indicated by the bit being set (1), and the unselected options and
2447      reserved fields being reset (0). The encoding of the bits is specified
2448      in section 5.2. The options are described in more detail above in
2449      section 2. The meanings of the options are:
2450
2451         Bit(s)    Name                Description
2452          0        RESERVED
2453                                       Reserved for future  expansion  of  this
2454                                       field.
2455
2456          1        FORWARDABLE
2457                                       The FORWARDABLE  option  indicates  that
2458                                       the  ticket  to be issued is to have its
2459                                       forwardable flag set.  It  may  only  be
2460                                       set on the initial request, or in a sub-
2461                                       sequent request if  the  ticket-granting
2462                                       ticket on which it is based is also for-
2463                                       wardable.
2464
2465          2        FORWARDED
2466                                       The FORWARDED option is  only  specified
2467                                       in  a  request  to  the  ticket-granting
2468                                       server and will only be honored  if  the
2469                                       ticket-granting  ticket  in  the request
2470                                       has  its  FORWARDABLE  bit  set.    This
2471                                       option  indicates that this is a request
2472                                       for forwarding.  The address(es) of  the
2473                                       host  from which the resulting ticket is
2474                                       to  be  valid  are   included   in   the
2475                                       addresses field of the request.
2476
2477          3        PROXIABLE
2478                                       The PROXIABLE option indicates that  the
2479                                       ticket to be issued is to have its prox-
2480                                       iable flag set.  It may only be  set  on
2481                                       the  initial request, or in a subsequent
2482                                       request if the ticket-granting ticket on
2483                                       which it is based is also proxiable.
2484
2485          4        PROXY
2486                                       The PROXY option indicates that this  is
2487                                       a request for a proxy.  This option will
2488                                       only be honored if  the  ticket-granting
2489                                       ticket  in the request has its PROXIABLE
2490                                       bit set.  The address(es)  of  the  host
2491
2492
2493 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2494
2495                                       from which the resulting ticket is to be
2496                                        valid  are  included  in  the  addresses
2497                                       field of the request.
2498
2499          5        ALLOW-POSTDATE
2500                                       The ALLOW-POSTDATE option indicates that
2501                                       the  ticket  to be issued is to have its
2502                                       MAY-POSTDATE flag set.  It may  only  be
2503                                       set on the initial request, or in a sub-
2504                                       sequent request if  the  ticket-granting
2505                                       ticket on which it is based also has its
2506                                       MAY-POSTDATE flag set.
2507
2508          6        POSTDATED
2509                                       The POSTDATED option indicates that this
2510                                       is  a  request  for  a postdated ticket.
2511                                       This option will only be honored if  the
2512                                       ticket-granting  ticket  on  which it is
2513                                       based has  its  MAY-POSTDATE  flag  set.
2514                                       The  resulting ticket will also have its
2515                                       INVALID flag set, and that flag  may  be
2516                                       reset by a subsequent request to the KDC
2517                                       after the starttime in  the  ticket  has
2518                                       been reached.
2519
2520          7        UNUSED
2521                                       This option is presently unused.
2522
2523          8        RENEWABLE
2524                                       The RENEWABLE option indicates that  the
2525                                       ticket  to  be  issued  is  to  have its
2526                                       RENEWABLE flag set.  It may only be  set
2527                                       on  the  initial  request,  or  when the
2528                                       ticket-granting  ticket  on  which   the
2529                                       request  is based is also renewable.  If
2530                                       this option is requested, then the rtime
2531                                       field   in   the  request  contains  the
2532                                       desired absolute expiration time for the
2533                                       ticket.
2534
2535          9-13     UNUSED
2536                                       These options are presently unused.
2537
2538          14       REQUEST-ANONYMOUS
2539                                       The REQUEST-ANONYMOUS  option  indicates
2540                                       that  the  ticket to be issued is not to
2541                                       identify  the  user  to  which  it   was
2542                                       issued.  Instead, the principal identif-
2543                                       ier is to be generic,  as  specified  by
2544                                       the  policy  of  the realm (e.g. usually
2545                                       anonymous@realm).  The  purpose  of  the
2546                                       ticket  is only to securely distribute a
2547                                       session key, and  not  to  identify  the
2548                                       user.   The ANONYMOUS flag on the ticket
2549
2550
2551 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2552
2553                                       to be returned should be  set.   If  the
2554                                       local  realms  policy  does  not  permit
2555                                       anonymous credentials, the request is to
2556                                       be rejected.
2557
2558          15-25    RESERVED
2559                                       Reserved for future use.
2560
2561          26       DISABLE-TRANSITED-CHECK
2562                                       By default the KDC will check the
2563                                       transited field of a ticket-granting-
2564                                       ticket against the policy of the local
2565                                       realm before it will issue derivative
2566                                       tickets based on the ticket granting
2567                                       ticket.  If this flag is set in the
2568                                       request, checking of the transited field
2569                                       is disabled.  Tickets issued without the
2570                                       performance of this check will be noted
2571                                       by the reset (0) value of the
2572                                       TRANSITED-POLICY-CHECKED flag,
2573                                       indicating to the application server
2574                                       that the tranisted field must be checked
2575                                       locally.  KDC's are encouraged but not
2576                                       required to honor the
2577                                       DISABLE-TRANSITED-CHECK option.
2578
2579          27       RENEWABLE-OK
2580                                       The RENEWABLE-OK option indicates that a
2581                                       renewable ticket will be acceptable if a
2582                                       ticket with the  requested  life  cannot
2583                                       otherwise be provided.  If a ticket with
2584                                       the requested life cannot  be  provided,
2585                                       then  a  renewable  ticket may be issued
2586                                       with  a  renew-till  equal  to  the  the
2587                                       requested  endtime.   The  value  of the
2588                                       renew-till field may still be limited by
2589                                       local  limits, or limits selected by the
2590                                       individual principal or server.
2591
2592          28       ENC-TKT-IN-SKEY
2593                                       This option is used only by the  ticket-
2594                                       granting  service.   The ENC-TKT-IN-SKEY
2595                                       option indicates that the ticket for the
2596                                       end  server  is  to  be encrypted in the
2597                                       session key from the additional  ticket-
2598                                       granting ticket provided.
2599
2600          29       RESERVED
2601                                       Reserved for future use.
2602
2603          30       RENEW
2604                                       This option is used only by the  ticket-
2605                                       granting   service.   The  RENEW  option
2606                                       indicates that the  present  request  is
2607
2608
2609 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2610
2611                                       for  a  renewal.  The ticket provided is
2612                                       encrypted in  the  secret  key  for  the
2613                                       server  on  which  it  is  valid.   This
2614                                       option  will  only  be  honored  if  the
2615                                       ticket  to  be renewed has its RENEWABLE
2616                                       flag set and if the time in  its  renew-
2617                                       till  field  has not passed.  The ticket
2618                                       to be renewed is passed  in  the  padata
2619                                       field  as  part  of  the  authentication
2620                                       header.
2621
2622          31       VALIDATE
2623                                       This option is used only by the  ticket-
2624                                       granting  service.   The VALIDATE option
2625                                       indicates that the request is  to  vali-
2626                                       date  a  postdated ticket.  It will only
2627                                       be honored if the  ticket  presented  is
2628                                       postdated,  presently  has  its  INVALID
2629                                       flag set, and would be otherwise  usable
2630                                       at  this time.  A ticket cannot be vali-
2631                                       dated before its starttime.  The  ticket
2632                                       presented for validation is encrypted in
2633                                       the key of the server for  which  it  is
2634                                       valid  and is passed in the padata field
2635                                       as part of the authentication header.
2636
2637 cname and sname
2638      These fields are the same as those described for the ticket in section
2639      5.3.1. sname may only be absent when the ENC-TKT-IN-SKEY option is
2640      specified. If absent, the name of the server is taken from the name of
2641      the client in the ticket passed as additional-tickets.
2642 enc-authorization-data
2643      The enc-authorization-data, if present (and it can only be present in
2644      the TGS_REQ form), is an encoding of the desired authorization-data
2645      encrypted under the sub-session key if present in the Authenticator, or
2646      alternatively from the session key in the ticket-granting ticket, both
2647      from the padata field in the KRB_AP_REQ.
2648 realm
2649      This field specifies the realm part of the server's principal
2650      identifier. In the AS exchange, this is also the realm part of the
2651      client's principal identifier.
2652 from
2653      This field is included in the KRB_AS_REQ and KRB_TGS_REQ ticket
2654      requests when the requested ticket is to be postdated. It specifies the
2655      desired start time for the requested ticket. If this field is omitted
2656      then the KDC should use the current time instead.
2657 till
2658      This field contains the expiration date requested by the client in a
2659      ticket request. It is optional and if omitted the requested ticket is
2660      to have the maximum endtime permitted according to KDC policy for the
2661      parties to the authentication exchange as limited by expiration date of
2662      the ticket granting ticket or other preauthentication credentials.
2663 rtime
2664      This field is the requested renew-till time sent from a client to the
2665
2666
2667 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2668
2669      KDC in a ticket request. It is optional.
2670 nonce
2671      This field is part of the KDC request and response. It it intended to
2672      hold a random number generated by the client. If the same number is
2673      included in the encrypted response from the KDC, it provides evidence
2674      that the response is fresh and has not been replayed by an attacker.
2675      Nonces must never be re-used. Ideally, it should be generated randomly,
2676      but if the correct time is known, it may suffice[25].
2677 etype
2678      This field specifies the desired encryption algorithm to be used in the
2679      response.
2680 addresses
2681      This field is included in the initial request for tickets, and
2682      optionally included in requests for additional tickets from the
2683      ticket-granting server. It specifies the addresses from which the
2684      requested ticket is to be valid. Normally it includes the addresses for
2685      the client's host. If a proxy is requested, this field will contain
2686      other addresses. The contents of this field are usually copied by the
2687      KDC into the caddr field of the resulting ticket.
2688 additional-tickets
2689      Additional tickets may be optionally included in a request to the
2690      ticket-granting server. If the ENC-TKT-IN-SKEY option has been
2691      specified, then the session key from the additional ticket will be used
2692      in place of the server's key to encrypt the new ticket. If more than
2693      one option which requires additional tickets has been specified, then
2694      the additional tickets are used in the order specified by the ordering
2695      of the options bits (see kdc-options, above).
2696
2697 The application code will be either ten (10) or twelve (12) depending on
2698 whether the request is for an initial ticket (AS-REQ) or for an additional
2699 ticket (TGS-REQ).
2700
2701 The optional fields (addresses, authorization-data and additional-tickets)
2702 are only included if necessary to perform the operation specified in the
2703 kdc-options field.
2704
2705 It should be noted that in KRB_TGS_REQ, the protocol version number appears
2706 twice and two different message types appear: the KRB_TGS_REQ message
2707 contains these fields as does the authentication header (KRB_AP_REQ) that is
2708 passed in the padata field.
2709
2710 5.4.2. KRB_KDC_REP definition
2711
2712 The KRB_KDC_REP message format is used for the reply from the KDC for either
2713 an initial (AS) request or a subsequent (TGS) request. There is no message
2714 type for KRB_KDC_REP. Instead, the type will be either KRB_AS_REP or
2715 KRB_TGS_REP. The key used to encrypt the ciphertext part of the reply
2716 depends on the message type. For KRB_AS_REP, the ciphertext is encrypted in
2717 the client's secret key, and the client's key version number is included in
2718 the key version number for the encrypted data. For KRB_TGS_REP, the
2719 ciphertext is encrypted in the sub-session key from the Authenticator, or if
2720 absent, the session key from the ticket-granting ticket used in the request.
2721 In that case, no version number will be present in the EncryptedData
2722 sequence.
2723
2724
2725 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2726
2727
2728 The KRB_KDC_REP message contains the following fields:
2729
2730 AS-REP ::=    [APPLICATION 11] KDC-REP
2731 TGS-REP ::=   [APPLICATION 13] KDC-REP
2732
2733 KDC-REP ::=   SEQUENCE {
2734               pvno[0]                    INTEGER,
2735               msg-type[1]                INTEGER,
2736               padata[2]                  SEQUENCE OF PA-DATA OPTIONAL,
2737               crealm[3]                  Realm,
2738               cname[4]                   PrincipalName,
2739               ticket[5]                  Ticket,
2740               enc-part[6]                EncryptedData
2741 }
2742
2743 EncASRepPart ::=    [APPLICATION 25[27]] EncKDCRepPart
2744 EncTGSRepPart ::=   [APPLICATION 26] EncKDCRepPart
2745
2746 EncKDCRepPart ::=   SEQUENCE {
2747                     key[0]               EncryptionKey,
2748                     last-req[1]          LastReq,
2749                     nonce[2]             INTEGER,
2750                     key-expiration[3]    KerberosTime OPTIONAL,
2751                     flags[4]             TicketFlags,
2752                     authtime[5]          KerberosTime,
2753                     starttime[6]         KerberosTime OPTIONAL,
2754                     endtime[7]           KerberosTime,
2755                     renew-till[8]        KerberosTime OPTIONAL,
2756                     srealm[9]            Realm,
2757                     sname[10]            PrincipalName,
2758                     caddr[11]            HostAddresses OPTIONAL
2759 }
2760
2761 pvno and msg-type
2762      These fields are described above in section 5.4.1. msg-type is either
2763      KRB_AS_REP or KRB_TGS_REP.
2764 padata
2765      This field is described in detail in section 5.4.1. One possible use
2766      for this field is to encode an alternate "mix-in" string to be used
2767      with a string-to-key algorithm (such as is described in section 6.3.2).
2768      This ability is useful to ease transitions if a realm name needs to
2769      change (e.g. when a company is acquired); in such a case all existing
2770      password-derived entries in the KDC database would be flagged as
2771      needing a special mix-in string until the next password change.
2772 crealm, cname, srealm and sname
2773      These fields are the same as those described for the ticket in section
2774      5.3.1.
2775 ticket
2776      The newly-issued ticket, from section 5.3.1.
2777 enc-part
2778      This field is a place holder for the ciphertext and related information
2779      that forms the encrypted part of a message. The description of the
2780      encrypted part of the message follows each appearance of this field.
2781
2782
2783 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2784
2785      The encrypted part is encoded as described in section 6.1.
2786 key
2787      This field is the same as described for the ticket in section 5.3.1.
2788 last-req
2789      This field is returned by the KDC and specifies the time(s) of the last
2790      request by a principal. Depending on what information is available,
2791      this might be the last time that a request for a ticket-granting ticket
2792      was made, or the last time that a request based on a ticket-granting
2793      ticket was successful. It also might cover all servers for a realm, or
2794      just the particular server. Some implementations may display this
2795      information to the user to aid in discovering unauthorized use of one's
2796      identity. It is similar in spirit to the last login time displayed when
2797      logging into timesharing systems.
2798 nonce
2799      This field is described above in section 5.4.1.
2800 key-expiration
2801      The key-expiration field is part of the response from the KDC and
2802      specifies the time that the client's secret key is due to expire. The
2803      expiration might be the result of password aging or an account
2804      expiration. This field will usually be left out of the TGS reply since
2805      the response to the TGS request is encrypted in a session key and no
2806      client information need be retrieved from the KDC database. It is up to
2807      the application client (usually the login program) to take appropriate
2808      action (such as notifying the user) if the expiration time is imminent.
2809 flags, authtime, starttime, endtime, renew-till and caddr
2810      These fields are duplicates of those found in the encrypted portion of
2811      the attached ticket (see section 5.3.1), provided so the client may
2812      verify they match the intended request and to assist in proper ticket
2813      caching. If the message is of type KRB_TGS_REP, the caddr field will
2814      only be filled in if the request was for a proxy or forwarded ticket,
2815      or if the user is substituting a subset of the addresses from the
2816      ticket granting ticket. If the client-requested addresses are not
2817      present or not used, then the addresses contained in the ticket will be
2818      the same as those included in the ticket-granting ticket.
2819
2820 5.5. Client/Server (CS) message specifications
2821
2822 This section specifies the format of the messages used for the
2823 authentication of the client to the application server.
2824
2825 5.5.1. KRB_AP_REQ definition
2826
2827 The KRB_AP_REQ message contains the Kerberos protocol version number, the
2828 message type KRB_AP_REQ, an options field to indicate any options in use,
2829 and the ticket and authenticator themselves. The KRB_AP_REQ message is often
2830 referred to as the 'authentication header'.
2831
2832 AP-REQ ::=      [APPLICATION 14] SEQUENCE {
2833                 pvno[0]                       INTEGER,
2834                 msg-type[1]                   INTEGER,
2835                 ap-options[2]                 APOptions,
2836                 ticket[3]                     Ticket,
2837                 authenticator[4]              EncryptedData
2838 }
2839
2840
2841 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2842
2843
2844 APOptions ::=   BIT STRING {
2845                 reserved(0),
2846                 use-session-key(1),
2847                 mutual-required(2)
2848 }
2849
2850
2851
2852 pvno and msg-type
2853      These fields are described above in section 5.4.1. msg-type is
2854      KRB_AP_REQ.
2855 ap-options
2856      This field appears in the application request (KRB_AP_REQ) and affects
2857      the way the request is processed. It is a bit-field, where the selected
2858      options are indicated by the bit being set (1), and the unselected
2859      options and reserved fields being reset (0). The encoding of the bits
2860      is specified in section 5.2. The meanings of the options are:
2861
2862           Bit(s)   Name              Description
2863           0        RESERVED
2864                                      Reserved for future  expansion  of  this
2865                                      field.
2866
2867           1        USE-SESSION-KEY
2868                                      The  USE-SESSION-KEY  option   indicates
2869                                      that the ticket the client is presenting
2870                                      to a server is encrypted in the  session
2871                                      key  from  the  server's ticket-granting
2872                                      ticket.  When this option is not  speci-
2873                                      fied,  the  ticket  is  encrypted in the
2874                                      server's secret key.
2875
2876           2        MUTUAL-REQUIRED
2877                                      The  MUTUAL-REQUIRED  option  tells  the
2878                                      server  that  the client requires mutual
2879                                      authentication, and that it must respond
2880                                      with a KRB_AP_REP message.
2881
2882           3-31     RESERVED
2883                                           Reserved for future use.
2884 ticket
2885      This field is a ticket authenticating the client to the server.
2886 authenticator
2887      This contains the authenticator, which includes the client's choice of
2888      a subkey. Its encoding is described in section 5.3.2.
2889
2890 5.5.2. KRB_AP_REP definition
2891
2892 The KRB_AP_REP message contains the Kerberos protocol version number, the
2893 message type, and an encrypted time- stamp. The message is sent in in
2894 response to an application request (KRB_AP_REQ) where the mutual
2895 authentication option has been selected in the ap-options field.
2896
2897
2898
2899 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2900
2901 AP-REP ::=         [APPLICATION 15] SEQUENCE {
2902                    pvno[0]                           INTEGER,
2903                    msg-type[1]                       INTEGER,
2904                    enc-part[2]                       EncryptedData
2905 }
2906
2907 EncAPRepPart ::=   [APPLICATION 27[29]] SEQUENCE {
2908                    ctime[0]                          KerberosTime,
2909                    cusec[1]                          INTEGER,
2910                    subkey[2]                         EncryptionKey OPTIONAL,
2911                    seq-number[3]                     INTEGER OPTIONAL
2912 }
2913
2914 The encoded EncAPRepPart is encrypted in the shared session key of the
2915 ticket. The optional subkey field can be used in an application-arranged
2916 negotiation to choose a per association session key.
2917
2918 pvno and msg-type
2919      These fields are described above in section 5.4.1. msg-type is
2920      KRB_AP_REP.
2921 enc-part
2922      This field is described above in section 5.4.2.
2923 ctime
2924      This field contains the current time on the client's host.
2925 cusec
2926      This field contains the microsecond part of the client's timestamp.
2927 subkey
2928      This field contains an encryption key which is to be used to protect
2929      this specific application session. See section 3.2.6 for specifics on
2930      how this field is used to negotiate a key. Unless an application
2931      specifies otherwise, if this field is left out, the sub-session key
2932      from the authenticator, or if also left out, the session key from the
2933      ticket will be used.
2934
2935 5.5.3. Error message reply
2936
2937 If an error occurs while processing the application request, the KRB_ERROR
2938 message will be sent in response. See section 5.9.1 for the format of the
2939 error message. The cname and crealm fields may be left out if the server
2940 cannot determine their appropriate values from the corresponding KRB_AP_REQ
2941 message. If the authenticator was decipherable, the ctime and cusec fields
2942 will contain the values from it.
2943
2944 5.6. KRB_SAFE message specification
2945
2946 This section specifies the format of a message that can be used by either
2947 side (client or server) of an application to send a tamper-proof message to
2948 its peer. It presumes that a session key has previously been exchanged (for
2949 example, by using the KRB_AP_REQ/KRB_AP_REP messages).
2950
2951 5.6.1. KRB_SAFE definition
2952
2953 The KRB_SAFE message contains user data along with a collision-proof
2954 checksum keyed with the last encryption key negotiated via subkeys, or the
2955
2956
2957 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
2958
2959 session key if no negotiation has occured. The message fields are:
2960
2961 KRB-SAFE ::=        [APPLICATION 20] SEQUENCE {
2962                     pvno[0]                       INTEGER,
2963                     msg-type[1]                   INTEGER,
2964                     safe-body[2]                  KRB-SAFE-BODY,
2965                     cksum[3]                      Checksum
2966 }
2967
2968 KRB-SAFE-BODY ::=   SEQUENCE {
2969                     user-data[0]                  OCTET STRING,
2970                     timestamp[1]                  KerberosTime OPTIONAL,
2971                     usec[2]                       INTEGER OPTIONAL,
2972                     seq-number[3]                 INTEGER OPTIONAL,
2973                     s-address[4]                  HostAddress OPTIONAL,
2974                     r-address[5]                  HostAddress OPTIONAL
2975 }
2976
2977 pvno and msg-type
2978      These fields are described above in section 5.4.1. msg-type is
2979      KRB_SAFE.
2980 safe-body
2981      This field is a placeholder for the body of the KRB-SAFE message. It is
2982      to be encoded separately and then have the checksum computed over it,
2983      for use in the cksum field.
2984 cksum
2985      This field contains the checksum of the application data. Checksum
2986      details are described in section 6.4. The checksum is computed over the
2987      encoding of the KRB-SAFE-BODY sequence.
2988 user-data
2989      This field is part of the KRB_SAFE and KRB_PRIV messages and contain
2990      the application specific data that is being passed from the sender to
2991      the recipient.
2992 timestamp
2993      This field is part of the KRB_SAFE and KRB_PRIV messages. Its contents
2994      are the current time as known by the sender of the message. By checking
2995      the timestamp, the recipient of the message is able to make sure that
2996      it was recently generated, and is not a replay.
2997 usec
2998      This field is part of the KRB_SAFE and KRB_PRIV headers. It contains
2999      the microsecond part of the timestamp.
3000 seq-number
3001      This field is described above in section 5.3.2.
3002 s-address
3003      This field specifies the address in use by the sender of the message.
3004 r-address
3005      This field specifies the address in use by the recipient of the
3006      message. It may be omitted for some uses (such as broadcast protocols),
3007      but the recipient may arbitrarily reject such messages. This field
3008      along with s-address can be used to help detect messages which have
3009      been incorrectly or maliciously delivered to the wrong recipient.
3010
3011 5.7. KRB_PRIV message specification
3012
3013
3014
3015 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3016
3017 This section specifies the format of a message that can be used by either
3018 side (client or server) of an application to securely and privately send a
3019 message to its peer. It presumes that a session key has previously been
3020 exchanged (for example, by using the KRB_AP_REQ/KRB_AP_REP messages).
3021
3022 5.7.1. KRB_PRIV definition
3023
3024 The KRB_PRIV message contains user data encrypted in the Session Key. The
3025 message fields are:
3026
3027 KRB-PRIV ::=         [APPLICATION 21] SEQUENCE {
3028                      pvno[0]                           INTEGER,
3029                      msg-type[1]                       INTEGER,
3030                      enc-part[3]                       EncryptedData
3031 }
3032
3033 EncKrbPrivPart ::=   [APPLICATION 28[31]] SEQUENCE {
3034                      user-data[0]        OCTET STRING,
3035                      timestamp[1]        KerberosTime OPTIONAL,
3036                      usec[2]             INTEGER OPTIONAL,
3037                      seq-number[3]       INTEGER OPTIONAL,
3038                      s-address[4]        HostAddress OPTIONAL, -- sender's addr
3039                      r-address[5]        HostAddress OPTIONAL -- recip's addr
3040 }
3041
3042 pvno and msg-type
3043      These fields are described above in section 5.4.1. msg-type is
3044      KRB_PRIV.
3045 enc-part
3046      This field holds an encoding of the EncKrbPrivPart sequence encrypted
3047      under the session key[32]. This encrypted encoding is used for the
3048      enc-part field of the KRB-PRIV message. See section 6 for the format of
3049      the ciphertext.
3050 user-data, timestamp, usec, s-address and r-address
3051      These fields are described above in section 5.6.1.
3052 seq-number
3053      This field is described above in section 5.3.2.
3054
3055 5.8. KRB_CRED message specification
3056
3057 This section specifies the format of a message that can be used to send
3058 Kerberos credentials from one principal to another. It is presented here to
3059 encourage a common mechanism to be used by applications when forwarding
3060 tickets or providing proxies to subordinate servers. It presumes that a
3061 session key has already been exchanged perhaps by using the
3062 KRB_AP_REQ/KRB_AP_REP messages.
3063
3064 5.8.1. KRB_CRED definition
3065
3066 The KRB_CRED message contains a sequence of tickets to be sent and
3067 information needed to use the tickets, including the session key from each.
3068 The information needed to use the tickets is encrypted under an encryption
3069 key previously exchanged or transferred alongside the KRB_CRED message. The
3070 message fields are:
3071
3072
3073 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3074
3075
3076 KRB-CRED         ::= [APPLICATION 22]   SEQUENCE {
3077                  pvno[0]                INTEGER,
3078                  msg-type[1]            INTEGER, -- KRB_CRED
3079                  tickets[2]             SEQUENCE OF Ticket,
3080                  enc-part[3]            EncryptedData
3081 }
3082
3083 EncKrbCredPart   ::= [APPLICATION 29]   SEQUENCE {
3084                  ticket-info[0]         SEQUENCE OF KrbCredInfo,
3085                  nonce[1]               INTEGER OPTIONAL,
3086                  timestamp[2]           KerberosTime OPTIONAL,
3087                  usec[3]                INTEGER OPTIONAL,
3088                  s-address[4]           HostAddress OPTIONAL,
3089                  r-address[5]           HostAddress OPTIONAL
3090 }
3091
3092 KrbCredInfo      ::=                    SEQUENCE {
3093                  key[0]                 EncryptionKey,
3094                  prealm[1]              Realm OPTIONAL,
3095                  pname[2]               PrincipalName OPTIONAL,
3096                  flags[3]               TicketFlags OPTIONAL,
3097                  authtime[4]            KerberosTime OPTIONAL,
3098                  starttime[5]           KerberosTime OPTIONAL,
3099                  endtime[6]             KerberosTime OPTIONAL
3100                  renew-till[7]          KerberosTime OPTIONAL,
3101                  srealm[8]              Realm OPTIONAL,
3102                  sname[9]               PrincipalName OPTIONAL,
3103                  caddr[10]              HostAddresses OPTIONAL
3104 }
3105
3106 pvno and msg-type
3107      These fields are described above in section 5.4.1. msg-type is
3108      KRB_CRED.
3109 tickets
3110      These are the tickets obtained from the KDC specifically for use by the
3111      intended recipient. Successive tickets are paired with the
3112      corresponding KrbCredInfo sequence from the enc-part of the KRB-CRED
3113      message.
3114 enc-part
3115      This field holds an encoding of the EncKrbCredPart sequence encrypted
3116      under the session key shared between the sender and the intended
3117      recipient. This encrypted encoding is used for the enc-part field of
3118      the KRB-CRED message. See section 6 for the format of the ciphertext.
3119 nonce
3120      If practical, an application may require the inclusion of a nonce
3121      generated by the recipient of the message. If the same value is
3122      included as the nonce in the message, it provides evidence that the
3123      message is fresh and has not been replayed by an attacker. A nonce must
3124      never be re-used; it should be generated randomly by the recipient of
3125      the message and provided to the sender of the message in an application
3126      specific manner.
3127 timestamp and usec
3128      These fields specify the time that the KRB-CRED message was generated.
3129
3130
3131 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3132
3133      The time is used to provide assurance that the message is fresh.
3134 s-address and r-address
3135      These fields are described above in section 5.6.1. They are used
3136      optionally to provide additional assurance of the integrity of the
3137      KRB-CRED message.
3138 key
3139      This field exists in the corresponding ticket passed by the KRB-CRED
3140      message and is used to pass the session key from the sender to the
3141      intended recipient. The field's encoding is described in section 6.2.
3142
3143 The following fields are optional. If present, they can be associated with
3144 the credentials in the remote ticket file. If left out, then it is assumed
3145 that the recipient of the credentials already knows their value.
3146
3147 prealm and pname
3148      The name and realm of the delegated principal identity.
3149 flags, authtime, starttime, endtime, renew-till, srealm, sname, and caddr
3150      These fields contain the values of the correspond- ing fields from the
3151      ticket found in the ticket field. Descriptions of the fields are
3152      identical to the descriptions in the KDC-REP message.
3153
3154 5.9. Error message specification
3155
3156 This section specifies the format for the KRB_ERROR message. The fields
3157 included in the message are intended to return as much information as
3158 possible about an error. It is not expected that all the information
3159 required by the fields will be available for all types of errors. If the
3160 appropriate information is not available when the message is composed, the
3161 corresponding field will be left out of the message.
3162
3163 Note that since the KRB_ERROR message is not protected by any encryption, it
3164 is quite possible for an intruder to synthesize or modify such a message. In
3165 particular, this means that the client should not use any fields in this
3166 message for security-critical purposes, such as setting a system clock or
3167 generating a fresh authenticator. The message can be useful, however, for
3168 advising a user on the reason for some failure.
3169
3170 5.9.1. KRB_ERROR definition
3171
3172 The KRB_ERROR message consists of the following fields:
3173
3174 KRB-ERROR ::=   [APPLICATION 30] SEQUENCE {
3175                 pvno[0]                       INTEGER,
3176                 msg-type[1]                   INTEGER,
3177                 ctime[2]                      KerberosTime OPTIONAL,
3178                 cusec[3]                      INTEGER OPTIONAL,
3179                 stime[4]                      KerberosTime,
3180                 susec[5]                      INTEGER,
3181                 error-code[6]                 INTEGER,
3182                 crealm[7]                     Realm OPTIONAL,
3183                 cname[8]                      PrincipalName OPTIONAL,
3184                 realm[9]                      Realm, -- Correct realm
3185                 sname[10]                     PrincipalName, -- Correct name
3186                 e-text[11]                    GeneralString OPTIONAL,
3187
3188
3189 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3190
3191                 e-data[12]                    OCTET STRING OPTIONAL,
3192                 e-cksum[13]                   Checksum OPTIONAL,
3193                 e-typed-data[14]              SEQUENCE of ETypedData OPTIONAL
3194 }
3195
3196 ETypedData ::=  SEQUENCE {
3197                 e-data-type    [1] INTEGER,
3198                 e-data-value   [2] OCTET STRING,
3199 }
3200
3201
3202
3203 pvno and msg-type
3204      These fields are described above in section 5.4.1. msg-type is
3205      KRB_ERROR.
3206 ctime
3207      This field is described above in section 5.4.1.
3208 cusec
3209      This field is described above in section 5.5.2.
3210 stime
3211      This field contains the current time on the server. It is of type
3212      KerberosTime.
3213 susec
3214      This field contains the microsecond part of the server's timestamp. Its
3215      value ranges from 0 to 999999. It appears along with stime. The two
3216      fields are used in conjunction to specify a reasonably accurate
3217      timestamp.
3218 error-code
3219      This field contains the error code returned by Kerberos or the server
3220      when a request fails. To interpret the value of this field see the list
3221      of error codes in section 8. Implementations are encouraged to provide
3222      for national language support in the display of error messages.
3223 crealm, cname, srealm and sname
3224      These fields are described above in section 5.3.1.
3225 e-text
3226      This field contains additional text to help explain the error code
3227      associated with the failed request (for example, it might include a
3228      principal name which was unknown).
3229 e-data
3230      This field contains additional data about the error for use by the
3231      application to help it recover from or handle the error. If the
3232      errorcode is KDC_ERR_PREAUTH_REQUIRED, then the e-data field will
3233      contain an encoding of a sequence of padata fields, each corresponding
3234      to an acceptable pre-authentication method and optionally containing
3235      data for the method:
3236
3237      METHOD-DATA ::=   SEQUENCE of PA-DATA
3238
3239      If the error-code is KRB_AP_ERR_METHOD, then the e-data field will
3240      contain an encoding of the following sequence:
3241
3242      METHOD-DATA ::=   SEQUENCE {
3243                          method-type[0]   INTEGER,
3244                          method-data[1]   OCTET STRING OPTIONAL
3245
3246
3247 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3248
3249      }
3250
3251      method-type will indicate the required alternate method; method-data
3252      will contain any required additional information.
3253 e-cksum
3254      This field contains an optional checksum for the KRB-ERROR message. The
3255      checksum is calculated over the Kerberos ASN.1 encoding of the
3256      KRB-ERROR message with the checksum absent. The checksum is then added
3257      to the KRB-ERROR structure and the message is re-encoded. The Checksum
3258      should be calculated using the session key from the ticket granting
3259      ticket or service ticket, where available. If the error is in response
3260      to a TGS or AP request, the checksum should be calculated uing the the
3261      session key from the client's ticket. If the error is in response to an
3262      AS request, then the checksum should be calulated using the client's
3263      secret key ONLY if there has been suitable preauthentication to prove
3264      knowledge of the secret key by the client[33]. If a checksum can not be
3265      computed because the key to be used is not available, no checksum will
3266      be included.
3267 e-typed-data
3268      [This field for discussion, may be deleted from final spec] This field
3269      contains optional data that may be used to help the client recover from
3270      the indicated error. [This could contain the METHOD-DATA specified
3271      since I don't think anyone actually uses it yet. It could also contain
3272      the PA-DATA sequence for the preauth required error if we had a clear
3273      way to transition to the use of this field from the use of the untype
3274      e-data field.] For example, this field may specify the key version of
3275      the key used to verify preauthentication:
3276
3277      e-data-type  := 20 -- Key version number
3278      e-data-value := Integer -- Key version number used to verify
3279                                 preauthentication 
3280
3281 6. Encryption and Checksum Specifications
3282
3283 The Kerberos protocols described in this document are designed to use stream
3284 encryption ciphers, which can be simulated using commonly available block
3285 encryption ciphers, such as the Data Encryption Standard, [DES77] in
3286 conjunction with block chaining and checksum methods [DESM80]. Encryption is
3287 used to prove the identities of the network entities participating in
3288 message exchanges. The Key Distribution Center for each realm is trusted by
3289 all principals registered in that realm to store a secret key in confidence.
3290 Proof of knowledge of this secret key is used to verify the authenticity of
3291 a principal.
3292
3293 The KDC uses the principal's secret key (in the AS exchange) or a shared
3294 session key (in the TGS exchange) to encrypt responses to ticket requests;
3295 the ability to obtain the secret key or session key implies the knowledge of
3296 the appropriate keys and the identity of the KDC. The ability of a principal
3297 to decrypt the KDC response and present a Ticket and a properly formed
3298 Authenticator (generated with the session key from the KDC response) to a
3299 service verifies the identity of the principal; likewise the ability of the
3300 service to extract the session key from the Ticket and prove its knowledge
3301 thereof in a response verifies the identity of the service.
3302
3303
3304
3305 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3306
3307 The Kerberos protocols generally assume that the encryption used is secure
3308 from cryptanalysis; however, in some cases, the order of fields in the
3309 encrypted portions of messages are arranged to minimize the effects of
3310 poorly chosen keys. It is still important to choose good keys. If keys are
3311 derived from user-typed passwords, those passwords need to be well chosen to
3312 make brute force attacks more difficult. Poorly chosen keys still make easy
3313 targets for intruders.
3314
3315 The following sections specify the encryption and checksum mechanisms
3316 currently defined for Kerberos. The encodings, chaining, and padding
3317 requirements for each are described. For encryption methods, it is often
3318 desirable to place random information (often referred to as a confounder) at
3319 the start of the message. The requirements for a confounder are specified
3320 with each encryption mechanism.
3321
3322 Some encryption systems use a block-chaining method to improve the the
3323 security characteristics of the ciphertext. However, these chaining methods
3324 often don't provide an integrity check upon decryption. Such systems (such
3325 as DES in CBC mode) must be augmented with a checksum of the plain-text
3326 which can be verified at decryption and used to detect any tampering or
3327 damage. Such checksums should be good at detecting burst errors in the
3328 input. If any damage is detected, the decryption routine is expected to
3329 return an error indicating the failure of an integrity check. Each
3330 encryption type is expected to provide and verify an appropriate checksum.
3331 The specification of each encryption method sets out its checksum
3332 requirements.
3333
3334 Finally, where a key is to be derived from a user's password, an algorithm
3335 for converting the password to a key of the appropriate type is included. It
3336 is desirable for the string to key function to be one-way, and for the
3337 mapping to be different in different realms. This is important because users
3338 who are registered in more than one realm will often use the same password
3339 in each, and it is desirable that an attacker compromising the Kerberos
3340 server in one realm not obtain or derive the user's key in another.
3341
3342 For an discussion of the integrity characteristics of the candidate
3343 encryption and checksum methods considered for Kerberos, the the reader is
3344 referred to [SG92].
3345
3346 6.1. Encryption Specifications
3347
3348 The following ASN.1 definition describes all encrypted messages. The
3349 enc-part field which appears in the unencrypted part of messages in section
3350 5 is a sequence consisting of an encryption type, an optional key version
3351 number, and the ciphertext.
3352
3353 EncryptedData ::=   SEQUENCE {
3354                     etype[0]     INTEGER, -- EncryptionType
3355                     kvno[1]      INTEGER OPTIONAL,
3356                     cipher[2]    OCTET STRING -- ciphertext
3357 }
3358
3359
3360
3361
3362
3363 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3364
3365 etype
3366      This field identifies which encryption algorithm was used to encipher
3367      the cipher. Detailed specifications for selected encryption types
3368      appear later in this section.
3369 kvno
3370      This field contains the version number of the key under which data is
3371      encrypted. It is only present in messages encrypted under long lasting
3372      keys, such as principals' secret keys.
3373 cipher
3374      This field contains the enciphered text, encoded as an OCTET STRING.
3375
3376 The cipher field is generated by applying the specified encryption algorithm
3377 to data composed of the message and algorithm-specific inputs. Encryption
3378 mechanisms defined for use with Kerberos must take sufficient measures to
3379 guarantee the integrity of the plaintext, and we recommend they also take
3380 measures to protect against precomputed dictionary attacks. If the
3381 encryption algorithm is not itself capable of doing so, the protections can
3382 often be enhanced by adding a checksum and a confounder.
3383
3384 The suggested format for the data to be encrypted includes a confounder, a
3385 checksum, the encoded plaintext, and any necessary padding. The msg-seq
3386 field contains the part of the protocol message described in section 5 which
3387 is to be encrypted. The confounder, checksum, and padding are all untagged
3388 and untyped, and their length is exactly sufficient to hold the appropriate
3389 item. The type and length is implicit and specified by the particular
3390 encryption type being used (etype). The format for the data to be encrypted
3391 is described in the following diagram:
3392
3393       +-----------+----------+-------------+-----+
3394       |confounder |   check  |   msg-seq   | pad |
3395       +-----------+----------+-------------+-----+
3396
3397 The format cannot be described in ASN.1, but for those who prefer an
3398 ASN.1-like notation:
3399
3400 CipherText ::=   ENCRYPTED       SEQUENCE {
3401             confounder[0]   UNTAGGED[35] OCTET STRING(conf_length) OPTIONAL,
3402             check[1]        UNTAGGED OCTET STRING(checksum_length) OPTIONAL,
3403             msg-seq[2]      MsgSequence,
3404             pad             UNTAGGED OCTET STRING(pad_length) OPTIONAL
3405 }
3406
3407 One generates a random confounder of the appropriate length, placing it in
3408 confounder; zeroes out check; calculates the appropriate checksum over
3409 confounder, check, and msg-seq, placing the result in check; adds the
3410 necessary padding; then encrypts using the specified encryption type and the
3411 appropriate key.
3412
3413 Unless otherwise specified, a definition of an encryption algorithm that
3414 specifies a checksum, a length for the confounder field, or an octet
3415 boundary for padding uses this ciphertext format[36]. Those fields which are
3416 not specified will be omitted.
3417
3418 In the interest of allowing all implementations using a particular
3419
3420
3421 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3422
3423 encryption type to communicate with all others using that type, the
3424 specification of an encryption type defines any checksum that is needed as
3425 part of the encryption process. If an alternative checksum is to be used, a
3426 new encryption type must be defined.
3427
3428 Some cryptosystems require additional information beyond the key and the
3429 data to be encrypted. For example, DES, when used in cipher-block-chaining
3430 mode, requires an initialization vector. If required, the description for
3431 each encryption type must specify the source of such additional information.
3432 6.2. Encryption Keys
3433
3434 The sequence below shows the encoding of an encryption key:
3435
3436        EncryptionKey ::=   SEQUENCE {
3437                            keytype[0]    INTEGER,
3438                            keyvalue[1]   OCTET STRING
3439        }
3440
3441 keytype
3442      This field specifies the type of encryption key that follows in the
3443      keyvalue field. It will almost always correspond to the encryption
3444      algorithm used to generate the EncryptedData, though more than one
3445      algorithm may use the same type of key (the mapping is many to one).
3446      This might happen, for example, if the encryption algorithm uses an
3447      alternate checksum algorithm for an integrity check, or a different
3448      chaining mechanism.
3449 keyvalue
3450      This field contains the key itself, encoded as an octet string.
3451
3452 All negative values for the encryption key type are reserved for local use.
3453 All non-negative values are reserved for officially assigned type fields and
3454 interpreta- tions.
3455
3456 6.3. Encryption Systems
3457
3458 6.3.1. The NULL Encryption System (null)
3459
3460 If no encryption is in use, the encryption system is said to be the NULL
3461 encryption system. In the NULL encryption system there is no checksum,
3462 confounder or padding. The ciphertext is simply the plaintext. The NULL Key
3463 is used by the null encryption system and is zero octets in length, with
3464 keytype zero (0).
3465
3466 6.3.2. DES in CBC mode with a CRC-32 checksum (des-cbc-crc)
3467
3468 The des-cbc-crc encryption mode encrypts information under the Data
3469 Encryption Standard [DES77] using the cipher block chaining mode [DESM80]. A
3470 CRC-32 checksum (described in ISO 3309 [ISO3309]) is applied to the
3471 confounder and message sequence (msg-seq) and placed in the cksum field. DES
3472 blocks are 8 bytes. As a result, the data to be encrypted (the concatenation
3473 of confounder, checksum, and message) must be padded to an 8 byte boundary
3474 before encryption. The details of the encryption of this data are identical
3475 to those for the des-cbc-md5 encryption mode.
3476
3477
3478
3479 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3480
3481 Note that, since the CRC-32 checksum is not collision-proof, an attacker
3482 could use a probabilistic chosen-plaintext attack to generate a valid
3483 message even if a confounder is used [SG92]. The use of collision-proof
3484 checksums is recommended for environments where such attacks represent a
3485 significant threat. The use of the CRC-32 as the checksum for ticket or
3486 authenticator is no longer mandated as an interoperability requirement for
3487 Kerberos Version 5 Specification 1 (See section 9.1 for specific details).
3488
3489 6.3.3. DES in CBC mode with an MD4 checksum (des-cbc-md4)
3490
3491 The des-cbc-md4 encryption mode encrypts information under the Data
3492 Encryption Standard [DES77] using the cipher block chaining mode [DESM80].
3493 An MD4 checksum (described in [MD492]) is applied to the confounder and
3494 message sequence (msg-seq) and placed in the cksum field. DES blocks are 8
3495 bytes. As a result, the data to be encrypted (the concatenation of
3496 confounder, checksum, and message) must be padded to an 8 byte boundary
3497 before encryption. The details of the encryption of this data are identical
3498 to those for the des-cbc-md5 encryption mode.
3499
3500 6.3.4. DES in CBC mode with an MD5 checksum (des-cbc-md5)
3501
3502 The des-cbc-md5 encryption mode encrypts information under the Data
3503 Encryption Standard [DES77] using the cipher block chaining mode [DESM80].
3504 An MD5 checksum (described in [MD5-92].) is applied to the confounder and
3505 message sequence (msg-seq) and placed in the cksum field. DES blocks are 8
3506 bytes. As a result, the data to be encrypted (the concatenation of
3507 confounder, checksum, and message) must be padded to an 8 byte boundary
3508 before encryption.
3509
3510 Plaintext and DES ciphtertext are encoded as blocks of 8 octets which are
3511 concatenated to make the 64-bit inputs for the DES algorithms. The first
3512 octet supplies the 8 most significant bits (with the octet's MSbit used as
3513 the DES input block's MSbit, etc.), the second octet the next 8 bits, ...,
3514 and the eighth octet supplies the 8 least significant bits.
3515
3516 Encryption under DES using cipher block chaining requires an additional
3517 input in the form of an initialization vector. Unless otherwise specified,
3518 zero should be used as the initialization vector. Kerberos' use of DES
3519 requires an 8 octet confounder.
3520
3521 The DES specifications identify some 'weak' and 'semi-weak' keys; those keys
3522 shall not be used for encrypting messages for use in Kerberos. Additionally,
3523 because of the way that keys are derived for the encryption of checksums,
3524 keys shall not be used that yield 'weak' or 'semi-weak' keys when
3525 eXclusive-ORed with the hexadecimal constant F0F0F0F0F0F0F0F0.
3526
3527 A DES key is 8 octets of data, with keytype one (1). This consists of 56
3528 bits of key, and 8 parity bits (one per octet). The key is encoded as a
3529 series of 8 octets written in MSB-first order. The bits within the key are
3530 also encoded in MSB order. For example, if the encryption key is
3531 (B1,B2,...,B7,P1,B8,...,B14,P2,B15,...,B49,P7,B50,...,B56,P8) where
3532 B1,B2,...,B56 are the key bits in MSB order, and P1,P2,...,P8 are the parity
3533 bits, the first octet of the key would be B1,B2,...,B7,P1 (with B1 as the
3534 MSbit). [See the FIPS 81 introduction for reference.]
3535
3536
3537 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3538
3539
3540 String to key transformation
3541
3542 To generate a DES key from a text string (password), the text string
3543 normally must have the realm and each component of the principal's name
3544 appended[37], then padded with ASCII nulls to an 8 byte boundary. This
3545 string is then fan-folded and eXclusive-ORed with itself to form an 8 byte
3546 DES key. The parity is corrected on the key, and it is used to generate a
3547 DES CBC checksum on the initial string (with the realm and name appended).
3548 Next, parity is corrected on the CBC checksum. If the result matches a
3549 'weak' or 'semi-weak' key as described in the DES specification, it is
3550 eXclusive-ORed with the constant 00000000000000F0. Finally, the result is
3551 returned as the key. Pseudocode follows:
3552
3553      string_to_key(string,realm,name) {
3554           odd = 1;
3555           s = string + realm;
3556           for(each component in name) {
3557                s = s + component;
3558           }
3559           tempkey = NULL;
3560           pad(s); /* with nulls to 8 byte boundary */
3561           for(8byteblock in s) {
3562                if(odd == 0)  {
3563                    odd = 1;
3564                    reverse(8byteblock)
3565                }
3566                else odd = 0;
3567                tempkey = tempkey XOR 8byteblock;
3568           }
3569           fixparity(tempkey);
3570           key = DES-CBC-check(s,tempkey);
3571           fixparity(key);
3572           if(is_weak_key_key(key))
3573                key = key XOR 0xF0;
3574           return(key);
3575      }
3576
3577 6.3.5. Triple DES EDE in outer CBC mode with an SHA1 check-sum
3578 (des3-cbc-sha1)
3579
3580 The des3-cbc-sha1 encryption encodes information using three Data Encryption
3581 Standard transformations with three DES keys. The first key is used to
3582 perform a DES ECB encryption on an eight-octet data block using the first
3583 DES key, followed by a DES ECB decryption of the result using the second DES
3584 key, and a DES ECB encryption of the result using the third DES key. Because
3585 DES blocks are 8 bytes, the data to be encrypted (the concatenation of
3586 confounder, checksum, and message) must first be padded to an 8 byte
3587 boundary before encryption. To support the outer CBC mode, the input is
3588 padded to an eight-octet boundary. The first 8 octets of the data to be
3589 encrypted (the confounder) is exclusive-ored with an initialization vector
3590 of zero and then ECB encrypted using triple DES as described above.
3591 Subsequent blocks of 8 octets are exclusive-ored with the ciphertext
3592 produced by the encryption on the previous block before ECB encryption.
3593
3594
3595 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3596
3597
3598 An HMAC-SHA1 checksum (described in [KBC96].) is applied to the confounder
3599 and message sequence (msg-seq) and placed in the cksum field.
3600
3601 Plaintext are encoded as blocks of 8 octets which are concatenated to make
3602 the 64-bit inputs for the DES algorithms. The first octet supplies the 8
3603 most significant bits (with the octet's MSbit used as the DES input block's
3604 MSbit, etc.), the second octet the next 8 bits, ..., and the eighth octet
3605 supplies the 8 least significant bits.
3606
3607 Encryption under Triple DES using cipher block chaining requires an
3608 additional input in the form of an initialization vector. Unless otherwise
3609 specified, zero should be used as the initialization vector. Kerberos' use
3610 of DES requires an 8 octet confounder.
3611
3612 The DES specifications identify some 'weak' and 'semi-weak' keys; those keys
3613 shall not be used for encrypting messages for use in Kerberos. Additionally,
3614 because of the way that keys are derived for the encryption of checksums,
3615 keys shall not be used that yield 'weak' or 'semi-weak' keys when
3616 eXclusive-ORed with the hexadecimal constant F0F0F0F0F0F0F0F0.
3617
3618 A Triple DES key is 24 octets of data, with keytype seven (7). This consists
3619 of 168 bits of key, and 24 parity bits (one per octet). The key is encoded
3620 as a series of 24 octets written in MSB-first order, with the first 8 octets
3621 treated as the first DES key, the second 8 octets as the second key, and the
3622 third 8 octets the third DES key. The bits within each key are also encoded
3623 in MSB order. For example, if the encryption key is
3624 (B1,B2,...,B7,P1,B8,...,B14,P2,B15,...,B49,P7,B50,...,B56,P8) where
3625 B1,B2,...,B56 are the key bits in MSB order, and P1,P2,...,P8 are the parity
3626 bits, the first octet of the key would be B1,B2,...,B7,P1 (with B1 as the
3627 MSbit). [See the FIPS 81 introduction for reference.]
3628
3629 Key derivation for specified operations (Horowitz)
3630
3631 [Discussion is needed for this section, especially since it does not simply
3632 derive key generation, but also specifies encryption using triple DES in a
3633 manner that is different than the basic template that was specified for
3634 single DES and similar systems]
3635
3636 In the Kerberos protocol cryptographic keys are used in a number of places.
3637 In order to minimize the effect of compromising a key, it is desirable to
3638 use a different key in each of these places. Key derivation [Horowitz96] can
3639 be used to construct different keys for each operation from the keys
3640 transported on the network or derived from the password specified by the
3641 user.
3642
3643 For each place where a key is used in Kerberos, a ``key usage'' is specified
3644 for that purpose. The key, key usage, and encryption/checksum type together
3645 describe the transformation from plaintext to ciphertext. For backwards
3646 compatibility, this key derivation is only specified here for encryption
3647 methods based on triple DES. Encryption methods specified for use by
3648 Kerberos in the future should specify the key derivation function to be
3649 used.
3650
3651
3652
3653 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3654
3655 Kerberos requires that the ciphertext component of EncryptedData be
3656 tamper-resistant as well as confidential. This implies encryption and
3657 integrity functions, which must each use their own separate keys. So, for
3658 each key usage, two keys must be generated, one for encryption (Ke), and one
3659 for integrity (Ki):
3660
3661       Ke = DK(protocol key, key usage | 0xAA)
3662       Ki = DK(protocol key, key usage | 0x55)
3663
3664 where the key usage is represented as a 32 bit integer in network byte
3665 order. The ciphertest must be generated from the plaintext as follows:
3666
3667       ciphertext = E(Ke, confounder | length | plaintext | padding) |
3668                    H(Ki, confounder | length | plaintext | padding)
3669
3670 The confounder and padding are specific to the encryption algorithm E.
3671
3672 When generating a checksum only, there is no need for a confounder or
3673 padding. Again, a new key (Kc) must be used. Checksums must be generated
3674 from the plaintext as follows:
3675
3676       Kc = DK(protocol key, key usage | 0x99)
3677       MAC = H(Kc, length | plaintext)
3678
3679
3680 Note that each enctype is described by an encryption algorithm E and a keyed
3681 hash algorithm H, and each checksum type is described by a keyed hash
3682 algorithm H. HMAC, with an appropriate hash, is recommended for use as H.
3683
3684 The key usage value will be taken from the following list of places where
3685 keys are used in the Kerberos protocol, with key usage values and Kerberos
3686 specification section numbers:
3687
3688       1.  AS-REQ PA-ENC-TIMESTAMP padata timestamp, encrypted with the
3689           client key (section 5.4.1)
3690       2.  AS-REP Ticket and TGS-REP Ticket (includes tgs session key or
3691           application session key), encrypted with the service key
3692           (section 5.4.2)
3693       3.  AS-REP encrypted part (includes tgs session key or application
3694           session key), encrypted with the client key (section 5.4.2)
3695
3696       4.  TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the tgs
3697           session key (section 5.4.1)
3698       5.  TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the tgs
3699           authenticator subkey (section 5.4.1)
3700       6.  TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator cksum, keyed
3701           with the tgs session key (sections 5.3.2, 5.4.1)
3702       7.  TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator (includes tgs
3703           authenticator subkey), encrypted with the tgs session key
3704           (section 5.3.2)
3705       8.  TGS-REP encrypted part (includes application session key),
3706           encrypted with the tgs session key (section 5.4.2)
3707       9.  TGS-REP encrypted part (includes application session key),
3708           encrypted with the tgs authenticator subkey (section 5.4.2)
3709
3710
3711 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3712
3713
3714       10. AP-REQ Authenticator cksum, keyed with the application session
3715           key (section 5.3.2)
3716       11. AP-REQ Authenticator (includes application authenticator
3717           subkey), encrypted with the application session key (section
3718           5.3.2)
3719       12. AP-REP encrypted part (includes application session subkey),
3720           encrypted with the application session key (section 5.5.2)
3721
3722       13. KRB-PRIV encrypted part, encrypted with a key chosen by the
3723           application (section 5.7.1)
3724       14. KRB-CRED encrypted part, encrypted with a key chosen by the
3725           application (section 5.6.1)
3726       15. KRB-SAFE cksum, keyed with a key chosen by the application
3727           (section 5.8.1)
3728
3729       16. Data which is defined in some specification outside of
3730           Kerberos to be encrypted using Kerberos encryption type.
3731       17. Data which is defined in some specification outside of
3732           Kerberos to be checksummed using Kerberos checksum type.
3733
3734       18. KRB-ERROR checksum (e-cksum in section 5.9.1)
3735       19. AD-KDCIssued checksum (ad-checksum in appendix B.1)
3736       20. Checksum for Mandatory Ticket Extensions (appendix B.6)
3737       21. Checksum in Authorization Data in Ticket Extensions (appendix B.7)
3738
3739 String to key transformation
3740
3741 To generate a DES key from a text string (password), the text string
3742 normally must have the realm and each component of the principal's name
3743 appended[38].
3744
3745 The input string (with any salt data appended to it) is n-folded into a 24
3746 octet (192 bit) string. To n-fold a number X, replicate the input value to a
3747 length that is the least common multiple of n and the length of X. Before
3748 each repetition, the input X is rotated to the right by 13 bit positions.
3749 The successive n-bit chunks are added together using 1's-complement addition
3750 (addition with end-around carry) to yield a n-bit result. (This
3751 transformation was proposed by Richard Basch)
3752
3753 Each successive set of 8 octets is taken as a DES key, and its parity is
3754 adjusted in the same manner as previously described. If any of the three
3755 sets of 8 octets match a 'weak' or 'semi-weak key as described in the DES
3756 specification, that chunk is eXclusive-ORed with the hexadecimal constant
3757 00000000000000F0. The resulting DES keys are then used in sequence to
3758 perform a Triple-DES CBC encryption of the n-folded input string (appended
3759 with any salt data), using a zero initial vector. Parity, weak, and
3760 semi-weak keys are once again corrected and the result is returned as the 24
3761 octet key.
3762
3763 Pseudocode follows:
3764
3765      string_to_key(string,realm,name) {
3766           s = string + realm;
3767
3768
3769 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3770
3771           for(each component in name) {
3772                s = s + component;
3773           }
3774           tkey[24] = fold(s);
3775           fixparity(tkey);
3776           if(isweak(tkey[0-7])) tkey[0-7] = tkey[0-7] XOR 0xF0;
3777           if(isweak(tkey[8-15])) tkey[8-15] = tkey[8-15] XOR 0xF0;
3778           if(is_weak(tkey[16-23])) tkey[16-23] = tkey[16-23] XOR 0xF0;
3779           key[24] = 3DES-CBC(data=fold(s),key=tkey,iv=0);
3780           fixparity(key);
3781           if(is_weak(key[0-7])) key[0-7] = key[0-7] XOR 0xF0;
3782           if(is_weak(key[8-15])) key[8-15] = key[8-15] XOR 0xF0;
3783           if(is_weak(key[16-23])) key[16-23] = key[16-23] XOR 0xF0;
3784           return(key);
3785      }
3786
3787 6.4. Checksums
3788
3789 The following is the ASN.1 definition used for a checksum:
3790
3791          Checksum ::=   SEQUENCE {
3792                         cksumtype[0]   INTEGER,
3793                         checksum[1]    OCTET STRING
3794          }
3795
3796 cksumtype
3797      This field indicates the algorithm used to generate the accompanying
3798      checksum.
3799 checksum
3800      This field contains the checksum itself, encoded as an octet string.
3801
3802 Detailed specification of selected checksum types appear later in this
3803 section. Negative values for the checksum type are reserved for local use.
3804 All non-negative values are reserved for officially assigned type fields and
3805 interpretations.
3806
3807 Checksums used by Kerberos can be classified by two properties: whether they
3808 are collision-proof, and whether they are keyed. It is infeasible to find
3809 two plaintexts which generate the same checksum value for a collision-proof
3810 checksum. A key is required to perturb or initialize the algorithm in a
3811 keyed checksum. To prevent message-stream modification by an active
3812 attacker, unkeyed checksums should only be used when the checksum and
3813 message will be subsequently encrypted (e.g. the checksums defined as part
3814 of the encryption algorithms covered earlier in this section).
3815
3816 Collision-proof checksums can be made tamper-proof if the checksum value is
3817 encrypted before inclusion in a message. In such cases, the composition of
3818 the checksum and the encryption algorithm must be considered a separate
3819 checksum algorithm (e.g. RSA-MD5 encrypted using DES is a new checksum
3820 algorithm of type RSA-MD5-DES). For most keyed checksums, as well as for the
3821 encrypted forms of unkeyed collision-proof checksums, Kerberos prepends a
3822 confounder before the checksum is calculated.
3823
3824 6.4.1. The CRC-32 Checksum (crc32)
3825
3826
3827 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3828
3829
3830 The CRC-32 checksum calculates a checksum based on a cyclic redundancy check
3831 as described in ISO 3309 [ISO3309]. The resulting checksum is four (4)
3832 octets in length. The CRC-32 is neither keyed nor collision-proof. The use
3833 of this checksum is not recommended. An attacker using a probabilistic
3834 chosen-plaintext attack as described in [SG92] might be able to generate an
3835 alternative message that satisfies the checksum. The use of collision-proof
3836 checksums is recommended for environments where such attacks represent a
3837 significant threat.
3838
3839 6.4.2. The RSA MD4 Checksum (rsa-md4)
3840
3841 The RSA-MD4 checksum calculates a checksum using the RSA MD4 algorithm
3842 [MD4-92]. The algorithm takes as input an input message of arbitrary length
3843 and produces as output a 128-bit (16 octet) checksum. RSA-MD4 is believed to
3844 be collision-proof.
3845
3846 6.4.3. RSA MD4 Cryptographic Checksum Using DES (rsa-md4-des)
3847
3848 The RSA-MD4-DES checksum calculates a keyed collision-proof checksum by
3849 prepending an 8 octet confounder before the text, applying the RSA MD4
3850 checksum algorithm, and encrypting the confounder and the checksum using DES
3851 in cipher-block-chaining (CBC) mode using a variant of the key, where the
3852 variant is computed by eXclusive-ORing the key with the constant
3853 F0F0F0F0F0F0F0F0[39]. The initialization vector should be zero. The
3854 resulting checksum is 24 octets long (8 octets of which are redundant). This
3855 checksum is tamper-proof and believed to be collision-proof.
3856
3857 The DES specifications identify some weak keys' and 'semi-weak keys'; those
3858 keys shall not be used for generating RSA-MD4 checksums for use in Kerberos.
3859
3860 The format for the checksum is described in the follow- ing diagram:
3861
3862 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
3863 |  des-cbc(confounder   +   rsa-md4(confounder+msg),key=var(key),iv=0)  |
3864 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
3865
3866 The format cannot be described in ASN.1, but for those who prefer an
3867 ASN.1-like notation:
3868
3869 rsa-md4-des-checksum ::=   ENCRYPTED       UNTAGGED SEQUENCE {
3870                            confounder[0]   UNTAGGED OCTET STRING(8),
3871                            check[1]        UNTAGGED OCTET STRING(16)
3872 }
3873
3874 6.4.4. The RSA MD5 Checksum (rsa-md5)
3875
3876 The RSA-MD5 checksum calculates a checksum using the RSA MD5 algorithm.
3877 [MD5-92]. The algorithm takes as input an input message of arbitrary length
3878 and produces as output a 128-bit (16 octet) checksum. RSA-MD5 is believed to
3879 be collision-proof.
3880
3881 6.4.5. RSA MD5 Cryptographic Checksum Using DES (rsa-md5-des)
3882
3883
3884
3885 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3886
3887 The RSA-MD5-DES checksum calculates a keyed collision-proof checksum by
3888 prepending an 8 octet confounder before the text, applying the RSA MD5
3889 checksum algorithm, and encrypting the confounder and the checksum using DES
3890 in cipher-block-chaining (CBC) mode using a variant of the key, where the
3891 variant is computed by eXclusive-ORing the key with the hexadecimal constant
3892 F0F0F0F0F0F0F0F0. The initialization vector should be zero. The resulting
3893 checksum is 24 octets long (8 octets of which are redundant). This checksum
3894 is tamper-proof and believed to be collision-proof.
3895
3896 The DES specifications identify some 'weak keys' and 'semi-weak keys'; those
3897 keys shall not be used for encrypting RSA-MD5 checksums for use in Kerberos.
3898
3899 The format for the checksum is described in the following diagram:
3900
3901 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
3902 |  des-cbc(confounder   +   rsa-md5(confounder+msg),key=var(key),iv=0)  |
3903 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
3904
3905 The format cannot be described in ASN.1, but for those who prefer an
3906 ASN.1-like notation:
3907
3908 rsa-md5-des-checksum ::=   ENCRYPTED       UNTAGGED SEQUENCE {
3909                            confounder[0]   UNTAGGED OCTET STRING(8),
3910                            check[1]        UNTAGGED OCTET STRING(16)
3911 }
3912
3913 6.4.6. DES cipher-block chained checksum (des-mac)
3914
3915 The DES-MAC checksum is computed by prepending an 8 octet confounder to the
3916 plaintext, performing a DES CBC-mode encryption on the result using the key
3917 and an initialization vector of zero, taking the last block of the
3918 ciphertext, prepending the same confounder and encrypting the pair using DES
3919 in cipher-block-chaining (CBC) mode using a a variant of the key, where the
3920 variant is computed by eXclusive-ORing the key with the hexadecimal constant
3921 F0F0F0F0F0F0F0F0. The initialization vector should be zero. The resulting
3922 checksum is 128 bits (16 octets) long, 64 bits of which are redundant. This
3923 checksum is tamper-proof and collision-proof.
3924
3925 The format for the checksum is described in the following diagram:
3926
3927 +--+--+--+--+--+--+--+--+-----+-----+-----+-----+-----+-----+-----+-----+
3928 |   des-cbc(confounder  + des-mac(conf+msg,iv=0,key),key=var(key),iv=0) |
3929 +--+--+--+--+--+--+--+--+-----+-----+-----+-----+-----+-----+-----+-----+
3930
3931 The format cannot be described in ASN.1, but for those who prefer an
3932 ASN.1-like notation:
3933
3934 des-mac-checksum ::=   ENCRYPTED       UNTAGGED SEQUENCE {
3935                        confounder[0]   UNTAGGED OCTET STRING(8),
3936                        check[1]        UNTAGGED OCTET STRING(8)
3937 }
3938
3939 The DES specifications identify some 'weak' and 'semi-weak' keys; those keys
3940 shall not be used for generating DES-MAC checksums for use in Kerberos, nor
3941
3942
3943 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
3944
3945 shall a key be used whose variant is 'weak' or 'semi-weak'.
3946
3947 6.4.7. RSA MD4 Cryptographic Checksum Using DES alternative (rsa-md4-des-k)
3948
3949 The RSA-MD4-DES-K checksum calculates a keyed collision-proof checksum by
3950 applying the RSA MD4 checksum algorithm and encrypting the results using DES
3951 in cipher-block-chaining (CBC) mode using a DES key as both key and
3952 initialization vector. The resulting checksum is 16 octets long. This
3953 checksum is tamper-proof and believed to be collision-proof. Note that this
3954 checksum type is the old method for encoding the RSA-MD4-DES checksum and it
3955 is no longer recommended.
3956
3957 6.4.8. DES cipher-block chained checksum alternative (des-mac-k)
3958
3959 The DES-MAC-K checksum is computed by performing a DES CBC-mode encryption
3960 of the plaintext, and using the last block of the ciphertext as the checksum
3961 value. It is keyed with an encryption key and an initialization vector; any
3962 uses which do not specify an additional initialization vector will use the
3963 key as both key and initialization vector. The resulting checksum is 64 bits
3964 (8 octets) long. This checksum is tamper-proof and collision-proof. Note
3965 that this checksum type is the old method for encoding the DES-MAC checksum
3966 and it is no longer recommended. The DES specifications identify some 'weak
3967 keys' and 'semi-weak keys'; those keys shall not be used for generating
3968 DES-MAC checksums for use in Kerberos.
3969
3970 7. Naming Constraints
3971
3972 7.1. Realm Names
3973
3974 Although realm names are encoded as GeneralStrings and although a realm can
3975 technically select any name it chooses, interoperability across realm
3976 boundaries requires agreement on how realm names are to be assigned, and
3977 what information they imply.
3978
3979 To enforce these conventions, each realm must conform to the conventions
3980 itself, and it must require that any realms with which inter-realm keys are
3981 shared also conform to the conventions and require the same from its
3982 neighbors.
3983
3984 Kerberos realm names are case sensitive. Realm names that differ only in the
3985 case of the characters are not equivalent. There are presently four styles
3986 of realm names: domain, X500, other, and reserved. Examples of each style
3987 follow:
3988
3989      domain:   ATHENA.MIT.EDU (example)
3990        X500:   C=US/O=OSF (example)
3991       other:   NAMETYPE:rest/of.name=without-restrictions (example)
3992    reserved:   reserved, but will not conflict with above
3993
3994 Domain names must look like domain names: they consist of components
3995 separated by periods (.) and they contain neither colons (:) nor slashes
3996 (/). Domain names must be converted to upper case when used as realm names.
3997
3998 X.500 names contain an equal (=) and cannot contain a colon (:) before the
3999
4000
4001 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4002
4003 equal. The realm names for X.500 names will be string representations of the
4004 names with components separated by slashes. Leading and trailing slashes
4005 will not be included.
4006
4007 Names that fall into the other category must begin with a prefix that
4008 contains no equal (=) or period (.) and the prefix must be followed by a
4009 colon (:) and the rest of the name. All prefixes must be assigned before
4010 they may be used. Presently none are assigned.
4011
4012 The reserved category includes strings which do not fall into the first
4013 three categories. All names in this category are reserved. It is unlikely
4014 that names will be assigned to this category unless there is a very strong
4015 argument for not using the 'other' category.
4016
4017 These rules guarantee that there will be no conflicts between the various
4018 name styles. The following additional constraints apply to the assignment of
4019 realm names in the domain and X.500 categories: the name of a realm for the
4020 domain or X.500 formats must either be used by the organization owning (to
4021 whom it was assigned) an Internet domain name or X.500 name, or in the case
4022 that no such names are registered, authority to use a realm name may be
4023 derived from the authority of the parent realm. For example, if there is no
4024 domain name for E40.MIT.EDU, then the administrator of the MIT.EDU realm can
4025 authorize the creation of a realm with that name.
4026
4027 This is acceptable because the organization to which the parent is assigned
4028 is presumably the organization authorized to assign names to its children in
4029 the X.500 and domain name systems as well. If the parent assigns a realm
4030 name without also registering it in the domain name or X.500 hierarchy, it
4031 is the parent's responsibility to make sure that there will not in the
4032 future exists a name identical to the realm name of the child unless it is
4033 assigned to the same entity as the realm name.
4034
4035 7.2. Principal Names
4036
4037 As was the case for realm names, conventions are needed to ensure that all
4038 agree on what information is implied by a principal name. The name-type
4039 field that is part of the principal name indicates the kind of information
4040 implied by the name. The name-type should be treated as a hint. Ignoring the
4041 name type, no two names can be the same (i.e. at least one of the
4042 components, or the realm, must be different). The following name types are
4043 defined:
4044
4045   name-type      value   meaning
4046
4047    NT-UNKNOWN        0   Name type not known
4048    NT-PRINCIPAL      1   General principal name (e.g. username, or DCE principal)
4049    NT-SRV-INST       2   Service and other unique instance (krbtgt)
4050    NT-SRV-HST        3   Service with host name as instance (telnet, rcommands)
4051    NT-SRV-XHST       4   Service with slash-separated host name components
4052    NT-UID            5   Unique ID
4053    NT-X500-PRINCIPAL 6   Encoded X.509 Distingished name [RFC 1779]
4054
4055 When a name implies no information other than its uniqueness at a particular
4056 time the name type PRINCIPAL should be used. The principal name type should
4057
4058
4059 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4060
4061 be used for users, and it might also be used for a unique server. If the
4062 name is a unique machine generated ID that is guaranteed never to be
4063 reassigned then the name type of UID should be used (note that it is
4064 generally a bad idea to reassign names of any type since stale entries might
4065 remain in access control lists).
4066
4067 If the first component of a name identifies a service and the remaining
4068 components identify an instance of the service in a server specified manner,
4069 then the name type of SRV-INST should be used. An example of this name type
4070 is the Kerberos ticket-granting service whose name has a first component of
4071 krbtgt and a second component identifying the realm for which the ticket is
4072 valid.
4073
4074 If instance is a single component following the service name and the
4075 instance identifies the host on which the server is running, then the name
4076 type SRV-HST should be used. This type is typically used for Internet
4077 services such as telnet and the Berkeley R commands. If the separate
4078 components of the host name appear as successive components following the
4079 name of the service, then the name type SRV-XHST should be used. This type
4080 might be used to identify servers on hosts with X.500 names where the slash
4081 (/) might otherwise be ambiguous.
4082
4083 A name type of NT-X500-PRINCIPAL should be used when a name from an X.509
4084 certificiate is translated into a Kerberos name. The encoding of the X.509
4085 name as a Kerberos principal shall conform to the encoding rules specified
4086 in RFC 1779.
4087
4088 A name type of UNKNOWN should be used when the form of the name is not
4089 known. When comparing names, a name of type UNKNOWN will match principals
4090 authenticated with names of any type. A principal authenticated with a name
4091 of type UNKNOWN, however, will only match other names of type UNKNOWN.
4092
4093 Names of any type with an initial component of 'krbtgt' are reserved for the
4094 Kerberos ticket granting service. See section 8.2.3 for the form of such
4095 names.
4096
4097 7.2.1. Name of server principals
4098
4099 The principal identifier for a server on a host will generally be composed
4100 of two parts: (1) the realm of the KDC with which the server is registered,
4101 and (2) a two-component name of type NT-SRV-HST if the host name is an
4102 Internet domain name or a multi-component name of type NT-SRV-XHST if the
4103 name of the host is of a form such as X.500 that allows slash (/)
4104 separators. The first component of the two- or multi-component name will
4105 identify the service and the latter components will identify the host. Where
4106 the name of the host is not case sensitive (for example, with Internet
4107 domain names) the name of the host must be lower case. If specified by the
4108 application protocol for services such as telnet and the Berkeley R commands
4109 which run with system privileges, the first component may be the string
4110 'host' instead of a service specific identifier. When a host has an official
4111 name and one or more aliases, the official name of the host must be used
4112 when constructing the name of the server principal.
4113
4114 8. Constants and other defined values
4115
4116
4117 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4118
4119
4120 8.1. Host address types
4121
4122 All negative values for the host address type are reserved for local use.
4123 All non-negative values are reserved for officially assigned type fields and
4124 interpretations.
4125
4126 The values of the types for the following addresses are chosen to match the
4127 defined address family constants in the Berkeley Standard Distributions of
4128 Unix. They can be found in with symbolic names AF_xxx (where xxx is an
4129 abbreviation of the address family name).
4130
4131 Internet (IPv4) Addresses
4132
4133 Internet (IPv4) addresses are 32-bit (4-octet) quantities, encoded in MSB
4134 order. The type of IPv4 addresses is two (2).
4135
4136 Internet (IPv6) Addresses
4137
4138 IPv6 addresses are 128-bit (16-octet) quantities, encoded in MSB order. The
4139 type of IPv6 addresses is twenty-four (24). [RFC1883] [RFC1884]. The
4140 following addresses (see [RFC1884]) MUST not appear in any Kerberos packet:
4141
4142    * the Unspecified Address
4143    * the Loopback Address
4144    * Link-Local addresses
4145
4146 IPv4-mapped IPv6 addresses MUST be represented as addresses of type 2.
4147
4148 CHAOSnet addresses
4149
4150 CHAOSnet addresses are 16-bit (2-octet) quantities, encoded in MSB order.
4151 The type of CHAOSnet addresses is five (5).
4152
4153 ISO addresses
4154
4155 ISO addresses are variable-length. The type of ISO addresses is seven (7).
4156
4157 Xerox Network Services (XNS) addresses
4158
4159 XNS addresses are 48-bit (6-octet) quantities, encoded in MSB order. The
4160 type of XNS addresses is six (6).
4161
4162 AppleTalk Datagram Delivery Protocol (DDP) addresses
4163
4164 AppleTalk DDP addresses consist of an 8-bit node number and a 16-bit network
4165 number. The first octet of the address is the node number; the remaining two
4166 octets encode the network number in MSB order. The type of AppleTalk DDP
4167 addresses is sixteen (16).
4168
4169 DECnet Phase IV addresses
4170
4171 DECnet Phase IV addresses are 16-bit addresses, encoded in LSB order. The
4172 type of DECnet Phase IV addresses is twelve (12).
4173
4174
4175 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4176
4177
4178 8.2. KDC messages
4179
4180 8.2.1. UDP/IP transport
4181
4182 When contacting a Kerberos server (KDC) for a KRB_KDC_REQ request using UDP
4183 IP transport, the client shall send a UDP datagram containing only an
4184 encoding of the request to port 88 (decimal) at the KDC's IP address; the
4185 KDC will respond with a reply datagram containing only an encoding of the
4186 reply message (either a KRB_ERROR or a KRB_KDC_REP) to the sending port at
4187 the sender's IP address. Kerberos servers supporting IP transport must
4188 accept UDP requests on port 88 (decimal). The response to a request made
4189 through UDP/IP transport must also use UDP/IP transport.
4190
4191 8.2.2. TCP/IP transport
4192
4193 Kerberos servers (KDC's) must accept TCP requests on port 88 (decimal). When
4194 the KRB_KDC_REQ message is sent to the KDC over a TCP stream, a new
4195 connection will be established for each authentication exchange (request and
4196 response). The KRB_KDC_REP or KRB_ERROR message will be returned to the
4197 client on the same TCP stream that was established for the request. The
4198 connection will be broken after the reply has been received (or upon
4199 time-out). Care must be taken in managing TCP/IP connections with the KDC to
4200 prevent denial of service attacks based on the number of TCP/IP connections
4201 with the KDC that remain open. If multiple exchanges with the KDC are needed
4202 for certain forms of preauthentication, multiple TCP connections will be
4203 required. The response to a request made through TCP/IP transport must also
4204 use TCP/IP transport.
4205
4206 The first four octets of the TCP stream used to transmit the request request
4207 will encode in network byte order the length of the request (KRB_KDC_REQ),
4208 and the length will be followed by the request itself. The response will
4209 similarly be preceeded by a 4 octet encoding in network byte order of the
4210 length of the KRB_KDC_REP or the KRB_ERROR message and will be followed by
4211 the KRB_KDC_REP or the KRB_ERROR response.
4212
4213 8.2.3. OSI transport
4214
4215 During authentication of an OSI client to an OSI server, the mutual
4216 authentication of an OSI server to an OSI client, the transfer of
4217 credentials from an OSI client to an OSI server, or during exchange of
4218 private or integrity checked messages, Kerberos protocol messages may be
4219 treated as opaque objects and the type of the authentication mechanism will
4220 be:
4221
4222 OBJECT IDENTIFIER ::= {iso (1), org(3), dod(6),internet(1), security(5),kerberosv5(2)}
4223
4224 Depending on the situation, the opaque object will be an authentication
4225 header (KRB_AP_REQ), an authentication reply (KRB_AP_REP), a safe message
4226 (KRB_SAFE), a private message (KRB_PRIV), or a credentials message
4227 (KRB_CRED). The opaque data contains an application code as specified in the
4228 ASN.1 description for each message. The application code may be used by
4229 Kerberos to determine the message type.
4230
4231
4232
4233 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4234
4235 8.2.3. Name of the TGS
4236
4237 The principal identifier of the ticket-granting service shall be composed of
4238 three parts: (1) the realm of the KDC issuing the TGS ticket (2) a two-part
4239 name of type NT-SRV-INST, with the first part "krbtgt" and the second part
4240 the name of the realm which will accept the ticket-granting ticket. For
4241 example, a ticket-granting ticket issued by the ATHENA.MIT.EDU realm to be
4242 used to get tickets from the ATHENA.MIT.EDU KDC has a principal identifier
4243 of "ATHENA.MIT.EDU" (realm), ("krbtgt", "ATHENA.MIT.EDU") (name). A
4244 ticket-granting ticket issued by the ATHENA.MIT.EDU realm to be used to get
4245 tickets from the MIT.EDU realm has a principal identifier of
4246 "ATHENA.MIT.EDU" (realm), ("krbtgt", "MIT.EDU") (name).
4247
4248 8.3. Protocol constants and associated values
4249
4250 The following tables list constants used in the protocol and defines their
4251 meanings.
4252
4253 Encryption type  etype value  block size    minimum pad size  confounder size
4254 NULL              0            1                 0                 0
4255 des-cbc-crc       1            8                 4                 8
4256 des-cbc-md4       2            8                 0                 8
4257 des-cbc-md5       3            8                 0                 8
4258         4
4259 des3-cbc-md5      5            8                 0                 8
4260         6
4261 des3-cbc-sha1     7            8                 0                 8
4262 sign-dsa-generate 8                                   (pkinit)
4263 encrypt-rsa-priv  9                                   (pkinit)
4264 encrypt-rsa-pub  10                                   (pkinit)
4265 rsa-pub-md5      11                                   (pkinit)
4266 rsa-pub-sha1     12                                   (pkinit)
4267 ENCTYPE_PK_CROSS 48                                   (reserved for pkcross)
4268        0x8003
4269
4270 Checksum type              sumtype value       checksum size
4271 CRC32                      1                   4
4272 rsa-md4                    2                   16
4273 rsa-md4-des                3                   24
4274 des-mac                    4                   16
4275 des-mac-k                  5                   8
4276 rsa-md4-des-k              6                   16
4277 rsa-md5                    7                   16
4278 rsa-md5-des                8                   24
4279 rsa-md5-des3               9                   24
4280 hmac-sha1-des3             10                  20  (I had this as 10, is it 12)
4281
4282 padata type                     padata-type value
4283
4284 PA-TGS-REQ                      1
4285 PA-ENC-TIMESTAMP                2
4286 PA-PW-SALT                      3
4287                       4
4288 PA-ENC-UNIX-TIME                5
4289
4290
4291 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4292
4293 PA-SANDIA-SECUREID              6
4294 PA-SESAME                       7
4295 PA-OSF-DCE                      8
4296 PA-CYBERSAFE-SECUREID           9
4297 PA-AFS3-SALT                    10
4298 PA-ETYPE-INFO                   11
4299 SAM-CHALLENGE                   12                  (sam/otp)
4300 SAM-RESPONSE                    13                  (sam/otp)
4301 PA-PK-AS-REQ                    14                  (pkinit)
4302 PA-PK-AS-REP                    15                  (pkinit)
4303 PA-PK-AS-SIGN                   16                  (pkinit)
4304 PA-PK-KEY-REQ                   17                  (pkinit)
4305 PA-PK-KEY-REP                   18                  (pkinit)
4306 PA-USE-SPECIFIED-KVNO           20
4307
4308 authorization data type         ad-type value
4309 AD-KDC-ISSUED                      1
4310 AD-INTENDED-FOR-SERVER             2
4311 AD-INTENDED-FOR-APPLICATION-CLASS  3
4312 AD-IF-RELEVANT                     4
4313 AD-OR                              5
4314 AD-MANDATORY-TICKET-EXTENSIONS     6
4315 AD-IN-TICKET-EXTENSIONS            7
4316 reserved values                    8-63
4317 OSF-DCE                            64
4318 SESAME                             65
4319
4320 Ticket Extension Types
4321
4322 TE-TYPE-NULL                  0      Null ticket extension
4323 TE-TYPE-EXTERNAL-ADATA        1      Integrity protected authorization data
4324                     2      TE-TYPE-PKCROSS-KDC  (I have reservations)
4325 TE-TYPE-PKCROSS-CLIENT        3      PKCROSS cross realm key ticket
4326 TE-TYPE-CYBERSAFE-EXT         4      Assigned to CyberSafe Corp
4327                     5      TE-TYPE-DEST-HOST (I have reservations)
4328
4329 alternate authentication type   method-type value
4330 reserved values                 0-63
4331 ATT-CHALLENGE-RESPONSE          64
4332
4333 transited encoding type         tr-type value
4334 DOMAIN-X500-COMPRESS            1
4335 reserved values                 all others
4336
4337 Label               Value   Meaning or MIT code
4338
4339 pvno                    5   current Kerberos protocol version number
4340
4341 message types
4342
4343 KRB_AS_REQ             10   Request for initial authentication
4344 KRB_AS_REP             11   Response to KRB_AS_REQ request
4345 KRB_TGS_REQ            12   Request for authentication based on TGT
4346 KRB_TGS_REP            13   Response to KRB_TGS_REQ request
4347
4348
4349 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4350
4351 KRB_AP_REQ             14   application request to server
4352 KRB_AP_REP             15   Response to KRB_AP_REQ_MUTUAL
4353 KRB_SAFE               20   Safe (checksummed) application message
4354 KRB_PRIV               21   Private (encrypted) application message
4355 KRB_CRED               22   Private (encrypted) message to forward credentials
4356 KRB_ERROR              30   Error response
4357
4358 name types
4359
4360 KRB_NT_UNKNOWN        0  Name type not known
4361 KRB_NT_PRINCIPAL      1  Just the name of the principal as in DCE, or for users
4362 KRB_NT_SRV_INST       2  Service and other unique instance (krbtgt)
4363 KRB_NT_SRV_HST        3  Service with host name as instance (telnet, rcommands)
4364 KRB_NT_SRV_XHST       4  Service with host as remaining components
4365 KRB_NT_UID            5  Unique ID
4366 KRB_NT_X500_PRINCIPAL 6  Encoded X.509 Distingished name [RFC 1779]
4367
4368 error codes
4369
4370 KDC_ERR_NONE                    0   No error
4371 KDC_ERR_NAME_EXP                1   Client's entry in database has expired
4372 KDC_ERR_SERVICE_EXP             2   Server's entry in database has expired
4373 KDC_ERR_BAD_PVNO                3   Requested protocol version number not 
4374                                     supported
4375 KDC_ERR_C_OLD_MAST_KVNO         4   Client's key encrypted in old master key
4376 KDC_ERR_S_OLD_MAST_KVNO         5   Server's key encrypted in old master key
4377 KDC_ERR_C_PRINCIPAL_UNKNOWN     6   Client not found in Kerberos database
4378 KDC_ERR_S_PRINCIPAL_UNKNOWN     7   Server not found in Kerberos database
4379 KDC_ERR_PRINCIPAL_NOT_UNIQUE    8   Multiple principal entries in database
4380 KDC_ERR_NULL_KEY                9   The client or server has a null key
4381 KDC_ERR_CANNOT_POSTDATE        10   Ticket not eligible for postdating
4382 KDC_ERR_NEVER_VALID            11   Requested start time is later than end time
4383 KDC_ERR_POLICY                 12   KDC policy rejects request
4384 KDC_ERR_BADOPTION              13   KDC cannot accommodate requested option
4385 KDC_ERR_ETYPE_NOSUPP           14   KDC has no support for encryption type
4386 KDC_ERR_SUMTYPE_NOSUPP         15   KDC has no support for checksum type
4387 KDC_ERR_PADATA_TYPE_NOSUPP     16   KDC has no support for padata type
4388 KDC_ERR_TRTYPE_NOSUPP          17   KDC has no support for transited type
4389 KDC_ERR_CLIENT_REVOKED         18   Clients credentials have been revoked
4390 KDC_ERR_SERVICE_REVOKED        19   Credentials for server have been revoked
4391 KDC_ERR_TGT_REVOKED            20   TGT has been revoked
4392 KDC_ERR_CLIENT_NOTYET          21   Client not yet valid - try again later
4393 KDC_ERR_SERVICE_NOTYET         22   Server not yet valid - try again later
4394 KDC_ERR_KEY_EXPIRED            23   Password has expired - change password
4395                                     to reset
4396 KDC_ERR_PREAUTH_FAILED         24   Pre-authentication information was invalid
4397 KDC_ERR_PREAUTH_REQUIRED       25   Additional pre-authenticationrequired [40]
4398 KDC_ERR_SERVER_NOMATCH         26   Requested server and ticket don't match
4399 KDC_ERR_MUST_USE_USER2USER     27   Server principal valid for user2user only
4400 KDC_ERR_PATH_NOT_ACCPETED      28   KDC Policy rejects transited path
4401 KRB_AP_ERR_BAD_INTEGRITY       31   Integrity check on decrypted field failed
4402 KRB_AP_ERR_TKT_EXPIRED         32   Ticket expired
4403 KRB_AP_ERR_TKT_NYV             33   Ticket not yet valid
4404 KRB_AP_ERR_REPEAT              34   Request is a replay
4405 KRB_AP_ERR_NOT_US              35   The ticket isn't for us
4406 KRB_AP_ERR_BADMATCH            36   Ticket and authenticator don't match
4407
4408
4409 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4410
4411 KRB_AP_ERR_SKEW                37   Clock skew too great
4412 KRB_AP_ERR_BADADDR             38   Incorrect net address
4413 KRB_AP_ERR_BADVERSION          39   Protocol version mismatch
4414 KRB_AP_ERR_MSG_TYPE            40   Invalid msg type
4415 KRB_AP_ERR_MODIFIED            41   Message stream modified
4416 KRB_AP_ERR_BADORDER            42   Message out of order
4417 KRB_AP_ERR_BADKEYVER           44   Specified version of key is not available
4418 KRB_AP_ERR_NOKEY               45   Service key not available
4419 KRB_AP_ERR_MUT_FAIL            46   Mutual authentication failed
4420 KRB_AP_ERR_BADDIRECTION        47   Incorrect message direction
4421 KRB_AP_ERR_METHOD              48   Alternative authentication method required
4422 KRB_AP_ERR_BADSEQ              49   Incorrect sequence number in message
4423 KRB_AP_ERR_INAPP_CKSUM         50   Inappropriate type of checksum in message
4424 KRB_AP_PATH_NOT_ACCEPTED       51   Policy rejects transited path
4425 KRB_ERR_GENERIC                60   Generic error (description in e-text)
4426 KRB_ERR_FIELD_TOOLONG          61   Field is too long for this implementation
4427 KDC_ERROR_CLIENT_NOT_TRUSTED   62   (pkinit)
4428 KDC_ERROR_KDC_NOT_TRUSTED      63   (pkinit)
4429 KDC_ERROR_INVALID_SIG          64   (pkinit)
4430 KDC_ERR_KEY_TOO_WEAK           65   (pkinit)
4431 KDC_ERR_CERTIFICATE_MISMATCH   66   (pkinit)
4432
4433 9. Interoperability requirements
4434
4435 Version 5 of the Kerberos protocol supports a myriad of options. Among these
4436 are multiple encryption and checksum types, alternative encoding schemes for
4437 the transited field, optional mechanisms for pre-authentication, the
4438 handling of tickets with no addresses, options for mutual authentication,
4439 user to user authentication, support for proxies, forwarding, postdating,
4440 and renewing tickets, the format of realm names, and the handling of
4441 authorization data.
4442
4443 In order to ensure the interoperability of realms, it is necessary to define
4444 a minimal configuration which must be supported by all implementations. This
4445 minimal configuration is subject to change as technology does. For example,
4446 if at some later date it is discovered that one of the required encryption
4447 or checksum algorithms is not secure, it will be replaced.
4448
4449 9.1. Specification 2
4450
4451 This section defines the second specification of these options.
4452 Implementations which are configured in this way can be said to support
4453 Kerberos Version 5 Specification 2 (5.1). Specification 1 (depricated) may
4454 be found in RFC1510.
4455
4456 Transport
4457
4458 TCP/IP and UDP/IP transport must be supported by KDCs claiming conformance
4459 to specification 2. Kerberos clients claiming conformance to specification 2
4460 must support UDP/IP transport for messages with the KDC and may support
4461 TCP/IP transport.
4462
4463 Encryption and checksum methods
4464
4465
4466
4467 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4468
4469 The following encryption and checksum mechanisms must be supported.
4470 Implementations may support other mechanisms as well, but the additional
4471 mechanisms may only be used when communicating with principals known to also
4472 support them: This list is to be determined.
4473
4474 Encryption: DES-CBC-MD5
4475 Checksums: CRC-32, DES-MAC, DES-MAC-K, and DES-MD5
4476
4477 Realm Names
4478
4479 All implementations must understand hierarchical realms in both the Internet
4480 Domain and the X.500 style. When a ticket granting ticket for an unknown
4481 realm is requested, the KDC must be able to determine the names of the
4482 intermediate realms between the KDCs realm and the requested realm.
4483
4484 Transited field encoding
4485
4486 DOMAIN-X500-COMPRESS (described in section 3.3.3.2) must be supported.
4487 Alternative encodings may be supported, but they may be used only when that
4488 encoding is supported by ALL intermediate realms.
4489
4490 Pre-authentication methods
4491
4492 The TGS-REQ method must be supported. The TGS-REQ method is not used on the
4493 initial request. The PA-ENC-TIMESTAMP method must be supported by clients
4494 but whether it is enabled by default may be determined on a realm by realm
4495 basis. If not used in the initial request and the error
4496 KDC_ERR_PREAUTH_REQUIRED is returned specifying PA-ENC-TIMESTAMP as an
4497 acceptable method, the client should retry the initial request using the
4498 PA-ENC-TIMESTAMP preauthentication method. Servers need not support the
4499 PA-ENC-TIMESTAMP method, but if not supported the server should ignore the
4500 presence of PA-ENC-TIMESTAMP pre-authentication in a request.
4501
4502 Mutual authentication
4503
4504 Mutual authentication (via the KRB_AP_REP message) must be supported.
4505
4506 Ticket addresses and flags
4507
4508 All KDC's must pass on tickets that carry no addresses (i.e. if a TGT
4509 contains no addresses, the KDC will return derivative tickets), but each
4510 realm may set its own policy for issuing such tickets, and each application
4511 server will set its own policy with respect to accepting them.
4512
4513 Proxies and forwarded tickets must be supported. Individual realms and
4514 application servers can set their own policy on when such tickets will be
4515 accepted.
4516
4517 All implementations must recognize renewable and postdated tickets, but need
4518 not actually implement them. If these options are not supported, the
4519 starttime and endtime in the ticket shall specify a ticket's entire useful
4520 life. When a postdated ticket is decoded by a server, all implementations
4521 shall make the presence of the postdated flag visible to the calling server.
4522
4523
4524
4525 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4526
4527 User-to-user authentication
4528
4529 Support for user to user authentication (via the ENC-TKT-IN-SKEY KDC option)
4530 must be provided by implementations, but individual realms may decide as a
4531 matter of policy to reject such requests on a per-principal or realm-wide
4532 basis.
4533
4534 Authorization data
4535
4536 Implementations must pass all authorization data subfields from
4537 ticket-granting tickets to any derivative tickets unless directed to
4538 suppress a subfield as part of the definition of that registered subfield
4539 type (it is never incorrect to pass on a subfield, and no registered
4540 subfield types presently specify suppression at the KDC).
4541
4542 Implementations must make the contents of any authorization data subfields
4543 available to the server when a ticket is used. Implementations are not
4544 required to allow clients to specify the contents of the authorization data
4545 fields.
4546
4547 9.2. Recommended KDC values
4548
4549 Following is a list of recommended values for a KDC implementation, based on
4550 the list of suggested configuration constants (see section 4.4).
4551
4552 minimum lifetime              5 minutes
4553 maximum renewable lifetime    1 week
4554 maximum ticket lifetime       1 day
4555 empty addresses               only when suitable  restrictions  appear
4556                               in authorization data
4557 proxiable, etc.               Allowed.
4558
4559 10. REFERENCES
4560
4561 [NT94]    B. Clifford Neuman and Theodore Y. Ts'o, "An  Authenti-
4562           cation  Service for Computer Networks," IEEE Communica-
4563           tions Magazine, Vol. 32(9), pp. 33-38 (September 1994).
4564
4565 [MNSS87]  S. P. Miller, B. C. Neuman, J. I. Schiller, and  J.  H.
4566           Saltzer,  Section  E.2.1:  Kerberos  Authentication and
4567           Authorization System, M.I.T. Project Athena, Cambridge,
4568           Massachusetts (December 21, 1987).
4569
4570 [SNS88]   J. G. Steiner, B. C. Neuman, and J. I. Schiller,  "Ker-
4571           beros:  An Authentication Service for Open Network Sys-
4572           tems," pp. 191-202 in  Usenix  Conference  Proceedings,
4573           Dallas, Texas (February, 1988).
4574
4575 [NS78]    Roger M.  Needham  and  Michael  D.  Schroeder,  "Using
4576           Encryption for Authentication in Large Networks of Com-
4577           puters,"  Communications  of  the  ACM,  Vol.   21(12),
4578           pp. 993-999 (December, 1978).
4579
4580 [DS81]    Dorothy E. Denning and  Giovanni  Maria  Sacco,  "Time-
4581
4582
4583 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4584
4585           stamps  in  Key Distribution Protocols," Communications
4586           of the ACM, Vol. 24(8), pp. 533-536 (August 1981).
4587
4588 [KNT92]   John T. Kohl, B. Clifford Neuman, and Theodore Y. Ts'o,
4589           "The Evolution of the Kerberos Authentication Service,"
4590           in an IEEE Computer Society Text soon to  be  published
4591           (June 1992).
4592
4593 [Neu93]   B.  Clifford  Neuman,  "Proxy-Based  Authorization  and
4594           Accounting  for Distributed Systems," in Proceedings of
4595           the 13th International Conference on  Distributed  Com-
4596           puting Systems, Pittsburgh, PA (May, 1993).
4597
4598 [DS90]    Don Davis and Ralph Swick,  "Workstation  Services  and
4599           Kerberos  Authentication  at Project Athena," Technical
4600           Memorandum TM-424,  MIT Laboratory for Computer Science
4601           (February 1990).
4602
4603 [LGDSR87] P. J. Levine, M. R. Gretzinger, J. M. Diaz, W. E.  Som-
4604           merfeld,  and  K. Raeburn, Section E.1: Service Manage-
4605           ment System, M.I.T.  Project  Athena,  Cambridge,  Mas-
4606           sachusetts (1987).
4607
4608 [X509-88] CCITT, Recommendation X.509: The Directory  Authentica-
4609           tion Framework, December 1988.
4610
4611 [Pat92].  J. Pato, Using  Pre-Authentication  to  Avoid  Password
4612           Guessing  Attacks, Open Software Foundation DCE Request
4613           for Comments 26 (December 1992).
4614
4615 [DES77]   National Bureau of Standards, U.S. Department  of  Com-
4616           merce,  "Data Encryption Standard," Federal Information
4617           Processing Standards Publication  46,   Washington,  DC
4618           (1977).
4619
4620 [DESM80]  National Bureau of Standards, U.S. Department  of  Com-
4621           merce,  "DES  Modes  of Operation," Federal Information
4622           Processing Standards Publication 81,   Springfield,  VA
4623           (December 1980).
4624
4625 [SG92]    Stuart G. Stubblebine and Virgil D. Gligor, "On Message
4626           Integrity  in  Cryptographic Protocols," in Proceedings
4627           of the IEEE  Symposium  on  Research  in  Security  and
4628           Privacy, Oakland, California (May 1992).
4629
4630 [IS3309]  International Organization  for  Standardization,  "ISO
4631           Information  Processing  Systems - Data Communication -
4632           High-Level Data Link Control Procedure -  Frame  Struc-
4633           ture," IS 3309 (October 1984).  3rd Edition.
4634
4635 [MD4-92]  R. Rivest, "The  MD4  Message  Digest  Algorithm,"  RFC
4636           1320,   MIT  Laboratory  for  Computer  Science  (April
4637           1992).
4638
4639
4640
4641 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4642
4643 [MD5-92]  R. Rivest, "The  MD5  Message  Digest  Algorithm,"  RFC
4644           1321,   MIT  Laboratory  for  Computer  Science  (April
4645           1992).
4646
4647 [KBC96]   H. Krawczyk, M. Bellare, and R. Canetti, "HMAC:  Keyed-
4648           Hashing  for  Message  Authentication,"  Working  Draft
4649           draft-ietf-ipsec-hmac-md5-01.txt,   (August 1996).
4650
4651 A. Pseudo-code for protocol processing
4652
4653 This appendix provides pseudo-code describing how the messages are to be
4654 constructed and interpreted by clients and servers.
4655
4656 A.1. KRB_AS_REQ generation
4657
4658         request.pvno := protocol version; /* pvno = 5 */
4659         request.msg-type := message type; /* type = KRB_AS_REQ */
4660
4661         if(pa_enc_timestamp_required) then
4662                 request.padata.padata-type = PA-ENC-TIMESTAMP;
4663                 get system_time;
4664                 padata-body.patimestamp,pausec = system_time;
4665                 encrypt padata-body into request.padata.padata-value
4666                         using client.key; /* derived from password */
4667         endif
4668
4669         body.kdc-options := users's preferences;
4670         body.cname := user's name;
4671         body.realm := user's realm;
4672         body.sname := service's name; /* usually "krbtgt",  "localrealm" */
4673         if (body.kdc-options.POSTDATED is set) then
4674                 body.from := requested starting time;
4675         else
4676                 omit body.from;
4677         endif
4678         body.till := requested end time;
4679         if (body.kdc-options.RENEWABLE is set) then
4680                 body.rtime := requested final renewal time;
4681         endif
4682         body.nonce := random_nonce();
4683         body.etype := requested etypes;
4684         if (user supplied addresses) then
4685                 body.addresses := user's addresses;
4686         else
4687                 omit body.addresses;
4688         endif
4689         omit body.enc-authorization-data;
4690         request.req-body := body;
4691
4692         kerberos := lookup(name of local kerberos server (or servers));
4693         send(packet,kerberos);
4694
4695         wait(for response);
4696         if (timed_out) then
4697
4698
4699 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4700
4701                 retry or use alternate server;
4702         endif
4703
4704 A.2. KRB_AS_REQ verification and KRB_AS_REP generation
4705
4706         decode message into req;
4707
4708         client := lookup(req.cname,req.realm);
4709         server := lookup(req.sname,req.realm);
4710
4711         get system_time;
4712         kdc_time := system_time.seconds;
4713
4714         if (!client) then
4715                 /* no client in Database */
4716                 error_out(KDC_ERR_C_PRINCIPAL_UNKNOWN);
4717         endif
4718         if (!server) then
4719                 /* no server in Database */
4720                 error_out(KDC_ERR_S_PRINCIPAL_UNKNOWN);
4721         endif
4722
4723         if(client.pa_enc_timestamp_required and
4724            pa_enc_timestamp not present) then
4725                 error_out(KDC_ERR_PREAUTH_REQUIRED(PA_ENC_TIMESTAMP));
4726         endif
4727
4728         if(pa_enc_timestamp present) then
4729                 decrypt req.padata-value into decrypted_enc_timestamp
4730                         using client.key;
4731                         using auth_hdr.authenticator.subkey;
4732                 if (decrypt_error()) then
4733                         error_out(KRB_AP_ERR_BAD_INTEGRITY);
4734                 if(decrypted_enc_timestamp is not within allowable skew) then
4735                         error_out(KDC_ERR_PREAUTH_FAILED);
4736                 endif
4737                 if(decrypted_enc_timestamp and usec is replay)
4738                         error_out(KDC_ERR_PREAUTH_FAILED);
4739                 endif
4740                 add decrypted_enc_timestamp and usec to replay cache;
4741         endif
4742
4743         use_etype := first supported etype in req.etypes;
4744
4745         if (no support for req.etypes) then
4746                 error_out(KDC_ERR_ETYPE_NOSUPP);
4747         endif
4748
4749         new_tkt.vno := ticket version; /* = 5 */
4750         new_tkt.sname := req.sname;
4751         new_tkt.srealm := req.srealm;
4752         reset all flags in new_tkt.flags;
4753
4754         /* It should be noted that local policy may affect the  */
4755
4756
4757 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4758
4759         /* processing of any of these flags.  For example, some */
4760         /* realms may refuse to issue renewable tickets         */
4761
4762         if (req.kdc-options.FORWARDABLE is set) then
4763                 set new_tkt.flags.FORWARDABLE;
4764         endif
4765         if (req.kdc-options.PROXIABLE is set) then
4766                 set new_tkt.flags.PROXIABLE;
4767         endif
4768
4769         if (req.kdc-options.ALLOW-POSTDATE is set) then
4770                 set new_tkt.flags.MAY-POSTDATE;
4771         endif
4772         if ((req.kdc-options.RENEW is set) or
4773             (req.kdc-options.VALIDATE is set) or
4774             (req.kdc-options.PROXY is set) or
4775             (req.kdc-options.FORWARDED is set) or
4776             (req.kdc-options.ENC-TKT-IN-SKEY is set)) then
4777                 error_out(KDC_ERR_BADOPTION);
4778         endif
4779
4780         new_tkt.session := random_session_key();
4781         new_tkt.cname := req.cname;
4782         new_tkt.crealm := req.crealm;
4783         new_tkt.transited := empty_transited_field();
4784
4785         new_tkt.authtime := kdc_time;
4786
4787         if (req.kdc-options.POSTDATED is set) then
4788            if (against_postdate_policy(req.from)) then
4789                 error_out(KDC_ERR_POLICY);
4790            endif
4791            set new_tkt.flags.POSTDATED;
4792            set new_tkt.flags.INVALID;
4793            new_tkt.starttime := req.from;
4794         else
4795            omit new_tkt.starttime; /* treated as authtime when omitted */
4796         endif
4797         if (req.till = 0) then
4798                 till := infinity;
4799         else
4800                 till := req.till;
4801         endif
4802
4803         new_tkt.endtime := min(till,
4804                               new_tkt.starttime+client.max_life,
4805                               new_tkt.starttime+server.max_life,
4806                               new_tkt.starttime+max_life_for_realm);
4807
4808         if ((req.kdc-options.RENEWABLE-OK is set) and
4809             (new_tkt.endtime < req.till)) then
4810                 /* we set the RENEWABLE option for later processing */
4811                 set req.kdc-options.RENEWABLE;
4812                 req.rtime := req.till;
4813
4814
4815 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4816
4817         endif
4818
4819         if (req.rtime = 0) then
4820                 rtime := infinity;
4821         else
4822                 rtime := req.rtime;
4823         endif
4824
4825         if (req.kdc-options.RENEWABLE is set) then
4826                 set new_tkt.flags.RENEWABLE;
4827                 new_tkt.renew-till := min(rtime,
4828                                           new_tkt.starttime+client.max_rlife,
4829                                           new_tkt.starttime+server.max_rlife,
4830                                           new_tkt.starttime+max_rlife_for_realm);
4831         else
4832                 omit new_tkt.renew-till; /* only present if RENEWABLE */
4833         endif
4834
4835         if (req.addresses) then
4836                 new_tkt.caddr := req.addresses;
4837         else
4838                 omit new_tkt.caddr;
4839         endif
4840
4841         new_tkt.authorization_data := empty_authorization_data();
4842
4843         encode to-be-encrypted part of ticket into OCTET STRING;
4844         new_tkt.enc-part := encrypt OCTET STRING
4845                 using etype_for_key(server.key), server.key, server.p_kvno;
4846
4847         /* Start processing the response */
4848
4849         resp.pvno := 5;
4850         resp.msg-type := KRB_AS_REP;
4851         resp.cname := req.cname;
4852         resp.crealm := req.realm;
4853         resp.ticket := new_tkt;
4854
4855         resp.key := new_tkt.session;
4856         resp.last-req := fetch_last_request_info(client);
4857         resp.nonce := req.nonce;
4858         resp.key-expiration := client.expiration;
4859         resp.flags := new_tkt.flags;
4860
4861         resp.authtime := new_tkt.authtime;
4862         resp.starttime := new_tkt.starttime;
4863         resp.endtime := new_tkt.endtime;
4864
4865         if (new_tkt.flags.RENEWABLE) then
4866                 resp.renew-till := new_tkt.renew-till;
4867         endif
4868
4869         resp.realm := new_tkt.realm;
4870         resp.sname := new_tkt.sname;
4871
4872
4873 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4874
4875
4876         resp.caddr := new_tkt.caddr;
4877
4878         encode body of reply into OCTET STRING;
4879
4880         resp.enc-part := encrypt OCTET STRING
4881                          using use_etype, client.key, client.p_kvno;
4882         send(resp);
4883
4884 A.3. KRB_AS_REP verification
4885
4886         decode response into resp;
4887
4888         if (resp.msg-type = KRB_ERROR) then
4889                 if(error = KDC_ERR_PREAUTH_REQUIRED(PA_ENC_TIMESTAMP)) then
4890                         set pa_enc_timestamp_required;
4891                         goto KRB_AS_REQ;
4892                 endif
4893                 process_error(resp);
4894                 return;
4895         endif
4896
4897         /* On error, discard the response, and zero the session key */
4898         /* from the response immediately */
4899
4900         key = get_decryption_key(resp.enc-part.kvno, resp.enc-part.etype,
4901                                  resp.padata);
4902         unencrypted part of resp := decode of decrypt of resp.enc-part
4903                                 using resp.enc-part.etype and key;
4904         zero(key);
4905
4906         if (common_as_rep_tgs_rep_checks fail) then
4907                 destroy resp.key;
4908                 return error;
4909         endif
4910
4911         if near(resp.princ_exp) then
4912                 print(warning message);
4913         endif
4914         save_for_later(ticket,session,client,server,times,flags);
4915
4916 A.4. KRB_AS_REP and KRB_TGS_REP common checks
4917
4918         if (decryption_error() or
4919             (req.cname != resp.cname) or
4920             (req.realm != resp.crealm) or
4921             (req.sname != resp.sname) or
4922             (req.realm != resp.realm) or
4923             (req.nonce != resp.nonce) or
4924             (req.addresses != resp.caddr)) then
4925                 destroy resp.key;
4926                 return KRB_AP_ERR_MODIFIED;
4927         endif
4928
4929
4930
4931 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4932
4933         /* make sure no flags are set that shouldn't be, and that all that */
4934         /* should be are set                                               */
4935         if (!check_flags_for_compatability(req.kdc-options,resp.flags)) then
4936                 destroy resp.key;
4937                 return KRB_AP_ERR_MODIFIED;
4938         endif
4939
4940         if ((req.from = 0) and
4941             (resp.starttime is not within allowable skew)) then
4942                 destroy resp.key;
4943                 return KRB_AP_ERR_SKEW;
4944         endif
4945         if ((req.from != 0) and (req.from != resp.starttime)) then
4946                 destroy resp.key;
4947                 return KRB_AP_ERR_MODIFIED;
4948         endif
4949         if ((req.till != 0) and (resp.endtime > req.till)) then
4950                 destroy resp.key;
4951                 return KRB_AP_ERR_MODIFIED;
4952         endif
4953
4954         if ((req.kdc-options.RENEWABLE is set) and
4955             (req.rtime != 0) and (resp.renew-till > req.rtime)) then
4956                 destroy resp.key;
4957                 return KRB_AP_ERR_MODIFIED;
4958         endif
4959         if ((req.kdc-options.RENEWABLE-OK is set) and
4960             (resp.flags.RENEWABLE) and
4961             (req.till != 0) and
4962             (resp.renew-till > req.till)) then
4963                 destroy resp.key;
4964                 return KRB_AP_ERR_MODIFIED;
4965         endif
4966
4967 A.5. KRB_TGS_REQ generation
4968
4969         /* Note that make_application_request might have to recursivly     */
4970         /* call this routine to get the appropriate ticket-granting ticket */
4971
4972         request.pvno := protocol version; /* pvno = 5 */
4973         request.msg-type := message type; /* type = KRB_TGS_REQ */
4974
4975         body.kdc-options := users's preferences;
4976         /* If the TGT is not for the realm of the end-server  */
4977         /* then the sname will be for a TGT for the end-realm */
4978         /* and the realm of the requested ticket (body.realm) */
4979         /* will be that of the TGS to which the TGT we are    */
4980         /* sending applies                                    */
4981         body.sname := service's name;
4982         body.realm := service's realm;
4983
4984         if (body.kdc-options.POSTDATED is set) then
4985                 body.from := requested starting time;
4986         else
4987
4988
4989 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
4990
4991                 omit body.from;
4992         endif
4993         body.till := requested end time;
4994         if (body.kdc-options.RENEWABLE is set) then
4995                 body.rtime := requested final renewal time;
4996         endif
4997         body.nonce := random_nonce();
4998         body.etype := requested etypes;
4999         if (user supplied addresses) then
5000                 body.addresses := user's addresses;
5001         else
5002                 omit body.addresses;
5003         endif
5004
5005         body.enc-authorization-data := user-supplied data;
5006         if (body.kdc-options.ENC-TKT-IN-SKEY) then
5007                 body.additional-tickets_ticket := second TGT;
5008         endif
5009
5010         request.req-body := body;
5011         check := generate_checksum (req.body,checksumtype);
5012
5013         request.padata[0].padata-type := PA-TGS-REQ;
5014         request.padata[0].padata-value := create a KRB_AP_REQ using
5015                                       the TGT and checksum
5016
5017         /* add in any other padata as required/supplied */
5018
5019         kerberos := lookup(name of local kerberose server (or servers));
5020         send(packet,kerberos);
5021
5022         wait(for response);
5023         if (timed_out) then
5024                 retry or use alternate server;
5025         endif
5026
5027 A.6. KRB_TGS_REQ verification and KRB_TGS_REP generation
5028
5029         /* note that reading the application request requires first
5030         determining the server for which a ticket was issued, and choosing the
5031         correct key for decryption.  The name of the server appears in the
5032         plaintext part of the ticket. */
5033
5034         if (no KRB_AP_REQ in req.padata) then
5035                 error_out(KDC_ERR_PADATA_TYPE_NOSUPP);
5036         endif
5037         verify KRB_AP_REQ in req.padata;
5038
5039         /* Note that the realm in which the Kerberos server is operating is
5040         determined by the instance from the ticket-granting ticket.  The realm
5041         in the ticket-granting ticket is the realm under which the ticket
5042         granting ticket was issued.  It is possible for a single Kerberos
5043         server to support more than one realm. */
5044
5045
5046
5047 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5048
5049         auth_hdr := KRB_AP_REQ;
5050         tgt := auth_hdr.ticket;
5051
5052         if (tgt.sname is not a TGT for local realm and is not req.sname) then
5053                 error_out(KRB_AP_ERR_NOT_US);
5054
5055         realm := realm_tgt_is_for(tgt);
5056
5057         decode remainder of request;
5058
5059         if (auth_hdr.authenticator.cksum is missing) then
5060                 error_out(KRB_AP_ERR_INAPP_CKSUM);
5061         endif
5062
5063         if (auth_hdr.authenticator.cksum type is not supported) then
5064                 error_out(KDC_ERR_SUMTYPE_NOSUPP);
5065         endif
5066         if (auth_hdr.authenticator.cksum is not both collision-proof and keyed) then
5067                 error_out(KRB_AP_ERR_INAPP_CKSUM);
5068         endif
5069
5070         set computed_checksum := checksum(req);
5071         if (computed_checksum != auth_hdr.authenticatory.cksum) then
5072                 error_out(KRB_AP_ERR_MODIFIED);
5073         endif
5074
5075         server := lookup(req.sname,realm);
5076
5077         if (!server) then
5078                 if (is_foreign_tgt_name(req.sname)) then
5079                         server := best_intermediate_tgs(req.sname);
5080                 else
5081                         /* no server in Database */
5082                         error_out(KDC_ERR_S_PRINCIPAL_UNKNOWN);
5083                 endif
5084         endif
5085
5086         session := generate_random_session_key();
5087
5088         use_etype := first supported etype in req.etypes;
5089
5090         if (no support for req.etypes) then
5091                 error_out(KDC_ERR_ETYPE_NOSUPP);
5092         endif
5093
5094         new_tkt.vno := ticket version; /* = 5 */
5095         new_tkt.sname := req.sname;
5096         new_tkt.srealm := realm;
5097         reset all flags in new_tkt.flags;
5098
5099         /* It should be noted that local policy may affect the  */
5100         /* processing of any of these flags.  For example, some */
5101         /* realms may refuse to issue renewable tickets         */
5102
5103
5104
5105 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5106
5107         new_tkt.caddr := tgt.caddr;
5108         resp.caddr := NULL; /* We only include this if they change */
5109         if (req.kdc-options.FORWARDABLE is set) then
5110                 if (tgt.flags.FORWARDABLE is reset) then
5111                         error_out(KDC_ERR_BADOPTION);
5112                 endif
5113                 set new_tkt.flags.FORWARDABLE;
5114         endif
5115         if (req.kdc-options.FORWARDED is set) then
5116                 if (tgt.flags.FORWARDABLE is reset) then
5117                         error_out(KDC_ERR_BADOPTION);
5118                 endif
5119                 set new_tkt.flags.FORWARDED;
5120                 new_tkt.caddr := req.addresses;
5121                 resp.caddr := req.addresses;
5122         endif
5123         if (tgt.flags.FORWARDED is set) then
5124                 set new_tkt.flags.FORWARDED;
5125         endif
5126
5127         if (req.kdc-options.PROXIABLE is set) then
5128                 if (tgt.flags.PROXIABLE is reset)
5129                         error_out(KDC_ERR_BADOPTION);
5130                 endif
5131                 set new_tkt.flags.PROXIABLE;
5132         endif
5133         if (req.kdc-options.PROXY is set) then
5134                 if (tgt.flags.PROXIABLE is reset) then
5135                         error_out(KDC_ERR_BADOPTION);
5136                 endif
5137                 set new_tkt.flags.PROXY;
5138                 new_tkt.caddr := req.addresses;
5139                 resp.caddr := req.addresses;
5140         endif
5141
5142         if (req.kdc-options.ALLOW-POSTDATE is set) then
5143                 if (tgt.flags.MAY-POSTDATE is reset)
5144                         error_out(KDC_ERR_BADOPTION);
5145                 endif
5146                 set new_tkt.flags.MAY-POSTDATE;
5147         endif
5148         if (req.kdc-options.POSTDATED is set) then
5149                 if (tgt.flags.MAY-POSTDATE is reset) then
5150                         error_out(KDC_ERR_BADOPTION);
5151                 endif
5152                 set new_tkt.flags.POSTDATED;
5153                 set new_tkt.flags.INVALID;
5154                 if (against_postdate_policy(req.from)) then
5155                         error_out(KDC_ERR_POLICY);
5156                 endif
5157                 new_tkt.starttime := req.from;
5158         endif
5159
5160         if (req.kdc-options.VALIDATE is set) then
5161
5162
5163 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5164
5165                 if (tgt.flags.INVALID is reset) then
5166                         error_out(KDC_ERR_POLICY);
5167                 endif
5168                 if (tgt.starttime > kdc_time) then
5169                         error_out(KRB_AP_ERR_NYV);
5170                 endif
5171                 if (check_hot_list(tgt)) then
5172                         error_out(KRB_AP_ERR_REPEAT);
5173                 endif
5174                 tkt := tgt;
5175                 reset new_tkt.flags.INVALID;
5176         endif
5177
5178         if (req.kdc-options.(any flag except ENC-TKT-IN-SKEY, RENEW,
5179                              and those already processed) is set) then
5180                 error_out(KDC_ERR_BADOPTION);
5181         endif
5182
5183         new_tkt.authtime := tgt.authtime;
5184
5185         if (req.kdc-options.RENEW is set) then
5186           /* Note that if the endtime has already passed, the ticket would  */
5187           /* have been rejected in the initial authentication stage, so     */
5188           /* there is no need to check again here                           */
5189                 if (tgt.flags.RENEWABLE is reset) then
5190                         error_out(KDC_ERR_BADOPTION);
5191                 endif
5192                 if (tgt.renew-till < kdc_time) then
5193                         error_out(KRB_AP_ERR_TKT_EXPIRED);
5194                 endif
5195                 tkt := tgt;
5196                 new_tkt.starttime := kdc_time;
5197                 old_life := tgt.endttime - tgt.starttime;
5198                 new_tkt.endtime := min(tgt.renew-till,
5199                                        new_tkt.starttime + old_life);
5200         else
5201                 new_tkt.starttime := kdc_time;
5202                 if (req.till = 0) then
5203                         till := infinity;
5204                 else
5205                         till := req.till;
5206                 endif
5207                 new_tkt.endtime := min(till,
5208                                        new_tkt.starttime+client.max_life,
5209                                        new_tkt.starttime+server.max_life,
5210                                        new_tkt.starttime+max_life_for_realm,
5211                                        tgt.endtime);
5212
5213                 if ((req.kdc-options.RENEWABLE-OK is set) and
5214                     (new_tkt.endtime < req.till) and
5215                     (tgt.flags.RENEWABLE is set) then
5216                         /* we set the RENEWABLE option for later processing */
5217                         set req.kdc-options.RENEWABLE;
5218                         req.rtime := min(req.till, tgt.renew-till);
5219
5220
5221 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5222
5223                 endif
5224         endif
5225
5226         if (req.rtime = 0) then
5227                 rtime := infinity;
5228         else
5229                 rtime := req.rtime;
5230         endif
5231
5232         if ((req.kdc-options.RENEWABLE is set) and
5233             (tgt.flags.RENEWABLE is set)) then
5234                 set new_tkt.flags.RENEWABLE;
5235                 new_tkt.renew-till := min(rtime,
5236                                           new_tkt.starttime+client.max_rlife,
5237                                           new_tkt.starttime+server.max_rlife,
5238                                           new_tkt.starttime+max_rlife_for_realm,
5239                                           tgt.renew-till);
5240         else
5241                 new_tkt.renew-till := OMIT; /* leave the renew-till field out */
5242         endif
5243         if (req.enc-authorization-data is present) then
5244                 decrypt req.enc-authorization-data into decrypted_authorization_data
5245                         using auth_hdr.authenticator.subkey;
5246                 if (decrypt_error()) then
5247                         error_out(KRB_AP_ERR_BAD_INTEGRITY);
5248                 endif
5249         endif
5250         new_tkt.authorization_data := req.auth_hdr.ticket.authorization_data +
5251                                  decrypted_authorization_data;
5252
5253         new_tkt.key := session;
5254         new_tkt.crealm := tgt.crealm;
5255         new_tkt.cname := req.auth_hdr.ticket.cname;
5256
5257         if (realm_tgt_is_for(tgt) := tgt.realm) then
5258                 /* tgt issued by local realm */
5259                 new_tkt.transited := tgt.transited;
5260         else
5261                 /* was issued for this realm by some other realm */
5262                 if (tgt.transited.tr-type not supported) then
5263                         error_out(KDC_ERR_TRTYPE_NOSUPP);
5264                 endif
5265                 new_tkt.transited := compress_transited(tgt.transited + tgt.realm)
5266                 /* Don't check tranited field if TGT for foreign realm,
5267                  * or requested not to check */
5268                 if (is_not_foreign_tgt_name(new_tkt.server)
5269                    && req.kdc-options.DISABLE-TRANSITED-CHECK not set) then
5270                         /* Check it, so end-server does not have to
5271                          * but don't fail, end-server may still accept it */
5272                         if (check_transited_field(new_tkt.transited) == OK)
5273                               set new_tkt.flags.TRANSITED-POLICY-CHECKED;
5274                         endif
5275                 endif
5276         endif
5277
5278
5279 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5280
5281
5282         encode encrypted part of new_tkt into OCTET STRING;
5283         if (req.kdc-options.ENC-TKT-IN-SKEY is set) then
5284                 if (server not specified) then
5285                         server = req.second_ticket.client;
5286                 endif
5287                 if ((req.second_ticket is not a TGT) or
5288                     (req.second_ticket.client != server)) then
5289                         error_out(KDC_ERR_POLICY);
5290                 endif
5291
5292                 new_tkt.enc-part := encrypt OCTET STRING using
5293                         using etype_for_key(second-ticket.key), second-ticket.key;
5294         else
5295                 new_tkt.enc-part := encrypt OCTET STRING
5296                         using etype_for_key(server.key), server.key, server.p_kvno;
5297         endif
5298
5299         resp.pvno := 5;
5300         resp.msg-type := KRB_TGS_REP;
5301         resp.crealm := tgt.crealm;
5302         resp.cname := tgt.cname;
5303         resp.ticket := new_tkt;
5304
5305         resp.key := session;
5306         resp.nonce := req.nonce;
5307         resp.last-req := fetch_last_request_info(client);
5308         resp.flags := new_tkt.flags;
5309
5310         resp.authtime := new_tkt.authtime;
5311         resp.starttime := new_tkt.starttime;
5312         resp.endtime := new_tkt.endtime;
5313
5314         omit resp.key-expiration;
5315
5316         resp.sname := new_tkt.sname;
5317         resp.realm := new_tkt.realm;
5318
5319         if (new_tkt.flags.RENEWABLE) then
5320                 resp.renew-till := new_tkt.renew-till;
5321         endif
5322
5323         encode body of reply into OCTET STRING;
5324
5325         if (req.padata.authenticator.subkey)
5326                 resp.enc-part := encrypt OCTET STRING using use_etype,
5327                         req.padata.authenticator.subkey;
5328         else resp.enc-part := encrypt OCTET STRING using use_etype, tgt.key;
5329
5330         send(resp);
5331
5332 A.7. KRB_TGS_REP verification
5333
5334         decode response into resp;
5335
5336
5337 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5338
5339
5340         if (resp.msg-type = KRB_ERROR) then
5341                 process_error(resp);
5342                 return;
5343         endif
5344
5345         /* On error, discard the response, and zero the session key from
5346         the response immediately */
5347
5348         if (req.padata.authenticator.subkey)
5349                 unencrypted part of resp := decode of decrypt of resp.enc-part
5350                         using resp.enc-part.etype and subkey;
5351         else unencrypted part of resp := decode of decrypt of resp.enc-part
5352                                 using resp.enc-part.etype and tgt's session key;
5353         if (common_as_rep_tgs_rep_checks fail) then
5354                 destroy resp.key;
5355                 return error;
5356         endif
5357
5358         check authorization_data as necessary;
5359         save_for_later(ticket,session,client,server,times,flags);
5360
5361 A.8. Authenticator generation
5362
5363         body.authenticator-vno := authenticator vno; /* = 5 */
5364         body.cname, body.crealm := client name;
5365         if (supplying checksum) then
5366                 body.cksum := checksum;
5367         endif
5368         get system_time;
5369         body.ctime, body.cusec := system_time;
5370         if (selecting sub-session key) then
5371                 select sub-session key;
5372                 body.subkey := sub-session key;
5373         endif
5374         if (using sequence numbers) then
5375                 select initial sequence number;
5376                 body.seq-number := initial sequence;
5377         endif
5378
5379 A.9. KRB_AP_REQ generation
5380
5381         obtain ticket and session_key from cache;
5382
5383         packet.pvno := protocol version; /* 5 */
5384         packet.msg-type := message type; /* KRB_AP_REQ */
5385
5386         if (desired(MUTUAL_AUTHENTICATION)) then
5387                 set packet.ap-options.MUTUAL-REQUIRED;
5388         else
5389                 reset packet.ap-options.MUTUAL-REQUIRED;
5390         endif
5391         if (using session key for ticket) then
5392                 set packet.ap-options.USE-SESSION-KEY;
5393
5394
5395 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5396
5397         else
5398                 reset packet.ap-options.USE-SESSION-KEY;
5399         endif
5400         packet.ticket := ticket; /* ticket */
5401         generate authenticator;
5402         encode authenticator into OCTET STRING;
5403         encrypt OCTET STRING into packet.authenticator using session_key;
5404
5405 A.10. KRB_AP_REQ verification
5406
5407         receive packet;
5408         if (packet.pvno != 5) then
5409                 either process using other protocol spec
5410                 or error_out(KRB_AP_ERR_BADVERSION);
5411         endif
5412         if (packet.msg-type != KRB_AP_REQ) then
5413                 error_out(KRB_AP_ERR_MSG_TYPE);
5414         endif
5415         if (packet.ticket.tkt_vno != 5) then
5416                 either process using other protocol spec
5417                 or error_out(KRB_AP_ERR_BADVERSION);
5418         endif
5419         if (packet.ap_options.USE-SESSION-KEY is set) then
5420                 retrieve session key from ticket-granting ticket for
5421                  packet.ticket.{sname,srealm,enc-part.etype};
5422         else
5423                 retrieve service key for
5424                  packet.ticket.{sname,srealm,enc-part.etype,enc-part.skvno};
5425         endif
5426         if (no_key_available) then
5427                 if (cannot_find_specified_skvno) then
5428                         error_out(KRB_AP_ERR_BADKEYVER);
5429                 else
5430                         error_out(KRB_AP_ERR_NOKEY);
5431                 endif
5432         endif
5433         decrypt packet.ticket.enc-part into decr_ticket using retrieved key;
5434         if (decryption_error()) then
5435                 error_out(KRB_AP_ERR_BAD_INTEGRITY);
5436         endif
5437         decrypt packet.authenticator into decr_authenticator
5438                 using decr_ticket.key;
5439         if (decryption_error()) then
5440                 error_out(KRB_AP_ERR_BAD_INTEGRITY);
5441         endif
5442         if (decr_authenticator.{cname,crealm} !=
5443             decr_ticket.{cname,crealm}) then
5444                 error_out(KRB_AP_ERR_BADMATCH);
5445         endif
5446         if (decr_ticket.caddr is present) then
5447                 if (sender_address(packet) is not in decr_ticket.caddr) then
5448                         error_out(KRB_AP_ERR_BADADDR);
5449                 endif
5450         elseif (application requires addresses) then
5451
5452
5453 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5454
5455                 error_out(KRB_AP_ERR_BADADDR);
5456         endif
5457         if (not in_clock_skew(decr_authenticator.ctime,
5458                               decr_authenticator.cusec)) then
5459                 error_out(KRB_AP_ERR_SKEW);
5460         endif
5461         if (repeated(decr_authenticator.{ctime,cusec,cname,crealm})) then
5462                 error_out(KRB_AP_ERR_REPEAT);
5463         endif
5464         save_identifier(decr_authenticator.{ctime,cusec,cname,crealm});
5465         get system_time;
5466         if ((decr_ticket.starttime-system_time > CLOCK_SKEW) or
5467             (decr_ticket.flags.INVALID is set)) then
5468                 /* it hasn't yet become valid */
5469                 error_out(KRB_AP_ERR_TKT_NYV);
5470         endif
5471         if (system_time-decr_ticket.endtime > CLOCK_SKEW) then
5472                 error_out(KRB_AP_ERR_TKT_EXPIRED);
5473         endif
5474         if (decr_ticket.transited) then
5475             /* caller may ignore the TRANSITED-POLICY-CHECKED and do
5476              * check anyway */
5477             if (decr_ticket.flags.TRANSITED-POLICY-CHECKED not set) then
5478                  if (check_transited_field(decr_ticket.transited) then
5479                       error_out(KDC_AP_PATH_NOT_ACCPETED);
5480                  endif
5481             endif
5482         endif
5483         /* caller must check decr_ticket.flags for any pertinent details */
5484         return(OK, decr_ticket, packet.ap_options.MUTUAL-REQUIRED);
5485
5486 A.11. KRB_AP_REP generation
5487
5488         packet.pvno := protocol version; /* 5 */
5489         packet.msg-type := message type; /* KRB_AP_REP */
5490
5491         body.ctime := packet.ctime;
5492         body.cusec := packet.cusec;
5493         if (selecting sub-session key) then
5494                 select sub-session key;
5495                 body.subkey := sub-session key;
5496         endif
5497         if (using sequence numbers) then
5498                 select initial sequence number;
5499                 body.seq-number := initial sequence;
5500         endif
5501
5502         encode body into OCTET STRING;
5503
5504         select encryption type;
5505         encrypt OCTET STRING into packet.enc-part;
5506
5507 A.12. KRB_AP_REP verification
5508
5509
5510
5511 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5512
5513         receive packet;
5514         if (packet.pvno != 5) then
5515                 either process using other protocol spec
5516                 or error_out(KRB_AP_ERR_BADVERSION);
5517         endif
5518         if (packet.msg-type != KRB_AP_REP) then
5519                 error_out(KRB_AP_ERR_MSG_TYPE);
5520         endif
5521         cleartext := decrypt(packet.enc-part) using ticket's session key;
5522         if (decryption_error()) then
5523                 error_out(KRB_AP_ERR_BAD_INTEGRITY);
5524         endif
5525         if (cleartext.ctime != authenticator.ctime) then
5526                 error_out(KRB_AP_ERR_MUT_FAIL);
5527         endif
5528         if (cleartext.cusec != authenticator.cusec) then
5529                 error_out(KRB_AP_ERR_MUT_FAIL);
5530         endif
5531         if (cleartext.subkey is present) then
5532                 save cleartext.subkey for future use;
5533         endif
5534         if (cleartext.seq-number is present) then
5535                 save cleartext.seq-number for future verifications;
5536         endif
5537         return(AUTHENTICATION_SUCCEEDED);
5538
5539 A.13. KRB_SAFE generation
5540
5541         collect user data in buffer;
5542
5543         /* assemble packet: */
5544         packet.pvno := protocol version; /* 5 */
5545         packet.msg-type := message type; /* KRB_SAFE */
5546
5547         body.user-data := buffer; /* DATA */
5548         if (using timestamp) then
5549                 get system_time;
5550                 body.timestamp, body.usec := system_time;
5551         endif
5552         if (using sequence numbers) then
5553                 body.seq-number := sequence number;
5554         endif
5555         body.s-address := sender host addresses;
5556         if (only one recipient) then
5557                 body.r-address := recipient host address;
5558         endif
5559         checksum.cksumtype := checksum type;
5560         compute checksum over body;
5561         checksum.checksum := checksum value; /* checksum.checksum */
5562         packet.cksum := checksum;
5563         packet.safe-body := body;
5564
5565 A.14. KRB_SAFE verification
5566
5567
5568
5569 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5570
5571         receive packet;
5572         if (packet.pvno != 5) then
5573                 either process using other protocol spec
5574                 or error_out(KRB_AP_ERR_BADVERSION);
5575         endif
5576         if (packet.msg-type != KRB_SAFE) then
5577                 error_out(KRB_AP_ERR_MSG_TYPE);
5578         endif
5579         if (packet.checksum.cksumtype is not both collision-proof and keyed) then
5580                 error_out(KRB_AP_ERR_INAPP_CKSUM);
5581         endif
5582         if (safe_priv_common_checks_ok(packet)) then
5583                 set computed_checksum := checksum(packet.body);
5584                 if (computed_checksum != packet.checksum) then
5585                         error_out(KRB_AP_ERR_MODIFIED);
5586                 endif
5587                 return (packet, PACKET_IS_GENUINE);
5588         else
5589                 return common_checks_error;
5590         endif
5591
5592 A.15. KRB_SAFE and KRB_PRIV common checks
5593
5594         if (packet.s-address != O/S_sender(packet)) then
5595                 /* O/S report of sender not who claims to have sent it */
5596                 error_out(KRB_AP_ERR_BADADDR);
5597         endif
5598         if ((packet.r-address is present) and
5599             (packet.r-address != local_host_address)) then
5600                 /* was not sent to proper place */
5601                 error_out(KRB_AP_ERR_BADADDR);
5602         endif
5603         if (((packet.timestamp is present) and
5604              (not in_clock_skew(packet.timestamp,packet.usec))) or
5605             (packet.timestamp is not present and timestamp expected)) then
5606                 error_out(KRB_AP_ERR_SKEW);
5607         endif
5608         if (repeated(packet.timestamp,packet.usec,packet.s-address)) then
5609                 error_out(KRB_AP_ERR_REPEAT);
5610         endif
5611
5612         if (((packet.seq-number is present) and
5613              ((not in_sequence(packet.seq-number)))) or
5614             (packet.seq-number is not present and sequence expected)) then
5615                 error_out(KRB_AP_ERR_BADORDER);
5616         endif
5617         if (packet.timestamp not present and packet.seq-number not present)
5618         then
5619                 error_out(KRB_AP_ERR_MODIFIED);
5620         endif
5621
5622         save_identifier(packet.{timestamp,usec,s-address},
5623                         sender_principal(packet));
5624
5625         return PACKET_IS_OK;
5626
5627
5628 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5629
5630
5631 A.16. KRB_PRIV generation
5632
5633         collect user data in buffer;
5634
5635         /* assemble packet: */
5636         packet.pvno := protocol version; /* 5 */
5637         packet.msg-type := message type; /* KRB_PRIV */
5638
5639         packet.enc-part.etype := encryption type;
5640
5641         body.user-data := buffer;
5642         if (using timestamp) then
5643                 get system_time;
5644                 body.timestamp, body.usec := system_time;
5645         endif
5646         if (using sequence numbers) then
5647                 body.seq-number := sequence number;
5648         endif
5649         body.s-address := sender host addresses;
5650         if (only one recipient) then
5651                 body.r-address := recipient host address;
5652         endif
5653
5654         encode body into OCTET STRING;
5655
5656         select encryption type;
5657         encrypt OCTET STRING into packet.enc-part.cipher;
5658
5659 A.17. KRB_PRIV verification
5660
5661         receive packet;
5662         if (packet.pvno != 5) then
5663                 either process using other protocol spec
5664                 or error_out(KRB_AP_ERR_BADVERSION);
5665         endif
5666         if (packet.msg-type != KRB_PRIV) then
5667                 error_out(KRB_AP_ERR_MSG_TYPE);
5668         endif
5669
5670         cleartext := decrypt(packet.enc-part) using negotiated key;
5671         if (decryption_error()) then
5672                 error_out(KRB_AP_ERR_BAD_INTEGRITY);
5673         endif
5674
5675         if (safe_priv_common_checks_ok(cleartext)) then
5676                 return(cleartext.DATA, PACKET_IS_GENUINE_AND_UNMODIFIED);
5677         else
5678                 return common_checks_error;
5679         endif
5680
5681 A.18. KRB_CRED generation
5682
5683         invoke KRB_TGS; /* obtain tickets to be provided to peer */
5684
5685
5686 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5687
5688
5689         /* assemble packet: */
5690         packet.pvno := protocol version; /* 5 */
5691         packet.msg-type := message type; /* KRB_CRED */
5692
5693         for (tickets[n] in tickets to be forwarded) do
5694                 packet.tickets[n] = tickets[n].ticket;
5695         done
5696
5697         packet.enc-part.etype := encryption type;
5698
5699         for (ticket[n] in tickets to be forwarded) do
5700                 body.ticket-info[n].key = tickets[n].session;
5701                 body.ticket-info[n].prealm = tickets[n].crealm;
5702                 body.ticket-info[n].pname = tickets[n].cname;
5703                 body.ticket-info[n].flags = tickets[n].flags;
5704                 body.ticket-info[n].authtime = tickets[n].authtime;
5705                 body.ticket-info[n].starttime = tickets[n].starttime;
5706                 body.ticket-info[n].endtime = tickets[n].endtime;
5707                 body.ticket-info[n].renew-till = tickets[n].renew-till;
5708                 body.ticket-info[n].srealm = tickets[n].srealm;
5709                 body.ticket-info[n].sname = tickets[n].sname;
5710                 body.ticket-info[n].caddr = tickets[n].caddr;
5711         done
5712
5713         get system_time;
5714         body.timestamp, body.usec := system_time;
5715
5716         if (using nonce) then
5717                 body.nonce := nonce;
5718         endif
5719
5720         if (using s-address) then
5721                 body.s-address := sender host addresses;
5722         endif
5723         if (limited recipients) then
5724                 body.r-address := recipient host address;
5725         endif
5726
5727         encode body into OCTET STRING;
5728
5729         select encryption type;
5730         encrypt OCTET STRING into packet.enc-part.cipher
5731                using negotiated encryption key;
5732
5733 A.19. KRB_CRED verification
5734
5735         receive packet;
5736         if (packet.pvno != 5) then
5737                 either process using other protocol spec
5738                 or error_out(KRB_AP_ERR_BADVERSION);
5739         endif
5740         if (packet.msg-type != KRB_CRED) then
5741                 error_out(KRB_AP_ERR_MSG_TYPE);
5742
5743
5744 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5745
5746         endif
5747
5748         cleartext := decrypt(packet.enc-part) using negotiated key;
5749         if (decryption_error()) then
5750                 error_out(KRB_AP_ERR_BAD_INTEGRITY);
5751         endif
5752         if ((packet.r-address is present or required) and
5753            (packet.s-address != O/S_sender(packet)) then
5754                 /* O/S report of sender not who claims to have sent it */
5755                 error_out(KRB_AP_ERR_BADADDR);
5756         endif
5757         if ((packet.r-address is present) and
5758             (packet.r-address != local_host_address)) then
5759                 /* was not sent to proper place */
5760                 error_out(KRB_AP_ERR_BADADDR);
5761         endif
5762         if (not in_clock_skew(packet.timestamp,packet.usec)) then
5763                 error_out(KRB_AP_ERR_SKEW);
5764         endif
5765         if (repeated(packet.timestamp,packet.usec,packet.s-address)) then
5766                 error_out(KRB_AP_ERR_REPEAT);
5767         endif
5768         if (packet.nonce is required or present) and
5769            (packet.nonce != expected-nonce) then
5770                 error_out(KRB_AP_ERR_MODIFIED);
5771         endif
5772
5773         for (ticket[n] in tickets that were forwarded) do
5774                 save_for_later(ticket[n],key[n],principal[n],
5775                                server[n],times[n],flags[n]);
5776         return
5777
5778 A.20. KRB_ERROR generation
5779
5780         /* assemble packet: */
5781         packet.pvno := protocol version; /* 5 */
5782         packet.msg-type := message type; /* KRB_ERROR */
5783
5784         get system_time;
5785         packet.stime, packet.susec := system_time;
5786         packet.realm, packet.sname := server name;
5787
5788         if (client time available) then
5789                 packet.ctime, packet.cusec := client_time;
5790         endif
5791         packet.error-code := error code;
5792         if (client name available) then
5793                 packet.cname, packet.crealm := client name;
5794         endif
5795         if (error text available) then
5796                 packet.e-text := error text;
5797         endif
5798         if (error data available) then
5799                 packet.e-data := error data;
5800
5801
5802 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5803
5804         endif
5805
5806 B. Definition of common authorization data elements
5807
5808 This appendix contains the definitions of common authorization data
5809 elements. These common authorization data elements are recursivly defined,
5810 meaning the ad-data for these types will itself contain a sequence of
5811 authorization data whose interpretation is affected by the encapsulating
5812 element. Depending on the meaning of the encapsulating element, the
5813 encapsulated elements may be ignored, might be interpreted as issued
5814 directly by the KDC, or they might be stored in a separate plaintext part of
5815 the ticket. The types of the encapsulating elements are specified as part of
5816 the Kerberos specification ebcause the behavior based on these values should
5817 be understood across implementations whereas other elements need only be
5818 understood by the applications which they affect.
5819
5820 In the definitions that follow, the value of the ad-type for the element
5821 will be specified in the subsection number, and the value of the ad-data
5822 will be as shown in the ASN.1 structure that follows the subsection heading.
5823
5824 B.1. KDC Issued
5825
5826 AD-KDCIssued   SEQUENCE {
5827                ad-checksum[0]    Checksum,
5828                 i-realm[1]       Realm OPTIONAL,
5829                 i-sname[2]       PrincipalName OPTIONAL,
5830                elements[3]       AuthorizationData.
5831 }
5832
5833 ad-checksum
5834      A checksum over the elements field using a cryptographic checksum
5835      method that is identical to the checksum used to protect the ticket
5836      itself (i.e. using the same hash function and the same encryption
5837      algorithm used to encrypt the ticket) and using a key derived from the
5838      same key used to protect the ticket.
5839 i-realm, i-sname
5840      The name of the issuing principal if different from the KDC itself.
5841      This field would be used when the KDC can verify the authenticity of
5842      elements signed by the issuing principal and it allows this KDC to
5843      notify the application server of the validity of those elements.
5844 elements
5845      A sequence of authorization data elements issued by the KDC.
5846
5847 The KDC-issued ad-data field is intended to provide a means for Kerberos
5848 principal credentials to embed within themselves privilege attributes and
5849 other mechanisms for positive authorization, amplifying the priveleges of
5850 the principal beyond what can be done using a credentials without such an
5851 a-data element.
5852
5853 This can not be provided without this element because the definition of the
5854 authorization-data field allows elements to be added at will by the bearer
5855 of a TGT at the time that they request service tickets and elements may also
5856 be added to a delegated ticket by inclusion in the authenticator.
5857
5858
5859
5860 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5861
5862 For KDC-issued elements this is prevented because the elements are signed by
5863 the KDC by including a checksum encrypted using the server's key (the same
5864 key used to encrypt the ticket - or a key derived from that key). Elements
5865 encapsulated with in the KDC-issued element will be ignored by the
5866 application server if this "signature" is not present. Further, elements
5867 encapsulated within this element from a ticket granting ticket may be
5868 interpreted by the KDC, and used as a basis according to policy for
5869 including new signed elements within derivative tickets, but they will not
5870 be copied to a derivative ticket directly. If they are copied directly to a
5871 derivative ticket by a KDC that is not aware of this element, the signature
5872 will not be correct for the application ticket elements, and the field will
5873 be ignored by the application server.
5874
5875 This element and the elements it encapulates may be safely ignored by
5876 applications, application servers, and KDCs that do not implement this
5877 element.
5878
5879 B.2. Intended for server
5880
5881 AD-INTENDED-FOR-SERVER   SEQUENCE {
5882          intended-server[0]     SEQUENCE OF PrincipalName
5883          elements[1]            AuthorizationData
5884 }
5885
5886 AD elements encapsulated within the intended-for-server element may be
5887 ignored if the application server is not in the list of principal names of
5888 intended servers. Further, a KDC issuing a ticket for an application server
5889 can remove this element if the application server is not in the list of
5890 intended servers.
5891
5892 Application servers should check for their principal name in the
5893 intended-server field of this element. If their principal name is not found,
5894 this element should be ignored. If found, then the encapsulated elements
5895 should be evaluated in the same manner as if they were present in the top
5896 level authorization data field. Applications and application servers that do
5897 not implement this element should reject tickets that contain authorization
5898 data elements of this type.
5899
5900 B.3. Intended for application class
5901
5902 AD-INTENDED-FOR-APPLICATION-CLASS SEQUENCE { intended-application-class[0]
5903 SEQUENCE OF GeneralString elements[1] AuthorizationData } AD elements
5904 encapsulated within the intended-for-application-class element may be
5905 ignored if the application server is not in one of the named classes of
5906 application servers. Examples of application server classes include
5907 "FILESYSTEM", and other kinds of servers.
5908
5909 This element and the elements it encapulates may be safely ignored by
5910 applications, application servers, and KDCs that do not implement this
5911 element.
5912
5913 B.4. If relevant
5914
5915 AD-IF-RELEVANT   AuthorizationData
5916
5917
5918 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5919
5920
5921 AD elements encapsulated within the if-relevant element are intended for
5922 interpretation only by application servers that understand the particular
5923 ad-type of the embedded element. Application servers that do not understand
5924 the type of an element embedded within the if-relevant element may ignore
5925 the uninterpretable element. This element promotes interoperability across
5926 implementations which may have local extensions for authorization.
5927
5928 B.5. And-Or
5929
5930 AD-AND-OR           SEQUENCE {
5931                         condition-count[0]    INTEGER,
5932                         elements[1]           AuthorizationData
5933 }
5934
5935 When restrictive AD elements encapsulated within the and-or element are
5936 encountered, only the number specified in condition-count of the
5937 encapsulated conditions must be met in order to satisfy this element. This
5938 element may be used to implement an "or" operation by setting the
5939 condition-count field to 1, and it may specify an "and" operation by setting
5940 the condition count to the number of embedded elements. Application servers
5941 that do not implement this element must reject tickets that contain
5942 authorization data elements of this type.
5943
5944 B.6. Mandatory ticket extensions
5945
5946 AD-Mandatory-Ticket-Extensions   Checksum
5947
5948 An authorization data element of type mandatory-ticket-extensions specifies
5949 a collision-proof checksum using the same has angorithm used to protect the
5950 integrity of the ticket itself. This checksum will be calculated over the
5951 entire extensions field. If there are more than one extension, all will be
5952 covered by the checksum. This restriction indicates that the ticket should
5953 not be accepted if the checksum does not match that calculated over the
5954 ticket extensions. Application servers that do not implement this element
5955 must reject tickets that contain authorization data elements of this type.
5956
5957 B.7. Authorization Data in ticket extensions
5958
5959 AD-IN-Ticket-Extensions   Checksum
5960
5961 An authorization data element of type in-ticket-extensions specifies a
5962 collision-proof checksum using the same has angorithm used to protect the
5963 integrity of the ticket itself. This checksum is calculated over a separate
5964 external AuthorizationData field carried in the ticket extensions.
5965 Application servers that do not implement this element must reject tickets
5966 that contain authorization data elements of this type. Application servers
5967 that do implement this element will search the ticket extensions for
5968 authorization data fields, calculate the specified checksum over each
5969 authorization data field and look for one matching the checksum in this
5970 in-ticket-extensions element. If not found, then the ticket must be
5971 rejected. If found, the corresponding authorization data elements will be
5972 interpreted in the same manner as if they were contained in the top level
5973 authorization data field.
5974
5975
5976 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
5977
5978
5979 Note that if multiple external authorization data fields are present in a
5980 ticket, each will have a corresponding element of type in-ticket-extensions
5981 in the top level authorization data field, and the external entries will be
5982 linked to the corresponding element by their checksums.
5983
5984 C. Definition of common ticket extensions
5985
5986 This appendix contains the definitions of common ticket extensions. Support
5987 for these extensions is optional. However, certain extensions have
5988 associated authorization data elements that may require rejection of a
5989 ticket containing an extension by application servers that do not implement
5990 the particular extension. Other extensions have been defined beyond those
5991 described in this specification. Such extensions are described elswhere and
5992 for some of those extensions the reserved number may be found in the list of
5993 constants.
5994
5995 It is known that older versions of Kerberos did not support this field, and
5996 that some clients will strip this field from a ticket when they parse and
5997 then reassemble a ticket as it is passed to the application servers. The
5998 presence of the extension will not break such clients, but any functionaly
5999 dependent on the extensions will not work when such tickets are handled by
6000 old clients. In such situations, some implementation may use alternate
6001 methods to transmit the information in the extensions field.
6002
6003 C.1. Null ticket extension
6004
6005 TE-NullExtension   OctetString -- The empty Octet String
6006
6007 The te-data field in the null ticket extension is an octet string of lenght
6008 zero. This extension may be included in a ticket granting ticket so that the
6009 KDC can determine on presentation of the ticket granting ticket whether the
6010 client software will strip the extensions field.
6011
6012 C.2. External Authorization Data
6013
6014 TE-ExternalAuthorizationData   AuthorizationData
6015
6016 The te-data field in the external authorization data ticket extension is
6017 field of type AuthorizationData containing one or more authorization data
6018 elements. If present, a corresponding authorization data element will be
6019 present in the primary authorization data for the ticket and that element
6020 will contain a checksum of the external authorization data ticket extension.
6021 ----------------------------------------------------------------------------
6022 [TM] Project Athena, Athena, and Kerberos are trademarks of the
6023 Massachusetts Institute of Technology (MIT). No commercial use of these
6024 trademarks may be made without prior written permission of MIT.
6025
6026 [1] Note, however, that many applications use Kerberos' functions only upon
6027 the initiation of a stream-based network connection. Unless an application
6028 subsequently provides integrity protection for the data stream, the identity
6029 verification applies only to the initiation of the connection, and does not
6030 guarantee that subsequent messages on the connection originate from the same
6031 principal.
6032
6033
6034 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
6035
6036
6037 [2] Secret and private are often used interchangeably in the literature. In
6038 our usage, it takes two (or more) to share a secret, thus a shared DES key
6039 is a secret key. Something is only private when no one but its owner knows
6040 it. Thus, in public key cryptosystems, one has a public and a private key.
6041
6042 [3] Of course, with appropriate permission the client could arrange
6043 registration of a separately-named prin- cipal in a remote realm, and engage
6044 in normal exchanges with that realm's services. However, for even small
6045 numbers of clients this becomes cumbersome, and more automatic methods as
6046 described here are necessary.
6047
6048 [4] Though it is permissible to request or issue tick- ets with no network
6049 addresses specified.
6050
6051 [5] The password-changing request must not be honored unless the requester
6052 can provide the old password (the user's current secret key). Otherwise, it
6053 would be possible for someone to walk up to an unattended ses- sion and
6054 change another user's password.
6055
6056 [6] To authenticate a user logging on to a local system, the credentials
6057 obtained in the AS exchange may first be used in a TGS exchange to obtain
6058 credentials for a local server. Those credentials must then be verified by a
6059 local server through successful completion of the Client/Server exchange.
6060
6061 [7] "Random" means that, among other things, it should be impossible to
6062 guess the next session key based on knowledge of past session keys. This can
6063 only be achieved in a pseudo-random number generator if it is based on
6064 cryptographic principles. It is more desirable to use a truly random number
6065 generator, such as one based on measurements of random physical phenomena.
6066
6067 [8] Tickets contain both an encrypted and unencrypted portion, so cleartext
6068 here refers to the entire unit, which can be copied from one message and
6069 replayed in another without any cryptographic skill.
6070
6071 [9] Note that this can make applications based on unreliable transports
6072 difficult to code correctly. If the transport might deliver duplicated
6073 messages, either a new authenticator must be generated for each retry, or
6074 the application server must match requests and replies and replay the first
6075 reply in response to a detected duplicate.
6076
6077 [10] This is used for user-to-user authentication as described in [8].
6078
6079 [11] Note that the rejection here is restricted to authenticators from the
6080 same principal to the same server. Other client principals communicating
6081 with the same server principal should not be have their authenticators
6082 rejected if the time and microsecond fields happen to match some other
6083 client's authenticator.
6084
6085 [12] In the Kerberos version 4 protocol, the timestamp in the reply was the
6086 client's timestamp plus one. This is not necessary in version 5 because
6087 version 5 messages are formatted in such a way that it is not possible to
6088 create the reply by judicious message surgery (even in encrypted form)
6089 without knowledge of the appropriate encryption keys.
6090
6091
6092 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
6093
6094
6095 [13] Note that for encrypting the KRB_AP_REP message, the sub-session key is
6096 not used, even if present in the Authenticator.
6097
6098 [14] Implementations of the protocol may wish to provide routines to choose
6099 subkeys based on session keys and random numbers and to generate a
6100 negotiated key to be returned in the KRB_AP_REP message.
6101
6102 [15]This can be accomplished in several ways. It might be known beforehand
6103 (since the realm is part of the principal identifier), it might be stored in
6104 a nameserver, or it might be obtained from a configura- tion file. If the
6105 realm to be used is obtained from a nameserver, there is a danger of being
6106 spoofed if the nameservice providing the realm name is not authenti- cated.
6107 This might result in the use of a realm which has been compromised, and
6108 would result in an attacker's ability to compromise the authentication of
6109 the application server to the client.
6110
6111 [16] If the client selects a sub-session key, care must be taken to ensure
6112 the randomness of the selected sub- session key. One approach would be to
6113 generate a random number and XOR it with the session key from the
6114 ticket-granting ticket.
6115
6116 [17] This allows easy implementation of user-to-user authentication [8],
6117 which uses ticket-granting ticket session keys in lieu of secret server keys
6118 in situa- tions where such secret keys could be easily comprom- ised.
6119
6120 [18] For the purpose of appending, the realm preceding the first listed
6121 realm is considered to be the null realm ("").
6122
6123 [19] For the purpose of interpreting null subfields, the client's realm is
6124 considered to precede those in the transited field, and the server's realm
6125 is considered to follow them.
6126
6127 [20] This means that a client and server running on the same host and
6128 communicating with one another using the KRB_SAFE messages should not share
6129 a common replay cache to detect KRB_SAFE replays.
6130
6131 [21] The implementation of the Kerberos server need not combine the database
6132 and the server on the same machine; it is feasible to store the principal
6133 database in, say, a network name service, as long as the entries stored
6134 therein are protected from disclosure to and modification by unauthorized
6135 parties. However, we recommend against such strategies, as they can make
6136 system management and threat analysis quite complex.
6137
6138 [22] See the discussion of the padata field in section 5.4.2 for details on
6139 why this can be useful.
6140
6141 [23] Warning for implementations that unpack and repack data structures
6142 during the generation and verification of embedded checksums: Because any
6143 checksums applied to data structures must be checked against the original
6144 data the length of bit strings must be preserved within a data structure
6145 between the time that a checksum is generated through transmission to the
6146 time that the checksum is verified.
6147
6148
6149
6150 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
6151
6152 [24] It is NOT recommended that this time value be used to adjust the
6153 workstation's clock since the workstation cannot reliably determine that
6154 such a KRB_AS_REP actually came from the proper KDC in a timely manner.
6155
6156 [25] Note, however, that if the time is used as the nonce, one must make
6157 sure that the workstation time is monotonically increasing. If the time is
6158 ever reset backwards, there is a small, but finite, probability that a nonce
6159 will be reused.
6160
6161 [27] An application code in the encrypted part of a message provides an
6162 additional check that the message was decrypted properly.
6163
6164 [29] An application code in the encrypted part of a message provides an
6165 additional check that the message was decrypted properly.
6166
6167 [31] An application code in the encrypted part of a message provides an
6168 additional check that the message was decrypted properly.
6169
6170 [32] If supported by the encryption method in use, an initialization vector
6171 may be passed to the encryption procedure, in order to achieve proper cipher
6172 chaining. The initialization vector might come from the last block of the
6173 ciphertext from the previous KRB_PRIV message, but it is the application's
6174 choice whether or not to use such an initialization vector. If left out, the
6175 default initialization vector for the encryption algorithm will be used.
6176
6177 [33] This prevents an attacker who generates an incorrect AS request from
6178 obtaining verifiable plaintext for use in an off-line password guessing
6179 attack.
6180
6181 [35] In the above specification, UNTAGGED OCTET STRING(length) is the
6182 notation for an octet string with its tag and length removed. It is not a
6183 valid ASN.1 type. The tag bits and length must be removed from the
6184 confounder since the purpose of the confounder is so that the message starts
6185 with random data, but the tag and its length are fixed. For other fields,
6186 the length and tag would be redundant if they were included because they are
6187 specified by the encryption type. [36] The ordering of the fields in the
6188 CipherText is important. Additionally, messages encoded in this format must
6189 include a length as part of the msg-seq field. This allows the recipient to
6190 verify that the message has not been truncated. Without a length, an
6191 attacker could use a chosen plaintext attack to generate a message which
6192 could be truncated, while leaving the checksum intact. Note that if the
6193 msg-seq is an encoding of an ASN.1 SEQUENCE or OCTET STRING, then the length
6194 is part of that encoding.
6195
6196 [37] In some cases, it may be necessary to use a different "mix-in" string
6197 for compatibility reasons; see the discussion of padata in section 5.4.2.
6198
6199 [38] In some cases, it may be necessary to use a different "mix-in" string
6200 for compatibility reasons; see the discussion of padata in section 5.4.2.
6201
6202 [39] A variant of the key is used to limit the use of a key to a particular
6203 function, separating the functions of generating a checksum from other
6204 encryption performed using the session key. The constant F0F0F0F0F0F0F0F0
6205 was chosen because it maintains key parity. The properties of DES precluded
6206
6207
6208 draft-ietf-cat-kerberos-r-01                        Expires 21 May 1998\f
6209
6210 the use of the complement. The same constant is used for similar purpose in
6211 the Message Integrity Check in the Privacy Enhanced Mail standard.
6212
6213 [40] This error carries additional information in the e- data field. The
6214 contents of the e-data field for this message is described in section 5.9.1.