diff --git a/apps/spkac.c b/apps/spkac.c index 74bdae7af8640f7ea6f1f40bd5bef6b9c7d43fac..f25f4ce9a2df123035e4d4a0bc20621863c0b2fb 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 1740df7e2bb9566710854d3ba2749637fa5ebbe1..857b7c885865868349e6bd9a07fba9955ee4696d 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 414387d2b1e66a45ae9b2ed28a20ef92274ac0b9..2191aee1db48b9bfcc87414bdd1ce032cc240626 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 c6d8835bf95e1f3a4775a4910a770986de2b9dff..a0b6032f75810756c1a14f74d2e3d652b4c76ff0 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 5e4da0f7c43630a7d2f2cfe6e5330b8ce9cf65bd..68b5818c957eb7d3a5e761d385ee49043e7f0d60 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 629982a384bb3b84007d8e628ebea3f180477200..23fdd7f87a0844845911f5e3631e95c633b58167 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)=@_;