[Automatic update for 2016-03-13]
[metze/wireshark/wip.git] / asn1 / kerberos / KerberosV5Spec2.asn
1 --http://www.ietf.org/rfc/rfc4120.txt?number=4120
2 KerberosV5Spec2 {
3         iso(1) identified-organization(3) dod(6) internet(1)
4         security(5) kerberosV5(2) modules(4) krb5spec2(2)
5 } DEFINITIONS EXPLICIT TAGS ::= BEGIN
6
7 -- OID arc for KerberosV5
8 --
9 -- This OID may be used to identify Kerberos protocol messages
10 -- encapsulated in other protocols.
11 --
12 -- This OID also designates the OID arc for KerberosV5-related OIDs.
13 --
14 -- NOTE: RFC 1510 had an incorrect value (5) for "dod" in its OID.
15 -- WS construct
16 Applications ::= CHOICE {
17         ticket                  Ticket,                         -- 1 --
18         authenticator   Authenticator,          -- 2 --
19         encTicketPart   EncTicketPart,          -- 3 --
20         as-req                  AS-REQ,                         -- 10 --
21         as-rep                  AS-REP,                         -- 11 --
22         tgs-req                 TGS-REQ,                        -- 12 --
23         tgs-rep                 TGS-REP,                        -- 13 --
24         ap-req                  AP-REQ,                         -- 14 --
25         ap-rep                  AP-REP,                         -- 15 --
26         krb-safe                KRB-SAFE,                       -- 20 --
27         krb-priv                KRB-PRIV,                       -- 21 --
28         krb-cred                KRB-CRED,                       -- 22 --
29         encASRepPart    EncASRepPart,           -- 25 --
30         encTGSRepPart   EncTGSRepPart,          -- 26 --
31         encAPRepPart    EncAPRepPart,           -- 27 --
32         encKrbPrivPart  ENC-KRB-PRIV-PART,      -- 28 --
33         encKrbCredPart  EncKrbCredPart,         -- 29 --
34         krb-error               KRB-ERROR                       -- 30 --
35         }
36 -- end WS construct
37 id-krb5         OBJECT IDENTIFIER ::= {
38         iso(1) identified-organization(3) dod(6) internet(1)
39         security(5) kerberosV5(2)
40 }
41
42 Int32           ::= INTEGER (-2147483648..2147483647)
43                     -- signed values representable in 32 bits
44
45 UInt32          ::= INTEGER (0..4294967295)
46                     -- unsigned 32 bit values
47
48 Microseconds    ::= INTEGER (0..999999)
49                     -- microseconds
50
51 KerberosString  ::= GeneralString (IA5String)
52 CNameString  ::= GeneralString (IA5String)
53 SNameString  ::= GeneralString (IA5String)
54
55 Realm           ::= KerberosString
56
57 PrincipalName   ::= SEQUENCE {
58 --        name-type       [0] Int32, Use the translationj from krb5.asn (Heimdahl)
59         name-type       [0] NAME-TYPE,
60         name-string     [1] SEQUENCE OF KerberosString
61 }
62
63 CName   ::= SEQUENCE {
64         name-type       [0] NAME-TYPE,
65         cname-string    [1] SEQUENCE OF CNameString
66 }
67
68 SName   ::= SEQUENCE {
69         name-type       [0] NAME-TYPE,
70         sname-string    [1] SEQUENCE OF SNameString
71 }
72
73 KerberosTime    ::= GeneralizedTime -- with no fractional seconds
74
75 HostAddress     ::= SEQUENCE  {
76 --        addr-type       [0] Int32,
77         addr-type       [0] ADDR-TYPE, --use k5.asn
78         address         [1] OCTET STRING
79 }
80
81 -- NOTE: HostAddresses is always used as an OPTIONAL field and
82 -- should not be empty.
83 HostAddresses   -- NOTE: subtly different from rfc1510,
84                 -- but has a value mapping and encodes the same
85         ::= SEQUENCE OF HostAddress
86
87 -- NOTE: AuthorizationData is always used as an OPTIONAL field and
88 -- should not be empty.
89 AuthorizationData       ::= SEQUENCE OF SEQUENCE {
90         ad-type         [0] Int32,
91         ad-data         [1] OCTET STRING
92 }
93
94 PA-DATA         ::= SEQUENCE {
95         -- NOTE: first tag is [1], not [0]
96 --        padata-type     [1] Int32, use k5.asn
97         padata-type     [1] PADATA-TYPE,
98         padata-value    [2] OCTET STRING -- might be encoded AP-REQ
99 }
100
101 KerberosFlags   ::= BIT STRING (SIZE (32..MAX))
102                     -- minimum number of bits shall be sent,
103                     -- but no fewer than 32
104
105 EncryptedData   ::= SEQUENCE {
106 --        etype   [0] Int32 - - EncryptionType - -, Use k5.asn
107         etype   [0] ENCTYPE -- EncryptionType --,
108         kvno    [1] UInt32 OPTIONAL,
109         cipher  [2] OCTET STRING -- ciphertext
110 }
111
112 EncryptionKey   ::= SEQUENCE {
113         keytype         [0] Int32 -- actually encryption type --,
114         keyvalue        [1] OCTET STRING
115 }
116
117 Checksum        ::= SEQUENCE {
118 --        cksumtype       [0] Int32, Use k5.asn
119         cksumtype       [0] CKSUMTYPE,
120         checksum        [1] OCTET STRING
121 }
122
123 EncryptedTicketData   ::= SEQUENCE {
124         etype   [0] ENCTYPE, -- EncryptionType - - Use k5.asn
125         kvno    [1] UInt32 OPTIONAL,
126         cipher  [2] OCTET STRING -- ciphertext
127 }
128
129 EncryptedAuthorizationData   ::= SEQUENCE {
130         etype   [0] ENCTYPE, -- EncryptionType - - Use k5.asn
131         kvno    [1] UInt32 OPTIONAL,
132         cipher  [2] OCTET STRING -- ciphertext
133 }
134
135 EncryptedKDCREPData   ::= SEQUENCE {
136         etype   [0] ENCTYPE, -- EncryptionType - - Use k5.asn
137         kvno    [1] UInt32 OPTIONAL,
138         cipher  [2] OCTET STRING -- ciphertext
139 }
140
141 EncryptedAPREPData   ::= SEQUENCE {
142         etype   [0] ENCTYPE, -- EncryptionType - - Use k5.asn
143         kvno    [1] UInt32 OPTIONAL,
144         cipher  [2] OCTET STRING -- ciphertext
145 }
146
147 EncryptedKrbPrivData   ::= SEQUENCE {
148         etype   [0] ENCTYPE, -- EncryptionType - - Use k5.asn
149         kvno    [1] UInt32 OPTIONAL,
150         cipher  [2] OCTET STRING -- ciphertext
151 }
152
153 EncryptedKrbCredData   ::= SEQUENCE {
154         etype   [0] ENCTYPE, -- EncryptionType - - Use k5.asn
155         kvno    [1] UInt32 OPTIONAL,
156         cipher  [2] OCTET STRING -- ciphertext
157 }
158
159 Ticket          ::= [APPLICATION 1] SEQUENCE {
160         tkt-vno         [0] INTEGER (5),
161         realm           [1] Realm,
162         sname           [2] SName,
163         enc-part        [3] EncryptedTicketData 
164 }
165
166 -- Encrypted part of ticket
167 EncTicketPart   ::= [APPLICATION 3] SEQUENCE {
168         flags                   [0] TicketFlags,
169         key                     [1] EncryptionKey,
170         crealm                  [2] Realm,
171         cname                   [3] CName,
172         transited               [4] TransitedEncoding,
173         authtime                [5] KerberosTime,
174         starttime               [6] KerberosTime OPTIONAL,
175         endtime                 [7] KerberosTime,
176         renew-till              [8] KerberosTime OPTIONAL,
177         caddr                   [9] HostAddresses OPTIONAL,
178         authorization-data      [10] AuthorizationData OPTIONAL
179 }
180
181 -- encoded Transited field
182 TransitedEncoding       ::= SEQUENCE {
183         tr-type         [0] Int32 -- must be registered --,
184         contents        [1] OCTET STRING
185 }
186 -- Use the k5.asn def
187 -- TicketFlags     ::= KerberosFlags
188         -- reserved(0),
189         -- forwardable(1),
190         -- forwarded(2),
191         -- proxiable(3),
192         -- proxy(4),
193         -- may-postdate(5),
194         -- postdated(6),
195         -- invalid(7),
196         -- renewable(8),
197         -- initial(9),
198         -- pre-authent(10),
199         -- hw-authent(11),
200 -- the following are new since 1510
201         -- transited-policy-checked(12),
202         -- ok-as-delegate(13)
203
204 AS-REQ          ::= [APPLICATION 10] KDC-REQ
205
206 TGS-REQ         ::= [APPLICATION 12] KDC-REQ
207
208 KDC-REQ         ::= SEQUENCE {
209         -- NOTE: first tag is [1], not [0]
210         pvno            [1] INTEGER (5) ,
211 --        msg-type        [2] INTEGER (10 - - AS - - | 12 - - TGS - -),
212 --        msg-type        [2] INTEGER, use k5.asn
213         msg-type        [2] MESSAGE-TYPE,
214         padata          [3] SEQUENCE OF PA-DATA OPTIONAL
215                             -- NOTE: not empty --,
216         req-body        [4] KDC-REQ-BODY
217 }
218
219 KDC-REQ-BODY    ::= SEQUENCE {
220         kdc-options             [0] KDCOptions,
221         cname                   [1] CName OPTIONAL
222                                     -- Used only in AS-REQ --,
223         realm                   [2] Realm
224                                     -- Server's realm
225                                     -- Also client's in AS-REQ --,
226         sname                   [3] SName OPTIONAL,
227         from                    [4] KerberosTime OPTIONAL,
228
229 -- this field is not optional in the kerberos spec, however, in the packetcable spec it is optional
230 -- make it optional here since normal kerberos will still decode the pdu correctly.
231         till                    [5] KerberosTime OPTIONAL, 
232
233         rtime                   [6] KerberosTime OPTIONAL,
234         nonce                   [7] UInt32,
235 --        etype                   [8] SEQUENCE OF Int32 - - EncryptionType Use k5.asn
236         etype                   [8] SEQUENCE OF ENCTYPE -- EncryptionType
237                                     -- in preference order --,
238         addresses               [9] HostAddresses OPTIONAL,
239         enc-authorization-data  [10] EncryptedAuthorizationData OPTIONAL
240                                     -- AuthorizationData --,
241         additional-tickets      [11] SEQUENCE OF Ticket OPTIONAL
242                                         -- NOTE: not empty
243 }
244
245 -- Use th k5.asn def
246 --KDCOptions      ::= KerberosFlags
247         -- reserved(0),
248         -- forwardable(1),
249         -- forwarded(2),
250         -- proxiable(3),
251         -- proxy(4),
252         -- allow-postdate(5),
253         -- postdated(6),
254         -- unused7(7),
255         -- renewable(8),
256         -- unused9(9),
257         -- unused10(10),
258         -- opt-hardware-auth(11),
259         -- unused12(12),
260         -- unused13(13),
261 -- 15 is reserved for canonicalize
262         -- unused15(15),
263 -- 26 was unused in 1510
264         -- disable-transited-check(26),
265 --
266         -- renewable-ok(27),
267         -- enc-tkt-in-skey(28),
268         -- renew(30),
269         -- validate(31)
270
271 AS-REP          ::= [APPLICATION 11] KDC-REP
272
273 TGS-REP         ::= [APPLICATION 13] KDC-REP
274
275
276 KDC-REP         ::= SEQUENCE {
277         pvno            [0] INTEGER (5),
278 --        msg-type        [1] INTEGER (11 - - AS - - | 13 - - TGS - -),
279 --        msg-type        [1] INTEGER, use k5.asn
280         msg-type        [1] MESSAGE-TYPE,
281         padata          [2] SEQUENCE OF PA-DATA OPTIONAL
282                                 -- NOTE: not empty --,
283         crealm          [3] Realm,
284         cname           [4] CName,
285         ticket          [5] Ticket,
286         enc-part        [6] EncryptedKDCREPData
287                                 -- EncASRepPart or EncTGSRepPart,
288                                 -- as appropriate
289 }
290
291 EncASRepPart    ::= [APPLICATION 25] EncKDCRepPart
292
293 EncTGSRepPart   ::= [APPLICATION 26] EncKDCRepPart
294
295 EncKDCRepPart   ::= SEQUENCE {
296         key             [0] EncryptionKey,
297         last-req        [1] LastReq,
298         nonce           [2] UInt32,
299         key-expiration  [3] KerberosTime OPTIONAL,
300         flags           [4] TicketFlags,
301         authtime        [5] KerberosTime,
302         starttime       [6] KerberosTime OPTIONAL,
303         endtime         [7] KerberosTime,
304         renew-till      [8] KerberosTime OPTIONAL,
305         srealm          [9] Realm,
306         sname           [10] SName,
307         caddr           [11] HostAddresses OPTIONAL,
308             encrypted-pa-data[12]       METHOD-DATA OPTIONAL -- from k5.asn
309 }
310
311 LastReq         ::=     SEQUENCE OF SEQUENCE {
312 --        lr-type         [0] Int32, Use k5.asn
313                 lr-type         [0] LR-TYPE,
314         lr-value        [1] KerberosTime
315 }
316
317 AP-REQ          ::= [APPLICATION 14] SEQUENCE {
318         pvno            [0] INTEGER (5),
319 --        msg-type        [1] INTEGER (14), use k5.asn
320         msg-type        [1] MESSAGE-TYPE,
321         ap-options      [2] APOptions,
322         ticket          [3] Ticket,
323         authenticator   [4] EncryptedAuthorizationData -- Authenticator
324 }
325 -- Use the krb5.asn def.
326 --APOptions       ::= KerberosFlags
327         -- reserved(0),
328         -- use-session-key(1),
329         -- mutual-required(2)
330
331 -- Unencrypted authenticator
332 Authenticator   ::= [APPLICATION 2] SEQUENCE  {
333         authenticator-vno       [0] INTEGER (5),
334         crealm                  [1] Realm,
335         cname                   [2] CName,
336         cksum                   [3] Checksum OPTIONAL,
337         cusec                   [4] Microseconds,
338         ctime                   [5] KerberosTime,
339         subkey                  [6] EncryptionKey OPTIONAL,
340         seq-number              [7] UInt32 OPTIONAL,
341         authorization-data      [8] AuthorizationData OPTIONAL
342 }
343
344 AP-REP          ::= [APPLICATION 15] SEQUENCE {
345         pvno            [0] INTEGER (5),
346 --        msg-type        [1] INTEGER (15), Use k5.asn
347         msg-type        [1] MESSAGE-TYPE,
348         enc-part        [2] EncryptedAPREPData -- EncAPRepPart
349 }
350
351 EncAPRepPart    ::= [APPLICATION 27] SEQUENCE {
352         ctime           [0] KerberosTime,
353         cusec           [1] Microseconds,
354         subkey          [2] EncryptionKey OPTIONAL,
355         seq-number      [3] UInt32 OPTIONAL
356 }
357
358 KRB-SAFE        ::= [APPLICATION 20] SEQUENCE {
359         pvno            [0] INTEGER (5),
360 --        msg-type        [1] INTEGER (20), use k5.asn
361         msg-type        [1] MESSAGE-TYPE,
362         safe-body       [2] KRB-SAFE-BODY,
363         cksum           [3] Checksum
364 }
365
366 KRB-SAFE-BODY   ::= SEQUENCE {
367         user-data       [0] OCTET STRING,
368         timestamp       [1] KerberosTime OPTIONAL,
369         usec            [2] Microseconds OPTIONAL,
370         seq-number      [3] UInt32 OPTIONAL,
371         s-address       [4] HostAddress OPTIONAL, -- XXX this one is OPTIONAL in packetcable?  but mandatory in kerberos
372         r-address       [5] HostAddress OPTIONAL
373 }
374
375 KRB-PRIV        ::= [APPLICATION 21] SEQUENCE {
376         pvno            [0] INTEGER (5),
377 --        msg-type        [1] INTEGER (21), Use k5.asn
378         msg-type        [1] MESSAGE-TYPE,
379                         -- NOTE: there is no [2] tag
380         enc-part        [3] EncryptedKrbPrivData -- EncKrbPrivPart
381 }
382
383 ENC-KRB-PRIV-PART  ::= [APPLICATION 28] EncKrbPrivPart
384
385 EncKrbPrivPart  ::= SEQUENCE {
386         user-data       [0] OCTET STRING,
387         timestamp       [1] KerberosTime OPTIONAL,
388         usec            [2] Microseconds OPTIONAL,
389         seq-number      [3] UInt32 OPTIONAL,
390         s-address       [4] HostAddress -- sender's addr --,
391         r-address       [5] HostAddress OPTIONAL -- recip's addr
392 }
393
394 KRB-CRED        ::= [APPLICATION 22] SEQUENCE {
395         pvno            [0] INTEGER (5),
396 --        msg-type        [1] INTEGER (22), use k5.asn
397         msg-type        [1] MESSAGE-TYPE,
398         tickets         [2] SEQUENCE OF Ticket,
399         enc-part        [3] EncryptedKrbCredData -- EncKrbCredPart
400 }
401
402 EncKrbCredPart  ::= [APPLICATION 29] SEQUENCE {
403         ticket-info     [0] SEQUENCE OF KrbCredInfo,
404         nonce           [1] UInt32 OPTIONAL,
405         timestamp       [2] KerberosTime OPTIONAL,
406         usec            [3] Microseconds OPTIONAL,
407         s-address       [4] HostAddress OPTIONAL,
408         r-address       [5] HostAddress OPTIONAL
409 }
410
411 KrbCredInfo     ::= SEQUENCE {
412         key             [0] EncryptionKey,
413         prealm          [1] Realm OPTIONAL,
414         pname           [2] PrincipalName OPTIONAL,
415         flags           [3] TicketFlags OPTIONAL,
416         authtime        [4] KerberosTime OPTIONAL,
417         starttime       [5] KerberosTime OPTIONAL,
418         endtime         [6] KerberosTime OPTIONAL,
419         renew-till      [7] KerberosTime OPTIONAL,
420         srealm          [8] Realm OPTIONAL,
421         sname           [9] SName OPTIONAL,
422         caddr           [10] HostAddresses OPTIONAL
423 }
424
425 KRB-ERROR       ::= [APPLICATION 30] SEQUENCE {
426         pvno            [0] INTEGER (5),
427 --        msg-type        [1] INTEGER (30), use k5.asn
428         msg-type        [1] MESSAGE-TYPE,
429         ctime           [2] KerberosTime OPTIONAL,
430         cusec           [3] Microseconds OPTIONAL,
431         stime           [4] KerberosTime,
432         susec           [5] Microseconds,
433 --        error-code      [6] Int32,
434         error-code      [6] ERROR-CODE, -- Use k5.asn
435         crealm          [7] Realm OPTIONAL,
436         cname           [8] CName OPTIONAL,
437         realm           [9] Realm -- service realm --,
438         sname           [10] SName -- service name --,
439         e-text          [11] KerberosString OPTIONAL,
440         e-data          [12] OCTET STRING OPTIONAL,
441         e-checksum      [13] Checksum OPTIONAL -- used by PacketCable
442 }
443
444 METHOD-DATA     ::= SEQUENCE OF PA-DATA
445
446 TYPED-DATA      ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
447         data-type       [0] Int32,
448         data-value      [1] OCTET STRING OPTIONAL
449 }
450
451 -- preauth stuff follows
452
453 PA-ENC-TIMESTAMP        ::= SEQUENCE {
454         etype   [0] ENCTYPE -- EncryptionType --,
455         kvno    [1] UInt32 OPTIONAL,
456         cipher  [2] OCTET STRING -- ciphertext 
457 }
458
459 PA-ENC-TS-ENC           ::= SEQUENCE {
460         patimestamp     [0] KerberosTime -- client's time --,
461         pausec          [1] Microseconds OPTIONAL
462 }
463
464 ETYPE-INFO-ENTRY        ::= SEQUENCE {
465 --        etype           [0] Int32, use k5.asn
466         etype           [0] ENCTYPE,
467         salt            [1] OCTET STRING OPTIONAL
468 }
469
470 ETYPE-INFO              ::= SEQUENCE OF ETYPE-INFO-ENTRY
471
472 ETYPE-INFO2-ENTRY       ::= SEQUENCE {
473 --        etype           [0] Int32, use k5.asn
474         etype           [0] ENCTYPE,
475         salt            [1] KerberosString OPTIONAL,
476         s2kparams       [2] OCTET STRING OPTIONAL
477 }
478
479 ETYPE-INFO2             ::= SEQUENCE SIZE (1..MAX) OF ETYPE-INFO2-ENTRY
480
481 AD-IF-RELEVANT          ::= AuthorizationData
482
483 AD-KDCIssued            ::= SEQUENCE {
484         ad-checksum     [0] Checksum,
485         i-realm         [1] Realm OPTIONAL,
486         i-sname         [2] SName OPTIONAL,
487         elements        [3] AuthorizationData
488 }
489
490 AD-AND-OR               ::= SEQUENCE {
491         condition-count [0] Int32,
492         elements        [1] AuthorizationData
493 }
494
495 AD-MANDATORY-FOR-KDC    ::= AuthorizationData
496
497 END