Make CryptoNative_EvpDigestUpdate count parameter int32_t instead of size_t
authorGünther Foidl <gue@korporal.at>
Fri, 20 Sep 2019 13:13:35 +0000 (15:13 +0200)
committerJeremy Barton <jbarton@microsoft.com>
Fri, 20 Sep 2019 13:13:35 +0000 (06:13 -0700)
Shim functions should use sized types, which the size type isn't.

Commit migrated from https://github.com/dotnet/corefx/commit/ca6add5711542ae513dcd2269146eec3c518c4b5

src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.c
src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h

index 9665ffe..94f6585 100644 (file)
@@ -40,9 +40,9 @@ int32_t CryptoNative_EvpDigestReset(EVP_MD_CTX* ctx, const EVP_MD* type)
     return EVP_DigestInit_ex(ctx, type, NULL);
 }
 
-int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, size_t cnt)
+int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, int32_t cnt)
 {
-    return EVP_DigestUpdate(ctx, d, cnt);
+    return EVP_DigestUpdate(ctx, d, (size_t)cnt);
 }
 
 int32_t CryptoNative_EvpDigestFinalEx(EVP_MD_CTX* ctx, uint8_t* md, uint32_t* s)
index b0d7f9b..cb98118 100644 (file)
@@ -40,7 +40,7 @@ EvpDigestUpdate
 
 Direct shim to EVP_DigestUpdate.
 */
-DLLEXPORT int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, size_t cnt);
+DLLEXPORT int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, int32_t cnt);
 
 /*
 Function: