aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/sha
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/sha')
-rw-r--r--crypto/sha/Makefile.ssl2
-rw-r--r--crypto/sha/sha.h8
-rw-r--r--crypto/sha/sha1_one.c2
-rw-r--r--crypto/sha/sha1dgst.c2
-rw-r--r--crypto/sha/sha1test.c9
-rw-r--r--crypto/sha/sha_dgst.c3
-rw-r--r--crypto/sha/sha_one.c2
-rw-r--r--crypto/sha/shatest.c9
8 files changed, 35 insertions, 2 deletions
diff --git a/crypto/sha/Makefile.ssl b/crypto/sha/Makefile.ssl
index 4033cd8c8c..4f5413cbd7 100644
--- a/crypto/sha/Makefile.ssl
+++ b/crypto/sha/Makefile.ssl
@@ -88,7 +88,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
- $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/crypto/sha/sha.h b/crypto/sha/sha.h
index ac10d4c517..105d4c8575 100644
--- a/crypto/sha/sha.h
+++ b/crypto/sha/sha.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_SHA
+#error SHA is disabled.
+#endif
+
#define SHA_CBLOCK 64
#define SHA_LBLOCK 16
#define SHA_BLOCK 16
@@ -84,16 +88,20 @@ typedef struct SHAstate_st
int num;
} SHA_CTX;
+#ifndef NO_SHA0
void SHA_Init(SHA_CTX *c);
void SHA_Update(SHA_CTX *c, unsigned char *data, unsigned long len);
void SHA_Final(unsigned char *md, SHA_CTX *c);
unsigned char *SHA(unsigned char *d, unsigned long n,unsigned char *md);
void SHA_Transform(SHA_CTX *c, unsigned char *data);
+#endif
+#ifndef NO_SHA1
void SHA1_Init(SHA_CTX *c);
void SHA1_Update(SHA_CTX *c, unsigned char *data, unsigned long len);
void SHA1_Final(unsigned char *md, SHA_CTX *c);
unsigned char *SHA1(unsigned char *d, unsigned long n,unsigned char *md);
void SHA1_Transform(SHA_CTX *c, unsigned char *data);
+#endif
#ifdef __cplusplus
}
#endif
diff --git a/crypto/sha/sha1_one.c b/crypto/sha/sha1_one.c
index b5a93d96e1..864e2a89cb 100644
--- a/crypto/sha/sha1_one.c
+++ b/crypto/sha/sha1_one.c
@@ -60,6 +60,7 @@
#include <string.h>
#include <openssl/sha.h>
+#ifndef NO_SHA1
unsigned char *SHA1(unsigned char *d, unsigned long n, unsigned char *md)
{
SHA_CTX c;
@@ -72,3 +73,4 @@ unsigned char *SHA1(unsigned char *d, unsigned long n, unsigned char *md)
memset(&c,0,sizeof(c));
return(md);
}
+#endif
diff --git a/crypto/sha/sha1dgst.c b/crypto/sha/sha1dgst.c
index 18a492d0e6..532f53baa4 100644
--- a/crypto/sha/sha1dgst.c
+++ b/crypto/sha/sha1dgst.c
@@ -64,6 +64,7 @@
#include "sha_locl.h"
#include <openssl/opensslv.h>
+#ifndef NO_SHA1
char *SHA1_version="SHA1" OPENSSL_VERSION_PTEXT;
/* Implemented from SHA-1 document - The Secure Hash Algorithm
@@ -446,4 +447,5 @@ void SHA1_Final(unsigned char *md, SHA_CTX *c)
c->num=0;
/* memset((char *)&c,0,sizeof(c));*/
}
+#endif
diff --git a/crypto/sha/sha1test.c b/crypto/sha/sha1test.c
index 9e4d3f178b..6a34a9ae13 100644
--- a/crypto/sha/sha1test.c
+++ b/crypto/sha/sha1test.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_SHA
+int main(int argc, char *argv[])
+{
+ printf("No SHA support\n");
+ return(0);
+}
+#else
#include <openssl/sha.h>
#undef SHA_0 /* FIPS 180 */
@@ -145,3 +153,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf);
}
+#endif
diff --git a/crypto/sha/sha_dgst.c b/crypto/sha/sha_dgst.c
index 950c69c07a..e75c66c220 100644
--- a/crypto/sha/sha_dgst.c
+++ b/crypto/sha/sha_dgst.c
@@ -64,6 +64,7 @@
#include "sha_locl.h"
#include <openssl/opensslv.h>
+#ifndef NO_SHA0
char *SHA_version="SHA" OPENSSL_VERSION_PTEXT;
/* Implemented from SHA-0 document - The Secure Hash Algorithm
@@ -424,4 +425,4 @@ void SHA_Final(unsigned char *md, SHA_CTX *c)
c->num=0;
/* memset((char *)&c,0,sizeof(c));*/
}
-
+#endif
diff --git a/crypto/sha/sha_one.c b/crypto/sha/sha_one.c
index 80b0697380..6ef3f06a37 100644
--- a/crypto/sha/sha_one.c
+++ b/crypto/sha/sha_one.c
@@ -60,6 +60,7 @@
#include <string.h>
#include <openssl/sha.h>
+#ifndef NO_SHA0
unsigned char *SHA(unsigned char *d, unsigned long n, unsigned char *md)
{
SHA_CTX c;
@@ -72,3 +73,4 @@ unsigned char *SHA(unsigned char *d, unsigned long n, unsigned char *md)
memset(&c,0,sizeof(c));
return(md);
}
+#endif
diff --git a/crypto/sha/shatest.c b/crypto/sha/shatest.c
index 4e201ed7ea..6ebcbb13da 100644
--- a/crypto/sha/shatest.c
+++ b/crypto/sha/shatest.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_SHA
+int main(int argc, char *argv[])
+{
+ printf("No SHA support\n");
+ return(0);
+}
+#else
#include <openssl/sha.h>
#define SHA_0 /* FIPS 180 */
@@ -145,3 +153,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf);
}
+#endif