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