Make no-rsa, no-dsa and no-dh compile again.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 23 Apr 2009 17:16:40 +0000 (17:16 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 23 Apr 2009 17:16:40 +0000 (17:16 +0000)
16 files changed:
Configure
apps/apps.c
apps/dh.c
apps/dhparam.c
apps/dsa.c
apps/dsaparam.c
apps/gendh.c
apps/gendsa.c
apps/req.c
apps/rsa.c
apps/rsautl.c
crypto/evp/pmeth_lib.c
crypto/pem/pvkfmt.c
engines/e_capi.c
engines/e_gmp.c
engines/e_ubsec.c

index c3ebcda3f4b5c6b341b1cd1308dc1a9d9a5f5a5d..21bea24a8e710d1a0767ed6158152ac5c698281c 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -918,7 +918,8 @@ if (defined($disabled{"tls1"}))
        $disabled{"tlsext"} = "forced";
        }
 
-if (defined($disabled{"ec"}))
+if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
+    || defined($disabled{"dh"}))
        {
        $disabled{"gost"} = "forced";
        }
index 7294c26f317aef6019cd0e037c0c62ec641ef623..b04bfbd3c3460ce6cad070ad47f59aa593860974 100644 (file)
@@ -921,11 +921,13 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
                                &pkey, NULL, NULL))
                        goto end;
                }
+#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
        else if (format == FORMAT_MSBLOB)
                pkey = b2i_PrivateKey_bio(key);
        else if (format == FORMAT_PVK)
                pkey = b2i_PVK_bio(key, (pem_password_cb *)password_callback,
                                                                &cb_data);
+#endif
        else
                {
                BIO_printf(err,"bad input format specified for key file\n");
@@ -989,6 +991,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
                {
                pkey=d2i_PUBKEY_bio(key, NULL);
                }
+#ifndef OPENSSL_NO_RSA
        else if (format == FORMAT_ASN1RSA)
                {
                RSA *rsa;
@@ -1018,7 +1021,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
                else
                        pkey = NULL;
                }
-
+#endif
        else if (format == FORMAT_PEM)
                {
                pkey=PEM_read_bio_PUBKEY(key,NULL,
@@ -1028,8 +1031,10 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
        else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
                pkey = load_netscape_key(err, key, file, key_descrip, format);
 #endif
+#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
        else if (format == FORMAT_MSBLOB)
                pkey = b2i_PublicKey_bio(key);
+#endif
        else
                {
                BIO_printf(err,"bad input format specified for key file\n");
index c4d891e125ea1e3ed42145b6382b7423ecff4b43..e9609d630d9cf3c41b233e1f782726f47cbc09c8 100644 (file)
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -349,4 +349,10 @@ end:
        apps_shutdown();
        OPENSSL_EXIT(ret);
        }
+#else /* !OPENSSL_NO_DH */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif
index 04bd57c6e8aa22c16dadc9772ecc55484bcb6b2a..5fab29eb87bf0936ae51f40936c904af110af5c6 100644 (file)
@@ -554,4 +554,10 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
        return 1;
        }
 
+#else /* !OPENSSL_NO_DH */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif
index 5911f11873dae01d57eb00b9c43eb71eb7569bc3..9f38e2b77a3f9f1000ec385e8365c3bc90084534 100644 (file)
@@ -334,6 +334,7 @@ bad:
                        i=PEM_write_bio_DSA_PUBKEY(out,dsa);
                else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
                                                        NULL,0,NULL, passout);
+#ifndef OPENSSL_NO_RSA
        } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
                EVP_PKEY *pk;
                pk = EVP_PKEY_new();
@@ -345,6 +346,7 @@ bad:
                else
                        i = i2b_PrivateKey_bio(out, pk);
                EVP_PKEY_free(pk);
+#endif
        } else {
                BIO_printf(bio_err,"bad output format specified for outfile\n");
                goto end;
@@ -365,4 +367,10 @@ end:
        apps_shutdown();
        OPENSSL_EXIT(ret);
        }
+#else /* !OPENSSL_NO_DSA */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif
index c301e81af18ca3f3f3977d76dfc3bf9a44c9f003..4305a739b33132645c41f8d644c9f962a784f83a 100644 (file)
@@ -475,4 +475,10 @@ static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
 #endif
        return 1;
        }
+#else /* !OPENSSL_NO_DSA */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif
index 47497864b0024d8c774598a4bdf01a1cdc4f1151..caa7327a100aec6b2bfb56311bb48c9350c3d882 100644 (file)
@@ -235,4 +235,10 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
 #endif
        return 1;
        }
+#else /* !OPENSSL_NO_DH */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif
index 8a296c66e570ca2f9ccd20820aa6a076cb644396..22c39629e5c4adfa0dca27eafc6568c0b60bcf33 100644 (file)
@@ -279,4 +279,10 @@ end:
        apps_shutdown();
        OPENSSL_EXIT(ret);
        }
+#else /* !OPENSSL_NO_DSA */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif
index 3b4ab28e5d70e7af49ca13e9a7f8ed9940860478..e9b764b90cdb71ef83c554ea11ec56fcfb76add2 100644 (file)
@@ -1715,7 +1715,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
                ERR_print_errors(err);
                return NULL;
                }
-
+#ifndef OPENSSL_NO_RSA
        if ((*pkey_type == EVP_PKEY_RSA) && (keylen != -1))
                {
                if (EVP_PKEY_CTX_set_rsa_keygen_bits(gctx, keylen) <= 0)
@@ -1726,6 +1726,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
                        return NULL;
                        }
                }
+#endif
 
        return gctx;
        }
index c316da710900f1a24fee7e1ae93c5095288c0ee5..4a6206bb6663d23ebdb89932574e02e9d2c72671 100644 (file)
@@ -409,6 +409,7 @@ bad:
                        }
                else i=PEM_write_bio_RSAPrivateKey(out,rsa,
                                                enc,NULL,0,NULL,passout);
+#ifndef OPENSSL_NO_DSA
        } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
                EVP_PKEY *pk;
                pk = EVP_PKEY_new();
@@ -420,6 +421,7 @@ bad:
                else
                        i = i2b_PrivateKey_bio(out, pk);
                EVP_PKEY_free(pk);
+#endif
        } else  {
                BIO_printf(bio_err,"bad output format specified for outfile\n");
                goto end;
index 923e2b682f965920d64c913c18cd1e85289a717e..b01f004eb3f6c8c91e43fe53d19e61a68d4a6b7b 100644 (file)
@@ -342,4 +342,10 @@ static void usage()
 
 }
 
+#else /* !OPENSSL_NO_RSA */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
 #endif
index 51f0b6ad63c9bad30ad8f455118fbf184a978d06..4a05f0b1359d59c699f7c76bedae828d47220831 100644 (file)
@@ -77,9 +77,15 @@ extern const EVP_PKEY_METHOD ec_pkey_meth, hmac_pkey_meth;
 
 static const EVP_PKEY_METHOD *standard_methods[] =
        {
+#ifndef OPENSSL_NO_RSA
        &rsa_pkey_meth,
+#endif
+#ifndef OPENSSL_NO_DH
        &dh_pkey_meth,
+#endif
+#ifndef OPENSSL_NO_DSA
        &dsa_pkey_meth,
+#endif
 #ifndef OPENSSL_NO_EC
        &ec_pkey_meth,
 #endif
index 5d391cfd8ef8bc15491b0c4d1588d802c21f3f23..11e1f10f57562b5ab911b7834ccd0fbd3025b7d7 100644 (file)
@@ -63,6 +63,7 @@
 #include <openssl/pem.h>
 #include <openssl/rand.h>
 #include <openssl/bn.h>
+#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
 #include <openssl/dsa.h>
 #include <openssl/rsa.h>
 
@@ -933,3 +934,4 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
                }
        return -1;
        }
+#endif
index e98946c85a0a288c8ac925db665785f980bc32fe..01ef96b85f1052967ec26b8d29a0118f004367ab 100644 (file)
 #include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
-#include <openssl/rsa.h>
 #include <openssl/bn.h>
 
 #ifdef OPENSSL_SYS_WIN32
 #ifndef OPENSSL_NO_CAPIENG
 
+#include <openssl/rsa.h>
 
 #include <windows.h>
 
index dc9f295e9b43b9e2f429be19faa79104259fce71..c1f5601b62b34f18a36cd6624a3b3e5430bb8eb7 100644 (file)
@@ -85,7 +85,9 @@
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
 #include <openssl/engine.h>
+#ifndef OPENSSL_NO_RSA
 #include <openssl/rsa.h>
+#endif
 #include <openssl/bn.h>
 
 #ifndef OPENSSL_NO_HW
index e8389de6a1f85ed8b5ca1d65a5a75049e3bc0fd1..fe6bdba25b414b0c9febfe92b83819c8b0f36a8f 100644 (file)
@@ -95,14 +95,14 @@ static int ubsec_finish(ENGINE *e);
 static int ubsec_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void));
 static int ubsec_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                const BIGNUM *m, BN_CTX *ctx);
+#ifndef OPENSSL_NO_RSA
 static int ubsec_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                        const BIGNUM *q, const BIGNUM *dp,
                        const BIGNUM *dq, const BIGNUM *qinv, BN_CTX *ctx);
-#ifndef OPENSSL_NO_RSA
 static int ubsec_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
-#endif
 static int ubsec_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+#endif
 #ifndef OPENSSL_NO_DSA
 #ifdef NOT_USED
 static int ubsec_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
@@ -302,10 +302,10 @@ static t_UBSEC_diffie_hellman_generate_ioctl
        *p_UBSEC_diffie_hellman_generate_ioctl = NULL;
 static t_UBSEC_diffie_hellman_agree_ioctl *p_UBSEC_diffie_hellman_agree_ioctl = NULL;
 #endif
-/* #ifndef OPENSSL_NO_RSA */
 static t_UBSEC_rsa_mod_exp_ioctl *p_UBSEC_rsa_mod_exp_ioctl = NULL;
+#ifndef OPENSSL_NO_RSA
 static t_UBSEC_rsa_mod_exp_crt_ioctl *p_UBSEC_rsa_mod_exp_crt_ioctl = NULL;
-/* #endif */
+#endif
 #ifndef OPENSSL_NO_DSA
 static t_UBSEC_dsa_sign_ioctl *p_UBSEC_dsa_sign_ioctl = NULL;
 static t_UBSEC_dsa_verify_ioctl *p_UBSEC_dsa_verify_ioctl = NULL;
@@ -624,7 +624,6 @@ static int ubsec_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
 err:
        return to_return;
        }
-#endif
 
 static int ubsec_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                        const BIGNUM *q, const BIGNUM *dp,
@@ -672,6 +671,7 @@ static int ubsec_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
        r->top = (BN_num_bits(p) + BN_num_bits(q) + BN_BITS2 - 1)/BN_BITS2;
        return 1;
 }
+#endif
 
 #ifndef OPENSSL_NO_DSA
 #ifdef NOT_USED
@@ -704,6 +704,8 @@ static int ubsec_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
 #endif
 #endif
 
+#ifndef OPENSSL_NO_RSA
+
 /*
  * This function is aliased to mod_exp (with the mont stuff dropped).
  */
@@ -712,7 +714,6 @@ static int ubsec_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
         {
        int ret = 0;
 
-#ifndef OPENSSL_NO_RSA
        /* Do in software if the key is too large for the hardware. */
        if (BN_num_bits(m) > max_key_len)
                 {
@@ -720,13 +721,13 @@ static int ubsec_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                ret = (*meth->bn_mod_exp)(r, a, p, m, ctx, m_ctx);
                 }
         else
-#endif
                 {
                ret = ubsec_mod_exp(r, a, p, m, ctx);
                 }
        
        return ret;
         }
+#endif
 
 #ifndef OPENSSL_NO_DH
 /* This function is aliased to mod_exp (with the dh and mont dropped). */