aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2015-05-28 10:08:27 +0300
committerMartin Storsjö <martin@martin.st>2015-05-29 09:42:30 +0300
commit9f1b3050d9e31e9283d818f3640f3460ac8cfb5b (patch)
treeff4ece2948199ed5cfff5e682a01f8d04879b3a4 /libavformat
parent127d813bcb5705202b7100cf1eccd1e26d72ba14 (diff)
downloadffmpeg-9f1b3050d9e31e9283d818f3640f3460ac8cfb5b.tar.gz
rtmpdh: Check the output buffer size in the openssl version of dh_compute_key
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtmpdh.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index bd9813d600..80cced9312 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -189,7 +189,14 @@ void ff_dh_free(FF_DH *dh)
#define dh_new() DH_new()
#define dh_generate_key(dh) DH_generate_key(dh)
-#define dh_compute_key(dh, pub, len, secret) DH_compute_key(secret, pub, dh)
+
+static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
+ uint32_t secret_key_len, uint8_t *secret_key)
+{
+ if (secret_key_len < DH_size(dh))
+ return AVERROR(EINVAL);
+ return DH_compute_key(secret_key, pub_key_bn, dh);
+}
void ff_dh_free(FF_DH *dh)
{