Makefile.in: "make check" depends on krb5_decode_test and
authorTheodore Tso <tytso@mit.edu>
Wed, 19 Oct 1994 14:37:37 +0000 (14:37 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 19 Oct 1994 14:37:37 +0000 (14:37 +0000)
krb5_encode_test being up to date.

ktest_equal.c: Don't segfault if one of the arguments is NULL and the
other is not in array_compare.

krb5_decode_test.c: Use krb5_init_ets() instead of explicitly naming
the error tables to initialize.

utility.c: Remove unused routine, and return EINVAL instead of
ASN1_PARSE_ERROR in krb5_data_hex_parse, since the ASN1 error codes
aren't defined if the ISODE routines are being used.

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

src/tests/asn.1/ChangeLog
src/tests/asn.1/Makefile.in
src/tests/asn.1/krb5_decode_test.c
src/tests/asn.1/ktest_equal.c
src/tests/asn.1/utility.c

index 1911b1608aa9c9639cd29feb2d9425b081e330ea..80e105d7374218d559c35034c6940e47c3c75151 100644 (file)
@@ -1,3 +1,22 @@
+Wed Oct 19 00:11:43 1994  Theodore Y. Ts'o  (tytso@maytag)
+
+       * Makefile.in: "make check" depends on krb5_decode_test and
+               krb5_encode_test being up to date.
+
+Tue Oct 18 22:46:17 1994  Theodore Y. Ts'o  (tytso@maytag)
+
+       * ktest_equal.c (array_compare): Don't segfault if one of the
+               arguments is NULL and the other is not.
+
+       * krb5_decode_test.c (main): Use krb5_init_ets() instead of
+               explicitly naming the error tables to initialize.
+
+       * utility.c (asn1buf_print): Remove unneeded routine.
+
+       * utility.c (krb5_data_hex_parse): Return EINVAL instead of
+               ASN1_PARSE_ERROR if KRB5_USE_ISODE is defined, since the 
+               ASN1 error codes aren't defined in that case.
+
 Fri Oct 14 15:00:41 1994  Theodore Y. Ts'o  (tytso@dcl)
 
        * Makefile.in: Clean up the test.out file.
index 7bb79cc7f6ca49c45c63e4cf4372250e4f3d58aa..e76e6767415a35cdbb4beb14fe4d3035e7e4e942 100644 (file)
@@ -22,7 +22,7 @@ DECOBJS = krb5_decode_test.o ktest.o ktest_equal.o utility.o
 krb5_decode_test: $(DECOBJS) $(DEPKLIB)
        $(CC) $(CFLAGS) -o krb5_decode_test $(DECOBJS) $(LIBS) $(KLIB)
 
-check::
+check:: krb5_decode_test krb5_encode_test
        ./krb5_decode_test
        $(RM) test.out
        ./krb5_encode_test > test.out
index d49a302d2585a3f67d495b55d9b86576b8ca1b26..af3369366bbc78b2b82ece46f435df3aa754d7c9 100644 (file)
@@ -4,6 +4,7 @@
 #include "utility.h"
 #include "ktest_equal.h"
 
+#include <krb5/asn1.h>
 #include "debug.h"
 #include <string.h>
 
@@ -15,8 +16,7 @@ void main()
   krb5_data code;
   krb5_error_code retval;
   
-  initialize_asn1_error_table();
-  initialize_krb5_error_table();
+  krb5_init_ets();
   
 #define setup(type,typestring,constructor)\
   type ref, *var;\
index 93ed4447bf7ea67eff28827a3cf5c9aa752f2bd2..10a076440c18fc86cf772c33cdd647927b0592bc 100644 (file)
@@ -568,8 +568,9 @@ int ktest_equal_array_of_enctype(DECLARG(const int , length),
 #define array_compare(comparator)\
 int i,p=TRUE;\
 if(ref==var) return TRUE;\
-if(ref==NULL || ref[0]==NULL)\
-  if(var==NULL || var[0]==NULL) return TRUE;\
+if(!ref || !ref[0])\
+  return (!var || !var[0]);\
+if(!var || !var[0]) return FALSE;\
 for(i=0; ref[i] != NULL && var[i] != NULL; i++)\
   p = p && comparator(ref[i],var[i]);\
 if(ref[i] == NULL && var[i] == NULL) return p;\
index 17ed2243cf1f22083f191f1bf0b437e4375bcfc0..b8b3af4fe2537b7e632b10425151df60bdcda16c 100644 (file)
@@ -74,12 +74,19 @@ krb5_error_code krb5_data_hex_parse(DECLARG(krb5_data *, d),
   if(d->data == NULL) return ENOMEM;
   d->length = (strlen(s)+1)/3;
   for(i=0,pos=(char*)s; i<d->length; i++,pos+=3){
-    if(!sscanf(pos,"%x",&digit)) return ASN1_PARSE_ERROR;
+    if(!sscanf(pos,"%x",&digit)) {
+#ifdef KRB5_USE_ISODE
+           return EINVAL;
+#else
+           return ASN1_PARSE_ERROR;
+#endif
+    }
     d->data[i] = (char)digit;
   }
   return 0;
 }
 
+#if 0
 void asn1buf_print(DECLARG(const asn1buf *, buf))
      OLDDECLARG(const asn1buf *, buf)
 {
@@ -104,3 +111,4 @@ void asn1buf_print(DECLARG(const asn1buf *, buf))
   printf("%s\n",s);
   free(s);
 }
+#endif