* krb5_encode_test.c (main): In case of an error in the encoding
authorTheodore Tso <tytso@mit.edu>
Thu, 9 Nov 1995 01:05:57 +0000 (01:05 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 9 Nov 1995 01:05:57 +0000 (01:05 +0000)
routines, exit.  Otherwise, calling the print routines will often
lead to a coredump.

* ktest.c (ktest_make_sample_etype_info): Set etype.length to -1 to
mean that the optional salt string is missing.  (This is change in
the convention used by the ASN.1 encoder and decoder for this ASN.1
structure.)

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

src/tests/asn.1/ChangeLog
src/tests/asn.1/krb5_encode_test.c
src/tests/asn.1/ktest.c

index 837279e3b2aaf10afcec61b5336642f18a6841ec..b6f9bf11a8065491ff695e82b34ceac387fe459c 100644 (file)
@@ -1,3 +1,14 @@
+Wed Nov  8 20:03:51 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * krb5_encode_test.c (main): In case of an error in the encoding
+               routines, exit.  Otherwise, calling the print routines
+               will often lead to a coredump.
+
+       * ktest.c (ktest_make_sample_etype_info): Set etype.length to -1
+               to mean that the optional salt string is missing.  (This
+               is change in the convention used by the ASN.1 encoder and
+               decoder for this ASN.1 structure.) 
+
 Tue Oct 31 21:30:28 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * krb5_decode_test.c (main): Add tests for
index ca18a8812239547655b1826a7715958b6284b35f..6755ec85b50c96df5421e1c59d6aaa6a2c7af04b 100644 (file)
@@ -417,7 +417,10 @@ void main(argc, argv)
     setup(ad,authorization_data,"authorization_data",ktest_make_sample_authorization_data);
 
     retval = encode_krb5_authdata((const krb5_authdata**)ad,&(code));
-    if(retval) com_err("encoding authorization_data",retval,"");
+    if(retval) {
+       com_err("encoding authorization_data",retval,"");
+       exit(1);
+    }
     encoder_print_results(code, "authorization_data", "");
   }
   
@@ -444,7 +447,10 @@ void main(argc, argv)
     
     setup(pa,krb5_pa_data,"PreauthData",ktest_make_sample_pa_data_array);
     retval = encode_krb5_padata_sequence((const krb5_pa_data**)pa,&(code));
-    if(retval) com_err("encoding padata_sequence",retval,"");
+    if(retval) {
+       com_err("encoding padata_sequence",retval,"");
+       exit(1);
+    }
     encoder_print_results(code, "padata_sequence", "");
   }
 
@@ -455,7 +461,10 @@ void main(argc, argv)
     
     setup(pa,krb5_pa_data,"EmptyPreauthData",ktest_make_sample_empty_pa_data_array);
     retval = encode_krb5_padata_sequence((const krb5_pa_data**)pa,&(code));
-    if(retval) com_err("encoding padata_sequence(empty)",retval,"");
+    if(retval) {
+       com_err("encoding padata_sequence(empty)",retval,"");
+       exit(1);
+    }
     encoder_print_results(code, "padata_sequence(empty)", "");
   }
 
@@ -479,19 +488,28 @@ void main(argc, argv)
     setup(info,krb5_etype_info_entry **,"etype_info",
          ktest_make_sample_etype_info);
     retval = encode_krb5_etype_info((const krb5_etype_info_entry **)info,&(code));
-    if(retval) com_err("encoding etype_info",retval,"");
+    if(retval) {
+       com_err("encoding etype_info",retval,"");
+       exit(1);
+    }
     encoder_print_results(code, "etype_info", "");
     ktest_destroy_etype_info_entry(info[2]);      info[2] = 0;
     ktest_destroy_etype_info_entry(info[1]);      info[1] = 0;
 
     retval = encode_krb5_etype_info((const krb5_etype_info_entry **)info,&(code));
-    if(retval) com_err("encoding etype_info (only 1)",retval,"");
+    if(retval) {
+       com_err("encoding etype_info (only 1)",retval,"");
+       exit(1);
+    }
     encoder_print_results(code, "etype_info (only 1)", "");
 
     ktest_destroy_etype_info_entry(info[0]);      info[0] = 0;
     
     retval = encode_krb5_etype_info((const krb5_etype_info_entry **)info,&(code));
-    if(retval) com_err("encoding etype_info (no info)",retval,"");
+    if(retval) {
+       com_err("encoding etype_info (no info)",retval,"");
+       exit(1);
+    }
     encoder_print_results(code, "etype_info (no info)", "");
 
     free(info);
index a995d1d99154e4328f4e42f1cfd2fb5c31ae51a6..5700760af04bc29ebd1c7402e24d595386b3ce41 100644 (file)
@@ -680,7 +680,7 @@ krb5_error_code ktest_make_sample_etype_info(p)
        info[i]->magic = KV5M_ETYPE_INFO_ENTRY;
     }
     free(info[1]->salt);
-    info[1]->length = 0;
+    info[1]->length = -1;
     info[1]->salt = 0;
     *p = info;
     return 0;