(get_pa_etype_info): do not set salttype if it's vanilla pw-salt, that

keeps win2k happy.  also do the malloc check correctly.  From Daniel
Kouril <kouril@ics.muni.cz>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8417 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-06-21 01:54:15 +00:00
parent 3562fa2241
commit 08da0afa8c

View File

@@ -283,8 +283,8 @@ get_pa_etype_info(METHOD_DATA *md, hdb_entry *client)
return ENOMEM; return ENOMEM;
for(i = 0; i < client->keys.len; i++) { for(i = 0; i < client->keys.len; i++) {
pa.val[i].etype = client->keys.val[i].key.keytype; pa.val[i].etype = client->keys.val[i].key.keytype;
ALLOC(pa.val[i].salttype);
if(client->keys.val[i].salt){ if(client->keys.val[i].salt){
ALLOC(pa.val[i].salttype);
#if 0 #if 0
if(client->keys.val[i].salt->type == hdb_pw_salt) if(client->keys.val[i].salt->type == hdb_pw_salt)
*pa.val[i].salttype = 0; /* or 1? or NULL? */ *pa.val[i].salttype = 0; /* or 1? or NULL? */
@@ -307,19 +307,20 @@ get_pa_etype_info(METHOD_DATA *md, hdb_entry *client)
krb5_copy_data(context, &client->keys.val[i].salt->salt, krb5_copy_data(context, &client->keys.val[i].salt->salt,
&pa.val[i].salt); &pa.val[i].salt);
} else { } else {
#if 0 /* we return no salt type at all, as that should indicate
*pa.val[i].salttype = 1; /* or 0 with salt? */ * the default salt type and make everybody happy. some
#else * systems (like w2k) dislike being told the salt type
*pa.val[i].salttype = KRB5_PADATA_PW_SALT; * here. */
#endif
pa.val[i].salttype = NULL;
pa.val[i].salt = NULL; pa.val[i].salt = NULL;
} }
} }
len = length_ETYPE_INFO(&pa); len = length_ETYPE_INFO(&pa);
buf = malloc(len); buf = malloc(len);
if (buf) { if (buf == NULL) {
free_ETYPE_INFO(&pa); free_ETYPE_INFO(&pa);
return ret; return ENOMEM;
} }
ret = encode_ETYPE_INFO(buf + len - 1, len, &pa, &len); ret = encode_ETYPE_INFO(buf + len - 1, len, &pa, &len);
free_ETYPE_INFO(&pa); free_ETYPE_INFO(&pa);