* asn1_encode_k.c (asn1_encode_transited_encoding): whoops don't
authorTom Yu <tlyu@mit.edu>
Sat, 16 Jul 1994 10:07:08 +0000 (10:07 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 16 Jul 1994 10:07:08 +0000 (10:07 +0000)
bomb if val->tr_contents.dlength == 0

* asn1_decode_k.c (asn1_decode_encrypted_data): oops looks like
Harry made a brain fart here.... default value for kvno was 5, not
0.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3995 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/asn.1/ChangeLog
src/lib/krb5/asn.1/asn1_decode_k.c
src/lib/krb5/asn.1/asn1_encode_k.c

index 03f866479b94294e25cbc179772140c03bd91613..96b76b4b1b8a4f6ef052d471a7fb52bb556fd34a 100644 (file)
@@ -1,3 +1,12 @@
+Sat Jul 16 00:19:18 1994  Tom Yu  (tlyu at dragons-lair)
+
+       * asn1_encode_k.c (asn1_encode_transited_encoding): whoops don't
+       bomb if val->tr_contents.dlength == 0
+
+       * asn1_decode_k.c (asn1_decode_encrypted_data): oops looks like
+       Harry made a brain fart here.... default value for kvno was 5, not
+       0.
+
 Thu Jul 14 11:37:59 1994  Theodore Y. Ts'o  (tytso at tsx-11)
 
        * asn1_*.[ch]: 
index de430b41b07fa1728dbccf69c0a30cbaba2414ce..c74a14ccd5cc7eb0ff0625891ecfda97a6d5ec94 100644 (file)
@@ -281,7 +281,7 @@ asn1_error_code asn1_decode_encrypted_data(DECLARG(asn1buf *, buf),
   setup();
   { begin_structure();
     get_field(val->etype,0,asn1_decode_enctype);
-    opt_field(val->kvno,1,asn1_decode_kvno,5);
+    opt_field(val->kvno,1,asn1_decode_kvno,0);
     get_lenfield(val->ciphertext.length,val->ciphertext.data,2,asn1_decode_charstring);
     end_structure();
   }
index 41324f851085ab18cd9e27c3f8d4565d7962ec68..894ba95a681227124a05a71a6d14136890a51a11 100644 (file)
@@ -580,7 +580,9 @@ asn1_error_code asn1_encode_transited_encoding(DECLARG(asn1buf *, buf),
 {
   asn1_setup();
 
-  if(val == NULL || val->tr_contents.data == NULL) return ASN1_MISSING_FIELD;
+  if(val == NULL ||
+     (val->tr_contents.length != 0 && val->tr_contents.data == NULL))
+    return ASN1_MISSING_FIELD;
 
   asn1_addlenfield(val->tr_contents.length,val->tr_contents.data,
                   1,asn1_encode_charstring);