summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-29 11:31:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-29 11:31:43 +0200
commitbeecbe13a2ea49280554a7178bebc525e538b4e7 (patch)
tree1acc5f437016f45b69c3eea9a87ab9baf2576ecb
parent4c0b30b07a81727561cafc171a1d0182a5975a48 (diff)
parent9f1b3050d9e31e9283d818f3640f3460ac8cfb5b (diff)
Merge commit '9f1b3050d9e31e9283d818f3640f3460ac8cfb5b'
* commit '9f1b3050d9e31e9283d818f3640f3460ac8cfb5b': rtmpdh: Check the output buffer size in the openssl version of dh_compute_key Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/rtmpdh.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index 5f5c044c85..894b7d5ccd 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)
{