aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/crypto/sha/sha1_one.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/sha/sha1_one.c')
-rw-r--r--crypto/openssl/crypto/sha/sha1_one.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/openssl/crypto/sha/sha1_one.c b/crypto/openssl/crypto/sha/sha1_one.c
index 20e660c71df7..7c65b60276cd 100644
--- a/crypto/openssl/crypto/sha/sha1_one.c
+++ b/crypto/openssl/crypto/sha/sha1_one.c
@@ -62,13 +62,14 @@
#include <openssl/crypto.h>
#ifndef OPENSSL_NO_SHA1
-unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md)
+unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
{
SHA_CTX c;
static unsigned char m[SHA_DIGEST_LENGTH];
if (md == NULL) md=m;
- SHA1_Init(&c);
+ if (!SHA1_Init(&c))
+ return NULL;
SHA1_Update(&c,d,n);
SHA1_Final(md,&c);
OPENSSL_cleanse(&c,sizeof(c));