Fix extraction of authz data from the AuthorizationData sequence:
Where we had IF-RELEVENT:: WIN2K-PAC IF-RELEVENT:: SIGNED-PATH The recursion into find_type_in_ad() for the second element would set ret = ENOENT, and therefore the tail would set *found = FALSE, despite the data already being found. From Andrew Bartlett git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18922 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -101,13 +101,13 @@ static int
|
|||||||
find_type_in_ad(krb5_context context,
|
find_type_in_ad(krb5_context context,
|
||||||
int type,
|
int type,
|
||||||
krb5_data *data,
|
krb5_data *data,
|
||||||
int *found,
|
krb5_boolean *found,
|
||||||
int failp,
|
krb5_boolean failp,
|
||||||
krb5_keyblock *sessionkey,
|
krb5_keyblock *sessionkey,
|
||||||
const AuthorizationData *ad,
|
const AuthorizationData *ad,
|
||||||
int level)
|
int level)
|
||||||
{
|
{
|
||||||
krb5_error_code ret = ENOENT;
|
krb5_error_code ret = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (level > 9) {
|
if (level > 9) {
|
||||||
@@ -129,7 +129,7 @@ find_type_in_ad(krb5_context context,
|
|||||||
krb5_set_error_string(context, "malloc - out of memory");
|
krb5_set_error_string(context, "malloc - out of memory");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
*found = 1;
|
*found = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
switch (ad->val[i].ad_type) {
|
switch (ad->val[i].ad_type) {
|
||||||
@@ -144,8 +144,8 @@ find_type_in_ad(krb5_context context,
|
|||||||
"IF_RELEVANT with %d", ret);
|
"IF_RELEVANT with %d", ret);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
ret = find_type_in_ad(context, type, data, found, 0, sessionkey,
|
ret = find_type_in_ad(context, type, data, found, FALSE,
|
||||||
&child, level + 1);
|
sessionkey, &child, level + 1);
|
||||||
free_AuthorizationData(&child);
|
free_AuthorizationData(&child);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
@@ -242,7 +242,7 @@ krb5_ticket_get_authorization_data_type(krb5_context context,
|
|||||||
{
|
{
|
||||||
AuthorizationData *ad;
|
AuthorizationData *ad;
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
int found = 0;
|
krb5_boolean found = 0;
|
||||||
|
|
||||||
krb5_data_zero(data);
|
krb5_data_zero(data);
|
||||||
|
|
||||||
@@ -252,8 +252,8 @@ krb5_ticket_get_authorization_data_type(krb5_context context,
|
|||||||
return ENOENT; /* XXX */
|
return ENOENT; /* XXX */
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = find_type_in_ad(context, type, data, &found, 1, &ticket->ticket.key,
|
ret = find_type_in_ad(context, type, data, found, TRUE,
|
||||||
ticket->ticket.authorization_data, 0);
|
&ticket->ticket.key, ad, 0);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
Reference in New Issue
Block a user