From 05bf0abead4fcac7d5963c421dabd5bd580b47c9 Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Sat, 23 Nov 1996 22:37:33 +0000 Subject: [PATCH] * [krb5-libs/149] only generate requests that you can actually handle. Tue Sep 3 22:53:56 1996 Mark Eichin * kdc_preauth.c (get_preauth_hint_list): detect ap->get_edata return status and don't pass back hint if it failed. (get_etype_info): malloc one more word in entry for end marker. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9543 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 11 +++++++++++ src/kdc/kdc_preauth.c | 13 ++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index dd7446081..c2b2074f3 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,14 @@ +Sat Nov 23 17:26:22 1996 Mark Eichin + + * [krb5-libs/149] only generate requests that you can actually + handle. + + Tue Sep 3 22:53:56 1996 Mark Eichin + + * kdc_preauth.c (get_preauth_hint_list): detect ap->get_edata + return status and don't pass back hint if it failed. + (get_etype_info): malloc one more word in entry for end marker. + Thu Nov 7 12:27:21 1996 Theodore Ts'o * kdc_preauth.c (check_padata): Fixed error handling; in order for diff --git a/src/kdc/kdc_preauth.c b/src/kdc/kdc_preauth.c index 0350068f9..dd8d09b8b 100644 --- a/src/kdc/kdc_preauth.c +++ b/src/kdc/kdc_preauth.c @@ -203,8 +203,15 @@ void get_preauth_hint_list(request, client, server, e_data) memset(*pa, 0, sizeof(krb5_pa_data)); (*pa)->magic = KV5M_PA_DATA; (*pa)->pa_type = ap->type; - if (ap->get_edata) - (ap->get_edata)(kdc_context, request, client, server, *pa); + if (ap->get_edata) { + retval = (ap->get_edata)(kdc_context, request, client, server, *pa); + if (retval) { + /* just failed on this type, continue */ + free(*pa); + *pa = 0; + continue; + } + } pa++; } retval = encode_krb5_padata_sequence((const krb5_pa_data **) pa_data, @@ -433,7 +440,7 @@ get_etype_info(context, request, client, server, pa_data) salt.data = 0; - entry = malloc((client->n_key_data * 2) * sizeof(krb5_etype_info_entry *)); + entry = malloc((client->n_key_data * 2 + 1) * sizeof(krb5_etype_info_entry *)); if (entry == NULL) return ENOMEM; entry[0] = NULL; -- 2.26.2