diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-11-14 11:32:17 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-11-14 09:50:49 +0000 |
commit | 498bfd569c921aca4a04b00a80e67fa6513f8877 (patch) | |
tree | c7d6eb41825b20b726f94a425cb0940f2be31491 | |
parent | 6ac07f44a1b579016df6174e7ae20c552e468b64 (diff) | |
download | gstreamer-plugins-bad-498bfd569c921aca4a04b00a80e67fa6513f8877.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 |