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
9d1c0b18
Commit
9d1c0b18
authored
Jan 30, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Porting the stun agent to use the new StunMessageReturn API
parent
b9835c16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
stun/stunagent.c
stun/stunagent.c
+10
-6
No files found.
stun/stunagent.c
View file @
9d1c0b18
...
...
@@ -138,7 +138,8 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_RFC5389
&&
agent
->
usage_flags
&
STUN_AGENT_USAGE_USE_FINGERPRINT
)
{
/* Looks for FINGERPRINT */
if
(
stun_message_find32
(
msg
,
STUN_ATTRIBUTE_FINGERPRINT
,
&
fpr
)
!=
0
)
{
if
(
stun_message_find32
(
msg
,
STUN_ATTRIBUTE_FINGERPRINT
,
&
fpr
)
!=
STUN_MESSAGE_RETURN_SUCCESS
)
{
stun_debug
(
"STUN demux error: no FINGERPRINT attribute!
\n
"
);
return
STUN_VALIDATION_BAD_REQUEST
;
}
...
...
@@ -180,7 +181,8 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
ignore_credentials
=
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_IGNORE_CREDENTIALS
)
||
(
stun_message_get_class
(
msg
)
==
STUN_ERROR
&&
stun_message_find_error
(
msg
,
&
error_code
)
==
0
&&
stun_message_find_error
(
msg
,
&
error_code
)
==
STUN_MESSAGE_RETURN_SUCCESS
&&
(
error_code
==
400
||
error_code
==
401
))
||
(
stun_message_get_class
(
msg
)
==
STUN_INDICATION
&&
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_NO_INDICATION_AUTH
));
...
...
@@ -273,7 +275,8 @@ StunValidationStatus stun_agent_validate (StunAgent *agent, StunMessage *msg,
msg
->
key
=
key
;
msg
->
key_len
=
key_len
;
}
else
if
(
!
(
stun_message_get_class
(
msg
)
==
STUN_ERROR
&&
stun_message_find_error
(
msg
,
&
error_code
)
==
0
&&
stun_message_find_error
(
msg
,
&
error_code
)
==
STUN_MESSAGE_RETURN_SUCCESS
&&
(
error_code
==
400
||
error_code
==
401
)))
{
stun_debug
(
"STUN auth error: No message integrity attribute!
\n
"
);
return
STUN_VALIDATION_UNAUTHORIZED
;
...
...
@@ -414,7 +417,7 @@ bool stun_agent_init_error (StunAgent *agent, StunMessage *msg,
agent
->
usage_flags
&
STUN_AGENT_USAGE_ADD_SOFTWARE
)
{
stun_message_append_software
(
msg
);
}
if
(
stun_message_append_error
(
msg
,
err
)
==
0
)
{
if
(
stun_message_append_error
(
msg
,
err
)
==
STUN_MESSAGE_RETURN_SUCCESS
)
{
return
TRUE
;
}
}
...
...
@@ -444,7 +447,7 @@ size_t stun_agent_build_unknown_attributes_error (StunAgent *agent,
ids
[
counter
++
]
=
ids
[
0
];
if
(
stun_message_append_bytes
(
msg
,
STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES
,
ids
,
counter
*
2
)
==
0
)
{
ids
,
counter
*
2
)
==
STUN_MESSAGE_RETURN_SUCCESS
)
{
return
stun_agent_finish_message
(
agent
,
msg
,
request
->
key
,
request
->
key_len
);
}
...
...
@@ -477,7 +480,8 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
uint16_t
realm_len
;
uint16_t
username_len
;
realm
=
(
uint8_t
*
)
stun_message_find
(
msg
,
STUN_ATTRIBUTE_REALM
,
&
realm_len
);
realm
=
(
uint8_t
*
)
stun_message_find
(
msg
,
STUN_ATTRIBUTE_REALM
,
&
realm_len
);
username
=
(
uint8_t
*
)
stun_message_find
(
msg
,
STUN_ATTRIBUTE_USERNAME
,
&
username_len
);
if
(
username
==
NULL
||
realm
==
NULL
)
{
...
...
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