summaryrefslogtreecommitdiff
path: root/include/ssl_key_handler.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-01-07 00:12:53 +0300
committerEd Tanous <ed@tanous.net>2022-01-12 22:00:37 +0300
commit543f44000a992870ff76e76888dd589a3a31ed4e (patch)
tree9e4363d871da1643f25856665585bb8c6e251aa3 /include/ssl_key_handler.hpp
parentd63c72ea488b808f5574e61585334a3ffb90c258 (diff)
downloadbmcweb-543f44000a992870ff76e76888dd589a3a31ed4e.tar.xz
Enable init checker
clang-tidy added cppcoreguidelines-init-variables as a check, which is something we already enforce to some extent, but getting CI to enforce it will help reviews move faster. Tested: Code compiles. Noop changes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7e10950de617b1d3262265572b1703f2e60b69d0
Diffstat (limited to 'include/ssl_key_handler.hpp')
-rw-r--r--include/ssl_key_handler.hpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp
index abb1c94917..eb59bee88a 100644
--- a/include/ssl_key_handler.hpp
+++ b/include/ssl_key_handler.hpp
@@ -256,8 +256,7 @@ inline void generateSslCertificate(const std::string& filepath,
{
std::cerr << "Generating x509 Certificate\n";
// Use this code to directly generate a certificate
- X509* x509;
- x509 = X509_new();
+ X509* x509 = X509_new();
if (x509 != nullptr)
{
// get a random number from the RNG for the certificate serial
@@ -280,8 +279,7 @@ inline void generateSslCertificate(const std::string& filepath,
X509_set_pubkey(x509, pPrivKey);
// get the subject name
- X509_NAME* name;
- name = X509_get_subject_name(x509);
+ X509_NAME* name = X509_get_subject_name(x509);
X509_NAME_add_entry_by_txt(
name, "C", MBSTRING_ASC,