* asn1_k_decode.c (asn1_decode_last_req_entry): Decode the lr_type
authorEzra Peisach <epeisach@mit.edu>
Mon, 7 Aug 2000 15:22:18 +0000 (15:22 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 7 Aug 2000 15:22:18 +0000 (15:22 +0000)
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

src/lib/krb5/asn.1/ChangeLog
src/lib/krb5/asn.1/asn1_k_decode.c
src/lib/krb5/asn.1/krbasn1.h

index bb99e2a4ca4adbeac5ad7cc3d5c3a23e912dc32e..a076861ef34fede3dd38c188486d3c7474d768b0 100644 (file)
@@ -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
index 6f72d8e122da55bd8cf7a59ca48a08e2eca4eacc..a0c1ba3452d6bf48cec5d26b53d18eb519139469 100644 (file)
@@ -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();
 }
index c8fe0a4330f572ba7e52117d2791f7fca0786b86..f4e23387a5148868f86899ad9057a78df28467cd 100644 (file)
  */
 /* #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;