if (ca->ca_auc->auc_challenge)
stale = ca->ca_auc->auc_challenge(ca, ch);
+
+ if (AUTH_CLIENT_IS_EXTENDED(ca))
+ ca->ca_clear = 0;
+
if (stale < 0)
return -1;
stale = ac->ac_stale || cda->cda_ac->ac_nonce == NULL;
- if (ac->ac_qop && (cda->cda_cnonce == NULL || ac->ac_stale)) {
+ if (ac->ac_qop && (cda->cda_cnonce == NULL || ac->ac_stale || ca->ca_clear )) {
su_guid_t guid[1];
char *cnonce;
size_t b64len = BASE64_MINSIZE(sizeof(guid)) + 1;
}
}
+ if (status == 403) {
+ if (nh->nh_auth) {
+ /* Bad username/password */
+ SU_DEBUG_7(("nua(%p): bad credentials, clearing them\n", (void *)nh));
+ auc_clear_credentials(&nh->nh_auth, NULL, NULL);
+ }
+ }
+
if ((status == 401 && sip->sip_www_authenticate) ||
(status == 407 && sip->sip_proxy_authenticate)) {
int server = 0, proxy = 0;
cr->cr_challenged = 1;
- if (!invalid && auc_has_authorization(&nh->nh_auth)) {
+ if (invalid) {
+ /* Bad username/password */
+ SU_DEBUG_7(("nua(%p): bad credentials, clearing them\n", (void *)nh));
+ auc_clear_credentials(&nh->nh_auth, NULL, NULL);
+ } else if (auc_has_authorization(&nh->nh_auth)) {
return nua_client_restart(cr, 100, "Request Authorized by Cache");
}
cr->cr_status = 0, cr->cr_phrase = NULL;
nua_client_request_unref(cr);
- return !invalid;
+ return 1;
}
}
/* GriGiu : RFC-3261 status supported Retry-After */