#include "apps.h"
#include <openssl/bio.h>
#include <openssl/err.h>
-#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
/* 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)
{
EVP_PKEY_free(pktmp);
return ret;
}
+#endif
+#ifndef NO_DSA
DSA *d2i_DSA_PUBKEY(DSA **a, unsigned char **pp,
long length)
{
EVP_PKEY_free(pktmp);
return ret;
}
+#endif
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,
#include <openssl/pkcs7.h>
#include <openssl/pem.h>
+#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)
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);
$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; }
elsif (/^no-hmac$/) { $no_hmac=1; }
}
+
if (!$do_ssl && !$do_crypto)
{
print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT ] [rsaref]\n";
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 {
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)=@_;