From a149cbb52b0d7118f5e5c9c4113113e7f880d87d Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 7 Aug 2000 15:22:18 +0000 Subject: [PATCH] * 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 --- src/lib/krb5/asn.1/ChangeLog | 9 +++++++++ src/lib/krb5/asn.1/asn1_k_decode.c | 7 ++++++- src/lib/krb5/asn.1/krbasn1.h | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) 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 + + * 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 * 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; -- 2.26.2