* asn1_k_decode.c (asn1_decode_etype_info_entry): If the optional
authorTheodore Tso <tytso@mit.edu>
Thu, 9 Nov 1995 01:03:32 +0000 (01:03 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 9 Nov 1995 01:03:32 +0000 (01:03 +0000)
salt element is not present, set etype.length to -1.

* asn1_k_encode.c (asn1_encode_etype_info_entry): When encoding
the etype_info_entry structure, use length == -1 to mean
that the optional salt structure should not be sent.  (It
used to be if length == -1.)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7067 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/asn1_k_encode.c

index 8ddcdbe179fb97232871400593ce52ecf49052c1..09d37294fa158c94d46aa1b84e81378c71c79a00 100644 (file)
@@ -1,3 +1,13 @@
+Wed Nov  8 20:00:13 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * asn1_k_decode.c (asn1_decode_etype_info_entry): If the optional
+               salt element is not present, set etype.length to -1.
+
+       * asn1_k_encode.c (asn1_encode_etype_info_entry): When encoding
+               the etype_info_entry structure, use length == -1 to mean
+               that the optional salt structure should not be sent.  (It
+               used to be if length == -1.)
+
 Tue Oct 31 20:06:49 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * krb5_decode.c (decode_krb5_pa_enc_ts, decode_krb5_enc_data):
index 93db3055e05cc4ae36e15775eb4341f0873416df..ff985fbf59456955bdcf29b37edbf0294a6d8ca5 100644 (file)
@@ -665,7 +665,7 @@ asn1_error_code asn1_decode_etype_info_entry(buf, val)
     if (tagnum == 1) {
            get_lenfield(val->length,val->salt,1,asn1_decode_octetstring);
     } else {
-           val->length = 0;
+           val->length = -1;
            val->salt = 0;
     }
     end_structure();
index c2b92832790da520cf8de848c5e96f7f6f4f7cd9..9702f5e3d838e1ce520534b57e60390c09560d4b 100644 (file)
@@ -774,10 +774,10 @@ asn1_error_code asn1_encode_etype_info_entry(buf, val, retlen)
 {
   asn1_setup();
 
-  if(val == NULL || (val->length != 0 && val->salt == NULL))
+  if(val == NULL || (val->length >= 0 && val->salt == NULL))
      return ASN1_MISSING_FIELD;
 
-  if (val->length)
+  if (val->length >= 0)
          asn1_addlenfield((int) val->length,val->salt,1,
                           asn1_encode_octetstring);
   asn1_addfield(val->etype,0,asn1_encode_integer);