1*7c478bd9Sstevel@tonic-gate #ifndef __KRBASN1_H__
2*7c478bd9Sstevel@tonic-gate #define __KRBASN1_H__
3*7c478bd9Sstevel@tonic-gate 
4*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate #include <k5-int.h>
7*7c478bd9Sstevel@tonic-gate #include <stdio.h>
8*7c478bd9Sstevel@tonic-gate #include <errno.h>
9*7c478bd9Sstevel@tonic-gate #include <limits.h>		/* For INT_MAX */
10*7c478bd9Sstevel@tonic-gate #ifdef HAVE_STDLIB_H
11*7c478bd9Sstevel@tonic-gate #include <stdlib.h>
12*7c478bd9Sstevel@tonic-gate #endif
13*7c478bd9Sstevel@tonic-gate /*
14*7c478bd9Sstevel@tonic-gate  * Older versions of the Kerberos are always sending the
15*7c478bd9Sstevel@tonic-gate  * enc_kdc_rep_part structure with an application tag of #26, instead
16*7c478bd9Sstevel@tonic-gate  * of using the application tag of #25 (AS REP) or #26 (AS REP) as
17*7c478bd9Sstevel@tonic-gate  * necessary.  Worse yet, they will only accept a tag of #26, so we
18*7c478bd9Sstevel@tonic-gate  * need to follow this for backwards compatibility.  #defining
19*7c478bd9Sstevel@tonic-gate  * KRB5_ENCKRB5KDCREPPART_COMPAT will preserve this wrong (but
20*7c478bd9Sstevel@tonic-gate  * compatible) behavior.
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate #define KRB5_ENCKRB5KDCREPPART_COMPAT
23*7c478bd9Sstevel@tonic-gate 
24*7c478bd9Sstevel@tonic-gate /*
25*7c478bd9Sstevel@tonic-gate  * If KRB5_MSGTYPE_STRICT is defined, then be strict about checking
26*7c478bd9Sstevel@tonic-gate  * the msgtype fields.  Unfortunately, there old versions of Kerberos
27*7c478bd9Sstevel@tonic-gate  * don't set these fields correctly, so we have to make allowances for
28*7c478bd9Sstevel@tonic-gate  * them.
29*7c478bd9Sstevel@tonic-gate  */
30*7c478bd9Sstevel@tonic-gate /* #define KRB5_MSGTYPE_STRICT */
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate typedef krb5_octet asn1_octet;
33*7c478bd9Sstevel@tonic-gate typedef krb5_error_code asn1_error_code;
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate typedef enum { PRIMITIVE = 0x00, CONSTRUCTED = 0x20 } asn1_construction;
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate typedef enum { UNIVERSAL = 0x00, APPLICATION = 0x40,
38*7c478bd9Sstevel@tonic-gate 		 CONTEXT_SPECIFIC = 0x80, PRIVATE = 0xC0 } asn1_class;
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate typedef int asn1_tagnum;
41*7c478bd9Sstevel@tonic-gate #define ASN1_TAGNUM_CEILING INT_MAX
42*7c478bd9Sstevel@tonic-gate #define ASN1_TAGNUM_MAX (ASN1_TAGNUM_CEILING-1)
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate /* This is Kerberos Version 5 */
45*7c478bd9Sstevel@tonic-gate #define KVNO 5
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate /* Universal Tag Numbers */
48*7c478bd9Sstevel@tonic-gate #define ASN1_INTEGER		2
49*7c478bd9Sstevel@tonic-gate #define ASN1_BITSTRING		3
50*7c478bd9Sstevel@tonic-gate #define ASN1_OCTETSTRING	4
51*7c478bd9Sstevel@tonic-gate #define ASN1_NULL		5
52*7c478bd9Sstevel@tonic-gate #define ASN1_OBJECTIDENTIFIER	6
53*7c478bd9Sstevel@tonic-gate #define	ASN1_ENUMERATED		10
54*7c478bd9Sstevel@tonic-gate #define ASN1_SEQUENCE		16
55*7c478bd9Sstevel@tonic-gate #define ASN1_SET		17
56*7c478bd9Sstevel@tonic-gate #define ASN1_PRINTABLESTRING	19
57*7c478bd9Sstevel@tonic-gate #define ASN1_IA5STRING		22
58*7c478bd9Sstevel@tonic-gate #define ASN1_UTCTIME		23
59*7c478bd9Sstevel@tonic-gate #define ASN1_GENERALTIME	24
60*7c478bd9Sstevel@tonic-gate #define ASN1_GENERALSTRING	27
61*7c478bd9Sstevel@tonic-gate 
62*7c478bd9Sstevel@tonic-gate /* Kerberos Message Types */
63*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_AS_REQ		10
64*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_AS_REP		11
65*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_TGS_REQ	12
66*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_TGS_REP	13
67*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_AP_REQ		14
68*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_AP_REP		15
69*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_SAFE		20
70*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_PRIV		21
71*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_CRED		22
72*7c478bd9Sstevel@tonic-gate #define ASN1_KRB_ERROR		30
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate #endif
75