Some more ifdefs for no-xxx options.
authorUlf Möller <ulf@openssl.org>
Fri, 21 Jan 2000 00:03:51 +0000 (00:03 +0000)
committerUlf Möller <ulf@openssl.org>
Fri, 21 Jan 2000 00:03:51 +0000 (00:03 +0000)
crypto/mdc2/mdc2test.c
crypto/x509/x509.h
crypto/x509/x509_cmp.c
crypto/x509v3/v3_purp.c
ssl/ssl.h

index 0b1134bfe585b43261f549433d3c8d3f227b8efe..46c25aeff4c6cdcf9cdb4f21a2c566141927e14b 100644 (file)
@@ -60,7 +60,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#ifdef NO_DES
+#if defined(NO_DES) && !defined(NO_MDC2)
 #define NO_MDC2
 #endif
 
index 849633a3ec25f8940a2a5aca5a6743d48f885e45..6b2c290bc5e55f5c5f5263a363a1c8ba0407c297 100644 (file)
@@ -260,7 +260,9 @@ typedef struct x509_st
        unsigned long ex_kusage;
        unsigned long ex_xkusage;
        unsigned long ex_nscert;
+#ifndef NO_SHA
        unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+#endif
        X509_CERT_AUX *aux;
        } X509;
 
index 62d801336087ba643f83976cb33f0ad5a61a4d95..200682fd3e981061510bf5c4fb243e3696f610ba 100644 (file)
@@ -136,6 +136,8 @@ unsigned long X509_subject_name_hash(X509 *x)
        {
        return(X509_NAME_hash(x->cert_info->subject));
        }
+
+#ifndef NO_SHA
 /* Compare two certificates: they must be identical for
  * this to work.
  */
@@ -144,8 +146,10 @@ int X509_cmp(X509 *a, X509 *b)
        /* ensure hash is valid */
        X509_check_purpose(a, -1, 0);
        X509_check_purpose(b, -1, 0);
+
        return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
 }
+#endif
 
 int X509_NAME_cmp(X509_NAME *a, X509_NAME *b)
        {
index c5fca40c4c03e0e358db1d2596220c2da65e003e..e03f9765283517b72f3eda06baba808350e32beb 100644 (file)
@@ -247,6 +247,7 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp)
        return xp->trust;
 }
 
+#ifndef NO_SHA
 static void x509v3_cache_extensions(X509 *x)
 {
        BASIC_CONSTRAINTS *bs;
@@ -321,6 +322,7 @@ static void x509v3_cache_extensions(X509 *x)
        }
        x->ex_flags |= EXFLAG_SET;
 }
+#endif
 
 /* CA checks common to all purposes
  * return codes:
index db498041a3264a9c3e363af683058700a2ec64f0..11796af105ced861ff0a47b5ca448595e726176e 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -151,7 +151,7 @@ extern "C" {
 #include <openssl/pem.h>
 #include <openssl/x509.h>
 
-#if defined(NO_RSA) && !defined(NO_SSL2)
+#if (defined(NO_RSA) || defined(NO_MD5)) && !defined(NO_SSL2)
 #define NO_SSL2
 #endif