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