]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1Null.c
CryptoPkg: Update HMAC Wrapper with opaque HMAC_CTX object.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha1Null.c
index b31d0d1402dcceef84365d2264cc734c60d41124..466c4885c3426b9519122692cc499eb9f43e2e20 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.  \r
 \r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 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-SHA1 operations.\r
+  (NOTE: This API is deprecated.\r
+         Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)\r
 \r
   Return zero to indicate this interface is not supported.\r
 \r
@@ -32,6 +34,42 @@ HmacSha1GetContextSize (
   return 0;\r
 }\r
 \r
+/**\r
+  Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 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
+HmacSha1New (\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]  HmacSha1Ctx  Pointer to the HMAC_CTX context to be released.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+HmacSha1Free (\r
+  IN  VOID  *HmacSha1Ctx\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return;\r
+}\r
+\r
 /**\r
   Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for\r
   subsequent use.\r