CryptoPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the CryptoPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:53:54 -08:00
committed by mergify[bot]
parent 2b16a4fb91
commit 7c34237831
101 changed files with 4323 additions and 3711 deletions

View File

@@ -39,37 +39,42 @@ HkdfSha256ExtractAndExpand (
IN UINTN OutSize
)
{
EVP_PKEY_CTX *pHkdfCtx;
BOOLEAN Result;
EVP_PKEY_CTX *pHkdfCtx;
BOOLEAN Result;
if (Key == NULL || Salt == NULL || Info == NULL || Out == NULL ||
KeySize > INT_MAX || SaltSize > INT_MAX || InfoSize > INT_MAX || OutSize > INT_MAX ) {
if ((Key == NULL) || (Salt == NULL) || (Info == NULL) || (Out == NULL) ||
(KeySize > INT_MAX) || (SaltSize > INT_MAX) || (InfoSize > INT_MAX) || (OutSize > INT_MAX))
{
return FALSE;
}
pHkdfCtx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL);
pHkdfCtx = EVP_PKEY_CTX_new_id (EVP_PKEY_HKDF, NULL);
if (pHkdfCtx == NULL) {
return FALSE;
}
Result = EVP_PKEY_derive_init(pHkdfCtx) > 0;
Result = EVP_PKEY_derive_init (pHkdfCtx) > 0;
if (Result) {
Result = EVP_PKEY_CTX_set_hkdf_md(pHkdfCtx, EVP_sha256()) > 0;
}
if (Result) {
Result = EVP_PKEY_CTX_set1_hkdf_salt(pHkdfCtx, Salt, (UINT32)SaltSize) > 0;
}
if (Result) {
Result = EVP_PKEY_CTX_set1_hkdf_key(pHkdfCtx, Key, (UINT32)KeySize) > 0;
}
if (Result) {
Result = EVP_PKEY_CTX_add1_hkdf_info(pHkdfCtx, Info, (UINT32)InfoSize) > 0;
}
if (Result) {
Result = EVP_PKEY_derive(pHkdfCtx, Out, &OutSize) > 0;
Result = EVP_PKEY_CTX_set_hkdf_md (pHkdfCtx, EVP_sha256 ()) > 0;
}
EVP_PKEY_CTX_free(pHkdfCtx);
if (Result) {
Result = EVP_PKEY_CTX_set1_hkdf_salt (pHkdfCtx, Salt, (UINT32)SaltSize) > 0;
}
if (Result) {
Result = EVP_PKEY_CTX_set1_hkdf_key (pHkdfCtx, Key, (UINT32)KeySize) > 0;
}
if (Result) {
Result = EVP_PKEY_CTX_add1_hkdf_info (pHkdfCtx, Info, (UINT32)InfoSize) > 0;
}
if (Result) {
Result = EVP_PKEY_derive (pHkdfCtx, Out, &OutSize) > 0;
}
EVP_PKEY_CTX_free (pHkdfCtx);
pHkdfCtx = NULL;
return Result;
}