AUTH_SUCCESS,
/*! Authentication credentials correct but nonce mismatch */
AUTH_STALE,
+ /*! Authentication credentials were not provided */
+ AUTH_NOAUTH,
};
/*!
return AUTH_SUCCESS;
}
}
+
+ if (authed == PJSIP_EAUTHNOAUTH) {
+ return AUTH_NOAUTH;
+ }
+
return AUTH_FAIL;
}
enum digest_verify_result *verify_res;
enum ast_sip_check_auth_result res;
int i;
+ int failures = 0;
RAII_VAR(struct ast_sip_endpoint *, artificial_endpoint,
ast_sip_get_artificial_endpoint(), ao2_cleanup);
res = AST_SIP_AUTHENTICATION_SUCCESS;
goto cleanup;
}
+ if (verify_res[i] == AUTH_FAIL) {
+ failures++;
+ }
}
for (i = 0; i < endpoint->inbound_auths.num; ++i) {
challenge(auths[i]->realm, tdata, rdata, verify_res[i] == AUTH_STALE);
}
- res = AST_SIP_AUTHENTICATION_CHALLENGE;
+ if (failures == endpoint->inbound_auths.num) {
+ res = AST_SIP_AUTHENTICATION_FAILED;
+ } else {
+ res = AST_SIP_AUTHENTICATION_CHALLENGE;
+ }
cleanup:
ast_sip_cleanup_auths(auths, endpoint->inbound_auths.num);