diff options
author | Martin Szulecki | 2013-10-25 00:34:07 +0200 |
---|---|---|
committer | Martin Szulecki | 2013-10-25 00:34:07 +0200 |
commit | 2eaa56006670275faf691ae26679e14dde77e7ed (patch) | |
tree | 829685ff864f3c2089b2f7b52513a540e2ac8348 /common | |
parent | 8050de72b9910a923959e26cd5cc9e3181ae7761 (diff) | |
download | libimobiledevice-2eaa56006670275faf691ae26679e14dde77e7ed.tar.gz libimobiledevice-2eaa56006670275faf691ae26679e14dde77e7ed.tar.bz2 |
userpref: Use RSA_generate_key_ex() in favor of deprecated RSA_generate_key()
The RSA_generate_key function has been deprecated in OpenSSL
in favour of the newer function RSA_generate_key_ex.
RSA_generate_key_ex with its current interface has been
part of OpenSSL starting from version 0.9.8 (July 2005).
Diffstat (limited to 'common')
-rw-r--r-- | common/userpref.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/common/userpref.c b/common/userpref.c index e9b47dc..8af4cdf 100644 --- a/common/userpref.c +++ b/common/userpref.c @@ -690,8 +690,16 @@ static userpref_error_t userpref_device_record_gen_keys_and_cert(const char* udi debug_info("generating keys and certificates"); #ifdef HAVE_OPENSSL - RSA* root_keypair = RSA_generate_key(2048, 65537, NULL, NULL); - RSA* host_keypair = RSA_generate_key(2048, 65537, NULL, NULL); + BIGNUM *e = BN_new(); + RSA* root_keypair = RSA_new(); + RSA* host_keypair = RSA_new(); + + BN_set_word(e, 65537); + + RSA_generate_key_ex(root_keypair, 2048, e, NULL); + RSA_generate_key_ex(host_keypair, 2048, e, NULL); + + BN_free(e); EVP_PKEY* root_pkey = EVP_PKEY_new(); EVP_PKEY_assign_RSA(root_pkey, root_keypair); |