diff options
| -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); |
