Fix typos

After this change:
```
codespell --builtin clear,rare,en-GB_to_en-US -d --count --skip
"./subprojects/*,./.git" .
0
```

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I7bc4c94facdd366dea91e456e7ef8a0b05532b99
diff --git a/certificate.cpp b/certificate.cpp
index de01f4c..0e19141 100644
--- a/certificate.cpp
+++ b/certificate.cpp
@@ -94,7 +94,7 @@
     if (filePath == NULL)
     {
         log<level::ERR>(
-            "Error occured while creating random certificate file path",
+            "Error occurred while creating random certificate file path",
             entry("DIR=%s", directoryPath.c_str()));
         elog<InternalFailure>();
     }
@@ -258,7 +258,7 @@
     X509_STORE_Ptr x509Store(X509_STORE_new(), &X509_STORE_free);
     if (!x509Store)
     {
-        log<level::ERR>("Error occured during X509_STORE_new call");
+        log<level::ERR>("Error occurred during X509_STORE_new call");
         elog<InternalFailure>();
     }
 
@@ -270,7 +270,7 @@
 
     if (!lookup)
     {
-        log<level::ERR>("Error occured during X509_STORE_add_lookup call");
+        log<level::ERR>("Error occurred during X509_STORE_add_lookup call");
         elog<InternalFailure>();
     }
     // Load Certificate file.
@@ -278,17 +278,17 @@
                                     X509_FILETYPE_PEM);
     if (errCode != 1)
     {
-        log<level::ERR>("Error occured during X509_LOOKUP_load_file call",
+        log<level::ERR>("Error occurred during X509_LOOKUP_load_file call",
                         entry("FILE=%s", certSrcFilePath.c_str()));
         elog<InvalidCertificate>(Reason("Invalid certificate file format"));
     }
 
-    // Load Certificate file into the X509 structre.
+    // Load Certificate file into the X509 structure.
     X509_Ptr cert = loadCert(certSrcFilePath);
     X509_STORE_CTX_Ptr storeCtx(X509_STORE_CTX_new(), ::X509_STORE_CTX_free);
     if (!storeCtx)
     {
-        log<level::ERR>("Error occured during X509_STORE_CTX_new call",
+        log<level::ERR>("Error occurred during X509_STORE_CTX_new call",
                         entry("FILE=%s", certSrcFilePath.c_str()));
         elog<InternalFailure>();
     }
@@ -297,7 +297,7 @@
         X509_STORE_CTX_init(storeCtx.get(), x509Store.get(), cert.get(), NULL);
     if (errCode != 1)
     {
-        log<level::ERR>("Error occured during X509_STORE_CTX_init call",
+        log<level::ERR>("Error occurred during X509_STORE_CTX_init call",
                         entry("FILE=%s", certSrcFilePath.c_str()));
         elog<InternalFailure>();
     }
@@ -317,7 +317,7 @@
     {
         errCode = X509_STORE_CTX_get_error(storeCtx.get());
         log<level::INFO>(
-            "Error occured during X509_verify_cert call, checking for known "
+            "Error occurred during X509_verify_cert call, checking for known "
             "error",
             entry("FILE=%s", certSrcFilePath.c_str()),
             entry("ERRCODE=%d", errCode),
@@ -325,7 +325,7 @@
     }
     else
     {
-        log<level::ERR>("Error occured during X509_verify_cert call",
+        log<level::ERR>("Error occurred during X509_verify_cert call",
                         entry("FILE=%s", certSrcFilePath.c_str()));
         elog<InternalFailure>();
     }
@@ -341,7 +341,7 @@
             log<level::ERR>("Expired certificate ");
             elog<InvalidCertificate>(Reason("Expired Certificate"));
         }
-        // Loging general error here.
+        // Logging general error here.
         log<level::ERR>(
             "Certificate validation failed", entry("ERRCODE=%d", errCode),
             entry("ERROR_STR=%s", X509_verify_cert_error_string(errCode)));
@@ -506,7 +506,7 @@
     static const int maxKeySize = 4096;
     char subBuffer[maxKeySize] = {0};
     BIO_MEM_Ptr subBio(BIO_new(BIO_s_mem()), BIO_free);
-    // This pointer cannot be freed independantly.
+    // This pointer cannot be freed independently.
     X509_NAME* sub = X509_get_subject_name(cert.get());
     X509_NAME_print_ex(subBio.get(), sub, 0, XN_FLAG_SEP_COMMA_PLUS);
     BIO_read(subBio.get(), subBuffer, maxKeySize);
@@ -514,7 +514,7 @@
 
     char issuerBuffer[maxKeySize] = {0};
     BIO_MEM_Ptr issuerBio(BIO_new(BIO_s_mem()), BIO_free);
-    // This pointer cannot be freed independantly.
+    // This pointer cannot be freed independently.
     X509_NAME* issuer_name = X509_get_issuer_name(cert.get());
     X509_NAME_print_ex(issuerBio.get(), issuer_name, 0, XN_FLAG_SEP_COMMA_PLUS);
     BIO_read(issuerBio.get(), issuerBuffer, maxKeySize);
@@ -576,7 +576,7 @@
     X509_Ptr cert(X509_new(), ::X509_free);
     if (!cert)
     {
-        log<level::ERR>("Error occured during X509_new call",
+        log<level::ERR>("Error occurred during X509_new call",
                         entry("FILE=%s", filePath.c_str()),
                         entry("ERRCODE=%lu", ERR_get_error()));
         elog<InternalFailure>();
@@ -585,7 +585,7 @@
     BIO_MEM_Ptr bioCert(BIO_new_file(filePath.c_str(), "rb"), ::BIO_free);
     if (!bioCert)
     {
-        log<level::ERR>("Error occured during BIO_new_file call",
+        log<level::ERR>("Error occurred during BIO_new_file call",
                         entry("FILE=%s", filePath.c_str()));
         elog<InternalFailure>();
     }
@@ -593,7 +593,7 @@
     X509* x509 = cert.get();
     if (!PEM_read_bio_X509(bioCert.get(), &x509, nullptr, nullptr))
     {
-        log<level::ERR>("Error occured during PEM_read_bio_X509 call",
+        log<level::ERR>("Error occurred during PEM_read_bio_X509 call",
                         entry("FILE=%s", filePath.c_str()));
         elog<InternalFailure>();
     }
@@ -605,7 +605,7 @@
     BIO_MEM_Ptr keyBio(BIO_new(BIO_s_file()), ::BIO_free);
     if (!keyBio)
     {
-        log<level::ERR>("Error occured during BIO_s_file call",
+        log<level::ERR>("Error occurred during BIO_s_file call",
                         entry("FILE=%s", filePath.c_str()));
         elog<InternalFailure>();
     }
@@ -662,7 +662,7 @@
     X509_Ptr cert(X509_new(), ::X509_free);
     if (!cert)
     {
-        log<level::ERR>("Error occured during X509_new call",
+        log<level::ERR>("Error occurred during X509_new call",
                         entry("FILE=%s", filePath.c_str()),
                         entry("ERRCODE=%lu", ERR_get_error()));
         elog<InternalFailure>();
@@ -671,7 +671,7 @@
     BIO_MEM_Ptr bioCert(BIO_new_file(filePath.c_str(), "rb"), ::BIO_free);
     if (!bioCert)
     {
-        log<level::ERR>("Error occured during BIO_new_file call",
+        log<level::ERR>("Error occurred during BIO_new_file call",
                         entry("FILE=%s", filePath.c_str()));
         elog<InternalFailure>();
     }
@@ -691,7 +691,7 @@
     BIO_MEM_Ptr keyBio(BIO_new(BIO_s_file()), ::BIO_free);
     if (!keyBio)
     {
-        log<level::ERR>("Error occured during BIO_s_file call",
+        log<level::ERR>("Error occurred during BIO_s_file call",
                         entry("FILE=%s", filePath.c_str()));
         elog<InternalFailure>();
     }
diff --git a/certificate.hpp b/certificate.hpp
index 27ac488..3ea78a5 100644
--- a/certificate.hpp
+++ b/certificate.hpp
@@ -50,7 +50,7 @@
  *  @brief OpenBMC Certificate entry implementation.
  *  @details A concrete implementation for the
  *  xyz.openbmc_project.Certs.Certificate DBus API
- *  xyz.openbmc_project.Certs.Instal DBus API
+ *  xyz.openbmc_project.Certs.Install DBus API
  */
 class Certificate : public CertIfaces
 {
@@ -99,7 +99,7 @@
     std::string getCertId() const;
 
     /**
-     * @brief Check if provied certificate is the same as the current one.
+     * @brief Check if provided certificate is the same as the current one.
      *
      * @param[in] certPath - File path for certificate to check.
      *
@@ -185,7 +185,7 @@
      * @brief Generate authority certificate file path corresponding with
      * OpenSSL requirements.
      *
-     * Prepare authority certificate file path for provied certificate.
+     * Prepare authority certificate file path for provided certificate.
      * OpenSSL puts some restrictions on the certificate file name pattern.
      * Certificate full file name needs to consists of basic file name which
      * is certificate subject name hash and file name extension which is an
diff --git a/certs_manager.cpp b/certs_manager.cpp
index 4c71a41..0303c9a 100644
--- a/certs_manager.cpp
+++ b/certs_manager.cpp
@@ -38,7 +38,7 @@
     try
     {
         // Create certificate directory if not existing.
-        // Set correct certificate directory permitions.
+        // Set correct certificate directory permissions.
         fs::path certDirectory;
         try
         {
@@ -350,7 +350,7 @@
     ret = X509_REQ_set_version(x509Req.get(), nVersion);
     if (ret == 0)
     {
-        log<level::ERR>("Error occured during X509_REQ_set_version call");
+        log<level::ERR>("Error occurred during X509_REQ_set_version call");
         elog<InternalFailure>();
     }
 
@@ -415,7 +415,7 @@
     ret = X509_REQ_set_pubkey(x509Req.get(), pKey.get());
     if (ret == 0)
     {
-        log<level::ERR>("Error occured while setting Public key");
+        log<level::ERR>("Error occurred while setting Public key");
         elog<InternalFailure>();
     }
 
@@ -426,7 +426,7 @@
     ret = X509_REQ_sign(x509Req.get(), pKey.get(), EVP_sha256());
     if (ret == 0)
     {
-        log<level::ERR>("Error occured while signing key of x509");
+        log<level::ERR>("Error occurred while signing key of x509");
         elog<InternalFailure>();
     }
 
@@ -465,7 +465,7 @@
     auto ret = BN_set_word(bne.get(), RSA_F4);
     if (ret == 0)
     {
-        log<level::ERR>("Error occured during BN_set_word call");
+        log<level::ERR>("Error occurred during BN_set_word call");
         elog<InternalFailure>();
     }
 
@@ -474,7 +474,7 @@
     if (ret != 1)
     {
         free(rsa);
-        log<level::ERR>("Error occured during RSA_generate_key_ex call",
+        log<level::ERR>("Error occurred during RSA_generate_key_ex call",
                         entry("KEYBITLENGTH=%PRIu64", keyBitLen));
         elog<InternalFailure>();
     }
@@ -485,7 +485,7 @@
     if (ret == 0)
     {
         free(rsa);
-        log<level::ERR>("Error occured during assign rsa key into EVP");
+        log<level::ERR>("Error occurred during assign rsa key into EVP");
         elog<InternalFailure>();
     }
 
@@ -496,7 +496,7 @@
         EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, nullptr), &::EVP_PKEY_CTX_free);
     if (!ctx)
     {
-        log<level::ERR>("Error occured creating EVP_PKEY_CTX from algorithm");
+        log<level::ERR>("Error occurred creating EVP_PKEY_CTX from algorithm");
         elog<InternalFailure>();
     }
 
@@ -504,14 +504,14 @@
         (EVP_PKEY_CTX_set_rsa_keygen_bits(ctx.get(), keyBitLen) <= 0))
 
     {
-        log<level::ERR>("Error occured initializing keygen context");
+        log<level::ERR>("Error occurred initializing keygen context");
         elog<InternalFailure>();
     }
 
     EVP_PKEY* pKey = nullptr;
     if (EVP_PKEY_keygen(ctx.get(), &pKey) <= 0)
     {
-        log<level::ERR>("Error occured during generate EC key");
+        log<level::ERR>("Error occurred during generate EC key");
         elog<InternalFailure>();
     }
 
@@ -537,7 +537,7 @@
     if (ecGrp == NID_undef)
     {
         log<level::ERR>(
-            "Error occured during convert the curve id string format into NID",
+            "Error occurred during convert the curve id string format into NID",
             entry("KEYCURVEID=%s", curId.c_str()));
         elog<InternalFailure>();
     }
@@ -549,7 +549,7 @@
     if (ecKey == NULL)
     {
         log<level::ERR>(
-            "Error occured during create the EC_Key object from NID",
+            "Error occurred during create the EC_Key object from NID",
             entry("ECGROUP=%d", ecGrp));
         elog<InternalFailure>();
     }
@@ -564,7 +564,7 @@
     if (ret == 0)
     {
         EC_KEY_free(ecKey);
-        log<level::ERR>("Error occured during generate EC key");
+        log<level::ERR>("Error occurred during generate EC key");
         elog<InternalFailure>();
     }
 
@@ -573,7 +573,7 @@
     if (ret == 0)
     {
         EC_KEY_free(ecKey);
-        log<level::ERR>("Error occured during assign EC Key into EVP");
+        log<level::ERR>("Error occurred during assign EC Key into EVP");
         elog<InternalFailure>();
     }
 
@@ -590,7 +590,7 @@
         EVP_PKEY_CTX_new_id(EVP_PKEY_EC, nullptr), &::EVP_PKEY_CTX_free);
     if (!ctx)
     {
-        log<level::ERR>("Error occured creating EVP_PKEY_CTX for params");
+        log<level::ERR>("Error occurred creating EVP_PKEY_CTX for params");
         elog<InternalFailure>();
     }
 
@@ -603,7 +603,7 @@
         (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx.get(), ecGrp) <= 0) ||
         (EVP_PKEY_paramgen(ctx.get(), &params) <= 0))
     {
-        log<level::ERR>("Error occured setting curve parameters");
+        log<level::ERR>("Error occurred setting curve parameters");
         elog<InternalFailure>();
     }
 
@@ -615,14 +615,14 @@
 
     if (!ctx || (EVP_PKEY_keygen_init(ctx.get()) <= 0))
     {
-        log<level::ERR>("Error occured initializing keygen context");
+        log<level::ERR>("Error occurred initializing keygen context");
         elog<InternalFailure>();
     }
 
     EVP_PKEY* pKey = nullptr;
     if (EVP_PKEY_keygen(ctx.get(), &pKey) <= 0)
     {
-        log<level::ERR>("Error occured during generate EC key");
+        log<level::ERR>("Error occurred during generate EC key");
         elog<InternalFailure>();
     }
 
@@ -640,14 +640,14 @@
     FILE* fp = std::fopen(privKeyPath.c_str(), "w");
     if (fp == NULL)
     {
-        log<level::ERR>("Error occured creating private key file");
+        log<level::ERR>("Error occurred creating private key file");
         elog<InternalFailure>();
     }
     int ret = PEM_write_PrivateKey(fp, pKey.get(), NULL, NULL, 0, 0, NULL);
     std::fclose(fp);
     if (ret == 0)
     {
-        log<level::ERR>("Error occured while writing private key to file");
+        log<level::ERR>("Error occurred while writing private key to file");
         elog<InternalFailure>();
     }
 }
@@ -826,7 +826,7 @@
 
     if (!privateKey)
     {
-        log<level::ERR>("Error occured during PEM_read_PrivateKey call");
+        log<level::ERR>("Error occurred during PEM_read_PrivateKey call");
         elog<InternalFailure>();
     }
     return privateKey;
diff --git a/certs_manager.hpp b/certs_manager.hpp
index f6d18dd..122ce44 100644
--- a/certs_manager.hpp
+++ b/certs_manager.hpp
@@ -219,7 +219,7 @@
     bool isExtendedKeyUsage(const std::string& usage);
 
     /** @brief Create CSR D-Bus object by reading the data in the CSR file
-     *  @param[in] statis - SUCCESSS/FAILURE In CSR generation.
+     *  @param[in] statis - SUCCESS/FAILURE In CSR generation.
      */
     void createCSRObject(const Status& status);
 
@@ -230,7 +230,7 @@
      */
     void writeCSR(const std::string& filePath, const X509_REQ_Ptr& x509Req);
 
-    /** @brief Load certifiate
+    /** @brief Load certificate
      *  Load certificate and create certificate object
      */
     void createCertificates();
diff --git a/csr.cpp b/csr.cpp
index dc26522..c93a487 100644
--- a/csr.cpp
+++ b/csr.cpp
@@ -57,7 +57,7 @@
         {
             std::fclose(fp);
         }
-        log<level::ERR>("ERROR occured while reading CSR file",
+        log<level::ERR>("ERROR occurred while reading CSR file",
                         entry("FILENAME=%s", csrFilePath.c_str()));
         elog<InternalFailure>();
     }
@@ -67,7 +67,7 @@
     int ret = PEM_write_bio_X509_REQ(bio.get(), x509Req.get());
     if (ret <= 0)
     {
-        log<level::ERR>("Error occured while calling PEM_write_bio_X509_REQ");
+        log<level::ERR>("Error occurred while calling PEM_write_bio_X509_REQ");
         elog<InternalFailure>();
     }
 
diff --git a/test/certs_manager_test.cpp b/test/certs_manager_test.cpp
index c8f0719..c0c712c 100644
--- a/test/certs_manager_test.cpp
+++ b/test/certs_manager_test.cpp
@@ -1223,7 +1223,7 @@
     EXPECT_TRUE(fs::exists(privateKeyPath));
 }
 
-/** @brief Check error is thrown if giving unsupported ket bit length to
+/** @brief Check error is thrown if giving unsupported key bit length to
  * generate rsa key
  */
 TEST_F(TestCertificates, TestRSAKeyWithUnsupportedKeyBitLength)
@@ -1365,7 +1365,7 @@
     EXPECT_TRUE(fs::exists(privateKeyPath));
 }
 
-/** @brief Check RSA key is generted during application startup*/
+/** @brief Check RSA key is generated during application startup*/
 TEST_F(TestCertificates, TestGenerateRSAPrivateKeyFile)
 {
     std::string endpoint("https");