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
+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.
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
#include "utility.h"
#include "ktest_equal.h"
+#include <krb5/asn1.h>
#include "debug.h"
#include <string.h>
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;\
#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;\
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)
{
printf("%s\n",s);
free(s);
}
+#endif