Commit 0c621b73 authored by Youness Alaoui's avatar Youness Alaoui

Add a test for the agent's unmatched response error, and fix test-parse after...

Add a test for the agent's unmatched response error, and fix test-parse after the change to the agent that automatically uses the right key for the message integrity
parent d2333c67
...@@ -550,6 +550,10 @@ static void test_vectors (void) ...@@ -550,6 +550,10 @@ static void test_vectors (void)
test_vector_validater, (void *) 0) != STUN_VALIDATION_SUCCESS) test_vector_validater, (void *) 0) != STUN_VALIDATION_SUCCESS)
fatal ("Response ipv4 test vector authentication failed"); fatal ("Response ipv4 test vector authentication failed");
if (stun_agent_validate (&agent, &msg, respv4, sizeof(respv4),
test_vector_validater, (void *) 0) != STUN_VALIDATION_UNMATCHED_RESPONSE)
fatal ("Response ipv4 test vector authentication failed");
addrlen = sizeof (ip4); addrlen = sizeof (ip4);
if (stun_message_find_xor_addr (&msg, STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS, if (stun_message_find_xor_addr (&msg, STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS,
(struct sockaddr *)&ip4, &addrlen) != 0) (struct sockaddr *)&ip4, &addrlen) != 0)
...@@ -566,6 +570,8 @@ static void test_vectors (void) ...@@ -566,6 +570,8 @@ static void test_vectors (void)
fatal ("Request test vector second authentication failed"); fatal ("Request test vector second authentication failed");
/* Remove the fingerprint attributes */ /* Remove the fingerprint attributes */
msg.key = NULL;
msg.key_len = 0;
req[3] = 0x3C; req[3] = 0x3C;
if (stun_message_length (&msg) != sizeof(req) - 8) if (stun_message_length (&msg) != sizeof(req) - 8)
......
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