projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sha1-s390x.pl: lingering comment update.
[openssl.git]
/
crypto
/
sha
/
sha1_one.c
diff --git
a/crypto/sha/sha1_one.c
b/crypto/sha/sha1_one.c
index fe5770d6019cb98617de587127f07892eaa88c5b..c56ec94020e180600f534e68c3402839ca330a79 100644
(file)
--- a/
crypto/sha/sha1_one.c
+++ b/
crypto/sha/sha1_one.c
@@
-58,20
+58,21
@@
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
-#include "sha.h"
+#include <openssl/crypto.h>
+#include <openssl/sha.h>
-unsigned char *SHA1(d, n, md)
-unsigned char *d;
-unsigned long n;
-unsigned char *md;
+#ifndef OPENSSL_NO_SHA1
+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;
{
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);
SHA1_Update(&c,d,n);
SHA1_Final(md,&c);
-
memset(&c,0
,sizeof(c));
+
OPENSSL_cleanse(&c
,sizeof(c));
return(md);
}
return(md);
}
+#endif