]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
CryptoPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha256Null.c
index 48704e1091d2b1890948487bb1d86ac91f7a5270..f0a4420e276d5ed35d27acd1e9ffe605a4db3532 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.\r
 \r
-Copyright (c) 2016, 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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -16,6 +10,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 +28,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
@@ -109,7 +141,7 @@ HmacSha256Update (
   Return FALSE to indicate this interface is not supported.\r
 \r
   @param[in, out]  HmacSha256Context  Pointer to the HMAC-SHA256 context.\r
-  @param[out]      HashValue          Pointer to a buffer that receives the HMAC-SHA256 digest\r
+  @param[out]      HmacValue          Pointer to a buffer that receives the HMAC-SHA256 digest\r
                                       value (32 bytes).\r
 \r
   @retval FALSE  This interface is not supported.\r