diff options
| author | 2013-10-25 00:34:07 +0200 | |
|---|---|---|
| committer | 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 | |||
| 690 | 690 | ||
| 691 | debug_info("generating keys and certificates"); | 691 | debug_info("generating keys and certificates"); |
| 692 | #ifdef HAVE_OPENSSL | 692 | #ifdef HAVE_OPENSSL |
| 693 | RSA* root_keypair = RSA_generate_key(2048, 65537, NULL, NULL); | 693 | BIGNUM *e = BN_new(); |
| 694 | RSA* host_keypair = RSA_generate_key(2048, 65537, NULL, NULL); | 694 | RSA* root_keypair = RSA_new(); |
| 695 | RSA* host_keypair = RSA_new(); | ||
| 696 | |||
| 697 | BN_set_word(e, 65537); | ||
| 698 | |||
| 699 | RSA_generate_key_ex(root_keypair, 2048, e, NULL); | ||
| 700 | RSA_generate_key_ex(host_keypair, 2048, e, NULL); | ||
| 701 | |||
| 702 | BN_free(e); | ||
| 695 | 703 | ||
| 696 | EVP_PKEY* root_pkey = EVP_PKEY_new(); | 704 | EVP_PKEY* root_pkey = EVP_PKEY_new(); |
| 697 | EVP_PKEY_assign_RSA(root_pkey, root_keypair); | 705 | EVP_PKEY_assign_RSA(root_pkey, root_keypair); |
