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
62d13ca1
Commit
62d13ca1
authored
Aug 06, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not fail, but do not send message integrity if no realm/username in the current request
parent
e4e742bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
21 deletions
+28
-21
stun/stunagent.c
stun/stunagent.c
+28
-21
No files found.
stun/stunagent.c
View file @
62d13ca1
...
@@ -434,6 +434,7 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
...
@@ -434,6 +434,7 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
uint32_t
fpr
;
uint32_t
fpr
;
int
i
;
int
i
;
stun_transid_t
id
;
stun_transid_t
id
;
uint8_t
md5
[
16
];
if
(
msg
->
key
!=
NULL
)
{
if
(
msg
->
key
!=
NULL
)
{
key
=
msg
->
key
;
key
=
msg
->
key
;
...
@@ -441,28 +442,34 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
...
@@ -441,28 +442,34 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
}
}
if
(
key
!=
NULL
)
{
if
(
key
!=
NULL
)
{
ptr
=
stun_message_append
(
msg
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
20
);
bool
skip
=
FALSE
;
if
(
ptr
==
NULL
)
{
return
0
;
}
if
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
)
{
if
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
)
{
uint8_t
*
realm
=
NULL
;
uint8_t
*
realm
=
NULL
;
uint8_t
*
username
=
NULL
;
uint8_t
*
username
=
NULL
;
uint16_t
realm_len
;
uint16_t
realm_len
;
uint16_t
username_len
;
uint16_t
username_len
;
uint8_t
md5
[
16
];
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
,
username
=
(
uint8_t
*
)
stun_message_find
(
msg
,
STUN_ATTRIBUTE_USERNAME
,
&
username_len
);
STUN_ATTRIBUTE_USERNAME
,
&
username_len
);
if
(
username
==
NULL
||
realm
==
NULL
)
{
if
(
username
==
NULL
||
realm
==
NULL
)
{
return
0
;
skip
=
TRUE
;
}
}
else
{
stun_hash_creds
(
realm
,
realm_len
,
stun_hash_creds
(
realm
,
realm_len
,
username
,
username_len
,
username
,
username_len
,
key
,
key_len
,
md5
);
key
,
key_len
,
md5
);
}
}
/* If no realm/username and long term credentials,
then don't send the message integrity */
if
(
skip
==
FALSE
)
{
ptr
=
stun_message_append
(
msg
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
20
);
if
(
ptr
==
NULL
)
{
return
0
;
}
if
(
agent
->
usage_flags
&
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
)
{
stun_sha1
(
msg
->
buffer
,
stun_message_length
(
msg
),
ptr
,
md5
,
sizeof
(
md5
),
stun_sha1
(
msg
->
buffer
,
stun_message_length
(
msg
),
ptr
,
md5
,
sizeof
(
md5
),
agent
->
compatibility
==
STUN_COMPATIBILITY_RFC3489
?
TRUE
:
FALSE
);
agent
->
compatibility
==
STUN_COMPATIBILITY_RFC3489
?
TRUE
:
FALSE
);
}
else
{
}
else
{
...
@@ -476,7 +483,7 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
...
@@ -476,7 +483,7 @@ size_t stun_agent_finish_message (StunAgent *agent, StunMessage *msg,
stun_debug
(
"
\n
sent : "
);
stun_debug
(
"
\n
sent : "
);
stun_debug_bytes
(
ptr
,
20
);
stun_debug_bytes
(
ptr
,
20
);
stun_debug
(
"
\n
"
);
stun_debug
(
"
\n
"
);
}
}
}
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_3489BIS
&&
if
(
agent
->
compatibility
==
STUN_COMPATIBILITY_3489BIS
&&
...
...
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