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
c129b05a
Commit
c129b05a
authored
Feb 07, 2016
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stun turn usage: Only send the username if short term creds or nonce present
This is recommended by the STUN RFC 5389.
parent
501f9a82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
stun/usages/turn.c
stun/usages/turn.c
+9
-3
No files found.
stun/usages/turn.c
View file @
c129b05a
...
...
@@ -152,7 +152,9 @@ size_t stun_usage_turn_create (StunAgent *agent, StunMessage *msg,
}
}
if
(
username
!=
NULL
&&
username_len
>
0
)
{
if
(
username
!=
NULL
&&
username_len
>
0
&&
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
||
previous_response
))
{
if
(
stun_message_append_bytes
(
msg
,
STUN_ATTRIBUTE_USERNAME
,
username
,
username_len
)
!=
STUN_MESSAGE_RETURN_SUCCESS
)
return
0
;
...
...
@@ -205,7 +207,9 @@ size_t stun_usage_turn_create_refresh (StunAgent *agent, StunMessage *msg,
}
if
(
username
!=
NULL
&&
username_len
>
0
)
{
if
(
username
!=
NULL
&&
username_len
>
0
&&
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
||
previous_response
))
{
if
(
stun_message_append_bytes
(
msg
,
STUN_ATTRIBUTE_USERNAME
,
username
,
username_len
)
!=
STUN_MESSAGE_RETURN_SUCCESS
)
return
0
;
...
...
@@ -251,7 +255,9 @@ size_t stun_usage_turn_create_permission (StunAgent *agent, StunMessage *msg,
}
/* username */
if
(
username
!=
NULL
)
{
if
(
username
!=
NULL
&&
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
||
(
nonce
!=
NULL
&&
realm
!=
NULL
)))
{
if
(
stun_message_append_bytes
(
msg
,
STUN_ATTRIBUTE_USERNAME
,
username
,
username_len
)
!=
STUN_MESSAGE_RETURN_SUCCESS
)
return
0
;
...
...
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