+2000-10-17 Ezra Peisach <epeisach@mit.edu>
+
+ * ktest.c (ktest_make_sample_etype_info): Use KRB5_ETYPE_NO_SALT
+ instead of -1.
+
+ * ktest_equal.c (ktest_equal_krb5_etype_info_entry): Test for
+ KRB5_ETYPE_NO_SALT. ktest_equal_array_of_octet() and
+ ktest_equal_array_of_char take unsigned int lengths.
+
+ * ktest_equal.h: Add len_unsigned_array macro for a prototype of a
+ function taking an unsigned int
+ count. ktest_equal_array_of_octet() is one of
+ these. ktest_equal_array_of_char() takes an unsigned int as
+ length.
+
+ * trval.c (trval): Unsigned/signed int fix.
+
+ * utility.c (asn1_krb5_data_unparse): Better test for krb5_data
+ length being less than zero.
+
2000-09-26 Ezra Peisach <epeisach@mit.edu>
* krb5_decode_test.c (decode_run): If the ASN1 decoder returns an
return FALSE;
if (ref->length != var->length)
return FALSE;
- if (ref->length > 0)
+ if (ref->length > 0 && ref->length != KRB5_ETYPE_NO_SALT)
if (memcmp(ref->salt, var->salt, ref->length) != 0)
return FALSE;
return TRUE;
}
int ktest_equal_array_of_octet(length, ref, var)
- const int length;
+ const unsigned int length;
krb5_octet * ref;
krb5_octet * var;
{
}
int ktest_equal_array_of_char(length, ref, var)
- const int length;
+ const unsigned int length;
char * ref;
char * var;
{
#define len_array(funcname,type)\
int funcname KRB5_PROTOTYPE((const int length, type *ref, type *var))
+#define len_unsigned_array(funcname,type)\
+int funcname KRB5_PROTOTYPE((const unsigned int length, type *ref, type *var))
generic(ktest_equal_authenticator,krb5_authenticator);
generic(ktest_equal_principal_data,krb5_principal_data);
len_array(ktest_equal_array_of_enctype,krb5_enctype);
len_array(ktest_equal_array_of_data,krb5_data);
-len_array(ktest_equal_array_of_octet,krb5_octet);
+len_unsigned_array(ktest_equal_array_of_octet,krb5_octet);
int ktest_equal_array_of_passwd_phrase_element
KRB5_PROTOTYPE((passwd_phrase_element **ref, passwd_phrase_element **var));
int ktest_equal_addresses
KRB5_PROTOTYPE((krb5_address **ref, krb5_address **var));
int ktest_equal_array_of_char
- KRB5_PROTOTYPE((const int length, char *ref, char *var));
+ KRB5_PROTOTYPE((const unsigned int length, char *ref, char *var));
int ktest_equal_etype_info
KRB5_PROTOTYPE((krb5_etype_info_entry ** ref,
krb5_etype_info_entry ** var));
-int ktest_equal_etype_info_entry
+int ktest_equal_krb5_etype_info_entry
KRB5_PROTOTYPE((krb5_etype_info_entry * ref,
krb5_etype_info_entry * var));
*s = (char*)calloc(strlen("<NULL>")+1, sizeof(char));
if(*s == NULL) return ENOMEM;
strcpy(*s,"<NULL>");
- }else if(code->data == NULL || code->length <= 0){
+ }else if(code->data == NULL || ((int) code->length) <= 0){
*s = (char*)calloc(strlen("<EMPTY>")+1, sizeof(char));
if(*s==NULL) return ENOMEM;
strcpy(*s,"<EMPTY>");