diff options
author | Ed Tanous <ed.tanous@intel.com> | 2017-04-19 03:49:51 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2017-04-19 03:49:51 +0300 |
commit | 01250f2a144846b493cf5cf8f5311b1bf3fe6c19 (patch) | |
tree | 429f8011d5245f28c948e3ea346a6e7fd494f0ca /include/ssl_key_handler.hpp | |
parent | b078cf37df19e1e2610c07002a63562e0e24edb4 (diff) | |
download | bmcweb-01250f2a144846b493cf5cf8f5311b1bf3fe6c19.tar.xz |
incremental
Diffstat (limited to 'include/ssl_key_handler.hpp')
-rw-r--r-- | include/ssl_key_handler.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp index 1c3e8f4bad..eef4d55011 100644 --- a/include/ssl_key_handler.hpp +++ b/include/ssl_key_handler.hpp @@ -1,4 +1,5 @@ #pragma once +#ifdef CROW_ENABLE_SSL #include <openssl/bio.h> #include <openssl/dh.h> @@ -191,7 +192,7 @@ EVP_PKEY *create_ec_key(void) { if (myecc) { EC_KEY_set_asn1_flag(myecc, OPENSSL_EC_NAMED_CURVE); EC_KEY_generate_key(myecc); - EVP_PKEY *pKey = EVP_PKEY_new(); + pKey = EVP_PKEY_new(); if (pKey) { if (EVP_PKEY_assign_EC_KEY(pKey, myecc)) { /* pKey owns pRSA from now */ @@ -199,11 +200,7 @@ EVP_PKEY *create_ec_key(void) { fprintf(stderr, "EC_check_key failed.\n"); } } - EVP_PKEY_free(pKey); - pKey = NULL; } - EC_KEY_free(myecc); - myecc = NULL; } return pKey; } @@ -314,4 +311,6 @@ boost::asio::ssl::context get_ssl_context(std::string ssl_pem_file) { } return m_ssl_context; } -}
\ No newline at end of file +} + +#endif
\ No newline at end of file |