clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I01547e98d27910919e09ebf7907c86292a6c825d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/user_channel/passwd_mgr.cpp b/user_channel/passwd_mgr.cpp
index 9b35ac7..f712779 100644
--- a/user_channel/passwd_mgr.cpp
+++ b/user_channel/passwd_mgr.cpp
@@ -141,12 +141,10 @@
}
}
-int PasswdMgr::encryptDecryptData(bool doEncrypt, const EVP_CIPHER* cipher,
- uint8_t* key, size_t keyLen, uint8_t* iv,
- size_t ivLen, uint8_t* inBytes,
- size_t inBytesLen, uint8_t* mac,
- size_t* macLen, unsigned char* outBytes,
- size_t* outBytesLen)
+int PasswdMgr::encryptDecryptData(
+ bool doEncrypt, const EVP_CIPHER* cipher, uint8_t* key, size_t keyLen,
+ uint8_t* iv, size_t ivLen, uint8_t* inBytes, size_t inBytesLen,
+ uint8_t* mac, size_t* macLen, unsigned char* outBytes, size_t* outBytesLen)
{
if (cipher == NULL || key == NULL || iv == NULL || inBytes == NULL ||
outBytes == NULL || mac == NULL || inBytesLen == 0 ||
@@ -163,9 +161,9 @@
std::array<uint8_t, EVP_MAX_MD_SIZE> calMac;
size_t calMacLen = calMac.size();
// calculate MAC for the encrypted message.
- if (NULL == HMAC(EVP_sha256(), key, keyLen, inBytes, inBytesLen,
- calMac.data(),
- reinterpret_cast<unsigned int*>(&calMacLen)))
+ if (NULL ==
+ HMAC(EVP_sha256(), key, keyLen, inBytes, inBytesLen, calMac.data(),
+ reinterpret_cast<unsigned int*>(&calMacLen)))
{
lg2::debug("Error: Failed to calculate MAC");
return -EIO;
@@ -203,8 +201,8 @@
inBytes, inBytesLen)))
{
outLen += outEVPLen;
- if ((retval = EVP_CipherFinal(ctx.get(), outBytes + outLen,
- &outEVPLen)))
+ if ((retval =
+ EVP_CipherFinal(ctx.get(), outBytes + outLen, &outEVPLen)))
{
outLen += outEVPLen;
*outBytesLen = outLen;
@@ -503,9 +501,9 @@
lg2::debug("Hash genertion failed, bailing out");
return -EIO;
}
- if (NULL == HMAC(digest, keyBuff.data(), keyBuff.size(), hash.data(),
- hashLen, key.data(),
- reinterpret_cast<unsigned int*>(&keyLen)))
+ if (NULL ==
+ HMAC(digest, keyBuff.data(), keyBuff.size(), hash.data(), hashLen,
+ key.data(), reinterpret_cast<unsigned int*>(&keyLen)))
{
lg2::debug("Failed to create MAC for authentication");
return -EIO;