]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c
CryptoPkg: Fix typos in comments
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha1.c
index 58da2f3aecd5eb95cdd7817860d16a979d5e224e..e6602586acd0d3e358124cf28ef1b8ce92e347be 100644 (file)
@@ -30,7 +30,7 @@ HmacSha1GetContextSize (
   //\r
   // Retrieves the OpenSSL HMAC-SHA1 Context Size\r
   //\r
   //\r
   // Retrieves the OpenSSL HMAC-SHA1 Context Size\r
   //\r
-  return (UINTN)(sizeof (HMAC_CTX));\r
+  return (UINTN) (sizeof (HMAC_CTX));\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
@@ -58,7 +58,7 @@ HmacSha1Init (
   //\r
   // Check input parameters.\r
   //\r
   //\r
   // Check input parameters.\r
   //\r
-  if (HmacSha1Context == NULL) {\r
+  if (HmacSha1Context == NULL || KeySize > INT_MAX) {\r
     return FALSE;\r
   }\r
 \r
     return FALSE;\r
   }\r
 \r
@@ -108,7 +108,7 @@ HmacSha1Duplicate (
 \r
   This function performs HMAC-SHA1 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
 \r
   This function performs HMAC-SHA1 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-SHA1 context should be already correctly intialized by HmacSha1Init(), and should not\r
+  HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should not\r
   be finalized by HmacSha1Final(). Behavior with invalid context is undefined.\r
 \r
   If HmacSha1Context is NULL, then return FALSE.\r
   be finalized by HmacSha1Final(). Behavior with invalid context is undefined.\r
 \r
   If HmacSha1Context is NULL, then return FALSE.\r
@@ -157,7 +157,7 @@ HmacSha1Update (
   This function completes HMAC-SHA1 digest computation and retrieves the digest value into\r
   the specified memory. After this function has been called, the HMAC-SHA1 context cannot\r
   be used again.\r
   This function completes HMAC-SHA1 digest computation and retrieves the digest value into\r
   the specified memory. After this function has been called, the HMAC-SHA1 context cannot\r
   be used again.\r
-  HMAC-SHA1 context should be already correctly intialized by HmacSha1Init(), and should\r
+  HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should\r
   not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.\r
 \r
   If HmacSha1Context is NULL, then return FALSE.\r
   not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.\r
 \r
   If HmacSha1Context is NULL, then return FALSE.\r