]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg: Add HMAC-SHA256 cipher support
authorQin Long <qin.long@intel.com>
Mon, 31 Oct 2016 07:43:48 +0000 (15:43 +0800)
committerQin Long <qin.long@intel.com>
Wed, 2 Nov 2016 15:17:21 +0000 (23:17 +0800)
Add new HMAC-SHA256 cipher support in CryptoPkg to meet more security
and industry requirements,

and update Cryptest utility to include new HMAC-SHA256 test case.

Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
CryptoPkg/Application/Cryptest/HmacVerify.c
CryptoPkg/Include/Library/BaseCryptLib.h
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c [new file with mode: 0644]
CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c [new file with mode: 0644]
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf

index 73b38f37495cb0301188628e2a044f2bc0a23ca2..9a91295bcf83ce7b6615043eac74486344d59f32 100644 (file)
@@ -1,7 +1,7 @@
 /** @file  \r
   Application for HMAC Primitives Validation.\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 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
@@ -54,6 +54,22 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 HmacSha1Digest[] = {
   0xf1, 0x46, 0xbe, 0x00\r
   };\r
 \r
+//\r
+// Key value for HMAC-SHA-256 validation. (From "4. Test Vectors" of IETF RFC4231)\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 HmacSha256Key[20] = {\r
+  0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\r
+  0x0b, 0x0b, 0x0b, 0x0b\r
+  };\r
+\r
+//\r
+// Result for HMAC-SHA-256 ("Hi There"). (From "4. Test Vectors" of IETF RFC4231)\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 HmacSha256Digest[] = {\r
+  0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53, 0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b,\r
+  0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7, 0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7\r
+  };\r
+\r
 /**\r
   Validate UEFI-OpenSSL Message Authentication Codes Interfaces.\r
 \r
@@ -73,7 +89,7 @@ ValidateCryptHmac (
 \r
   Print (L" \nUEFI-OpenSSL HMAC Engine Testing:\n");\r
 \r
-  Print (L"- HMAC-MD5:  ");\r
+  Print (L"- HMAC-MD5:    ");\r
 \r
   //\r
   // HMAC-MD5 Digest Validation\r
@@ -113,7 +129,7 @@ ValidateCryptHmac (
 \r
   Print (L"[Pass]\n");\r
 \r
-  Print (L"- HMAC-SHA1: ");\r
+  Print (L"- HMAC-SHA1:   ");\r
 \r
   //\r
   // HMAC-SHA1 Digest Validation\r
@@ -153,5 +169,44 @@ ValidateCryptHmac (
 \r
   Print (L"[Pass]\n");\r
 \r
+  Print (L"- HMAC-SHA256: ");\r
+  //\r
+  // HMAC-SHA-256 Digest Validation\r
+  //\r
+  ZeroMem (Digest, MAX_DIGEST_SIZE);\r
+  CtxSize = HmacSha256GetContextSize ();\r
+  HmacCtx = AllocatePool (CtxSize);\r
+\r
+  Print (L"Init... ");\r
+  Status  = HmacSha256Init (HmacCtx, HmacSha256Key, sizeof (HmacSha256Key));\r
+  if (!Status) {\r
+    Print (L"[Fail]");\r
+    return EFI_ABORTED;\r
+  }\r
+\r
+  Print (L"Update... ");\r
+  Status  = HmacSha256Update (HmacCtx, HmacData, 8);\r
+  if (!Status) {\r
+    Print (L"[Fail]");\r
+    return EFI_ABORTED;\r
+  }\r
+\r
+  Print (L"Finalize... ");\r
+  Status  = HmacSha256Final (HmacCtx, Digest);\r
+  if (!Status) {\r
+    Print (L"[Fail]");\r
+    return EFI_ABORTED;\r
+  }\r
+\r
+  FreePool (HmacCtx);\r
+\r
+  Print (L"Check Value... ");\r
+  if (CompareMem (Digest, HmacSha256Digest, SHA256_DIGEST_SIZE) != 0) {\r
+    Print (L"[Fail]");\r
+    return EFI_ABORTED;\r
+  }\r
+\r
+  Print (L"[Pass]\n");\r
+\r
   return EFI_SUCCESS;\r
 }\r
index 346362678533f74e6b854249f244099f237f0f44..9693793da3f0a3dd8e4200ea7116f905f4da8371 100644 (file)
@@ -1131,6 +1131,124 @@ HmacSha1Final (
   OUT     UINT8  *HmacValue\r
   );\r
 \r
+/**\r
+  Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r
+\r
+  If this interface is not supported, then return zero.\r
+\r
+  @return  The size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r
+  @retval  0   This interface is not supported.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+HmacSha256GetContextSize (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for\r
+  subsequent use.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
+\r
+  @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context being initialized.\r
+  @param[in]   Key                Pointer to the user-supplied key.\r
+  @param[in]   KeySize            Key size in bytes.\r
+\r
+  @retval TRUE   HMAC-SHA256 context initialization succeeded.\r
+  @retval FALSE  HMAC-SHA256 context initialization failed.\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Init (\r
+  OUT  VOID         *HmacSha256Context,\r
+  IN   CONST UINT8  *Key,\r
+  IN   UINTN        KeySize\r
+  );\r
+\r
+/**\r
+  Makes a copy of an existing HMAC-SHA256 context.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+  If NewHmacSha256Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
+\r
+  @param[in]  HmacSha256Context     Pointer to HMAC-SHA256 context being copied.\r
+  @param[out] NewHmacSha256Context  Pointer to new HMAC-SHA256 context.\r
+\r
+  @retval TRUE   HMAC-SHA256 context copy succeeded.\r
+  @retval FALSE  HMAC-SHA256 context copy failed.\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Duplicate (\r
+  IN   CONST VOID  *HmacSha256Context,\r
+  OUT  VOID        *NewHmacSha256Context\r
+  );\r
+\r
+/**\r
+  Digests the input data and updates HMAC-SHA256 context.\r
+\r
+  This function performs HMAC-SHA256 digest on a data buffer of the specified size.\r
+  It can be called multiple times to compute the digest of long or discontinuous data streams.\r
+  HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not\r
+  be finalized by HmacSha256Final(). Behavior with invalid context is undefined.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\r
+\r
+  @param[in, out]  HmacSha256Context Pointer to the HMAC-SHA256 context.\r
+  @param[in]       Data              Pointer to the buffer containing the data to be digested.\r
+  @param[in]       DataSize          Size of Data buffer in bytes.\r
+\r
+  @retval TRUE   HMAC-SHA256 data digest succeeded.\r
+  @retval FALSE  HMAC-SHA256 data digest failed.\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Update (\r
+  IN OUT  VOID        *HmacSha256Context,\r
+  IN      CONST VOID  *Data,\r
+  IN      UINTN       DataSize\r
+  );\r
+\r
+/**\r
+  Completes computation of the HMAC-SHA256 digest value.\r
+\r
+  This function completes HMAC-SHA256 hash computation and retrieves the digest value into\r
+  the specified memory. After this function has been called, the HMAC-SHA256 context cannot\r
+  be used again.\r
+  HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should\r
+  not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+  If HashValue is NULL, then return FALSE.\r
+  If this interface is not supported, then return FALSE.\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
+                                      value (32 bytes).\r
+\r
+  @retval TRUE   HMAC-SHA256 digest computation succeeded.\r
+  @retval FALSE  HMAC-SHA256 digest computation failed.\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Final (\r
+  IN OUT  VOID   *HmacSha256Context,\r
+  OUT     UINT8  *HmacValue\r
+  );\r
+\r
 //=====================================================================================\r
 //    Symmetric Cryptography Primitive\r
 //=====================================================================================\r
index a66faf1c04c0d659ed5deeeb39f2b371798d3b88..31bb5fbe0af7482eeaa79405e612062a0acf21a4 100644 (file)
@@ -6,7 +6,7 @@
 #  This external input must be validated carefully to avoid security issues such as\r
 #  buffer overflow or integer overflow.\r
 #\r
-#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2009 - 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
@@ -41,6 +41,7 @@
   Hash/CryptSha512.c\r
   Hmac/CryptHmacMd5.c\r
   Hmac/CryptHmacSha1.c\r
+  Hmac/CryptHmacSha256.c\r
   Cipher/CryptAes.c\r
   Cipher/CryptTdes.c\r
   Cipher/CryptArc4.c\r
diff --git a/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c b/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
new file mode 100644 (file)
index 0000000..5d349dc
--- /dev/null
@@ -0,0 +1,197 @@
+/** @file\r
+  HMAC-SHA256 Wrapper Implementation over OpenSSL.\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
+\r
+**/\r
+\r
+#include "InternalCryptLib.h"\r
+#include <openssl/hmac.h>\r
+\r
+/**\r
+  Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 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
+  //\r
+  return (UINTN) (sizeof (HMAC_CTX));\r
+}\r
+\r
+/**\r
+  Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for\r
+  subsequent use.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+\r
+  @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context being initialized.\r
+  @param[in]   Key                Pointer to the user-supplied key.\r
+  @param[in]   KeySize            Key size in bytes.\r
+\r
+  @retval TRUE   HMAC-SHA256 context initialization succeeded.\r
+  @retval FALSE  HMAC-SHA256 context initialization failed.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Init (\r
+  OUT  VOID         *HmacSha256Context,\r
+  IN   CONST UINT8  *Key,\r
+  IN   UINTN        KeySize\r
+  )\r
+{\r
+  //\r
+  // Check input parameters.\r
+  //\r
+  if (HmacSha256Context == NULL || KeySize > INT_MAX) {\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // OpenSSL HMAC-SHA256 Context Initialization\r
+  //\r
+  HMAC_CTX_init (HmacSha256Context);\r
+  HMAC_Init_ex (HmacSha256Context, Key, (UINT32) KeySize, EVP_sha256(), NULL);\r
+\r
+  return TRUE;\r
+}\r
+\r
+/**\r
+  Makes a copy of an existing HMAC-SHA256 context.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+  If NewHmacSha256Context is NULL, then return FALSE.\r
+\r
+  @param[in]  HmacSha256Context     Pointer to HMAC-SHA256 context being copied.\r
+  @param[out] NewHmacSha256Context  Pointer to new HMAC-SHA256 context.\r
+\r
+  @retval TRUE   HMAC-SHA256 context copy succeeded.\r
+  @retval FALSE  HMAC-SHA256 context copy failed.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Duplicate (\r
+  IN   CONST VOID  *HmacSha256Context,\r
+  OUT  VOID        *NewHmacSha256Context\r
+  )\r
+{\r
+  //\r
+  // Check input parameters.\r
+  //\r
+  if (HmacSha256Context == NULL || NewHmacSha256Context == NULL) {\r
+    return FALSE;\r
+  }\r
+\r
+  CopyMem (NewHmacSha256Context, HmacSha256Context, sizeof (HMAC_CTX));\r
+\r
+  return TRUE;\r
+}\r
+\r
+/**\r
+  Digests the input data and updates HMAC-SHA256 context.\r
+\r
+  This function performs HMAC-SHA256 digest on a data buffer of the specified size.\r
+  It can be called multiple times to compute the digest of long or discontinuous data streams.\r
+  HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not\r
+  be finalized by HmacSha256Final(). Behavior with invalid context is undefined.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+\r
+  @param[in, out]  HmacSha256Context Pointer to the HMAC-SHA256 context.\r
+  @param[in]       Data              Pointer to the buffer containing the data to be digested.\r
+  @param[in]       DataSize          Size of Data buffer in bytes.\r
+\r
+  @retval TRUE   HMAC-SHA256 data digest succeeded.\r
+  @retval FALSE  HMAC-SHA256 data digest failed.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Update (\r
+  IN OUT  VOID        *HmacSha256Context,\r
+  IN      CONST VOID  *Data,\r
+  IN      UINTN       DataSize\r
+  )\r
+{\r
+  //\r
+  // Check input parameters.\r
+  //\r
+  if (HmacSha256Context == NULL) {\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // Check invalid parameters, in case that only DataLength was checked in OpenSSL\r
+  //\r
+  if (Data == NULL && DataSize != 0) {\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // OpenSSL HMAC-SHA256 digest update\r
+  //\r
+  HMAC_Update (HmacSha256Context, Data, DataSize);\r
+\r
+  return TRUE;\r
+}\r
+\r
+/**\r
+  Completes computation of the HMAC-SHA256 digest value.\r
+\r
+  This function completes HMAC-SHA256 hash computation and retrieves the digest value into\r
+  the specified memory. After this function has been called, the HMAC-SHA256 context cannot\r
+  be used again.\r
+  HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should\r
+  not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.\r
+\r
+  If HmacSha256Context is NULL, then return FALSE.\r
+  If HashValue is NULL, then return FALSE.\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
+                                      value (32 bytes).\r
+\r
+  @retval TRUE   HMAC-SHA256 digest computation succeeded.\r
+  @retval FALSE  HMAC-SHA256 digest computation failed.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Final (\r
+  IN OUT  VOID   *HmacSha256Context,\r
+  OUT     UINT8  *HmacValue\r
+  )\r
+{\r
+  UINT32  Length;\r
+\r
+  //\r
+  // Check input parameters.\r
+  //\r
+  if (HmacSha256Context == NULL || HmacValue == NULL) {\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // OpenSSL HMAC-SHA256 digest finalization\r
+  //\r
+  HMAC_Final (HmacSha256Context, HmacValue, &Length);\r
+  HMAC_CTX_cleanup (HmacSha256Context);\r
+\r
+  return TRUE;\r
+}\r
diff --git a/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c b/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
new file mode 100644 (file)
index 0000000..48704e1
--- /dev/null
@@ -0,0 +1,127 @@
+/** @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
+\r
+**/\r
+\r
+#include "InternalCryptLib.h"\r
+\r
+/**\r
+  Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r
+\r
+  Return zero to indicate this interface is not supported.\r
+\r
+  @retval  0   This interface is not supported.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+HmacSha256GetContextSize (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return 0;\r
+}\r
+\r
+/**\r
+  Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for\r
+  subsequent use.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context being initialized.\r
+  @param[in]   Key                Pointer to the user-supplied key.\r
+  @param[in]   KeySize            Key size in bytes.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Init (\r
+  OUT  VOID         *HmacSha256Context,\r
+  IN   CONST UINT8  *Key,\r
+  IN   UINTN        KeySize\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Makes a copy of an existing HMAC-SHA256 context.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in]  HmacSha256Context     Pointer to HMAC-SHA256 context being copied.\r
+  @param[out] NewHmacSha256Context  Pointer to new HMAC-SHA256 context.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Duplicate (\r
+  IN   CONST VOID  *HmacSha256Context,\r
+  OUT  VOID        *NewHmacSha256Context\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Digests the input data and updates HMAC-SHA256 context.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in, out]  HmacSha256Context Pointer to the HMAC-SHA256 context.\r
+  @param[in]       Data              Pointer to the buffer containing the data to be digested.\r
+  @param[in]       DataSize          Size of Data buffer in bytes.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Update (\r
+  IN OUT  VOID        *HmacSha256Context,\r
+  IN      CONST VOID  *Data,\r
+  IN      UINTN       DataSize\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Completes computation of the HMAC-SHA256 digest value.\r
+\r
+  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
+                                      value (32 bytes).\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+HmacSha256Final (\r
+  IN OUT  VOID   *HmacSha256Context,\r
+  OUT     UINT8  *HmacValue\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
index 75f8e6e5f06dbb37683d80ba579bf62f9efe86f5..058737b90689d655fcfa7982265f962ae068d31a 100644 (file)
@@ -7,13 +7,13 @@
 #  buffer overflow or integer overflow.\r
 #\r
 #  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,\r
-#  HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external \r
+#  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES/ARC4 functions, RSA external\r
 #  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 \r
 #  certificate handler functions, authenticode signature verification functions, \r
 #  PEM handler functions, and pseudorandom number generator functions are not \r
 #  supported in this instance.\r
 #\r
-#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 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
@@ -47,6 +47,7 @@
   Hash/CryptSha512Null.c\r
   Hmac/CryptHmacMd5Null.c\r
   Hmac/CryptHmacSha1Null.c\r
+  Hmac/CryptHmacSha256Null.c\r
   Cipher/CryptAesNull.c\r
   Cipher/CryptTdesNull.c\r
   Cipher/CryptArc4Null.c\r
index 446f0ae47605fd4b874cf073fcfd87bcb6e6972e..12434cfc8c67133c4a43e5043b51d36661be2886 100644 (file)
@@ -7,11 +7,11 @@
 #  buffer overflow or integer overflow.\r
 #\r
 #  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,\r
-#  HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external\r
+#  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES/ARC4 functions, RSA external\r
 #  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and \r
 #  authenticode signature verification functions are not supported in this instance.\r
 #\r
-#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2009 - 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
@@ -46,6 +46,7 @@
   Hash/CryptSha512Null.c\r
   Hmac/CryptHmacMd5Null.c\r
   Hmac/CryptHmacSha1Null.c\r
+  Hmac/CryptHmacSha256Null.c\r
   Cipher/CryptAesNull.c\r
   Cipher/CryptTdesNull.c\r
   Cipher/CryptArc4Null.c\r
index bff7a9e7683c8eb5f033b805966e7f7acd9fd88c..26d3e568c2fbc62d26b824aace05784a301ec1d7 100644 (file)
@@ -7,7 +7,7 @@
 #  buffer overflow or integer overflow.\r
 #\r
 #  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,\r
-#  HMAC-MD5 functions, HMAC-SHA1 functions, TDES/ARC4 functions, RSA external\r
+#  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, TDES/ARC4 functions, RSA external\r
 #  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and \r
 #  authenticode signature verification functions are not supported in this instance.\r
 #\r
@@ -46,6 +46,7 @@
   Hash/CryptSha512Null.c\r
   Hmac/CryptHmacMd5Null.c\r
   Hmac/CryptHmacSha1Null.c\r
+  Hmac/CryptHmacSha256Null.c\r
   Cipher/CryptAes.c\r
   Cipher/CryptTdesNull.c\r
   Cipher/CryptArc4Null.c\r