New Configure option no-<cipher> (rsa, idea, rc5, ...).
[openssl.git] / ssl / ssltest.c
index ef80d429907f3e293676cd52fdff9dcefd55f7da..54f24583455f6196829bce6fd1a823b9c8e9d88a 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include "e_os.h"
-#include "bio.h"
-#include "crypto.h"
-#include "x509.h"
-#include "ssl.h"
-#include "err.h"
+#include <openssl/e_os.h>
+#include <openssl/bio.h>
+#include <openssl/crypto.h>
+#include <openssl/x509.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
 #ifdef WINDOWS
 #include "../crypto/bio/bss_file.c"
 #endif
 
+#if defined(NO_RSA) && !defined(NO_SSL2)
+#define NO_SSL2
+#endif
+
 #define TEST_SERVER_CERT "../apps/server.pem"
 #define TEST_CLIENT_CERT "../apps/client.pem"
 
-#ifndef NOPROTO
 int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
+#ifndef NO_RSA
 static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export,int keylength);
-#ifndef NO_DSA
-static DH *get_dh512(void);
-#endif
-#else
-int MS_CALLBACK verify_callback();
-static RSA MS_CALLBACK *tmp_rsa_cb();
-#ifndef NO_DSA
-static DH *get_dh512();
 #endif
+#ifndef NO_DH
+static DH *get_dh512(void);
 #endif
-
 BIO *bio_err=NULL;
 BIO *bio_stdout=NULL;
 
@@ -98,12 +95,7 @@ static int s_nbio=0;
 #endif
 
 
-#ifndef  NOPROTO
 int doit(SSL *s_ssl,SSL *c_ssl,long bytes);
-#else
-int doit();
-#endif
-
 static void sv_usage(void)
        {
        fprintf(stderr,"usage: ssltest [args ...]\n");
@@ -724,6 +716,7 @@ static DH *get_dh512(void)
        }
 #endif
 
+#ifndef NO_RSA
 static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
        {
        static RSA *rsa_tmp=NULL;
@@ -732,13 +725,10 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
                {
                BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength);
                BIO_flush(bio_err);
-#ifndef NO_RSA
                rsa_tmp=RSA_generate_key(keylength,RSA_F4,NULL,NULL);
-#endif
                BIO_printf(bio_err,"\n");
                BIO_flush(bio_err);
                }
        return(rsa_tmp);
        }
-
-
+#endif