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
This commit is contained in:
Sebastian Dröge 2016-11-14 11:32:17 +02:00
parent 83d8f1eb20
commit 3a069193e2

View file

@ -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