Commit 440f8d92 authored by Pekka Pessi's avatar Pekka Pessi

auth_client: do not crash with unknown authentication schemes

darcs-hash:20090108190403-db55f-5836e8878d649b42ad6e47965347b19f167386b5.gz
parent 91a0e640
......@@ -128,11 +128,17 @@ int auc_challenge(auth_client_t **auc_list,
if (!matched) {
/* There was no matching authenticator, create a new one */
*cca = ca_create(home, scheme, realm);
if (ca_challenge((*cca), ch, crcl, scheme, realm) < 0) {
if (*cca == NULL) {
return -1;
}
else if (ca_challenge((*cca), ch, crcl, scheme, realm) < 0) {
ca_destroy(home, *cca), *cca = NULL;
return -1;
}
retval = 1; /* Updated authenticator */
/* XXX - case w/ unknown authentication scheme */
else
retval = 1; /* Updated authenticator */
}
}
......
......@@ -98,7 +98,8 @@ struct auth_client_plugin
/** Check if authentication client has been extended. @NEW_1_12_6. */
#define AUTH_CLIENT_IS_EXTENDED(ca) \
((ca)->ca_auc->auc_plugin_size > \
((ca)->ca_auc && \
(ca)->ca_auc->auc_plugin_size > \
(int)offsetof(auth_client_plugin_t, auc_clear) \
&& (ca)->ca_auc->auc_clear != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment