Ignore password attributes for S4U2Self requests

For consistency with Windows KDCs, allow protocol transition to work
even if the password has expired or needs changing.

Also, when looking up an enterprise principal with an AS request,
treat ERR_KEY_EXP as confirmation that the client is present in the
realm.

[ghudson@mit.edu: added comment in kdc_process_s4u2self_req(); edited
commit message]

ticket: 8763 (new)
tags: pullup
target_version: 1.17
add_pa_data_element(krb5_pa_data ***list, krb5_pa_data *pa)
{
    size_t count;
    krb5_pa_data **newlist;

    for (count = 0; *list != NULL && (*list)[count] != NULL; count++);

    newlist = realloc(*list, (count + 2) * sizeof(*newlist));
    if (newlist == NULL) {
        free(pa->contents);
        free(pa);
        return ENOMEM;
    }
    newlist[count] = pa;
    newlist[count + 1] = NULL;
    *list = newlist;
    return 0;
}

add_pa_data_element(krb5_pa_data ***list, krb5_pa_data *pa)
{
    size_t count;
    krb5_pa_data **newlist;

    for (count = 0; *list != NULL && (*list)[count] != NULL; count++);

    newlist = realloc(*list, (count + 2) * sizeof(*newlist));
    if (newlist == NULL) {
        free(pa->contents);
        free(pa);
        return ENOMEM;
    }
    newlist[count] = pa;
    newlist[count + 1] = NULL;
    *list = newlist;
    return 0;
}
