From 0508faaa11bf7507ffdd655aee57c9dc5a8203f4 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Thu, 28 May 2015 10:11:27 +0300 Subject: rtmpdh: Pass the actual buffer size of the output secret key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtmpdh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavformat/rtmpdh.c') diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c index 80cced9312..f328e68fbf 100644 --- a/libavformat/rtmpdh.c +++ b/libavformat/rtmpdh.c @@ -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; -- cgit v1.2.3