summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2000-08-07 15:22:18 +0000
committerEzra Peisach <epeisach@mit.edu>2000-08-07 15:22:18 +0000
commita149cbb52b0d7118f5e5c9c4113113e7f880d87d (patch)
tree3c3d0328d54878e2b8290f1d0069e8befac55802 /src/lib
parent41fd8c0ff0c1626b7ee2550f6cc6a35feb03690e (diff)
* asn1_k_decode.c (asn1_decode_last_req_entry): Decode the lr_type
as an int32. Handle backwards compatibility if KRB5_GENEROUS_LR_TYPE is defined. * krbasn1.h: Define KRB5_GENEROUS_LR_TYPE for compatibility with one byte negative lr_types which are sent as a positive integer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12608 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/krb5/asn.1/ChangeLog9
-rw-r--r--src/lib/krb5/asn.1/asn1_k_decode.c7
-rw-r--r--src/lib/krb5/asn.1/krbasn1.h9
3 files changed, 24 insertions, 1 deletions
diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog
index bb99e2a4c..a076861ef 100644
--- a/src/lib/krb5/asn.1/ChangeLog
+++ b/src/lib/krb5/asn.1/ChangeLog
@@ -1,3 +1,12 @@
+2000-08-07 Ezra Peisach <epeisach@mit.edu>
+
+ * asn1_k_decode.c (asn1_decode_last_req_entry): Decode the lr_type
+ as an int32. Handle backwards compatibility if KRB5_GENEROUS_LR_TYPE
+ is defined.
+
+ * krbasn1.h: Define KRB5_GENEROUS_LR_TYPE for compatibility with
+ one byte negative lr_types which are sent as a positive integer.
+
2000-06-29 Tom Yu <tlyu@mit.edu>
* asn1buf.h (asn1buf_insert_octet): Define using __inline__ rather
diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c
index 6f72d8e12..a0c1ba345 100644
--- a/src/lib/krb5/asn.1/asn1_k_decode.c
+++ b/src/lib/krb5/asn.1/asn1_k_decode.c
@@ -645,10 +645,15 @@ asn1_error_code asn1_decode_last_req_entry(buf, val)
{
setup();
{ begin_structure();
- get_field(val->lr_type,0,asn1_decode_octet);
+ get_field(val->lr_type,0,asn1_decode_int32);
get_field(val->value,1,asn1_decode_kerberos_time);
end_structure();
val->magic = KV5M_LAST_REQ_ENTRY;
+#ifdef KRB5_GENEROUS_LR_TYPE
+ /* If we are only a single byte wide and negative - fill in the
+ other bits */
+ if((val->lr_type & 0xffffff80) == 0x80) val->lr_type |= 0xffffff00;
+#endif
}
cleanup();
}
diff --git a/src/lib/krb5/asn.1/krbasn1.h b/src/lib/krb5/asn.1/krbasn1.h
index c8fe0a433..f4e23387a 100644
--- a/src/lib/krb5/asn.1/krbasn1.h
+++ b/src/lib/krb5/asn.1/krbasn1.h
@@ -27,6 +27,15 @@
*/
/* #define KRB5_MSGTYPE_STRICT */
+/*
+ * If KRB5_GENEROUS_LR_TYPE is defined, then we are generous about
+ * accepting a one byte negative lr_type - which is not sign
+ * extended. Prior to July 2000, we were sending a negative lr_type as
+ * a positve single byte value - instead of a signed integer. This
+ * allows us to receive the old value and deal
+ */
+#define KRB5_GENEROUS_LR_TYPE
+
typedef krb5_octet asn1_octet;
typedef krb5_error_code asn1_error_code;