summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>1994-06-29 05:35:50 +0000
committerTom Yu <tlyu@mit.edu>1994-06-29 05:35:50 +0000
commitba0c614172f11219c430b17cd14602d9f7e629e3 (patch)
tree61c2ac5235dbd41debd8aaf0d6eb63be20e1a506 /src/include
parent0ab5822efa69c6b2236b5f052775b2ce86c7c30e (diff)
downloadkrb5-ba0c614172f11219c430b17cd14602d9f7e629e3.tar.gz
krb5-ba0c614172f11219c430b17cd14602d9f7e629e3.tar.xz
krb5-ba0c614172f11219c430b17cd14602d9f7e629e3.zip
folding in Harry's changes
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3924 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/krb5/ChangeLog6
-rw-r--r--src/include/krb5/asn.1/ChangeLog5
-rw-r--r--src/include/krb5/asn.1/encode.h6
-rw-r--r--src/include/krb5/asn.1/krb5_is.h79
-rw-r--r--src/include/krb5/asn1.h2
-rw-r--r--src/include/krb5/configure.in1
-rw-r--r--src/include/krb5/error_def.h4
7 files changed, 103 insertions, 0 deletions
diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog
index c32dab58a2..6346e0629a 100644
--- a/src/include/krb5/ChangeLog
+++ b/src/include/krb5/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jun 28 19:09:21 1994 Tom Yu (tlyu at dragons-lair)
+
+ * error_def.h: folding in Harry's changes
+ * asn1.h: ditto
+ * configure.in: adding ISODE_DEFS, fixing ISODE_INCLUDE to dtrt
+
Tue Jun 21 23:54:40 1994 Tom Yu (tlyu at dragons-lair)
* pulling SEEK_SET, etc. out to avoid redef'ing in unistd.h
diff --git a/src/include/krb5/asn.1/ChangeLog b/src/include/krb5/asn.1/ChangeLog
new file mode 100644
index 0000000000..dd11f83675
--- /dev/null
+++ b/src/include/krb5/asn.1/ChangeLog
@@ -0,0 +1,5 @@
+Tue Jun 28 23:20:58 1994 Tom Yu (tlyu at dragons-lair)
+
+ * encode.h:
+ * krb5_is.h: ....folding in Harry's changes
+
diff --git a/src/include/krb5/asn.1/encode.h b/src/include/krb5/asn.1/encode.h
index 028c591575..4197a8bb1b 100644
--- a/src/include/krb5/asn.1/encode.h
+++ b/src/include/krb5/asn.1/encode.h
@@ -30,6 +30,7 @@
#ifndef KRB5_ENCODE_DEFS__
#define KRB5_ENCODE_DEFS__
+#ifdef KRB5_USE_ISODE
typedef int (*encoder_func) PROTOTYPE((PE *, int, int, char *, krb5_pointer));
typedef void (*free_func) PROTOTYPE((krb5_pointer ));
typedef krb5_pointer (*translator_func) PROTOTYPE((krb5_const_pointer, int * ));
@@ -370,4 +371,9 @@ krb5_error_code krb5_decode_generic
(dat)->data[0] == 0x5e))
+#else /* KRB5_USE_ISODE */
+#include <krb5/asn.1/krb5_encode.h>
+#include <krb5/asn.1/krb5_decode.h>
+#include <krb5/asn.1/krb5_is.h>
+#endif /* KRB5_USE_ISODE */
#endif /* KRB5_ENCODE_DEFS__ */
diff --git a/src/include/krb5/asn.1/krb5_is.h b/src/include/krb5/asn.1/krb5_is.h
new file mode 100644
index 0000000000..b548c06b59
--- /dev/null
+++ b/src/include/krb5/asn.1/krb5_is.h
@@ -0,0 +1,79 @@
+#ifndef __KRB5_IS_H__
+#define __KRB5_IS_H__
+
+/* ASN.1 encoding knowledge; KEEP IN SYNC WITH ASN.1 defs! */
+/* here we use some knowledge of ASN.1 encodings */
+/*
+ Ticket is APPLICATION 1.
+ Authenticator is APPLICATION 2.
+ AS_REQ is APPLICATION 10.
+ AS_REP is APPLICATION 11.
+ TGS_REQ is APPLICATION 12.
+ TGS_REP is APPLICATION 13.
+ AP_REQ is APPLICATION 14.
+ AP_REP is APPLICATION 15.
+ KRB_SAFE is APPLICATION 20.
+ KRB_PRIV is APPLICATION 21.
+ KRB_CRED is APPLICATION 22.
+ EncASRepPart is APPLICATION 25.
+ EncTGSRepPart is APPLICATION 26.
+ EncAPRepPart is APPLICATION 27.
+ EncKrbPrivPart is APPLICATION 28.
+ EncKrbCredPart is APPLICATION 29.
+ KRB_ERROR is APPLICATION 30.
+ */
+/* 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))
+
+#endif
diff --git a/src/include/krb5/asn1.h b/src/include/krb5/asn1.h
index e8f53ba329..2bdfebbeb4 100644
--- a/src/include/krb5/asn1.h
+++ b/src/include/krb5/asn1.h
@@ -30,9 +30,11 @@
#ifndef KRB5_ASN1__
#define KRB5_ASN1__
+#ifdef KRB5_USE_ISODE
#include <krb5/asn.1/KRB5-types.h>
#include <krb5/asn.1/asn1defs.h>
#include <krb5/asn.1/KRB5-types-aux.h>
+#endif
#include <krb5/asn.1/encode.h>
#endif /* KRB5_ASN1__ */
diff --git a/src/include/krb5/configure.in b/src/include/krb5/configure.in
index 3d70dc92fa..e6204a181a 100644
--- a/src/include/krb5/configure.in
+++ b/src/include/krb5/configure.in
@@ -1,6 +1,7 @@
AC_INIT(acconfig.h)
AC_SET_BUILDTOP
CONFIG_RULES
+ISODE_DEFS
AC_CONFIG_HEADER(autoconf.h)
AC_PROG_LEX
HAVE_YYLINENO
diff --git a/src/include/krb5/error_def.h b/src/include/krb5/error_def.h
index f1cf2d2ab6..31a296e8da 100644
--- a/src/include/krb5/error_def.h
+++ b/src/include/krb5/error_def.h
@@ -32,7 +32,11 @@
#include <krb5/krb5_err.h>
#include <krb5/kdb5_err.h>
+#ifndef KRB5_USE_ISODE
+#include <krb5/asn1_err.h>
+#else
#include <krb5/isode_err.h>
+#endif
#include <errno.h>
#endif /* KRB5_ERROR_DEF__ */