Commit b5816b56 authored by Pekka Pessi's avatar Pekka Pessi

test_nua: using AUTHTAG_MAX_NCOUNT(1) for Mr. C

C is now challenged every time.

darcs-hash:20070725164357-65a35-ff1a6a123263ba7e3cd93805315c5b0ecf4783a3.gz
parent 592b6640
......@@ -332,7 +332,6 @@ int test_prack_auth(struct context *ctx)
struct event *e, *ep, *ei;
sip_t *sip;
sip_proxy_authenticate_t *au;
char const *md5 = NULL, *md5sess = NULL;
if (print_headings)
printf("TEST NUA-10.1.3: Call with 100rel, PRACK is challenged\n");
......@@ -396,10 +395,6 @@ int test_prack_auth(struct context *ctx)
TEST(e->data->e_status, 407);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(au = sip->sip_proxy_authenticate);
TEST_1(auth_get_params(NULL, au->au_params,
"algorithm=md5", &md5,
"algorithm=md5-sess", &md5sess,
NULL) > 0);
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_calling); /* CALLING */
......@@ -417,16 +412,7 @@ int test_prack_auth(struct context *ctx)
ep = event_by_type(e->next, nua_r_prack);
TEST_1(e = ep); TEST_E(e->data->e_event, nua_r_prack);
if (e->data->e_status != 200 && md5 && !md5sess) {
if (e->data->e_status != 100) {
TEST(e->data->e_status, 407);
}
TEST_1(e = e->next); TEST_E(e->data->e_event, nua_i_state);
TEST(callstate(e->data->e_tags), nua_callstate_proceeding);
TEST_1(!is_answer_recv(e->data->e_tags));
TEST_1(!is_offer_sent(e->data->e_tags));
if (e->data->e_status == 100 || e->data->e_status == 407) {
TEST_1(e = ep = event_by_type(e->next, nua_r_prack));
}
TEST_E(e->data->e_event, nua_r_prack);
......
......@@ -148,6 +148,7 @@ int test_nua_init(struct context *ctx,
AUTHTAG_QOP("auth-int"),
AUTHTAG_ALGORITHM("md5"),
AUTHTAG_NEXT_EXPIRES(60),
AUTHTAG_MAX_NCOUNT(1),
TAG_END());
ctx->proxy_tests = 1;
......
......@@ -64,9 +64,15 @@ int save_until_notified(CONDITION_PARAMS)
int save_until_notified_and_responded(CONDITION_PARAMS)
{
save_event_in_list(ctx, event, ep, call);
if (event == nua_i_notify) ep->flags.bit0 = 1;
if (event == nua_r_subscribe || event == nua_r_unsubscribe) {
if (status >= 300)
if (status == 407) {
AUTHENTICATE(ep, call, nh,
NUTAG_AUTH("Digest:\"test-proxy\":charlie:secret"),
TAG_END());
}
else if (status >= 300)
return 1;
else if (status >= 200)
ep->flags.bit1 = 1;
......
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