summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-10-24 11:12:47 -0700
committerJames Feist <james.feist@linux.intel.com>2019-11-11 20:33:48 +0000
commit99131cd04bfc4a187e7a8d63803cb8911e64a08e (patch)
treec85b64c16b541561965f014d6e850279da04d3db /include
parenta9cbc9cd3c957996831d731ad50c69f920ab065b (diff)
downloadbmcweb-99131cd04bfc4a187e7a8d63803cb8911e64a08e.tar.gz
bmcweb-99131cd04bfc4a187e7a8d63803cb8911e64a08e.zip
Replace all uses of NULL with nullptr
This was an automatic change made by clang-tidy. It moves all uses of NULL to nullptr, which are equivalent, but nullptr is prefered. Tested: Code compiles. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I9526599b222693c9723a69934b599c7a5b5d1fbf
Diffstat (limited to 'include')
-rw-r--r--include/openbmc_dbus_rest.hpp2
-rw-r--r--include/pam_authenticate.hpp4
-rw-r--r--include/ssl_key_handler.hpp20
3 files changed, 13 insertions, 13 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index c8673d1..73986b9 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -1071,7 +1071,7 @@ int readStructFromMessage(const std::string &typeCode,
int readVariantFromMessage(sdbusplus::message::message &m, nlohmann::json &data)
{
const char *containerType;
- int r = sd_bus_message_peek_type(m.get(), NULL, &containerType);
+ int r = sd_bus_message_peek_type(m.get(), nullptr, &containerType);
if (r < 0)
{
BMCWEB_LOG_ERROR << "sd_bus_message_peek_type failed";
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp
index 464f171..5d78efc 100644
--- a/include/pam_authenticate.hpp
+++ b/include/pam_authenticate.hpp
@@ -54,7 +54,7 @@ inline bool pamAuthenticateUser(const std::string_view username,
std::string passStr(password);
const struct pam_conv localConversation = {
pamFunctionConversation, const_cast<char*>(passStr.c_str())};
- pam_handle_t* localAuthHandle = NULL; // this gets set by pam_start
+ pam_handle_t* localAuthHandle = nullptr; // this gets set by pam_start
if (pam_start("webserver", userStr.c_str(), &localConversation,
&localAuthHandle) != PAM_SUCCESS)
@@ -91,7 +91,7 @@ inline int pamUpdatePassword(const std::string& username,
{
const struct pam_conv localConversation = {
pamFunctionConversation, const_cast<char*>(password.c_str())};
- pam_handle_t* localAuthHandle = NULL; // this gets set by pam_start
+ pam_handle_t* localAuthHandle = nullptr; // this gets set by pam_start
int retval = pam_start("passwd", username.c_str(), &localConversation,
&localAuthHandle);
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp
index 2bd1f59..84aa097 100644
--- a/include/ssl_key_handler.hpp
+++ b/include/ssl_key_handler.hpp
@@ -56,7 +56,7 @@ inline bool validateCertificate(X509 *const cert)
return false;
}
- int errCode = X509_STORE_CTX_init(storeCtx, x509Store, cert, NULL);
+ int errCode = X509_STORE_CTX_init(storeCtx, x509Store, cert, nullptr);
if (errCode != 1)
{
BMCWEB_LOG_ERROR << "Error occured during X509_STORE_CTX_init call";
@@ -107,9 +107,9 @@ inline bool verifyOpensslKeyCert(const std::string &filepath)
std::cout << "Checking certs in file " << filepath << "\n";
FILE *file = fopen(filepath.c_str(), "r");
- if (file != NULL)
+ if (file != nullptr)
{
- EVP_PKEY *pkey = PEM_read_PrivateKey(file, NULL, NULL, NULL);
+ EVP_PKEY *pkey = PEM_read_PrivateKey(file, nullptr, nullptr, nullptr);
if (pkey != nullptr)
{
RSA *rsa = EVP_PKEY_get1_RSA(pkey);
@@ -154,7 +154,7 @@ inline bool verifyOpensslKeyCert(const std::string &filepath)
// key order issue.
fseek(file, 0, SEEK_SET);
- X509 *x509 = PEM_read_X509(file, NULL, NULL, NULL);
+ X509 *x509 = PEM_read_X509(file, nullptr, nullptr, nullptr);
if (x509 == nullptr)
{
std::cout << "error getting x509 cert " << ERR_get_error()
@@ -176,7 +176,7 @@ inline bool verifyOpensslKeyCert(const std::string &filepath)
inline void generateSslCertificate(const std::string &filepath)
{
- FILE *pFile = NULL;
+ FILE *pFile = nullptr;
std::cout << "Generating new keys\n";
initOpenssl();
@@ -233,19 +233,19 @@ inline void generateSslCertificate(const std::string &filepath)
if (pFile != nullptr)
{
- PEM_write_PrivateKey(pFile, pRsaPrivKey, NULL, NULL, 0, 0,
- NULL);
+ PEM_write_PrivateKey(pFile, pRsaPrivKey, nullptr, nullptr, 0,
+ nullptr, nullptr);
PEM_write_X509(pFile, x509);
fclose(pFile);
- pFile = NULL;
+ pFile = nullptr;
}
X509_free(x509);
}
EVP_PKEY_free(pRsaPrivKey);
- pRsaPrivKey = NULL;
+ pRsaPrivKey = nullptr;
}
// cleanup_openssl();
@@ -253,7 +253,7 @@ inline void generateSslCertificate(const std::string &filepath)
EVP_PKEY *createEcKey()
{
- EVP_PKEY *pKey = NULL;
+ EVP_PKEY *pKey = nullptr;
int eccgrp = 0;
eccgrp = OBJ_txt2nid("prime256v1");
OpenPOWER on IntegriCloud