/** @file\r
HMAC-SHA256 Wrapper Implementation over OpenSSL.\r
\r
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
#include "InternalCryptLib.h"\r
#include <openssl/hmac.h>\r
\r
-//\r
-// NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h\r
-// #define HMAC_MAX_MD_CBLOCK_SIZE 144\r
-//\r
-#define HMAC_SHA256_CTX_SIZE (sizeof(void *) * 4 + sizeof(unsigned int) + \\r
- sizeof(unsigned char) * 144)\r
-\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r
- (NOTE: This API is deprecated.\r
- Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)\r
-\r
- @return The size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-HmacSha256GetContextSize (\r
- VOID\r
- )\r
-{\r
- //\r
- // Retrieves the OpenSSL HMAC-SHA256 Context Size\r
- // NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the\r
- // fixed size as a workaround to make this API work for compatibility.\r
- // We should retire HmacSha256GetContextSize() in future, and use HmacSha256New()\r
- // and HmacSha256Free() for context allocation and release.\r
- //\r
- return (UINTN)HMAC_SHA256_CTX_SIZE;\r
-}\r
-\r
/**\r
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.\r
\r