From 00a37b5a9b295c1b55ca9a1c1f207d347ad5b24a Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 6 Apr 2010 11:18:59 +0000 Subject: [PATCH] PR: 2220 Fixes to make OpenSSL compile with no-rc4 --- apps/apps.c | 2 +- apps/dsa.c | 2 +- apps/rsa.c | 2 +- crypto/pem/pem.h | 3 ++- crypto/pem/pvkfmt.c | 5 +++++ ssl/ssltest.c | 2 +- util/libeay.num | 4 ++-- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/apps.c b/apps/apps.c index 3edb76c871..200f1963f5 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -923,7 +923,7 @@ 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) +#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4) else if (format == FORMAT_MSBLOB) pkey = b2i_PrivateKey_bio(key); else if (format == FORMAT_PVK) diff --git a/apps/dsa.c b/apps/dsa.c index 1109346f78..5222487ab9 100644 --- a/apps/dsa.c +++ b/apps/dsa.c @@ -334,7 +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 +#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_RC4) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); diff --git a/apps/rsa.c b/apps/rsa.c index b3c8aff7e3..a17708fe9c 100644 --- a/apps/rsa.c +++ b/apps/rsa.c @@ -409,7 +409,7 @@ bad: } else i=PEM_write_bio_RSAPrivateKey(out,rsa, enc,NULL,0,NULL,passout); -#ifndef OPENSSL_NO_DSA +#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h index c2d7690580..fb704975b7 100644 --- a/crypto/pem/pem.h +++ b/crypto/pem/pem.h @@ -548,10 +548,11 @@ EVP_PKEY *b2i_PrivateKey_bio(BIO *in); EVP_PKEY *b2i_PublicKey_bio(BIO *in); int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk); int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk); - +#ifndef OPENSSL_NO_RC4 EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u); int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb, void *u); +#endif /* BEGIN ERROR CODES */ diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c index 0d6c749c33..0dd6f5d98a 100644 --- a/crypto/pem/pvkfmt.c +++ b/crypto/pem/pvkfmt.c @@ -654,6 +654,8 @@ int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk) return do_i2b_bio(out, pk, 1); } +#ifndef OPENSSL_NO_RC4 + static int do_PVK_header(const unsigned char **in, unsigned int length, int skip_magic, unsigned int *psaltlen, unsigned int *pkeylen) @@ -946,4 +948,7 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, } return -1; } + +#endif + #endif diff --git a/ssl/ssltest.c b/ssl/ssltest.c index abf214ad7f..ed01651e62 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -484,8 +484,8 @@ int main(int argc, char *argv[]) int comp = 0; #ifndef OPENSSL_NO_COMP COMP_METHOD *cm = NULL; -#endif STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; +#endif int test_cipherlist = 0; verbose = 0; diff --git a/util/libeay.num b/util/libeay.num index 0243d05b46..efc0f10f42 100755 --- a/util/libeay.num +++ b/util/libeay.num @@ -3861,10 +3861,10 @@ EVP_PKEY_meth_set_sign 4243 EXIST::FUNCTION: CRYPTO_THREADID_current 4244 EXIST::FUNCTION: EVP_PKEY_decrypt_init 4245 EXIST::FUNCTION: NETSCAPE_X509_free 4246 EXIST::FUNCTION: -i2b_PVK_bio 4247 EXIST::FUNCTION: +i2b_PVK_bio 4247 EXIST::FUNCTION:RC4 EVP_PKEY_print_private 4248 EXIST::FUNCTION: GENERAL_NAME_get0_value 4249 EXIST::FUNCTION: -b2i_PVK_bio 4250 EXIST::FUNCTION: +b2i_PVK_bio 4250 EXIST::FUNCTION:RC4 ASN1_UTCTIME_adj 4251 EXIST::FUNCTION: TS_TST_INFO_new 4252 EXIST::FUNCTION: EVP_MD_do_all_sorted 4253 EXIST::FUNCTION: