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
e60ef6a5
Commit
e60ef6a5
authored
May 01, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Should fix key checking for gtalk compat
parent
fb73b847
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
18 deletions
+22
-18
agent/conncheck.c
agent/conncheck.c
+1
-1
agent/test-thread.c
agent/test-thread.c
+2
-2
stun/bind.c
stun/bind.c
+11
-9
stun/conncheck.h
stun/conncheck.h
+1
-1
stun/stun-ice.c
stun/stun-ice.c
+4
-2
stun/stun-ice.h
stun/stun-ice.h
+1
-1
stun/stunrecv.c
stun/stunrecv.c
+2
-2
No files found.
agent/conncheck.c
View file @
e60ef6a5
...
@@ -1058,7 +1058,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1058,7 +1058,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
&
sockaddr
,
sizeof
(
sockaddr
),
&
sockaddr
,
sizeof
(
sockaddr
),
uname
,
password
,
uname
,
password
,
cand_use
,
controlling
,
priority
,
cand_use
,
controlling
,
priority
,
agent
->
tie_breaker
);
agent
->
tie_breaker
,
agent
->
compatibility
);
timeout
=
stun_bind_timeout
(
pair
->
stun_ctx
);
timeout
=
stun_bind_timeout
(
pair
->
stun_ctx
);
/* note: convert from milli to microseconds for g_time_val_add() */
/* note: convert from milli to microseconds for g_time_val_add() */
...
...
agent/test-thread.c
View file @
e60ef6a5
...
@@ -201,8 +201,8 @@ int main (void)
...
@@ -201,8 +201,8 @@ int main (void)
nice_udp_bsd_socket_factory_init
(
&
udpfactory
);
nice_udp_bsd_socket_factory_init
(
&
udpfactory
);
/* step: create the agents L and R */
/* step: create the agents L and R */
lagent
=
nice_agent_new
(
&
udpfactory
,
lmainctx
,
NICE_COMPATIBILITY_
ID19
);
lagent
=
nice_agent_new
(
&
udpfactory
,
lmainctx
,
NICE_COMPATIBILITY_
GOOGLE
);
ragent
=
nice_agent_new
(
&
udpfactory
,
rmainctx
,
NICE_COMPATIBILITY_
ID19
);
ragent
=
nice_agent_new
(
&
udpfactory
,
rmainctx
,
NICE_COMPATIBILITY_
GOOGLE
);
g_object_set_data
(
G_OBJECT
(
lagent
),
"other-agent"
,
ragent
);
g_object_set_data
(
G_OBJECT
(
lagent
),
"other-agent"
,
ragent
);
g_object_set_data
(
G_OBJECT
(
ragent
),
"other-agent"
,
lagent
);
g_object_set_data
(
G_OBJECT
(
ragent
),
"other-agent"
,
lagent
);
...
...
stun/bind.c
View file @
e60ef6a5
...
@@ -262,7 +262,7 @@ stun_conncheck_start (stun_bind_t **restrict context, int fd,
...
@@ -262,7 +262,7 @@ stun_conncheck_start (stun_bind_t **restrict context, int fd,
const
struct
sockaddr
*
restrict
srv
,
socklen_t
srvlen
,
const
struct
sockaddr
*
restrict
srv
,
socklen_t
srvlen
,
const
char
*
username
,
const
char
*
password
,
const
char
*
username
,
const
char
*
password
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
uint64_t
tie
)
uint64_t
tie
,
uint32_t
compat
)
{
{
int
val
;
int
val
;
stun_bind_t
*
ctx
;
stun_bind_t
*
ctx
;
...
@@ -275,15 +275,17 @@ stun_conncheck_start (stun_bind_t **restrict context, int fd,
...
@@ -275,15 +275,17 @@ stun_conncheck_start (stun_bind_t **restrict context, int fd,
return
val
;
return
val
;
ctx
=
*
context
;
ctx
=
*
context
;
ctx
->
trans
.
key
.
length
=
strlen
(
password
);
if
(
compat
!=
1
)
{
ctx
->
trans
.
key
.
value
=
malloc
(
ctx
->
trans
.
key
.
length
);
ctx
->
trans
.
key
.
length
=
strlen
(
password
);
if
(
ctx
->
trans
.
key
.
value
==
NULL
)
ctx
->
trans
.
key
.
value
=
malloc
(
ctx
->
trans
.
key
.
length
);
{
if
(
ctx
->
trans
.
key
.
value
==
NULL
)
val
=
ENOMEM
;
{
goto
error
;
val
=
ENOMEM
;
}
goto
error
;
}
memcpy
(
ctx
->
trans
.
key
.
value
,
password
,
ctx
->
trans
.
key
.
length
);
memcpy
(
ctx
->
trans
.
key
.
value
,
password
,
ctx
->
trans
.
key
.
length
);
}
if
(
cand_use
)
if
(
cand_use
)
{
{
...
...
stun/conncheck.h
View file @
e60ef6a5
...
@@ -71,7 +71,7 @@ int stun_conncheck_start (stun_bind_t **restrict context, int fd,
...
@@ -71,7 +71,7 @@ int stun_conncheck_start (stun_bind_t **restrict context, int fd,
const
struct
sockaddr
*
restrict
srv
,
socklen_t
srvlen
,
const
struct
sockaddr
*
restrict
srv
,
socklen_t
srvlen
,
const
char
*
username
,
const
char
*
password
,
const
char
*
username
,
const
char
*
password
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
uint64_t
tie
);
uint64_t
tie
,
uint32_t
compat
);
/**
/**
* Tries to parse a STUN connectivity check (Binding request) and format a
* Tries to parse a STUN connectivity check (Binding request) and format a
...
...
stun/stun-ice.c
View file @
e60ef6a5
...
@@ -119,10 +119,12 @@ stun_conncheck_reply (uint8_t *restrict buf, size_t *restrict plen,
...
@@ -119,10 +119,12 @@ stun_conncheck_reply (uint8_t *restrict buf, size_t *restrict plen,
return
EPROTO
;
return
EPROTO
;
}
}
DBG
(
"compat = %d - username %d - pass %d
\n
"
,
compat
,
stun_present
(
msg
,
STUN_USERNAME
),
stun_present
(
msg
,
STUN_MESSAGE_INTEGRITY
));
/* Short term credentials checking */
/* Short term credentials checking */
val
=
0
;
val
=
0
;
if
(
!
stun_present
(
msg
,
STUN_
MESSAGE_INTEGRITY
)
if
(
!
stun_present
(
msg
,
STUN_
USERNAME
)
||
(
compat
!=
1
&&
!
stun_present
(
msg
,
STUN_
USERNAME
)))
||
(
compat
!=
1
&&
!
stun_present
(
msg
,
STUN_
MESSAGE_INTEGRITY
)))
{
{
DBG
(
" Missing USERNAME or MESSAGE-INTEGRITY.
\n
"
);
DBG
(
" Missing USERNAME or MESSAGE-INTEGRITY.
\n
"
);
val
=
STUN_BAD_REQUEST
;
val
=
STUN_BAD_REQUEST
;
...
...
stun/stun-ice.h
View file @
e60ef6a5
...
@@ -71,7 +71,7 @@ int stun_conncheck_start (stun_bind_t **restrict context, int fd,
...
@@ -71,7 +71,7 @@ int stun_conncheck_start (stun_bind_t **restrict context, int fd,
const
struct
sockaddr
*
restrict
srv
,
socklen_t
srvlen
,
const
struct
sockaddr
*
restrict
srv
,
socklen_t
srvlen
,
const
char
*
username
,
const
char
*
password
,
const
char
*
username
,
const
char
*
password
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
bool
cand_use
,
bool
controlling
,
uint32_t
priority
,
uint64_t
tie
);
uint64_t
tie
,
uint32_t
compat
);
/**
/**
* Tries to parse a STUN connectivity check (Binding request) and format a
* Tries to parse a STUN connectivity check (Binding request) and format a
...
...
stun/stunrecv.c
View file @
e60ef6a5
...
@@ -601,12 +601,12 @@ stun_match_answer (const uint8_t *msg, stun_method_t method,
...
@@ -601,12 +601,12 @@ stun_match_answer (const uint8_t *msg, stun_method_t method,
* currently ignore them. */
* currently ignore them. */
if
(
stun_verify_key
(
msg
,
key
,
keylen
)
!=
0
)
if
(
stun_verify_key
(
msg
,
key
,
keylen
)
!=
0
)
return
false
;
return
false
;
}
}
/*
else
else
{
{
if (stun_present (msg, STUN_MESSAGE_INTEGRITY))
if (stun_present (msg, STUN_MESSAGE_INTEGRITY))
return false;
return false;
}
}*/
return
true
;
return
true
;
}
}
...
...
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