From 08da0afa8c7bdd7d8d2710cef93c8d52fd2768a5 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 21 Jun 2000 01:54:15 +0000 Subject: [PATCH] (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 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8417 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kdc/kerberos5.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kdc/kerberos5.c b/kdc/kerberos5.c index ad8b3417f..4a09f88b8 100644 --- a/kdc/kerberos5.c +++ b/kdc/kerberos5.c @@ -283,8 +283,8 @@ get_pa_etype_info(METHOD_DATA *md, hdb_entry *client) return ENOMEM; for(i = 0; i < client->keys.len; i++) { pa.val[i].etype = client->keys.val[i].key.keytype; - ALLOC(pa.val[i].salttype); if(client->keys.val[i].salt){ + ALLOC(pa.val[i].salttype); #if 0 if(client->keys.val[i].salt->type == hdb_pw_salt) *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, &pa.val[i].salt); } else { -#if 0 - *pa.val[i].salttype = 1; /* or 0 with salt? */ -#else - *pa.val[i].salttype = KRB5_PADATA_PW_SALT; -#endif + /* we return no salt type at all, as that should indicate + * the default salt type and make everybody happy. some + * systems (like w2k) dislike being told the salt type + * here. */ + + pa.val[i].salttype = NULL; pa.val[i].salt = NULL; } } len = length_ETYPE_INFO(&pa); buf = malloc(len); - if (buf) { + if (buf == NULL) { free_ETYPE_INFO(&pa); - return ret; + return ENOMEM; } ret = encode_ETYPE_INFO(buf + len - 1, len, &pa, &len); free_ETYPE_INFO(&pa);