Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
0508faaa
Commit
0508faaa
authored
May 28, 2015
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmpdh: Pass the actual buffer size of the output secret key
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
9f1b3050
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
rtmpcrypt.c
libavformat/rtmpcrypt.c
+1
-1
rtmpdh.c
libavformat/rtmpdh.c
+3
-2
rtmpdh.h
libavformat/rtmpdh.h
+4
-2
No files found.
libavformat/rtmpcrypt.c
View file @
0508faaa
...
...
@@ -163,7 +163,7 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata,
/* compute the shared secret secret in order to compute RC4 keys */
if
((
ret
=
ff_dh_compute_shared_secret_key
(
rt
->
dh
,
serverdata
+
server_pos
,
128
,
secret_key
))
<
0
)
128
,
secret_key
,
sizeof
(
secret_key
)
))
<
0
)
return
ret
;
/* set output key */
...
...
libavformat/rtmpdh.c
View file @
0508faaa
...
...
@@ -313,7 +313,8 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len)
}
int
ff_dh_compute_shared_secret_key
(
FF_DH
*
dh
,
const
uint8_t
*
pub_key
,
int
pub_key_len
,
uint8_t
*
secret_key
)
int
pub_key_len
,
uint8_t
*
secret_key
,
int
secret_key_len
)
{
FFBigNum
q1
=
NULL
,
pub_key_bn
=
NULL
;
int
ret
;
...
...
@@ -333,7 +334,7 @@ int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
/* when the public key is valid we have to compute the shared secret key */
if
((
ret
=
dh_is_valid_public_key
(
pub_key_bn
,
dh
->
p
,
q1
))
<
0
)
{
goto
fail
;
}
else
if
((
ret
=
dh_compute_key
(
dh
,
pub_key_bn
,
pub
_key_len
,
}
else
if
((
ret
=
dh_compute_key
(
dh
,
pub_key_bn
,
secret
_key_len
,
secret_key
))
<
0
)
{
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
...
...
libavformat/rtmpdh.h
View file @
0508faaa
...
...
@@ -92,11 +92,13 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len);
*
* @param dh a Diffie-Hellmann context, containing the private key
* @param pub_key the buffer containing the public key
* @param pub_key_len the length of the buffer
* @param pub_key_len the length of the
public key
buffer
* @param secret_key the buffer where the secret key is written
* @param secret_key_len the length of the secret key buffer
* @return length of the shared secret key on success, negative value otherwise
*/
int
ff_dh_compute_shared_secret_key
(
FF_DH
*
dh
,
const
uint8_t
*
pub_key
,
int
pub_key_len
,
uint8_t
*
secret_key
);
int
pub_key_len
,
uint8_t
*
secret_key
,
int
secret_key_len
);
#endif
/* AVFORMAT_RTMPDH_H */
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