+Tue Oct 28 10:18:10 1997 Ezra Peisach <epeisach@mit.edu>
+
+ * kdb_cpw.c (add_key_pwd): For KRB5_KDB_SALTTYPE_AFS3, the salt
+ key for afs_mit_string_to_key mut be null terminated.
+
Mon Oct 13 10:18:19 1997 Ezra Peisach <epeisach@mit.edu>
* t_kdb.c (do_testing): Add krb5_free_context.
key_salt.data.data = 0;
break;
case KRB5_KDB_SALTTYPE_AFS3: {
+#if 0
krb5_data * saltdata;
if (retval = krb5_copy_data(context, krb5_princ_realm(context,
db_entry->princ), &saltdata))
key_salt.data = *saltdata;
key_salt.data.length = -1; /*length actually used below...*/
krb5_xfree(saltdata);
+#else
+ /* Why do we do this? Well, the afs_mit_string_to_key needs to
+ use strlen, and the realm is not NULL terminated.... */
+ int slen = (*krb5_princ_realm(context,db_entry->princ)).length;
+ if(!(key_salt.data.data = (char *) malloc(slen+1)))
+ return ENOMEM;
+ key_salt.data.data[slen] = 0;
+ memcpy((char *)key_salt.data.data,
+ (char *)(*krb5_princ_realm(context,db_entry->princ)).data,
+ slen);
+ key_salt.data.length = -1; /*length actually used below...*/
+#endif
+
}
break;
default: