clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: Ia2e47cf46f7481581dc8360553c10a096cafcdce
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index a75a2c2..e5530e6 100644
--- a/.clang-format
+++ b/.clang-format
@@ -104,7 +104,7 @@
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyReturnTypeOnItsOwnLine: 150
PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
diff --git a/certificate.cpp b/certificate.cpp
index c99b0b0..696c6f2 100644
--- a/certificate.cpp
+++ b/certificate.cpp
@@ -135,8 +135,8 @@
}
}
-std::string
- Certificate::generateUniqueFilePath(const std::string& directoryPath)
+std::string Certificate::generateUniqueFilePath(
+ const std::string& directoryPath)
{
char* filePath = tempnam(directoryPath.c_str(), nullptr);
if (filePath == nullptr)
@@ -177,8 +177,8 @@
elog<InternalFailure>();
}
-std::string
- Certificate::generateAuthCertFilePath(const std::string& certSrcFilePath)
+std::string Certificate::generateAuthCertFilePath(
+ const std::string& certSrcFilePath)
{
// If there is a certificate file path (which means certificate replacement
// is doing) use it (do not create new one)
@@ -200,8 +200,8 @@
}
}
-std::string
- Certificate::generateCertFilePath(const std::string& certSrcFilePath)
+std::string Certificate::generateCertFilePath(
+ const std::string& certSrcFilePath)
{
if (certType == CertificateType::authority)
{
diff --git a/certs_manager.cpp b/certs_manager.cpp
index 7e50e88..ea2b55d 100644
--- a/certs_manager.cpp
+++ b/certs_manager.cpp
@@ -279,8 +279,8 @@
return certObjectPath;
}
-std::vector<sdbusplus::message::object_path>
- Manager::installAll(const std::string filePath)
+std::vector<sdbusplus::message::object_path> Manager::installAll(
+ const std::string filePath)
{
if (certType != CertificateType::authority)
{
@@ -365,8 +365,8 @@
return objects;
}
-std::vector<sdbusplus::message::object_path>
- Manager::replaceAll(std::string filePath)
+std::vector<sdbusplus::message::object_path> Manager::replaceAll(
+ std::string filePath)
{
installedCerts.clear();
certIdCounter = 1;
diff --git a/certs_manager.hpp b/certs_manager.hpp
index 4ce49d2..722f07f 100644
--- a/certs_manager.hpp
+++ b/certs_manager.hpp
@@ -86,8 +86,8 @@
*
* @return D-Bus object path to created objects.
*/
- std::vector<sdbusplus::message::object_path>
- installAll(std::string path) override;
+ std::vector<sdbusplus::message::object_path> installAll(
+ std::string path) override;
/** @brief Implementation for ReplaceAll
* Replace the current authority lists and restart the associated services.
@@ -96,8 +96,8 @@
*
* @return D-Bus object path to created objects.
*/
- std::vector<sdbusplus::message::object_path>
- replaceAll(std::string filePath) override;
+ std::vector<sdbusplus::message::object_path> replaceAll(
+ std::string filePath) override;
/** @brief Implementation for DeleteAll
* Delete all objects in the collection.
@@ -222,15 +222,15 @@
* @param[in] keyBitLength - KeyBit length.
* @return Pointer to RSA private key
*/
- std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)>
- generateRSAKeyPair(const int64_t keyBitLength);
+ std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)> generateRSAKeyPair(
+ const int64_t keyBitLength);
/** @brief Generate EC Key pair and get private key from key pair
* @param[in] p_KeyCurveId - Curve ID
* @return Pointer to EC private key
*/
- std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)>
- generateECKeyPair(const std::string& pKeyCurveId);
+ std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)> generateECKeyPair(
+ const std::string& pKeyCurveId);
/** @brief Write private key data to file
*
@@ -284,8 +284,8 @@
* @param[in] keyBitLength - Key bit length
* @return Pointer to RSA key
*/
- std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)>
- getRSAKeyPair(const int64_t keyBitLength);
+ std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)> getRSAKeyPair(
+ const int64_t keyBitLength);
/** @brief Update certificate storage (remove outdated files, recreate
* symbolic links, etc.).
diff --git a/x509_utils.hpp b/x509_utils.hpp
index 6e193fc..995741d 100644
--- a/x509_utils.hpp
+++ b/x509_utils.hpp
@@ -14,15 +14,15 @@
* @param[in] certSrcPath - the file path to a list of trusted certificates
*
*/
-std::unique_ptr<X509_STORE, decltype(&::X509_STORE_free)>
- getX509Store(const std::string& certSrcPath);
+std::unique_ptr<X509_STORE, decltype(&::X509_STORE_free)> getX509Store(
+ const std::string& certSrcPath);
/** @brief Loads Certificate file into the X509 structure.
* @param[in] filePath - Certificate and key full file path.
* @return pointer to the X509 structure.
*/
-std::unique_ptr<X509, decltype(&::X509_free)>
- loadCert(const std::string& filePath);
+std::unique_ptr<X509, decltype(&::X509_free)> loadCert(
+ const std::string& filePath);
/**
* @brief Parses the certificate and throws error if certificate NotBefore date