diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-11-14 11:32:17 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-11-14 11:33:14 +0200 |
commit | b810d09fd6c98f8289dd5df2b213e77c8e0daf27 (patch) | |
tree | ce23faa22676c75fec5a6447c741a0fdb2925967 | |
parent | 68441fbc7505867098550cbf51f06be185ff2ac3 (diff) | |
download | gstreamer-plugins-bad-b810d09fd6c98f8289dd5df2b213e77c8e0daf27.tar.gz |
dtlscertificate: Fix error checking in RSA_generate_key_ex() usage
Was broken during the port for OpenSSL 1.1.
https://bugzilla.gnome.org/show_bug.cgi?id=774328
-rw-r--r-- | ext/dtls/gstdtlscertificate.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/dtls/gstdtlscertificate.c b/ext/dtls/gstdtlscertificate.c index c1c96020f..c2d9bb217 100644 --- a/ext/dtls/gstdtlscertificate.c +++ b/ext/dtls/gstdtlscertificate.c @@ -207,12 +207,13 @@ init_generated (GstDtlsCertificate * self) rsa = RSA_new (); if (rsa != NULL) { BIGNUM *e = BN_new (); - if (e != NULL && BN_set_word (e, RSA_F4) - && RSA_generate_key_ex (rsa, 2048, e, NULL)) { + if (e == NULL || !BN_set_word (e, RSA_F4) + || !RSA_generate_key_ex (rsa, 2048, e, NULL)) { RSA_free (rsa); rsa = NULL; } - BN_free (e); + if (e) + BN_free (e); } #endif |