Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
692e5b4f
Commit
692e5b4f
authored
Oct 08, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly support stale nonce, and unauthorized errors
parent
14ac040f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
agent/conncheck.c
agent/conncheck.c
+19
-18
No files found.
agent/conncheck.c
View file @
692e5b4f
...
@@ -1810,37 +1810,38 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
...
@@ -1810,37 +1810,38 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
trans_found
=
TRUE
;
trans_found
=
TRUE
;
}
else
if
(
res
==
STUN_USAGE_TURN_RETURN_ERROR
)
{
}
else
if
(
res
==
STUN_USAGE_TURN_RETURN_ERROR
)
{
int
code
=
-
1
;
int
code
=
-
1
;
uint8_t
*
sent_
nonce
=
NULL
;
uint8_t
*
sent_
realm
=
NULL
;
uint8_t
*
recv_
nonce
=
NULL
;
uint8_t
*
recv_
realm
=
NULL
;
uint16_t
sent_
nonce
_len
=
0
;
uint16_t
sent_
realm
_len
=
0
;
uint16_t
recv_
nonce
_len
=
0
;
uint16_t
recv_
realm
_len
=
0
;
sent_
nonce
=
(
uint8_t
*
)
stun_message_find
(
&
d
->
stun_message
,
sent_
realm
=
(
uint8_t
*
)
stun_message_find
(
&
d
->
stun_message
,
STUN_ATTRIBUTE_
NONCE
,
&
sent_nonce
_len
);
STUN_ATTRIBUTE_
REALM
,
&
sent_realm
_len
);
recv_
nonce
=
(
uint8_t
*
)
stun_message_find
(
resp
,
recv_
realm
=
(
uint8_t
*
)
stun_message_find
(
resp
,
STUN_ATTRIBUTE_
NONCE
,
&
recv_nonce
_len
);
STUN_ATTRIBUTE_
REALM
,
&
recv_realm
_len
);
/* check for unauthorized error response */
/* check for unauthorized error response */
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
&&
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_DRAFT19
&&
stun_message_get_class
(
resp
)
==
STUN_ERROR
&&
stun_message_get_class
(
resp
)
==
STUN_ERROR
&&
stun_message_find_error
(
resp
,
&
code
)
==
0
&&
stun_message_find_error
(
resp
,
&
code
)
==
0
&&
code
==
401
&&
recv_nonce
!=
NULL
&&
recv_realm
!=
NULL
&&
recv_realm_len
>
0
)
{
recv_nonce_len
>
0
)
{
if
(
recv_nonce_len
==
sent_nonce_len
&&
if
(
code
==
438
||
sent_nonce
!=
NULL
&&
(
code
==
401
&&
memcmp
(
sent_nonce
,
recv_nonce
,
sent_nonce_len
)
==
0
)
{
!
(
recv_realm_len
==
sent_realm_len
&&
/* case: a real unauthorized error */
sent_realm
!=
NULL
&&
d
->
stun_message
.
buffer
=
NULL
;
memcmp
(
sent_realm
,
recv_realm
,
sent_realm_len
)
==
0
)))
{
d
->
stun_message
.
buffer_len
=
0
;
d
->
done
=
TRUE
;
}
else
{
d
->
stun_resp_msg
=
*
resp
;
d
->
stun_resp_msg
=
*
resp
;
memcpy
(
d
->
stun_resp_buffer
,
resp
->
buffer
,
memcpy
(
d
->
stun_resp_buffer
,
resp
->
buffer
,
stun_message_length
(
resp
));
stun_message_length
(
resp
));
d
->
stun_resp_msg
.
buffer
=
d
->
stun_resp_buffer
;
d
->
stun_resp_msg
.
buffer
=
d
->
stun_resp_buffer
;
d
->
stun_resp_msg
.
buffer_len
=
sizeof
(
d
->
stun_resp_buffer
);
d
->
stun_resp_msg
.
buffer_len
=
sizeof
(
d
->
stun_resp_buffer
);
d
->
pending
=
FALSE
;
d
->
pending
=
FALSE
;
}
else
{
/* case: a real unauthorized error */
d
->
stun_message
.
buffer
=
NULL
;
d
->
stun_message
.
buffer_len
=
0
;
d
->
done
=
TRUE
;
}
}
}
else
{
}
else
{
/* case: STUN error, the check STUN context was freed */
/* case: STUN error, the check STUN context was freed */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment