]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
CryptoPkg: Update HMAC Wrapper with opaque HMAC_CTX object.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha256Null.c
index 35abddaa92b67b14630eaf677e8a66c67b30f0d2..1696fa1eb919cc553cdacfd98fd25a96b980a802 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.\r
 \r
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -16,6 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \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 zero to indicate this interface is not supported.\r
 \r
@@ -32,6 +34,42 @@ HmacSha256GetContextSize (
   return 0;\r
 }\r
 \r
+/**\r
+  Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.\r
+\r
+  Return NULL to indicate this interface is not supported.\r
+\r
+  @return  NULL  This interface is not supported..\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+HmacSha256New (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return NULL;\r
+}\r
+\r
+/**\r
+  Release the specified HMAC_CTX context.\r
+\r
+  This function will do nothing.\r
+\r
+  @param[in]  HmacSha256Ctx  Pointer to the HMAC_CTX context to be released.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+HmacSha256Free (\r
+  IN  VOID  *HmacSha256Ctx\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return;\r
+}\r
+\r
 /**\r
   Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for\r
   subsequent use.\r