提交 180282cd authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-6287

上级 5e90a5a9
...@@ -185,6 +185,10 @@ int ca_challenge(auth_client_t *ca, ...@@ -185,6 +185,10 @@ int ca_challenge(auth_client_t *ca,
if (ca->ca_auc->auc_challenge) if (ca->ca_auc->auc_challenge)
stale = ca->ca_auc->auc_challenge(ca, ch); stale = ca->ca_auc->auc_challenge(ca, ch);
if (AUTH_CLIENT_IS_EXTENDED(ca))
ca->ca_clear = 0;
if (stale < 0) if (stale < 0)
return -1; return -1;
...@@ -863,7 +867,7 @@ static int auc_digest_challenge(auth_client_t *ca, msg_auth_t const *ch) ...@@ -863,7 +867,7 @@ static int auc_digest_challenge(auth_client_t *ca, msg_auth_t const *ch)
stale = ac->ac_stale || cda->cda_ac->ac_nonce == NULL; 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]; su_guid_t guid[1];
char *cnonce; char *cnonce;
size_t b64len = BASE64_MINSIZE(sizeof(guid)) + 1; size_t b64len = BASE64_MINSIZE(sizeof(guid)) + 1;
......
...@@ -1178,6 +1178,14 @@ int nua_base_client_check_restart(nua_client_request_t *cr, ...@@ -1178,6 +1178,14 @@ int nua_base_client_check_restart(nua_client_request_t *cr,
} }
} }
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) || if ((status == 401 && sip->sip_www_authenticate) ||
(status == 407 && sip->sip_proxy_authenticate)) { (status == 407 && sip->sip_proxy_authenticate)) {
int server = 0, proxy = 0; int server = 0, proxy = 0;
...@@ -1197,7 +1205,11 @@ int nua_base_client_check_restart(nua_client_request_t *cr, ...@@ -1197,7 +1205,11 @@ int nua_base_client_check_restart(nua_client_request_t *cr,
cr->cr_challenged = 1; 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"); return nua_client_restart(cr, 100, "Request Authorized by Cache");
} }
...@@ -1209,7 +1221,7 @@ int nua_base_client_check_restart(nua_client_request_t *cr, ...@@ -1209,7 +1221,7 @@ int nua_base_client_check_restart(nua_client_request_t *cr,
cr->cr_status = 0, cr->cr_phrase = NULL; cr->cr_status = 0, cr->cr_phrase = NULL;
nua_client_request_unref(cr); nua_client_request_unref(cr);
return !invalid; return 1;
} }
} }
/* GriGiu : RFC-3261 status supported Retry-After */ /* GriGiu : RFC-3261 status supported Retry-After */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论