From: Dr. Stephen Henson Date: Fri, 24 Dec 1999 17:26:33 +0000 (+0000) Subject: Fixes so NO_RSA works again. X-Git-Tag: OpenSSL_0_9_5beta1~353 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=12aefe78f0aec57159e396b5fd8f71644a76b631 Fixes so NO_RSA works again. --- diff --git a/apps/spkac.c b/apps/spkac.c index 74bdae7af8..f25f4ce9a2 100644 --- a/apps/spkac.c +++ b/apps/spkac.c @@ -64,7 +64,6 @@ #include "apps.h" #include #include -#include #include #include #include diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index 1740df7e2b..857b7c8858 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -287,7 +287,7 @@ int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp) /* The following are equivalents but which return RSA and DSA * keys */ - +#ifndef NO_RSA RSA *d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, long length) { @@ -323,7 +323,9 @@ int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp) EVP_PKEY_free(pktmp); return ret; } +#endif +#ifndef NO_DSA DSA *d2i_DSA_PUBKEY(DSA **a, unsigned char **pp, long length) { @@ -359,3 +361,4 @@ int i2d_DSA_PUBKEY(DSA *a, unsigned char **pp) EVP_PKEY_free(pktmp); return ret; } +#endif diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 414387d2b1..2191aee1db 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -612,12 +612,18 @@ int EVP_PKEY_type(int type); int EVP_PKEY_bits(EVP_PKEY *pkey); int EVP_PKEY_size(EVP_PKEY *pkey); int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); +#ifndef NO_RSA int EVP_PKEY_rset_RSA(EVP_PKEY *pkey,RSA *key); -int EVP_PKEY_rset_DSA(EVP_PKEY *pkey,DSA *key); -int EVP_PKEY_rset_DH(EVP_PKEY *pkey,DH *key); RSA * EVP_PKEY_rget_RSA(EVP_PKEY *pkey); +#endif +#ifndef NO_DSA +int EVP_PKEY_rset_DSA(EVP_PKEY *pkey,DSA *key); DSA * EVP_PKEY_rget_DSA(EVP_PKEY *pkey); +#endif +#ifndef NO_DH +int EVP_PKEY_rset_DH(EVP_PKEY *pkey,DH *key); DH * EVP_PKEY_rget_DH(EVP_PKEY *pkey); +#endif EVP_PKEY * EVP_PKEY_new(void); void EVP_PKEY_free(EVP_PKEY *pkey); EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, unsigned char **pp, diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c index c6d8835bf9..a0b6032f75 100644 --- a/crypto/pem/pem_all.c +++ b/crypto/pem/pem_all.c @@ -65,8 +65,12 @@ #include #include +#ifndef NO_RSA static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa); +#endif +#ifndef NO_DSA static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa); +#endif IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509) diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 5e4da0f7c4..68b5818c95 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -747,12 +747,16 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey, int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp, long length); +#ifndef NO_RSA int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp, long length); +#endif +#ifndef NO_DSA int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp, long length); +#endif X509_SIG * X509_SIG_new(void ); void X509_SIG_free(X509_SIG *a); diff --git a/util/mkdef.pl b/util/mkdef.pl index 629982a384..23fdd7f87a 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -39,6 +39,7 @@ foreach (@ARGV, split(/ /, $options)) $do_crypto=1 if $_ eq "libeay"; $do_crypto=1 if $_ eq "crypto"; $do_update=1 if $_ eq "update"; + $do_ctest=1 if $_ eq "ctest"; $rsaref=1 if $_ eq "rsaref"; if (/^no-rc2$/) { $no_rc2=1; } @@ -59,6 +60,7 @@ foreach (@ARGV, split(/ /, $options)) elsif (/^no-hmac$/) { $no_hmac=1; } } + if (!$do_ssl && !$do_crypto) { print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT ] [rsaref]\n"; @@ -131,7 +133,26 @@ if($do_crypto == 1) { open(OUT, ">>$crypto_num"); &update_numbers(*OUT,"LIBEAY",*crypto_list,$max_crypto, @crypto_func); close OUT; -} +} + +} elsif ($do_ctest) { + + print <<"EOF"; + +/* Test file to check all DEF file symbols are present by trying + * to link to all of them. This is *not* intended to be run! + */ + +int main() +{ +EOF + &print_test_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func) + if $do_ssl == 1; + + &print_test_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func) + if $do_crypto == 1; + + print "}\n"; } else { @@ -340,6 +361,26 @@ sub do_defs return(@ret); } +sub print_test_file +{ + (*OUT,my $name,*nums,@functions)=@_; + my $n =1; + + (@e)=grep(/^SSLeay/,@functions); + (@r)=grep(!/^SSLeay/,@functions); + @functions=((sort @e),(sort @r)); + + foreach $func (@functions) { + if (!defined($nums{$func})) { + printf STDERR "$func does not have a number assigned\n" + if(!$do_update); + } else { + $n=$nums{$func}; + print OUT "\t$func();\n"; + } + } +} + sub print_def_file { (*OUT,my $name,*nums,@functions)=@_;