X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CryptoPkg%2FLibrary%2FBaseCryptLib%2FHmac%2FCryptHmacSha1.c;h=e6602586acd0d3e358124cf28ef1b8ce92e347be;hp=58da2f3aecd5eb95cdd7817860d16a979d5e224e;hb=2998af862469c6a05657e169d7def6f55420caad;hpb=16d2c32c4dff7fd8b0ee19e3ba908c0121f6636e diff --git a/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c b/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c index 58da2f3aec..e6602586ac 100644 --- a/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c +++ b/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c @@ -30,7 +30,7 @@ HmacSha1GetContextSize ( // // Retrieves the OpenSSL HMAC-SHA1 Context Size // - return (UINTN)(sizeof (HMAC_CTX)); + return (UINTN) (sizeof (HMAC_CTX)); } /** @@ -58,7 +58,7 @@ HmacSha1Init ( // // Check input parameters. // - if (HmacSha1Context == NULL) { + if (HmacSha1Context == NULL || KeySize > INT_MAX) { return FALSE; } @@ -108,7 +108,7 @@ HmacSha1Duplicate ( This function performs HMAC-SHA1 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. - HMAC-SHA1 context should be already correctly intialized by HmacSha1Init(), and should not + HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should not be finalized by HmacSha1Final(). Behavior with invalid context is undefined. If HmacSha1Context is NULL, then return FALSE. @@ -157,7 +157,7 @@ HmacSha1Update ( This function completes HMAC-SHA1 digest computation and retrieves the digest value into the specified memory. After this function has been called, the HMAC-SHA1 context cannot be used again. - HMAC-SHA1 context should be already correctly intialized by HmacSha1Init(), and should + HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined. If HmacSha1Context is NULL, then return FALSE.