projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Since we're moving between directories, let's get an absolute path to
[oweals/openssl.git]
/
crypto
/
sha
/
sha_one.c
diff --git
a/crypto/sha/sha_one.c
b/crypto/sha/sha_one.c
index 87da617bec0d0ad8756be71ffbd43cebe871e870..3bae623ce882ce46360b0041ac4ef2db3d4b2728 100644
(file)
--- a/
crypto/sha/sha_one.c
+++ b/
crypto/sha/sha_one.c
@@
-1,5
+1,5
@@
/* crypto/sha/sha_one.c */
/* crypto/sha/sha_one.c */
-/* Copyright (C) 1995-199
7
Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-199
8
Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* All rights reserved.
*
* This package is an SSL implementation written
@@
-57,21
+57,22
@@
*/
#include <stdio.h>
*/
#include <stdio.h>
-#include "cryptlib.h"
-#include "sha.h"
+#include <string.h>
+#include <openssl/sha.h>
+#include <openssl/crypto.h>
-unsigned char *SHA(d, n, md)
-unsigned char *d;
-unsigned long n;
-unsigned char *md;
+#ifndef OPENSSL_NO_SHA0
+unsigned char *SHA(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;
- SHA_Init(&c);
+ if (!SHA_Init(&c))
+ return NULL;
SHA_Update(&c,d,n);
SHA_Final(md,&c);
SHA_Update(&c,d,n);
SHA_Final(md,&c);
-
memset(&c,0
,sizeof(c));
+
OPENSSL_cleanse(&c
,sizeof(c));
return(md);
}
return(md);
}
+#endif