aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/Makefile.ssl4
-rw-r--r--crypto/asn1/Makefile.ssl2
-rw-r--r--crypto/asn1/d2i_dhp.c3
-rw-r--r--crypto/asn1/d2i_dsap.c3
-rw-r--r--crypto/asn1/d2i_r_pr.c3
-rw-r--r--crypto/asn1/d2i_r_pu.c3
-rw-r--r--crypto/asn1/d2i_s_pr.c3
-rw-r--r--crypto/asn1/d2i_s_pu.c5
-rw-r--r--crypto/asn1/i2d_dhp.c2
-rw-r--r--crypto/asn1/i2d_dsap.c2
-rw-r--r--crypto/asn1/i2d_r_pr.c2
-rw-r--r--crypto/asn1/i2d_r_pu.c3
-rw-r--r--crypto/asn1/i2d_s_pr.c3
-rw-r--r--crypto/asn1/i2d_s_pu.c3
-rw-r--r--crypto/asn1/n_pkey.c4
-rw-r--r--crypto/bf/Makefile.ssl2
-rw-r--r--crypto/bf/bftest.c9
-rw-r--r--crypto/bf/blowfish.h4
-rw-r--r--crypto/bio/Makefile.ssl2
-rw-r--r--crypto/bn/Makefile.ssl2
-rw-r--r--crypto/buffer/Makefile.ssl2
-rw-r--r--crypto/cast/Makefile.ssl2
-rw-r--r--crypto/cast/cast.h4
-rw-r--r--crypto/cast/casttest.c10
-rw-r--r--crypto/comp/Makefile.ssl2
-rw-r--r--crypto/conf/Makefile.ssl2
-rw-r--r--crypto/des/Makefile.ssl2
-rw-r--r--crypto/des/des.h4
-rw-r--r--crypto/des/destest.c13
-rw-r--r--crypto/des/ede_cbcm_enc.c2
-rw-r--r--crypto/dh/Makefile.ssl2
-rw-r--r--crypto/dh/dh.h4
-rw-r--r--crypto/dh/dhtest.c9
-rw-r--r--crypto/dsa/Makefile.ssl2
-rw-r--r--crypto/dsa/dsa.h4
-rw-r--r--crypto/dsa/dsatest.c13
-rw-r--r--crypto/err/Makefile.ssl2
-rw-r--r--crypto/evp/Makefile.ssl2
-rw-r--r--crypto/evp/evp.h24
-rw-r--r--crypto/evp/evp_pkey.c23
-rw-r--r--crypto/evp/p_open.c2
-rw-r--r--crypto/evp/p_seal.c2
-rw-r--r--crypto/hmac/Makefile.ssl2
-rw-r--r--crypto/hmac/hmac.h4
-rw-r--r--crypto/hmac/hmactest.c9
-rw-r--r--crypto/idea/Makefile.ssl2
-rw-r--r--crypto/idea/idea.h4
-rw-r--r--crypto/idea/ideatest.c10
-rw-r--r--crypto/lhash/Makefile.ssl2
-rw-r--r--crypto/md2/Makefile.ssl2
-rw-r--r--crypto/md2/md2.h4
-rw-r--r--crypto/md2/md2test.c9
-rw-r--r--crypto/md5/Makefile.ssl2
-rw-r--r--crypto/md5/md5.h4
-rw-r--r--crypto/md5/md5test.c9
-rw-r--r--crypto/mdc2/Makefile.ssl2
-rw-r--r--crypto/mdc2/mdc2.h4
-rw-r--r--crypto/mdc2/mdc2test.c14
-rw-r--r--crypto/objects/Makefile.ssl2
-rw-r--r--crypto/objects/obj_dat.h2
-rw-r--r--crypto/pem/Makefile.ssl2
-rw-r--r--crypto/pem/pem.h34
-rw-r--r--crypto/pem/pem_seal.c2
-rw-r--r--crypto/pkcs12/Makefile.ssl2
-rw-r--r--crypto/pkcs12/p12_crpt.c4
-rw-r--r--crypto/pkcs7/Makefile.ssl2
-rw-r--r--crypto/rand/Makefile.ssl2
-rw-r--r--crypto/rc2/Makefile.ssl2
-rw-r--r--crypto/rc2/rc2.h4
-rw-r--r--crypto/rc2/rc2test.c9
-rw-r--r--crypto/rc4/Makefile.ssl2
-rw-r--r--crypto/rc4/rc4.h4
-rw-r--r--crypto/rc4/rc4test.c10
-rw-r--r--crypto/rc5/Makefile.ssl2
-rw-r--r--crypto/rc5/rc5.h4
-rw-r--r--crypto/rc5/rc5test.c9
-rw-r--r--crypto/ripemd/Makefile.ssl2
-rw-r--r--crypto/ripemd/ripemd.h4
-rw-r--r--crypto/ripemd/rmdtest.c10
-rw-r--r--crypto/rsa/Makefile.ssl2
-rw-r--r--crypto/rsa/rsa.h4
-rw-r--r--crypto/rsa/rsa_oaep_test.c10
-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
-rw-r--r--crypto/stack/Makefile.ssl2
-rw-r--r--crypto/txt_db/Makefile.ssl2
-rw-r--r--crypto/x509/Makefile.ssl2
-rw-r--r--crypto/x509/x509.h24
-rw-r--r--crypto/x509v3/Makefile.ssl2
95 files changed, 388 insertions, 90 deletions
diff --git a/crypto/Makefile.ssl b/crypto/Makefile.ssl
index 4c0add7a6d..ad6cfc9534 100644
--- a/crypto/Makefile.ssl
+++ b/crypto/Makefile.ssl
@@ -115,11 +115,11 @@ lint:
done;
depend:
- $(MAKEDEPEND) $(INCLUDE) $(PROGS) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC)
@for i in $(SDIRS) ;\
do \
(cd $$i; echo "making depend in crypto/$$i..."; \
- $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' depend ); \
+ $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
done;
clean:
diff --git a/crypto/asn1/Makefile.ssl b/crypto/asn1/Makefile.ssl
index 87f392eeb3..3bfadb1a3b 100644
--- a/crypto/asn1/Makefile.ssl
+++ b/crypto/asn1/Makefile.ssl
@@ -101,7 +101,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/asn1/d2i_dhp.c b/crypto/asn1/d2i_dhp.c
index a0f514dc7e..a077211a4c 100644
--- a/crypto/asn1/d2i_dhp.c
+++ b/crypto/asn1/d2i_dhp.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_DH
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -97,4 +98,4 @@ err:
if (bs != NULL) ASN1_BIT_STRING_free(bs);
return(NULL);
}
-
+#endif
diff --git a/crypto/asn1/d2i_dsap.c b/crypto/asn1/d2i_dsap.c
index 2582b8fd45..51863a8b13 100644
--- a/crypto/asn1/d2i_dsap.c
+++ b/crypto/asn1/d2i_dsap.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_DSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -90,4 +91,4 @@ err:
if (bs != NULL) ASN1_BIT_STRING_free(bs);
return(NULL);
}
-
+#endif
diff --git a/crypto/asn1/d2i_r_pr.c b/crypto/asn1/d2i_r_pr.c
index f6d118937c..18f11b6f5e 100644
--- a/crypto/asn1/d2i_r_pr.c
+++ b/crypto/asn1/d2i_r_pr.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_RSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -117,4 +118,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL);
}
-
+#endif
diff --git a/crypto/asn1/d2i_r_pu.c b/crypto/asn1/d2i_r_pu.c
index 80deaab71a..04cfe5671e 100644
--- a/crypto/asn1/d2i_r_pu.c
+++ b/crypto/asn1/d2i_r_pu.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_RSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -89,4 +90,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL);
}
-
+#endif
diff --git a/crypto/asn1/d2i_s_pr.c b/crypto/asn1/d2i_s_pr.c
index cf64a2edad..050e1cc5fb 100644
--- a/crypto/asn1/d2i_s_pr.c
+++ b/crypto/asn1/d2i_s_pr.c
@@ -58,6 +58,7 @@
/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
+#ifndef NO_DSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -101,4 +102,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL);
}
-
+#endif
diff --git a/crypto/asn1/d2i_s_pu.c b/crypto/asn1/d2i_s_pu.c
index 4d65cef5a9..2b1bf638c1 100644
--- a/crypto/asn1/d2i_s_pu.c
+++ b/crypto/asn1/d2i_s_pu.c
@@ -56,8 +56,9 @@
* [including the GNU Public Licence.]
*/
-/* Origional version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
+/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
+#ifndef NO_DSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -113,4 +114,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL);
}
-
+#endif
diff --git a/crypto/asn1/i2d_dhp.c b/crypto/asn1/i2d_dhp.c
index e82f2a96af..1b2b4b8ebe 100644
--- a/crypto/asn1/i2d_dhp.c
+++ b/crypto/asn1/i2d_dhp.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_DH
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -119,3 +120,4 @@ err:
*pp=p;
return(ret);
}
+#endif
diff --git a/crypto/asn1/i2d_dsap.c b/crypto/asn1/i2d_dsap.c
index 9317110464..f36f0da4e2 100644
--- a/crypto/asn1/i2d_dsap.c
+++ b/crypto/asn1/i2d_dsap.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_DSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -112,4 +113,5 @@ err:
*pp=p;
return(ret);
}
+#endif
diff --git a/crypto/asn1/i2d_r_pr.c b/crypto/asn1/i2d_r_pr.c
index 617c10af46..27e6844a7f 100644
--- a/crypto/asn1/i2d_r_pr.c
+++ b/crypto/asn1/i2d_r_pr.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_RSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -122,4 +123,5 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp)
*pp=p;
return(t);
}
+#endif
diff --git a/crypto/asn1/i2d_r_pu.c b/crypto/asn1/i2d_r_pu.c
index 03f7348527..6d01bfa8b5 100644
--- a/crypto/asn1/i2d_r_pu.c
+++ b/crypto/asn1/i2d_r_pu.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_RSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -108,4 +109,4 @@ int i2d_RSAPublicKey(RSA *a, unsigned char **pp)
*pp=p;
return(t);
}
-
+#endif
diff --git a/crypto/asn1/i2d_s_pr.c b/crypto/asn1/i2d_s_pr.c
index f3a5e8fe9d..5d3dcdf197 100644
--- a/crypto/asn1/i2d_s_pr.c
+++ b/crypto/asn1/i2d_s_pr.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_DSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -119,4 +120,4 @@ int i2d_DSAPrivateKey(DSA *a, unsigned char **pp)
*pp=p;
return(t);
}
-
+#endif
diff --git a/crypto/asn1/i2d_s_pu.c b/crypto/asn1/i2d_s_pu.c
index 7903ea410d..25b150794a 100644
--- a/crypto/asn1/i2d_s_pu.c
+++ b/crypto/asn1/i2d_s_pu.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_DSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
@@ -124,4 +125,4 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp)
*pp=p;
return(t);
}
-
+#endif
diff --git a/crypto/asn1/n_pkey.c b/crypto/asn1/n_pkey.c
index 9133bc6d29..cdc0d8b7c4 100644
--- a/crypto/asn1/n_pkey.c
+++ b/crypto/asn1/n_pkey.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_RSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/rsa.h>
@@ -78,6 +79,7 @@ static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp);
static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a,unsigned char **pp, long length);
static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void);
static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *);
+
int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
{
int i,j,l[6];
@@ -336,4 +338,4 @@ static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a)
}
#endif /* NO_RC4 */
-
+#endif
diff --git a/crypto/bf/Makefile.ssl b/crypto/bf/Makefile.ssl
index b1de95010c..225d818eca 100644
--- a/crypto/bf/Makefile.ssl
+++ b/crypto/bf/Makefile.ssl
@@ -91,7 +91,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/bf/bftest.c b/crypto/bf/bftest.c
index 091c8081a9..80182c0a2f 100644
--- a/crypto/bf/bftest.c
+++ b/crypto/bf/bftest.c
@@ -62,6 +62,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_BF
+int main(int argc, char *argv[])
+{
+ printf("No BF support\n");
+ return(0);
+}
+#else
#include <openssl/blowfish.h>
char *bf_key[2]={
@@ -511,3 +519,4 @@ static int test(void)
return(err);
}
+#endif
diff --git a/crypto/bf/blowfish.h b/crypto/bf/blowfish.h
index 005d0ed7b6..a18dfee1a4 100644
--- a/crypto/bf/blowfish.h
+++ b/crypto/bf/blowfish.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_BF
+#error BF is disabled.
+#endif
+
#define BF_ENCRYPT 1
#define BF_DECRYPT 0
diff --git a/crypto/bio/Makefile.ssl b/crypto/bio/Makefile.ssl
index 8a0f3f9e65..c1ccfd889d 100644
--- a/crypto/bio/Makefile.ssl
+++ b/crypto/bio/Makefile.ssl
@@ -73,7 +73,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/bn/Makefile.ssl b/crypto/bn/Makefile.ssl
index 6cd865a683..ca55875eee 100644
--- a/crypto/bn/Makefile.ssl
+++ b/crypto/bn/Makefile.ssl
@@ -140,7 +140,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/buffer/Makefile.ssl b/crypto/buffer/Makefile.ssl
index 0512a209cb..717615c801 100644
--- a/crypto/buffer/Makefile.ssl
+++ b/crypto/buffer/Makefile.ssl
@@ -65,7 +65,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/cast/Makefile.ssl b/crypto/cast/Makefile.ssl
index e29da45ddf..d44484c486 100644
--- a/crypto/cast/Makefile.ssl
+++ b/crypto/cast/Makefile.ssl
@@ -94,7 +94,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/cast/cast.h b/crypto/cast/cast.h
index c2657981b2..215356dbe4 100644
--- a/crypto/cast/cast.h
+++ b/crypto/cast/cast.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_CAST
+#error CAST is disabled.
+#endif
+
#define CAST_ENCRYPT 1
#define CAST_DECRYPT 0
diff --git a/crypto/cast/casttest.c b/crypto/cast/casttest.c
index a8a707c711..3244b119e9 100644
--- a/crypto/cast/casttest.c
+++ b/crypto/cast/casttest.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_CAST
+int main(int argc, char *argv[])
+{
+ printf("No CAST support\n");
+ return(0);
+}
+#else
#include <openssl/cast.h>
#define FULL_TEST
@@ -219,4 +227,4 @@ int main(int argc, char *argv[])
exit(err);
return(err);
}
-
+#endif
diff --git a/crypto/comp/Makefile.ssl b/crypto/comp/Makefile.ssl
index 89620a8fc8..2ccc8ed156 100644
--- a/crypto/comp/Makefile.ssl
+++ b/crypto/comp/Makefile.ssl
@@ -68,7 +68,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
- $(MAKEDEPEND) $(INCLUDES) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/crypto/conf/Makefile.ssl b/crypto/conf/Makefile.ssl
index a3e5a072f4..b84c53ce18 100644
--- a/crypto/conf/Makefile.ssl
+++ b/crypto/conf/Makefile.ssl
@@ -66,7 +66,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
- $(MAKEDEPEND) $(INCLUDES) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/crypto/des/Makefile.ssl b/crypto/des/Makefile.ssl
index 9bb5575ead..f243a90ddd 100644
--- a/crypto/des/Makefile.ssl
+++ b/crypto/des/Makefile.ssl
@@ -123,7 +123,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/des/des.h b/crypto/des/des.h
index 18ceaa2a25..392d8bbea0 100644
--- a/crypto/des/des.h
+++ b/crypto/des/des.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_DES
+#error DES is disabled.
+#endif
+
#include <stdio.h>
#include <openssl/opensslconf.h> /* DES_LONG */
diff --git a/crypto/des/destest.c b/crypto/des/destest.c
index 6b67e34cef..107635fcec 100644
--- a/crypto/des/destest.c
+++ b/crypto/des/destest.c
@@ -70,6 +70,14 @@
#include <io.h>
#endif
#include <string.h>
+
+#ifdef NO_DES
+int main(int argc, char *argv[])
+{
+ printf("No DES support\n");
+ return(0);
+}
+#else
#include <openssl/des.h>
#if defined(PERL5) || defined(__FreeBSD__)
@@ -318,6 +326,7 @@ int main(int argc, char *argv[])
int num;
char *str;
+#ifndef NO_DESCBCM
printf("Doing cbcm\n");
if ((j=des_key_sched(cbc_key,ks)) != 0)
{
@@ -368,7 +377,7 @@ int main(int argc, char *argv[])
printf("\n");
err=1;
}
-
+#endif
printf("Doing ecb\n");
for (i=0; i<NUM_TESTS; i++)
@@ -908,4 +917,4 @@ static int ede_cfb64_test(unsigned char *cfb_cipher)
}
#endif
-
+#endif
diff --git a/crypto/des/ede_cbcm_enc.c b/crypto/des/ede_cbcm_enc.c
index 82ef96188c..302e32ef48 100644
--- a/crypto/des/ede_cbcm_enc.c
+++ b/crypto/des/ede_cbcm_enc.c
@@ -68,6 +68,7 @@ http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/1998/CS/CS0928.ps.gz
*/
+#ifndef NO_DESCBCM
#include "des_locl.h"
void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
@@ -192,3 +193,4 @@ void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
tin0=tin1=tout0=tout1=xor0=xor1=0;
tin[0]=tin[1]=0;
}
+#endif
diff --git a/crypto/dh/Makefile.ssl b/crypto/dh/Makefile.ssl
index 1dfdd01543..eb4dc12f4e 100644
--- a/crypto/dh/Makefile.ssl
+++ b/crypto/dh/Makefile.ssl
@@ -65,7 +65,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/dh/dh.h b/crypto/dh/dh.h
index 3ae16f3b0c..6a0a186fe3 100644
--- a/crypto/dh/dh.h
+++ b/crypto/dh/dh.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_DH
+#error DH is disabled.
+#endif
+
#include <openssl/bn.h>
#define DH_FLAG_CACHE_MONT_P 0x01
diff --git a/crypto/dh/dhtest.c b/crypto/dh/dhtest.c
index c638e16bba..370784b964 100644
--- a/crypto/dh/dhtest.c
+++ b/crypto/dh/dhtest.c
@@ -65,6 +65,14 @@
#include <openssl/crypto.h>
#include <openssl/bio.h>
#include <openssl/bn.h>
+
+#ifdef NO_DH
+int main(int argc, char *argv[])
+{
+ printf("No DH support\n");
+ return(0);
+}
+#else
#include <openssl/dh.h>
#ifdef WIN16
@@ -177,3 +185,4 @@ static void MS_CALLBACK cb(int p, int n, char *arg)
p=n;
#endif
}
+#endif
diff --git a/crypto/dsa/Makefile.ssl b/crypto/dsa/Makefile.ssl
index e80750b95b..435349c396 100644
--- a/crypto/dsa/Makefile.ssl
+++ b/crypto/dsa/Makefile.ssl
@@ -65,7 +65,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/dsa/dsa.h b/crypto/dsa/dsa.h
index 3fc15194e3..d9ff1933ee 100644
--- a/crypto/dsa/dsa.h
+++ b/crypto/dsa/dsa.h
@@ -69,6 +69,10 @@
extern "C" {
#endif
+#ifdef NO_DSA
+#error DSA is disabled.
+#endif
+
#include <openssl/bn.h>
#define DSA_FLAG_CACHE_MONT_P 0x01
diff --git a/crypto/dsa/dsatest.c b/crypto/dsa/dsatest.c
index c0209936af..363eab6217 100644
--- a/crypto/dsa/dsatest.c
+++ b/crypto/dsa/dsatest.c
@@ -65,11 +65,19 @@
#include <openssl/rand.h>
#include <openssl/bio.h>
#include <openssl/err.h>
-#include <openssl/dsa.h>
#ifdef WINDOWS
#include "../bio/bss_file.c"
#endif
+#ifdef NO_DSA
+int main(int argc, char *argv[])
+{
+ printf("No DSA support\n");
+ return(0);
+}
+#else
+#include <openssl/dsa.h>
+
#ifdef WIN16
#define MS_CALLBACK _far _loadds
#else
@@ -206,5 +214,4 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
exit(1);
}
}
-
-
+#endif
diff --git a/crypto/err/Makefile.ssl b/crypto/err/Makefile.ssl
index d3030b98c8..f92b3ae6c5 100644
--- a/crypto/err/Makefile.ssl
+++ b/crypto/err/Makefile.ssl
@@ -65,7 +65,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/evp/Makefile.ssl b/crypto/evp/Makefile.ssl
index 3491f2ceb3..08f0a79a83 100644
--- a/crypto/evp/Makefile.ssl
+++ b/crypto/evp/Makefile.ssl
@@ -92,7 +92,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
- $(MAKEDEPEND) $(INCLUDES) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h
index 4b5af77b2a..ccb7d51474 100644
--- a/crypto/evp/evp.h
+++ b/crypto/evp/evp.h
@@ -69,10 +69,10 @@ extern "C" {
#ifndef NO_MD5
#include <openssl/md5.h>
#endif
-#if !defined(NO_SHA) || !defined(NO_SHA1)
+#ifndef NO_SHA
#include <openssl/sha.h>
#endif
-#ifndef NO_RMD160
+#ifndef NO_RIPEMD
#include <openssl/ripemd.h>
#endif
#ifndef NO_DES
@@ -87,7 +87,7 @@ extern "C" {
#ifndef NO_RC5
#include <openssl/rc5.h>
#endif
-#ifndef NO_BLOWFISH
+#ifndef NO_BF
#include <openssl/blowfish.h>
#endif
#ifndef NO_CAST
@@ -111,20 +111,14 @@ extern "C" {
#ifndef NO_RSA
#include <openssl/rsa.h>
-#else
-#define RSA long
#endif
#ifndef NO_DSA
#include <openssl/dsa.h>
-#else
-#define DSA long
#endif
#ifndef NO_DH
#include <openssl/dh.h>
-#else
-#define DH long
#endif
#include <openssl/objects.h>
@@ -159,9 +153,15 @@ typedef struct evp_pkey_st
int references;
union {
char *ptr;
+#ifndef NO_RSA
struct rsa_st *rsa; /* RSA */
+#endif
+#ifndef NO_DSA
struct dsa_st *dsa; /* DSA */
+#endif
+#ifndef NO_DH
struct dh_st *dh; /* DH */
+#endif
} pkey;
int save_parameters;
STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */
@@ -294,10 +294,10 @@ typedef struct env_md_ctx_st
#ifndef NO_MD5
MD5_CTX md5;
#endif
-#ifndef NO_RMD160
+#ifndef NO_RIPEMD
RIPEMD160_CTX ripemd160;
#endif
-#if !defined(NO_SHA) || !defined(NO_SHA1)
+#ifndef NO_SHA
SHA_CTX sha;
#endif
#ifndef NO_MDC2
@@ -372,7 +372,7 @@ typedef struct evp_cipher_ctx_st
#ifndef NO_RC5
RC5_32_KEY rc5_ks;/* key schedule */
#endif
-#ifndef NO_BLOWFISH
+#ifndef NO_BF
BF_KEY bf_ks;/* key schedule */
#endif
#ifndef NO_CAST
diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c
index 8bea61ebbd..421e452db1 100644
--- a/crypto/evp/evp_pkey.c
+++ b/crypto/evp/evp_pkey.c
@@ -67,14 +67,19 @@
EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
{
EVP_PKEY *pkey;
+#ifndef NO_RSA
RSA *rsa;
+#endif
+#ifndef NO_DSA
DSA *dsa;
ASN1_INTEGER *dsapriv;
- X509_ALGOR *a;
STACK *ndsa;
BN_CTX *ctx;
+ int plen;
+#endif
+ X509_ALGOR *a;
unsigned char *p;
- int plen, pkeylen;
+ int pkeylen;
char obj_tmp[80];
switch (p8->broken) {
@@ -100,6 +105,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
a = p8->pkeyalg;
switch (OBJ_obj2nid(a->algorithm))
{
+#ifndef NO_RSA
case NID_rsaEncryption:
if (!(rsa = d2i_RSAPrivateKey (NULL, &p, pkeylen))) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
@@ -107,7 +113,8 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
}
EVP_PKEY_assign_RSA (pkey, rsa);
break;
-
+#endif
+#ifndef NO_DSA
case NID_dsa:
/* PKCS#8 DSA is weird: you just get a private key integer
* and parameters in the AlgorithmIdentifier the pubkey must
@@ -174,7 +181,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
EVP_PKEY_assign_DSA (pkey, dsa);
BN_CTX_free (ctx);
break;
-
+#endif
default:
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
if (!a->algorithm) strcpy (obj_tmp, "NULL");
@@ -191,9 +198,11 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
{
PKCS8_PRIV_KEY_INFO *p8;
+#ifndef NO_DSA
ASN1_INTEGER *dpkey;
unsigned char *p, *q;
int len;
+#endif
if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) {
EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
return NULL;
@@ -205,6 +214,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
return NULL;
}
switch (EVP_PKEY_type(pkey->type)) {
+#ifndef NO_RSA
case EVP_PKEY_RSA:
p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption);
@@ -216,7 +226,8 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
return NULL;
}
break;
-
+#endif
+#ifndef NO_DSA
case EVP_PKEY_DSA:
p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa);
@@ -249,7 +260,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
}
ASN1_INTEGER_free (dpkey);
break;
-
+#endif
default:
EVPerr(EVP_F_EVP_PKEY2PKCS8, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
PKCS8_PRIV_KEY_INFO_free (p8);
diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c
index 6b532949a7..ddb9fd6942 100644
--- a/crypto/evp/p_open.c
+++ b/crypto/evp/p_open.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_RSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
@@ -109,3 +110,4 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
EVP_DecryptInit(ctx,NULL,NULL,NULL);
return(i);
}
+#endif
diff --git a/crypto/evp/p_seal.c b/crypto/evp/p_seal.c
index cd29276773..09b46f4b0e 100644
--- a/crypto/evp/p_seal.c
+++ b/crypto/evp/p_seal.c
@@ -59,7 +59,9 @@
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/rand.h>
+#ifndef NO_RSA
#include <openssl/rsa.h>
+#endif
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
diff --git a/crypto/hmac/Makefile.ssl b/crypto/hmac/Makefile.ssl
index f6d3bd13b2..6e1f964ead 100644
--- a/crypto/hmac/Makefile.ssl
+++ b/crypto/hmac/Makefile.ssl
@@ -65,7 +65,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/hmac/hmac.h b/crypto/hmac/hmac.h
index 2efce942e2..91b2f8d663 100644
--- a/crypto/hmac/hmac.h
+++ b/crypto/hmac/hmac.h
@@ -62,6 +62,10 @@
extern "C" {
#endif
+#ifdef NO_HMAC
+#error No HMAC support.
+#endif
+
#include <openssl/evp.h>
#define HMAC_MAX_MD_CBLOCK 64
diff --git a/crypto/hmac/hmactest.c b/crypto/hmac/hmactest.c
index 0a3db6852c..15eb0c416f 100644
--- a/crypto/hmac/hmactest.c
+++ b/crypto/hmac/hmactest.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_HMAC
+int main(int argc, char *argv[])
+{
+ printf("No HMAC support\n");
+ return(0);
+}
+#else
#include <openssl/hmac.h>
struct test_st
@@ -137,3 +145,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf);
}
+#endif
diff --git a/crypto/idea/Makefile.ssl b/crypto/idea/Makefile.ssl
index b643086dab..a61defe6f5 100644
--- a/crypto/idea/Makefile.ssl
+++ b/crypto/idea/Makefile.ssl
@@ -65,7 +65,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/idea/idea.h b/crypto/idea/idea.h
index 0075426d94..ae32f5692e 100644
--- a/crypto/idea/idea.h
+++ b/crypto/idea/idea.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_IDEA
+#error IDEA is disabled.
+#endif
+
#define IDEA_ENCRYPT 1
#define IDEA_DECRYPT 0
diff --git a/crypto/idea/ideatest.c b/crypto/idea/ideatest.c
index 4593d9e694..64b9353e41 100644
--- a/crypto/idea/ideatest.c
+++ b/crypto/idea/ideatest.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_IDEA
+int main(int argc, char *argv[])
+{
+ printf("No IDEA support\n");
+ return(0);
+}
+#else
#include <openssl/idea.h>
unsigned char k[16]={
@@ -219,4 +227,4 @@ static char *pt(unsigned char *p)
ret[16]='\0';
return(ret);
}
-
+#endif
diff --git a/crypto/lhash/Makefile.ssl b/crypto/lhash/Makefile.ssl
index dc56cec3da..15bf962fde 100644
--- a/crypto/lhash/Makefile.ssl
+++ b/crypto/lhash/Makefile.ssl
@@ -65,7 +65,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/md2/Makefile.ssl b/crypto/md2/Makefile.ssl
index cc7afffc62..d5faa85ecf 100644
--- a/crypto/md2/Makefile.ssl
+++ b/crypto/md2/Makefile.ssl
@@ -65,7 +65,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/md2/md2.h b/crypto/md2/md2.h
index e0285a3b88..0d3592506c 100644
--- a/crypto/md2/md2.h
+++ b/crypto/md2/md2.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_MD2
+#error MD2 is disabled.
+#endif
+
#define MD2_DIGEST_LENGTH 16
#define MD2_BLOCK 16
#include <openssl/opensslconf.h> /* MD2_INT */
diff --git a/crypto/md2/md2test.c b/crypto/md2/md2test.c
index 2368ec3332..63404b1833 100644
--- a/crypto/md2/md2test.c
+++ b/crypto/md2/md2test.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#ifdef NO_MD2
+int main(int argc, char *argv[])
+{
+ printf("No MD2 support\n");
+ return(0);
+}
+#else
#include <openssl/md2.h>
char *test[]={
@@ -120,3 +128,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf);
}
+#endif
diff --git a/crypto/md5/Makefile.ssl b/crypto/md5/Makefile.ssl
index f91b46289f..4a78035697 100644
--- a/crypto/md5/Makefile.ssl
+++ b/crypto/md5/Makefile.ssl
@@ -89,7 +89,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/md5/md5.h b/crypto/md5/md5.h
index fc767872ed..6e97fe1e4f 100644
--- a/crypto/md5/md5.h
+++ b/crypto/md5/md5.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_MD5
+#error MD5 is disabled.
+#endif
+
#define MD5_CBLOCK 64
#define MD5_LBLOCK 16
#define MD5_BLOCK 16
diff --git a/crypto/md5/md5test.c b/crypto/md5/md5test.c
index 2778b40ef6..a192a62bb3 100644
--- a/crypto/md5/md5test.c
+++ b/crypto/md5/md5test.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_MD5
+int main(int argc, char *argv[])
+{
+ printf("No MD5 support\n");
+ return(0);
+}
+#else
#include <openssl/md5.h>
char *test[]={
@@ -120,3 +128,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf);
}
+#endif
diff --git a/crypto/mdc2/Makefile.ssl b/crypto/mdc2/Makefile.ssl
index 924a8b3fbe..eb0f0d627e 100644
--- a/crypto/mdc2/Makefile.ssl
+++ b/crypto/mdc2/Makefile.ssl
@@ -65,7 +65,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/mdc2/mdc2.h b/crypto/mdc2/mdc2.h
index 39a6c9e9ff..ec8e159fc9 100644
--- a/crypto/mdc2/mdc2.h
+++ b/crypto/mdc2/mdc2.h
@@ -65,6 +65,10 @@ extern "C" {
#include <openssl/des.h>
+#ifdef NO_MDC2
+#error MDC2 is disabled.
+#endif
+
#define MDC2_BLOCK 8
#define MDC2_DIGEST_LENGTH 16
diff --git a/crypto/mdc2/mdc2test.c b/crypto/mdc2/mdc2test.c
index f627162988..6fc6c0ed00 100644
--- a/crypto/mdc2/mdc2test.c
+++ b/crypto/mdc2/mdc2test.c
@@ -59,6 +59,18 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#ifdef NO_DES
+#define NO_MDC2
+#endif
+
+#ifdef NO_MDC2
+int main(int argc, char *argv[])
+{
+ printf("No MDC2 support\n");
+ return(0);
+}
+#else
#include <openssl/mdc2.h>
static unsigned char pad1[16]={
@@ -117,4 +129,4 @@ int main(int argc, char *argv[])
exit(ret);
return(ret);
}
-
+#endif
diff --git a/crypto/objects/Makefile.ssl b/crypto/objects/Makefile.ssl
index e139fe41ea..a7ad157d09 100644
--- a/crypto/objects/Makefile.ssl
+++ b/crypto/objects/Makefile.ssl
@@ -68,7 +68,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/objects/obj_dat.h b/crypto/objects/obj_dat.h
index 03ba60c255..10a6304af5 100644
--- a/crypto/objects/obj_dat.h
+++ b/crypto/objects/obj_dat.h
@@ -761,8 +761,8 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[19]),/* OBJ_rsa 2 5 8 1 1 */
&(nid_objs[96]),/* OBJ_mdc2WithRSA 2 5 8 3 100 */
&(nid_objs[95]),/* OBJ_mdc2 2 5 8 3 101 */
-&(nid_objs[125]),/* OBJ_zlib_compression 1 1 1 1 666.2 */
&(nid_objs[124]),/* OBJ_rle_compression 1 1 1 1 666.1 */
+&(nid_objs[125]),/* OBJ_zlib_compression 1 1 1 1 666.2 */
&(nid_objs[104]),/* OBJ_md5WithRSA 1 3 14 3 2 3 */
&(nid_objs[29]),/* OBJ_des_ecb 1 3 14 3 2 6 */
&(nid_objs[31]),/* OBJ_des_cbc 1 3 14 3 2 7 */
diff --git a/crypto/pem/Makefile.ssl b/crypto/pem/Makefile.ssl
index 3582404cf4..519547a953 100644
--- a/crypto/pem/Makefile.ssl
+++ b/crypto/pem/Makefile.ssl
@@ -66,7 +66,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
- $(MAKEDEPEND) $(INCLUDES) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h
index e9eb5477e7..6f0f09fcbe 100644
--- a/crypto/pem/pem.h
+++ b/crypto/pem/pem.h
@@ -372,28 +372,42 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str);
X509 *PEM_read_X509(FILE *fp,X509 **x,int (*cb)());
X509_REQ *PEM_read_X509_REQ(FILE *fp,X509_REQ **x,int (*cb)());
X509_CRL *PEM_read_X509_CRL(FILE *fp,X509_CRL **x,int (*cb)());
+#ifndef NO_RSA
RSA *PEM_read_RSAPrivateKey(FILE *fp,RSA **x,int (*cb)());
RSA *PEM_read_RSAPublicKey(FILE *fp,RSA **x,int (*cb)());
+#endif
+#ifndef NO_DSA
DSA *PEM_read_DSAPrivateKey(FILE *fp,DSA **x,int (*cb)());
+DSA *PEM_read_DSAparams(FILE *fp,DSA **x,int (*cb)());
+#endif
+#ifndef NO_DH
+DH *PEM_read_DHparams(FILE *fp,DH **x,int (*cb)());
+#endif
EVP_PKEY *PEM_read_PrivateKey(FILE *fp,EVP_PKEY **x,int (*cb)());
PKCS7 *PEM_read_PKCS7(FILE *fp,PKCS7 **x,int (*cb)());
-DH *PEM_read_DHparams(FILE *fp,DH **x,int (*cb)());
-DSA *PEM_read_DSAparams(FILE *fp,DSA **x,int (*cb)());
NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)());
int PEM_write_X509(FILE *fp,X509 *x);
int PEM_write_X509_REQ(FILE *fp,X509_REQ *x);
int PEM_write_X509_CRL(FILE *fp,X509_CRL *x);
+#ifndef NO_RSA
int PEM_write_RSAPrivateKey(FILE *fp,RSA *x,EVP_CIPHER *enc,unsigned char *kstr,
int klen,int (*cb)());
int PEM_write_RSAPublicKey(FILE *fp,RSA *x);
+#endif
+#ifndef NO_DSA
int PEM_write_DSAPrivateKey(FILE *fp,DSA *x,const EVP_CIPHER *enc,
unsigned char *kstr,
int klen,int (*cb)());
+#endif
int PEM_write_PrivateKey(FILE *fp,EVP_PKEY *x,EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)());
int PEM_write_PKCS7(FILE *fp,PKCS7 *x);
+#ifndef NO_DH
int PEM_write_DHparams(FILE *fp,DH *x);
+#endif
+#ifndef NO_DSA
int PEM_write_DSAparams(FILE *fp,DSA *x);
+#endif
int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x);
#endif
@@ -401,27 +415,43 @@ int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x);
X509 *PEM_read_bio_X509(BIO *bp,X509 **x,int (*cb)());
X509_REQ *PEM_read_bio_X509_REQ(BIO *bp,X509_REQ **x,int (*cb)());
X509_CRL *PEM_read_bio_X509_CRL(BIO *bp,X509_CRL **x,int (*cb)());
+#ifndef NO_RSA
RSA *PEM_read_bio_RSAPrivateKey(BIO *bp,RSA **x,int (*cb)());
RSA *PEM_read_bio_RSAPublicKey(BIO *bp,RSA **x,int (*cb)());
+#endif
+#ifndef NO_DSA
DSA *PEM_read_bio_DSAPrivateKey(BIO *bp,DSA **x,int (*cb)());
+#endif
EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp,EVP_PKEY **x,int (*cb)());
PKCS7 *PEM_read_bio_PKCS7(BIO *bp,PKCS7 **x,int (*cb)());
+#ifndef NO_DH
DH *PEM_read_bio_DHparams(BIO *bp,DH **x,int (*cb)());
+#endif
NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)());
+#ifndef NO_DSA
DSA *PEM_read_bio_DSAparams(BIO *bp,DSA **x,int (*cb)());
+#endif
int PEM_write_bio_X509(BIO *bp,X509 *x);
int PEM_write_bio_X509_REQ(BIO *bp,X509_REQ *x);
int PEM_write_bio_X509_CRL(BIO *bp,X509_CRL *x);
+#ifndef NO_RSA
int PEM_write_bio_RSAPrivateKey(BIO *fp,RSA *x,const EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)());
int PEM_write_bio_RSAPublicKey(BIO *fp,RSA *x);
+#endif
+#ifndef NO_DSA
int PEM_write_bio_DSAPrivateKey(BIO *fp,DSA *x,const EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)());
+#endif
int PEM_write_bio_PrivateKey(BIO *fp,EVP_PKEY *x,EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)());
int PEM_write_bio_PKCS7(BIO *bp,PKCS7 *x);
+#ifndef NO_DH
int PEM_write_bio_DHparams(BIO *bp,DH *x);
+#endif
+#ifndef NO_DSA
int PEM_write_bio_DSAparams(BIO *bp,DSA *x);
+#endif
int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE *x);
#endif
diff --git a/crypto/pem/pem_seal.c b/crypto/pem/pem_seal.c
index 5f5d2c0e43..23f95beb1e 100644
--- a/crypto/pem/pem_seal.c
+++ b/crypto/pem/pem_seal.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#ifndef NO_RSA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
@@ -174,3 +175,4 @@ err:
if (s != NULL) Free(s);
return(ret);
}
+#endif
diff --git a/crypto/pkcs12/Makefile.ssl b/crypto/pkcs12/Makefile.ssl
index b4d5a53941..f86ef95a22 100644
--- a/crypto/pkcs12/Makefile.ssl
+++ b/crypto/pkcs12/Makefile.ssl
@@ -71,7 +71,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/pkcs12/p12_crpt.c b/crypto/pkcs12/p12_crpt.c
index 137d7cd360..9e37436c92 100644
--- a/crypto/pkcs12/p12_crpt.c
+++ b/crypto/pkcs12/p12_crpt.c
@@ -64,18 +64,22 @@
void PKCS12_PBE_add(void)
{
+#ifndef NO_RC4
EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(),
PKCS12_PBE_keyivgen);
EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC4, EVP_rc4_40(), EVP_sha1(),
PKCS12_PBE_keyivgen);
+#endif
EVP_PBE_alg_add(NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
EVP_des_ede3_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen);
EVP_PBE_alg_add(NID_pbe_WithSHA1And2_Key_TripleDES_CBC,
EVP_des_ede_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen);
+#ifndef NO_RC2
EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC2_CBC, EVP_rc2_cbc(),
EVP_sha1(), PKCS12_PBE_keyivgen);
EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(),
EVP_sha1(), PKCS12_PBE_keyivgen);
+#endif
}
int PKCS12_PBE_keyivgen (const char *pass, int passlen, unsigned char *salt,
diff --git a/crypto/pkcs7/Makefile.ssl b/crypto/pkcs7/Makefile.ssl
index e81cb1bba4..b2607f905f 100644
--- a/crypto/pkcs7/Makefile.ssl
+++ b/crypto/pkcs7/Makefile.ssl
@@ -67,7 +67,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/rand/Makefile.ssl b/crypto/rand/Makefile.ssl
index 7a001647ee..17591e0bb8 100644
--- a/crypto/rand/Makefile.ssl
+++ b/crypto/rand/Makefile.ssl
@@ -65,7 +65,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/rc2/Makefile.ssl b/crypto/rc2/Makefile.ssl
index c78a099aaa..50a46c751d 100644
--- a/crypto/rc2/Makefile.ssl
+++ b/crypto/rc2/Makefile.ssl
@@ -65,7 +65,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/rc2/rc2.h b/crypto/rc2/rc2.h
index 0204745f6f..9571efb755 100644
--- a/crypto/rc2/rc2.h
+++ b/crypto/rc2/rc2.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_RC2
+#error RC2 is disabled.
+#endif
+
#define RC2_ENCRYPT 1
#define RC2_DECRYPT 0
diff --git a/crypto/rc2/rc2test.c b/crypto/rc2/rc2test.c
index e6b355f434..6a5defa6ea 100644
--- a/crypto/rc2/rc2test.c
+++ b/crypto/rc2/rc2test.c
@@ -62,6 +62,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_RC2
+int main(int argc, char *argv[])
+{
+ printf("No RC2 support\n");
+ return(0);
+}
+#else
#include <openssl/rc2.h>
unsigned char RC2key[4][16]={
@@ -258,3 +266,4 @@ static char *pt(unsigned char *p)
}
#endif
+#endif
diff --git a/crypto/rc4/Makefile.ssl b/crypto/rc4/Makefile.ssl
index 60e419f809..389c4ea1c0 100644
--- a/crypto/rc4/Makefile.ssl
+++ b/crypto/rc4/Makefile.ssl
@@ -93,7 +93,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/rc4/rc4.h b/crypto/rc4/rc4.h
index 8d2b165dc2..7418c2a9a2 100644
--- a/crypto/rc4/rc4.h
+++ b/crypto/rc4/rc4.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_RC4
+#error RC4 is disabled.
+#endif
+
#include <openssl/opensslconf.h> /* RC4_INT */
typedef struct rc4_key_st
diff --git a/crypto/rc4/rc4test.c b/crypto/rc4/rc4test.c
index 1410b72951..5abf8cff30 100644
--- a/crypto/rc4/rc4test.c
+++ b/crypto/rc4/rc4test.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#ifdef NO_RC4
+int main(int argc, char *argv[])
+{
+ printf("No RC4 support\n");
+ return(0);
+}
+#else
#include <openssl/rc4.h>
unsigned char keys[7][30]={
@@ -190,4 +198,4 @@ int main(int argc, char *argv[])
exit(err);
return(0);
}
-
+#endif
diff --git a/crypto/rc5/Makefile.ssl b/crypto/rc5/Makefile.ssl
index 98b70be225..31349ed40f 100644
--- a/crypto/rc5/Makefile.ssl
+++ b/crypto/rc5/Makefile.ssl
@@ -91,7 +91,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/rc5/rc5.h b/crypto/rc5/rc5.h
index c18d943995..38e901502b 100644
--- a/crypto/rc5/rc5.h
+++ b/crypto/rc5/rc5.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_RC5
+#error RC5 is disabled.
+#endif
+
#define RC5_ENCRYPT 1
#define RC5_DECRYPT 0
diff --git a/crypto/rc5/rc5test.c b/crypto/rc5/rc5test.c
index d24da3c381..d819284607 100644
--- a/crypto/rc5/rc5test.c
+++ b/crypto/rc5/rc5test.c
@@ -62,6 +62,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_RC5
+int main(int argc, char *argv[])
+{
+ printf("No RC5 support\n");
+ return(0);
+}
+#else
#include <openssl/rc5.h>
unsigned char RC5key[5][16]={
@@ -373,3 +381,4 @@ static char *pt(unsigned char *p)
}
#endif
+#endif
diff --git a/crypto/ripemd/Makefile.ssl b/crypto/ripemd/Makefile.ssl
index 8e81d85d52..c43c2e0c13 100644
--- a/crypto/ripemd/Makefile.ssl
+++ b/crypto/ripemd/Makefile.ssl
@@ -89,7 +89,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/ripemd/ripemd.h b/crypto/ripemd/ripemd.h
index b2708d59ca..ab76be4c33 100644
--- a/crypto/ripemd/ripemd.h
+++ b/crypto/ripemd/ripemd.h
@@ -63,6 +63,10 @@
extern "C" {
#endif
+#ifdef NO_RIPEMD
+#error RIPEMD is disabled.
+#endif
+
#define RIPEMD160_CBLOCK 64
#define RIPEMD160_LBLOCK 16
#define RIPEMD160_BLOCK 16
diff --git a/crypto/ripemd/rmdtest.c b/crypto/ripemd/rmdtest.c
index 11737e24a6..8a19f29999 100644
--- a/crypto/ripemd/rmdtest.c
+++ b/crypto/ripemd/rmdtest.c
@@ -59,6 +59,14 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#ifdef NO_RIPEMD
+int main(int argc, char *argv[])
+{
+ printf("No ripemd support\n");
+ return(0);
+}
+#else
#include <openssl/ripemd.h>
char *test[]={
@@ -122,4 +130,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf);
}
-
+#endif
diff --git a/crypto/rsa/Makefile.ssl b/crypto/rsa/Makefile.ssl
index 9487b6f514..96480f4902 100644
--- a/crypto/rsa/Makefile.ssl
+++ b/crypto/rsa/Makefile.ssl
@@ -67,7 +67,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/rsa/rsa.h b/crypto/rsa/rsa.h
index f006b890db..2f53ff04b9 100644
--- a/crypto/rsa/rsa.h
+++ b/crypto/rsa/rsa.h
@@ -66,6 +66,10 @@ extern "C" {
#include <openssl/bn.h>
#include <openssl/crypto.h>
+#ifdef NO_RSA
+#error RSA is disabled.
+#endif
+
typedef struct rsa_st RSA;
typedef struct rsa_meth_st
diff --git a/crypto/rsa/rsa_oaep_test.c b/crypto/rsa/rsa_oaep_test.c
index 4005aa5ed2..4dd078ddbe 100644
--- a/crypto/rsa/rsa_oaep_test.c
+++ b/crypto/rsa/rsa_oaep_test.c
@@ -3,8 +3,15 @@
#include <stdio.h>
#include <string.h>
#include <openssl/e_os.h>
-#include <openssl/rsa.h>
#include <openssl/err.h>
+#ifdef NO_RSA
+int main(int argc, char *argv[])
+{
+ printf("No RSA support\n");
+ return(0);
+}
+#else
+#include <openssl/rsa.h>
#define SetKey \
key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \
@@ -291,3 +298,4 @@ int main()
}
return err;
}
+#endif
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
diff --git a/crypto/stack/Makefile.ssl b/crypto/stack/Makefile.ssl
index 3abe0bc523..4d34e5ff4f 100644
--- a/crypto/stack/Makefile.ssl
+++ b/crypto/stack/Makefile.ssl
@@ -65,7 +65,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/txt_db/Makefile.ssl b/crypto/txt_db/Makefile.ssl
index 6b9e5b6219..8bae0e70c6 100644
--- a/crypto/txt_db/Makefile.ssl
+++ b/crypto/txt_db/Makefile.ssl
@@ -65,7 +65,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/x509/Makefile.ssl b/crypto/x509/Makefile.ssl
index c724a74f9b..1fc144f165 100644
--- a/crypto/x509/Makefile.ssl
+++ b/crypto/x509/Makefile.ssl
@@ -75,7 +75,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/x509/x509.h b/crypto/x509/x509.h
index 1ba0be7786..7c3ab2fedb 100644
--- a/crypto/x509/x509.h
+++ b/crypto/x509/x509.h
@@ -69,20 +69,14 @@ extern "C" {
#ifndef NO_RSA
#include <openssl/rsa.h>
-#else
-#define RSA long
#endif
#ifndef NO_DSA
#include <openssl/dsa.h>
-#else
-#define DSA long
#endif
#ifndef NO_DH
#include <openssl/dh.h>
-#else
-#define DH long
#endif
#include <openssl/evp.h>
@@ -549,13 +543,17 @@ X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL *crl);
int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl);
X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ *req);
int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req);
+#ifndef NO_RSA
RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA *rsa);
int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa);
-DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
-int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA *rsa);
int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa);
#endif
+#ifndef NO_DSA
+DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
+int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
+#endif
+#endif
#ifdef HEADER_BIO_H
X509 *d2i_X509_bio(BIO *bp,X509 *x509);
@@ -564,13 +562,17 @@ X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL *crl);
int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl);
X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ *req);
int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req);
+#ifndef NO_RSA
RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA *rsa);
int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa);
-DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
-int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA *rsa);
int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa);
#endif
+#ifndef NO_DSA
+DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
+int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
+#endif
+#endif
X509 *X509_dup(X509 *x509);
X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
@@ -580,8 +582,10 @@ X509_REQ *X509_REQ_dup(X509_REQ *req);
X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
X509_NAME *X509_NAME_dup(X509_NAME *xn);
X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
+#ifndef NO_RSA
RSA *RSAPublicKey_dup(RSA *rsa);
RSA *RSAPrivateKey_dup(RSA *rsa);
+#endif
#endif /* !SSLEAY_MACROS */
diff --git a/crypto/x509v3/Makefile.ssl b/crypto/x509v3/Makefile.ssl
index a46f10a209..84e6ad3eef 100644
--- a/crypto/x509v3/Makefile.ssl
+++ b/crypto/x509v3/Makefile.ssl
@@ -69,7 +69,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
- $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDES) $(DEPFLFAG) $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new