Hello,

The following defines are not honored during compilation of rsa/dsa/dh:
   OPENSSL_NO_RSA
   OPENSSL_NO_DSA
   OPENSSL_NO_DH

The following source files have to be modified:

usr/src/common/openssl/crypto/dh/dh_asn1.c
usr/src/common/openssl/crypto/dh/dh_gen.c
usr/src/common/openssl/crypto/dh/dh_key.c
usr/src/common/openssl/crypto/dh/dh_lib.c
usr/src/common/openssl/crypto/dh/dh_check.c
usr/src/common/openssl/crypto/dh/dh_err.c
usr/src/common/openssl/crypto/dh/dh_depr.c
usr/src/common/openssl/crypto/dsa/dsa_gen.c
usr/src/common/openssl/crypto/dsa/dsa_key.c
usr/src/common/openssl/crypto/dsa/dsa_lib.c
usr/src/common/openssl/crypto/dsa/dsa_asn1.c
usr/src/common/openssl/crypto/dsa/dsa_vrf.c
usr/src/common/openssl/crypto/dsa/dsa_sign.c
usr/src/common/openssl/crypto/dsa/dsa_err.c
usr/src/common/openssl/crypto/dsa/dsa_ossl.c
usr/src/common/openssl/crypto/dsa/dsa_depr.c
usr/src/common/openssl/crypto/rsa/rsa_eay.c
usr/src/common/openssl/crypto/rsa/rsa_gen.c
usr/src/common/openssl/crypto/rsa/rsa_lib.c
usr/src/common/openssl/crypto/rsa/rsa_sign.c
usr/src/common/openssl/crypto/rsa/rsa_saos.c
usr/src/common/openssl/crypto/rsa/rsa_err.c
usr/src/common/openssl/crypto/rsa/rsa_pk1.c
usr/src/common/openssl/crypto/rsa/rsa_ssl.c
usr/src/common/openssl/crypto/rsa/rsa_none.c
usr/src/common/openssl/crypto/rsa/rsa_oaep.c
usr/src/common/openssl/crypto/rsa/rsa_chk.c
usr/src/common/openssl/crypto/rsa/rsa_null.c
usr/src/common/openssl/crypto/rsa/rsa_asn1.c
usr/src/common/openssl/crypto/rsa/rsa_depr.c
usr/src/common/openssl/crypto/rsa/rsa_pss.c
usr/src/common/openssl/crypto/rsa/rsa_x931.c


Attached patch fixes the problem.


v.

------- usr/src/common/openssl/crypto/dh/dh_asn1.c -------

Index: usr/src/common/openssl/crypto/dh/dh_asn1.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dh/dh_asn1.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dh/dh_asn1.c	Fri May 30 11:48:42 2008
@@ -57,14 +57,17 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
+#endif
 #include <openssl/objects.h>
 #include <openssl/asn1t.h>
 
+#ifndef OPENSSL_NO_DH
 /* Override the default free and new methods */
 static int dh_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it)
 {
 	if(operation == ASN1_OP_NEW_PRE) {
 		*pval = (ASN1_VALUE *)DH_new();
@@ -83,5 +86,6 @@
 	ASN1_SIMPLE(DH, g, BIGNUM),
 	ASN1_OPT(DH, length, ZLONG),
 } ASN1_SEQUENCE_END_cb(DH, DHparams)
 
 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DH, DHparams, DHparams)
+#endif

------- usr/src/common/openssl/crypto/dh/dh_gen.c -------

Index: usr/src/common/openssl/crypto/dh/dh_gen.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dh/dh_gen.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dh/dh_gen.c	Fri May 30 11:49:34 2008
@@ -62,10 +62,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
 
 static int dh_builtin_genparams(DH *ret, int prime_len, int generator, BN_GENCB *cb);
 
 int DH_generate_parameters_ex(DH *ret, int prime_len, int generator, BN_GENCB *cb)
@@ -171,5 +172,6 @@
 		BN_CTX_end(ctx);
 		BN_CTX_free(ctx);
 		}
 	return ok;
 	}
+#endif

------- usr/src/common/openssl/crypto/dh/dh_key.c -------

Index: usr/src/common/openssl/crypto/dh/dh_key.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dh/dh_key.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dh/dh_key.c	Fri May 30 11:50:21 2008
@@ -58,10 +58,11 @@
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
 #include <openssl/rand.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
 
 static int generate_key(DH *dh);
 static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
 static int dh_bn_mod_exp(const DH *dh, BIGNUM *r,
@@ -256,5 +257,6 @@
 	{
 	if(dh->method_mont_p)
 		BN_MONT_CTX_free(dh->method_mont_p);
 	return(1);
 	}
+#endif

------- usr/src/common/openssl/crypto/dh/dh_lib.c -------

Index: usr/src/common/openssl/crypto/dh/dh_lib.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dh/dh_lib.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dh/dh_lib.c	Fri May 30 11:53:59 2008
@@ -57,15 +57,18 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
+#endif
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
 
+#ifndef OPENSSL_NO_DH
 const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
 
 static const DH_METHOD *default_DH_method = NULL;
 
 void DH_set_default_method(const DH_METHOD *meth)
@@ -243,5 +246,6 @@
 
 int DH_size(const DH *dh)
 	{
 	return(BN_num_bytes(dh->p));
 	}
+#endif

------- usr/src/common/openssl/crypto/dh/dh_check.c -------

Index: usr/src/common/openssl/crypto/dh/dh_check.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dh/dh_check.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dh/dh_check.c	Fri May 30 11:54:27 2008
@@ -57,10 +57,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
 
 /* Check that p is a safe prime and
  * if g is 2, 3 or 5, check that is is a suitable generator
  * where
@@ -138,5 +139,6 @@
 	ok = 1;
 err:
 	if (q != NULL) BN_free(q);
 	return(ok);
 	}
+#endif

------- usr/src/common/openssl/crypto/dh/dh_err.c -------

Index: usr/src/common/openssl/crypto/dh/dh_err.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dh/dh_err.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dh/dh_err.c	Fri May 30 11:54:57 2008
@@ -58,10 +58,11 @@
  * only reason strings will be preserved.
  */
 
 #include <stdio.h>
 #include <openssl/err.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
 
 /* BEGIN ERROR CODES */
 #ifndef OPENSSL_NO_ERR
 
@@ -103,5 +104,6 @@
 		ERR_load_strings(0,DH_str_reasons);
 #endif
 
 		}
 	}
+#endif

------- usr/src/common/openssl/crypto/dh/dh_depr.c -------

Index: usr/src/common/openssl/crypto/dh/dh_depr.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dh/dh_depr.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dh/dh_depr.c	Fri May 30 11:55:20 2008
@@ -57,10 +57,11 @@
 /* This file contains deprecated functions as wrappers to the new ones */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
 
 static void *dummy=&dummy;
 
 #ifndef OPENSSL_NO_DEPRECATED
@@ -78,6 +79,7 @@
 	if(DH_generate_parameters_ex(ret, prime_len, generator, &cb))
 		return ret;
 	DH_free(ret);
 	return NULL;
 	}
+#endif
 #endif

------- usr/src/common/openssl/crypto/dsa/dsa_gen.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_gen.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_gen.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_gen.c	Fri May 30 11:55:56 2008
@@ -76,10 +76,11 @@
 #include <stdio.h>
 #include <time.h>
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 #include <openssl/rand.h>
 #include <openssl/sha.h>
 
 static int dsa_builtin_paramgen(DSA *ret, int bits,
@@ -310,6 +311,7 @@
 		BN_CTX_free(ctx);
 		}
 	if (mont != NULL) BN_MONT_CTX_free(mont);
 	return ok;
 	}
+#endif
 #endif

------- usr/src/common/openssl/crypto/dsa/dsa_key.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_key.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_key.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_key.c	Fri May 30 11:56:37 2008
@@ -59,13 +59,16 @@
 #include <stdio.h>
 #include <time.h>
 #include "cryptlib.h"
 #ifndef OPENSSL_NO_SHA
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
 #include <openssl/rand.h>
 
+#ifndef OPENSSL_NO_DSA
 static int dsa_builtin_keygen(DSA *dsa);
 
 int DSA_generate_key(DSA *dsa)
 	{
 	if(dsa->meth->dsa_keygen)
@@ -123,6 +126,7 @@
 	if ((pub_key != NULL) && (dsa->pub_key == NULL)) BN_free(pub_key);
 	if ((priv_key != NULL) && (dsa->priv_key == NULL)) BN_free(priv_key);
 	if (ctx != NULL) BN_CTX_free(ctx);
 	return(ok);
 	}
+#endif
 #endif

------- usr/src/common/openssl/crypto/dsa/dsa_lib.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_lib.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_lib.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_lib.c	Fri May 30 11:57:22 2008
@@ -59,19 +59,22 @@
 /* Original version from Steven Schoch <[EMAIL PROTECTED]> */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
 #include <openssl/asn1.h>
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
 #ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
 #endif
 
+#ifndef OPENSSL_NO_DSA
 const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
 
 static const DSA_METHOD *default_DSA_method = NULL;
 
 void DSA_set_default_method(const DSA_METHOD *meth)
@@ -306,6 +309,7 @@
  err:
 	if (ret != NULL)
 		DH_free(ret);
 	return NULL;
 	}
+#endif
 #endif

------- usr/src/common/openssl/crypto/dsa/dsa_asn1.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_asn1.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_asn1.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_asn1.c	Fri May 30 11:57:52 2008
@@ -56,14 +56,17 @@
  *
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 
+#ifndef OPENSSL_NO_DSA
 /* Override the default new methods */
 static int sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it)
 {
 	if(operation == ASN1_OP_NEW_PRE) {
 		DSA_SIG *sig;
@@ -136,5 +139,6 @@
 	ASN1_SIMPLE(DSA, pub_key, BIGNUM),
 	ASN1_EX_COMBINE(0, 0, dsa_pub_internal)
 } ASN1_CHOICE_END_cb(DSA, DSAPublicKey, write_params)
 
 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA, DSAPublicKey, DSAPublicKey)
+#endif

------- usr/src/common/openssl/crypto/dsa/dsa_vrf.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_vrf.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_vrf.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_vrf.c	Fri May 30 11:58:22 2008
@@ -59,15 +59,18 @@
 /* Original version from Steven Schoch <[EMAIL PROTECTED]> */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
 #include <openssl/rand.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1_mac.h>
 
+#ifndef OPENSSL_NO_DSA
 int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
 		  DSA *dsa)
 	{
 	return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
 	}
@@ -90,5 +93,6 @@
 	ret=DSA_do_verify(dgst,dgst_len,s,dsa);
 err:
 	DSA_SIG_free(s);
 	return(ret);
 	}
+#endif

------- usr/src/common/openssl/crypto/dsa/dsa_sign.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_sign.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_sign.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_sign.c	Fri May 30 11:58:51 2008
@@ -59,14 +59,17 @@
 /* Original version from Steven Schoch <[EMAIL PROTECTED]> */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
 #include <openssl/rand.h>
 #include <openssl/asn1.h>
 
+#ifndef OPENSSL_NO_DSA
 DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
 	{
 	return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
 	}
 
@@ -87,6 +90,6 @@
 
 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 	{
 	return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
 	}
-
+#endif

------- usr/src/common/openssl/crypto/dsa/dsa_err.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_err.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_err.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_err.c	Fri May 30 11:59:09 2008
@@ -58,10 +58,11 @@
  * only reason strings will be preserved.
  */
 
 #include <stdio.h>
 #include <openssl/err.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 
 /* BEGIN ERROR CODES */
 #ifndef OPENSSL_NO_ERR
 
@@ -110,5 +111,6 @@
 		ERR_load_strings(0,DSA_str_reasons);
 #endif
 
 		}
 	}
+#endif

------- usr/src/common/openssl/crypto/dsa/dsa_ossl.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_ossl.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_ossl.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_ossl.c	Fri May 30 11:59:37 2008
@@ -59,14 +59,17 @@
 /* Original version from Steven Schoch <[EMAIL PROTECTED]> */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
 #include <openssl/rand.h>
 #include <openssl/asn1.h>
 
+#ifndef OPENSSL_NO_DSA
 static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
 static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
 static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
 		  DSA *dsa);
 static int dsa_init(DSA *dsa);
@@ -388,6 +391,6 @@
 {
 	if(dsa->method_mont_p)
 		BN_MONT_CTX_free(dsa->method_mont_p);
 	return(1);
 }
-
+#endif

------- usr/src/common/openssl/crypto/dsa/dsa_depr.c -------

Index: usr/src/common/openssl/crypto/dsa/dsa_depr.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/dsa/dsa_depr.c	Fri May 30 03:18:10 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/dsa/dsa_depr.c	Fri May 30 12:00:06 2008
@@ -76,14 +76,17 @@
 #include <stdio.h>
 #include <time.h>
 #include "cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
+#endif
 #include <openssl/rand.h>
 #include <openssl/sha.h>
 
+#ifndef OPENSSL_NO_DSA
 #ifndef OPENSSL_NO_DEPRECATED
 DSA *DSA_generate_parameters(int bits,
 		unsigned char *seed_in, int seed_len,
 		int *counter_ret, unsigned long *h_ret,
 		void (*callback)(int, int, void *),
@@ -102,5 +105,6 @@
 	DSA_free(ret);
 	return NULL;
 	}
 #endif
 #endif
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_eay.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_eay.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_eay.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_eay.c	Fri May 30 12:02:10 2008
@@ -110,10 +110,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 
 #ifndef RSA_NULL
 
@@ -799,6 +800,7 @@
 	if (rsa->_method_mod_q != NULL)
 		BN_MONT_CTX_free(rsa->_method_mod_q);
 	return(1);
 	}
 
+#endif
 #endif

------- usr/src/common/openssl/crypto/rsa/rsa_gen.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_gen.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_gen.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_gen.c	Fri May 30 12:02:31 2008
@@ -64,10 +64,11 @@
 
 #include <stdio.h>
 #include <time.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 
 static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb);
 
 /* NB: this wrapper would normally be placed in rsa_lib.c and the static
@@ -186,6 +187,6 @@
 	BN_CTX_end(ctx);
 	BN_CTX_free(ctx);
 
 	return ok;
 	}
-
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_lib.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_lib.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_lib.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_lib.c	Fri May 30 12:02:54 2008
@@ -59,16 +59,19 @@
 #include <stdio.h>
 #include <openssl/crypto.h>
 #include "cryptlib.h"
 #include <openssl/lhash.h>
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
+#endif
 #include <openssl/rand.h>
 #ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
 
+#ifndef OPENSSL_NO_RSA
 const char *RSA_version="RSA" OPENSSL_VERSION_PTEXT;
 
 static const RSA_METHOD *default_RSA_meth=NULL;
 
 RSA *RSA_new(void)
@@ -458,5 +461,6 @@
 	r->flags&= ~(RSA_FLAG_CACHE_PRIVATE|RSA_FLAG_CACHE_PUBLIC);
 
 	r->bignum_data=p;
 	return(1);
 	}
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_sign.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_sign.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_sign.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_sign.c	Fri May 30 12:03:35 2008
@@ -57,17 +57,20 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
+#endif
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 
 /* Size of an SSL signature: MD5+SHA1 */
 #define SSL_SIG_LENGTH	36
 
+#ifndef OPENSSL_NO_RSA
 int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
 	     unsigned char *sigret, unsigned int *siglen, RSA *rsa)
 	{
 	X509_SIG sig;
 	ASN1_TYPE parameter;
@@ -244,6 +247,6 @@
 		OPENSSL_cleanse(s,(unsigned int)siglen);
 		OPENSSL_free(s);
 		}
 	return(ret);
 	}
-
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_saos.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_saos.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_saos.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_saos.c	Fri May 30 12:04:00 2008
@@ -57,14 +57,17 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
+#endif
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 
+#ifndef OPENSSL_NO_RSA
 int RSA_sign_ASN1_OCTET_STRING(int type,
 	const unsigned char *m, unsigned int m_len,
 	unsigned char *sigret, unsigned int *siglen, RSA *rsa)
 	{
 	ASN1_OCTET_STRING sig;
@@ -145,6 +148,6 @@
 		OPENSSL_cleanse(s,(unsigned int)siglen);
 		OPENSSL_free(s);
 		}
 	return(ret);
 	}
-
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_err.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_err.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_err.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_err.c	Fri May 30 12:04:22 2008
@@ -58,10 +58,11 @@
  * only reason strings will be preserved.
  */
 
 #include <stdio.h>
 #include <openssl/err.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 
 /* BEGIN ERROR CODES */
 #ifndef OPENSSL_NO_ERR
 
@@ -170,5 +171,6 @@
 		ERR_load_strings(0,RSA_str_reasons);
 #endif
 
 		}
 	}
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_pk1.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_pk1.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_pk1.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_pk1.c	Fri May 30 12:04:45 2008
@@ -57,10 +57,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 
 int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
 	     const unsigned char *from, int flen)
@@ -219,6 +220,6 @@
 		}
 	memcpy(to,p,(unsigned int)j);
 
 	return(j);
 	}
-
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_ssl.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_ssl.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_ssl.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_ssl.c	Fri May 30 12:05:13 2008
@@ -57,10 +57,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 
 int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
 	const unsigned char *from, int flen)
@@ -149,6 +150,6 @@
 		}
 	memcpy(to,p,(unsigned int)j);
 
 	return(j);
 	}
-
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_none.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_none.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_none.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_none.c	Fri May 30 12:06:16 2008
@@ -57,10 +57,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 
 int RSA_padding_add_none(unsigned char *to, int tlen,
 	const unsigned char *from, int flen)
@@ -93,6 +94,6 @@
 
 	memset(to,0,tlen-flen);
 	memcpy(to+tlen-flen,from,flen);
 	return(tlen);
 	}
-
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_oaep.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_oaep.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_oaep.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_oaep.c	Fri May 30 12:06:47 2008
@@ -21,15 +21,18 @@
 
 #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
+#endif
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 #include <openssl/sha.h>
 
+#ifndef OPENSSL_NO_RSA
 int MGF1(unsigned char *mask, long len,
 	const unsigned char *seed, long seedlen);
 
 int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
 	const unsigned char *from, int flen,
@@ -208,6 +211,7 @@
 
 int MGF1(unsigned char *mask, long len, const unsigned char *seed, long seedlen)
 	{
 	return PKCS1_MGF1(mask, len, seed, seedlen, EVP_sha1());
 	}
+#endif
 #endif

------- usr/src/common/openssl/crypto/rsa/rsa_chk.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_chk.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_chk.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_chk.c	Fri May 30 12:07:11 2008
@@ -48,10 +48,11 @@
  * ====================================================================
  */
 
 #include <openssl/bn.h>
 #include <openssl/err.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 
 
 int RSA_check_key(const RSA *key)
 	{
@@ -180,5 +181,6 @@
 	if (l != NULL) BN_free(l);
 	if (m != NULL) BN_free(m);
 	if (ctx != NULL) BN_CTX_free(ctx);
 	return (ret);
 	}
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_null.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_null.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_null.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_null.c	Fri May 30 12:07:31 2008
@@ -57,10 +57,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 
 /* This is a dummy RSA implementation that just returns errors when called.
  * It is designed to allow some RSA functions to work while stopping those
@@ -147,5 +148,6 @@
 
 static int RSA_null_finish(RSA *rsa)
 	{
 	return(1);
 	}
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_asn1.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_asn1.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_asn1.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_asn1.c	Fri May 30 12:08:01 2008
@@ -57,10 +57,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/asn1t.h>
 
 static ASN1_METHOD method={
         (I2D_OF(void))     i2d_RSAPrivateKey,
@@ -117,5 +118,6 @@
 
 RSA *RSAPrivateKey_dup(RSA *rsa)
 	{
 	return ASN1_item_dup(ASN1_ITEM_rptr(RSAPrivateKey), rsa);
 	}
+#endif

------- usr/src/common/openssl/crypto/rsa/rsa_depr.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_depr.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_depr.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_depr.c	Fri May 30 12:08:20 2008
@@ -58,10 +58,11 @@
 
 #include <stdio.h>
 #include <time.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 
 #ifdef OPENSSL_NO_DEPRECATED
 
 static void *dummy=&dummy;
@@ -95,6 +96,7 @@
 err:
 	if(e) BN_free(e);
 	if(rsa) RSA_free(rsa);
 	return 0;
 	}
+#endif
 #endif

------- usr/src/common/openssl/crypto/rsa/rsa_pss.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_pss.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_pss.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_pss.c	Fri May 30 12:08:47 2008
@@ -57,15 +57,18 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
+#endif
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 #include <openssl/sha.h>
 
+#ifndef OPENSSL_NO_RSA
 static const unsigned char zeroes[] = {0,0,0,0,0,0,0,0};
 
 #if defined(_MSC_VER) && defined(_ARM_)
 #pragma optimize("g", off)
 #endif
@@ -264,6 +267,7 @@
 
 	}
 
 #if defined(_MSC_VER)
 #pragma optimize("",on)
+#endif
 #endif

------- usr/src/common/openssl/crypto/rsa/rsa_x931.c -------

Index: usr/src/common/openssl/crypto/rsa/rsa_x931.c
--- /local/ws-mirrors/onnv-clone/usr/src/common/openssl/crypto/rsa/rsa_x931.c	Fri May 30 03:18:09 2008
+++ /local/workspaces/openssl-compile-test.onnv/usr/src/common/openssl/crypto/rsa/rsa_x931.c	Fri May 30 12:09:07 2008
@@ -57,10 +57,11 @@
  */
 
 #include <stdio.h>
 #include "cryptlib.h"
 #include <openssl/bn.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 #include <openssl/objects.h>
 
 int RSA_padding_add_X931(unsigned char *to, int tlen,
@@ -172,6 +173,6 @@
 		return 0x35;
 
 		}
 	return -1;
 	}
-
+#endif

Reply via email to