Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
libnice
libnice
Commits
bd0a4742
Commit
bd0a4742
authored
Oct 04, 2008
by
Youness Alaoui
Browse files
generate proper gtalk user/pass per candidate
parent
3a725145
Changes
1
Show whitespace changes
Inline
Side-by-side
agent/discovery.c
View file @
bd0a4742
...
...
@@ -229,7 +229,8 @@ static void priv_assign_foundation (NiceAgent *agent, NiceCandidate *candidate)
}
static
void
priv_generate_msn_credentials
(
NiceAgent
*
agent
,
NiceCandidate
*
candidate
)
void
priv_generate_candidate_credentials
(
NiceAgent
*
agent
,
NiceCandidate
*
candidate
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
...
...
@@ -247,6 +248,19 @@ void priv_generate_msn_credentials (NiceAgent *agent, NiceCandidate *candidate)
candidate
->
username
=
g_base64_encode
(
username
,
32
);
candidate
->
password
=
g_base64_encode
(
password
,
16
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
gchar
username
[
16
];
if
(
candidate
->
username
)
g_free
(
candidate
->
username
);
if
(
candidate
->
password
)
g_free
(
candidate
->
password
);
candidate
->
password
=
NULL
;
nice_rng_generate_bytes_print
(
agent
->
rng
,
16
,
(
gchar
*
)
username
);
candidate
->
username
=
g_strdup
(
username
);
}
...
...
@@ -289,7 +303,7 @@ NiceCandidate *discovery_add_local_host_candidate (
candidate
->
priority
=
nice_candidate_ice_priority
(
candidate
);
}
priv_generate_
msn
_credentials
(
agent
,
candidate
);
priv_generate_
candidate
_credentials
(
agent
,
candidate
);
priv_assign_foundation
(
agent
,
candidate
);
/* note: candidate username and password are left NULL as stream
...
...
@@ -379,7 +393,7 @@ discovery_add_server_reflexive_candidate (
candidate
->
sockptr
=
base_socket
;
candidate
->
base_addr
=
base_socket
->
addr
;
priv_generate_
msn
_credentials
(
agent
,
candidate
);
priv_generate_
candidate
_credentials
(
agent
,
candidate
);
priv_assign_foundation
(
agent
,
candidate
);
result
=
priv_add_local_candidate_pruned
(
component
,
candidate
);
...
...
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