*/
/* allow either constructed or primitive encoding, so check for bit 6
set or reset */
-#define krb5_is_krb_ticket(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x61 ||\
- (dat)->data[0] == 0x41))
-#define krb5_is_krb_authenticator(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x62 ||\
- (dat)->data[0] == 0x42))
-#define krb5_is_as_req(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x6a ||\
- (dat)->data[0] == 0x4a))
-#define krb5_is_as_rep(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x6b ||\
- (dat)->data[0] == 0x4b))
-#define krb5_is_tgs_req(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x6c ||\
- (dat)->data[0] == 0x4c))
-#define krb5_is_tgs_rep(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x6d ||\
- (dat)->data[0] == 0x4d))
-#define krb5_is_ap_req(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x6e ||\
- (dat)->data[0] == 0x4e))
-#define krb5_is_ap_rep(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x6f ||\
- (dat)->data[0] == 0x4f))
-#define krb5_is_krb_safe(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x74 ||\
- (dat)->data[0] == 0x54))
-#define krb5_is_krb_priv(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x75 ||\
- (dat)->data[0] == 0x55))
-#define krb5_is_krb_cred(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x76 ||\
- (dat)->data[0] == 0x56))
-#define krb5_is_krb_enc_as_rep_part(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x79 ||\
- (dat)->data[0] == 0x59))
-#define krb5_is_krb_enc_tgs_rep_part(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x7a ||\
- (dat)->data[0] == 0x5a))
-#define krb5_is_krb_enc_ap_rep_part(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x7b ||\
- (dat)->data[0] == 0x5b))
-#define krb5_is_krb_enc_krb_priv_part(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x7c ||\
- (dat)->data[0] == 0x5c))
-#define krb5_is_krb_enc_krb_cred_part(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x7d ||\
- (dat)->data[0] == 0x5d))
-#define krb5_is_krb_error(dat)\
- ((dat) && (dat)->length && ((dat)->data[0] == 0x7e ||\
- (dat)->data[0] == 0x5e))
+#define krb5int_is_app_tag(dat,tag)\
+ ((dat) && (dat)->length && \
+ ((((dat)->data[0] & ~0x20) == ((tag) | 0x40))))
+#define krb5_is_krb_ticket(dat) krb5int_is_app_tag(dat, 1)
+#define krb5_is_krb_authenticator(dat) krb5int_is_app_tag(dat, 2)
+#define krb5_is_as_req(dat) krb5int_is_app_tag(dat, 10)
+#define krb5_is_as_rep(dat) krb5int_is_app_tag(dat, 11)
+#define krb5_is_tgs_req(dat) krb5int_is_app_tag(dat, 12)
+#define krb5_is_tgs_rep(dat) krb5int_is_app_tag(dat, 13)
+#define krb5_is_ap_req(dat) krb5int_is_app_tag(dat, 14)
+#define krb5_is_ap_rep(dat) krb5int_is_app_tag(dat, 15)
+#define krb5_is_krb_safe(dat) krb5int_is_app_tag(dat, 20)
+#define krb5_is_krb_priv(dat) krb5int_is_app_tag(dat, 21)
+#define krb5_is_krb_cred(dat) krb5int_is_app_tag(dat, 22)
+#define krb5_is_krb_enc_as_rep_part(dat) krb5int_is_app_tag(dat, 25)
+#define krb5_is_krb_enc_tgs_rep_part(dat) krb5int_is_app_tag(dat, 26)
+#define krb5_is_krb_enc_ap_rep_part(dat) krb5int_is_app_tag(dat, 27)
+#define krb5_is_krb_enc_krb_priv_part(dat) krb5int_is_app_tag(dat, 28)
+#define krb5_is_krb_enc_krb_cred_part(dat) krb5int_is_app_tag(dat, 29)
+#define krb5_is_krb_error(dat) krb5int_is_app_tag(dat, 30)
/*************************************************************************
* Prototypes for krb5_encode.c