Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
77caf604
Commit
77caf604
authored
Sep 30, 2009
by
Quanah Gibson-Mount
Browse files
On OpenSSL 0.9.8 and newer, use RSA_generate_key_ex since RSA_generate_key is deprecated
parent
f186dfea
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap/tls_o.c
View file @
77caf604
...
...
@@ -1066,10 +1066,25 @@ static RSA *
tlso_tmp_rsa_cb
(
SSL
*
ssl
,
int
is_export
,
int
key_length
)
{
RSA
*
tmp_rsa
;
/* FIXME: Pregenerate the key on startup */
/* FIXME: Who frees the key? */
#if OPENSSL_VERSION_NUMBER > 0x00908000
BIGNUM
*
bn
=
BN_new
();
if
(
bn
)
{
if
(
BN_set_word
(
bn
,
RSA_F4
))
{
tmp_rsa
=
RSA_new
();
if
(
tmp_rsa
&&
!
RSA_generate_key_ex
(
tmp_rsa
,
key_length
,
bn
,
NULL
))
{
RSA_free
(
tmp_rsa
);
tmp_rsa
=
NULL
;
}
}
BN_free
(
bn
);
}
else
{
tmp_rsa
=
NULL
;
}
#else
tmp_rsa
=
RSA_generate_key
(
key_length
,
RSA_F4
,
NULL
,
NULL
);
#endif
if
(
!
tmp_rsa
)
{
Debug
(
LDAP_DEBUG_ANY
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment