Dead code clean: #if 0 removal in apps
Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
parent
d6fbb19409
commit
75d0ebef2a
12
apps/ca.c
12
apps/ca.c
@ -2171,18 +2171,6 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der,
|
|||||||
(void)i2d_X509_bio(bp, x);
|
(void)i2d_X509_bio(bp, x);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
/* ??? Not needed since X509_print prints all this stuff anyway */
|
|
||||||
f = X509_NAME_oneline(X509_get_issuer_name(x), buf, 256);
|
|
||||||
BIO_printf(bp, "issuer :%s\n", f);
|
|
||||||
|
|
||||||
f = X509_NAME_oneline(X509_get_subject_name(x), buf, 256);
|
|
||||||
BIO_printf(bp, "subject:%s\n", f);
|
|
||||||
|
|
||||||
BIO_puts(bp, "serial :");
|
|
||||||
i2a_ASN1_INTEGER(bp, x->cert_info->serialNumber);
|
|
||||||
BIO_puts(bp, "\n\n");
|
|
||||||
#endif
|
|
||||||
if (!notext)
|
if (!notext)
|
||||||
X509_print(bp, x);
|
X509_print(bp, x);
|
||||||
PEM_write_bio_X509(bp, x);
|
PEM_write_bio_X509(bp, x);
|
||||||
|
@ -196,9 +196,6 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out,
|
|||||||
if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
|
if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
|
||||||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
|
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
|
||||||
0, NULL, NULL)) <= 0)) {
|
0, NULL, NULL)) <= 0)) {
|
||||||
# if 0
|
|
||||||
BIO_printf(bio_out, "%s<no control commands>\n", indent);
|
|
||||||
# endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,12 +301,7 @@ int main(int Argc, char *ARGV[])
|
|||||||
}
|
}
|
||||||
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
||||||
|
|
||||||
#if 0
|
CRYPTO_set_locking_callback(lock_dbg_cb);
|
||||||
if (getenv("OPENSSL_DEBUG_LOCKING") != NULL)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
CRYPTO_set_locking_callback(lock_dbg_cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getenv("OPENSSL_FIPS")) {
|
if (getenv("OPENSSL_FIPS")) {
|
||||||
#ifdef OPENSSL_FIPS
|
#ifdef OPENSSL_FIPS
|
||||||
|
@ -812,10 +812,6 @@ void msg_cb(int write_p, int version, int content_type, const void *buf,
|
|||||||
|
|
||||||
BIO_printf(bio, " ");
|
BIO_printf(bio, " ");
|
||||||
num = len;
|
num = len;
|
||||||
#if 0
|
|
||||||
if (num > 16)
|
|
||||||
num = 16;
|
|
||||||
#endif
|
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
if (i % 16 == 0 && i > 0)
|
if (i % 16 == 0 && i > 0)
|
||||||
BIO_printf(bio, "\n ");
|
BIO_printf(bio, "\n ");
|
||||||
|
@ -1326,10 +1326,6 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if (state)
|
if (state)
|
||||||
SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
|
SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
|
||||||
#if 0
|
|
||||||
else
|
|
||||||
SSL_CTX_set_cipher_list(ctx, getenv("SSL_CIPHER"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SSL_CTX_set_verify(ctx, verify, verify_callback);
|
SSL_CTX_set_verify(ctx, verify, verify_callback);
|
||||||
|
|
||||||
@ -1508,17 +1504,6 @@ int MAIN(int argc, char **argv)
|
|||||||
SSL_set_tlsext_status_type(con, TLSEXT_STATUSTYPE_ocsp);
|
SSL_set_tlsext_status_type(con, TLSEXT_STATUSTYPE_ocsp);
|
||||||
SSL_CTX_set_tlsext_status_cb(ctx, ocsp_resp_cb);
|
SSL_CTX_set_tlsext_status_cb(ctx, ocsp_resp_cb);
|
||||||
SSL_CTX_set_tlsext_status_arg(ctx, bio_c_out);
|
SSL_CTX_set_tlsext_status_arg(ctx, bio_c_out);
|
||||||
# if 0
|
|
||||||
{
|
|
||||||
STACK_OF(OCSP_RESPID) *ids = sk_OCSP_RESPID_new_null();
|
|
||||||
OCSP_RESPID *id = OCSP_RESPID_new();
|
|
||||||
id->value.byKey = ASN1_OCTET_STRING_new();
|
|
||||||
id->type = V_OCSP_RESPID_KEY;
|
|
||||||
ASN1_STRING_set(id->value.byKey, "Hello World", -1);
|
|
||||||
sk_OCSP_RESPID_push(ids, id);
|
|
||||||
SSL_set_tlsext_status_ids(con, ids);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_JPAKE
|
#ifndef OPENSSL_NO_JPAKE
|
||||||
@ -1667,16 +1652,6 @@ int MAIN(int argc, char **argv)
|
|||||||
tty_on = 1;
|
tty_on = 1;
|
||||||
if (in_init) {
|
if (in_init) {
|
||||||
in_init = 0;
|
in_init = 0;
|
||||||
#if 0 /* This test doesn't really work as intended
|
|
||||||
* (needs to be fixed) */
|
|
||||||
# ifndef OPENSSL_NO_TLSEXT
|
|
||||||
if (servername != NULL && !SSL_session_reused(con)) {
|
|
||||||
BIO_printf(bio_c_out,
|
|
||||||
"Server did %sacknowledge servername extension.\n",
|
|
||||||
tlsextcbp.ack ? "" : "not ");
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
if (sess_out) {
|
if (sess_out) {
|
||||||
BIO *stmp = BIO_new_file(sess_out, "w");
|
BIO *stmp = BIO_new_file(sess_out, "w");
|
||||||
if (stmp) {
|
if (stmp) {
|
||||||
|
@ -838,12 +838,6 @@ static int cert_status_cb(SSL *s, void *arg)
|
|||||||
STACK_OF(X509_EXTENSION) *exts;
|
STACK_OF(X509_EXTENSION) *exts;
|
||||||
int ret = SSL_TLSEXT_ERR_NOACK;
|
int ret = SSL_TLSEXT_ERR_NOACK;
|
||||||
int i;
|
int i;
|
||||||
# if 0
|
|
||||||
STACK_OF(OCSP_RESPID) *ids;
|
|
||||||
SSL_get_tlsext_status_ids(s, &ids);
|
|
||||||
BIO_printf(err, "cert_status: received %d ids\n",
|
|
||||||
sk_OCSP_RESPID_num(ids));
|
|
||||||
# endif
|
|
||||||
if (srctx->verbose)
|
if (srctx->verbose)
|
||||||
BIO_puts(err, "cert_status: callback called\n");
|
BIO_puts(err, "cert_status: callback called\n");
|
||||||
/* Build up OCSP query from server certificate */
|
/* Build up OCSP query from server certificate */
|
||||||
@ -1735,19 +1729,6 @@ int MAIN(int argc, char *argv[])
|
|||||||
SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles);
|
SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (cipher == NULL)
|
|
||||||
cipher = getenv("SSL_CIPHER");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (s_cert_file == NULL) {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"You must specify a certificate file for the server to use\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((!SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) ||
|
if ((!SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) ||
|
||||||
(!SSL_CTX_set_default_verify_paths(ctx))) {
|
(!SSL_CTX_set_default_verify_paths(ctx))) {
|
||||||
/* BIO_printf(bio_err,"X509_load_verify_locations\n"); */
|
/* BIO_printf(bio_err,"X509_load_verify_locations\n"); */
|
||||||
@ -2691,27 +2672,6 @@ static DH *load_dh_param(const char *dhfile)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
static int load_CA(SSL_CTX *ctx, char *file)
|
|
||||||
{
|
|
||||||
FILE *in;
|
|
||||||
X509 *x = NULL;
|
|
||||||
|
|
||||||
if ((in = fopen(file, "r")) == NULL)
|
|
||||||
return (0);
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
if (PEM_read_X509(in, &x, NULL) == NULL)
|
|
||||||
break;
|
|
||||||
SSL_CTX_add_client_CA(ctx, x);
|
|
||||||
}
|
|
||||||
if (x != NULL)
|
|
||||||
X509_free(x);
|
|
||||||
fclose(in);
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int www_body(char *hostname, int s, int stype, unsigned char *context)
|
static int www_body(char *hostname, int s, int stype, unsigned char *context)
|
||||||
{
|
{
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
@ -3010,21 +2970,12 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context)
|
|||||||
BIO_printf(io, "'%s' is an invalid path\r\n", p);
|
BIO_printf(io, "'%s' is an invalid path\r\n", p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
/* append if a directory lookup */
|
|
||||||
if (e[-1] == '/')
|
|
||||||
strcat(p, "index.html");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* if a directory, do the index thang */
|
/* if a directory, do the index thang */
|
||||||
if (app_isdir(p) > 0) {
|
if (app_isdir(p) > 0) {
|
||||||
#if 0 /* must check buffer size */
|
|
||||||
strcat(p, "/index.html");
|
|
||||||
#else
|
|
||||||
BIO_puts(io, text);
|
BIO_puts(io, text);
|
||||||
BIO_printf(io, "'%s' is a directory\r\n", p);
|
BIO_printf(io, "'%s' is a directory\r\n", p);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((file = BIO_new_file(p, "r")) == NULL) {
|
if ((file = BIO_new_file(p, "r")) == NULL) {
|
||||||
|
@ -217,17 +217,6 @@ static int parseArgs(int argc, char **argv)
|
|||||||
goto bad;
|
goto bad;
|
||||||
host = *(++argv);
|
host = *(++argv);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
else if (strcmp(*argv, "-host") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
host = *(++argv);
|
|
||||||
} else if (strcmp(*argv, "-port") == 0) {
|
|
||||||
if (--argc < 1)
|
|
||||||
goto bad;
|
|
||||||
port = *(++argv);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (strcmp(*argv, "-reuse") == 0)
|
else if (strcmp(*argv, "-reuse") == 0)
|
||||||
perform = 2;
|
perform = 2;
|
||||||
else if (strcmp(*argv, "-new") == 0)
|
else if (strcmp(*argv, "-new") == 0)
|
||||||
@ -582,11 +571,6 @@ static SSL *doConnection(SSL *scon)
|
|||||||
|
|
||||||
SSL_set_bio(serverCon, conn, conn);
|
SSL_set_bio(serverCon, conn, conn);
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (scon != NULL)
|
|
||||||
SSL_set_session(serverCon, SSL_get_session(scon));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ok, lets connect */
|
/* ok, lets connect */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
i = SSL_connect(serverCon);
|
i = SSL_connect(serverCon);
|
||||||
|
@ -511,11 +511,6 @@ int MAIN(int argc, char **argv)
|
|||||||
while (*args) {
|
while (*args) {
|
||||||
if (!(cert = load_cert(bio_err, *args, FORMAT_PEM,
|
if (!(cert = load_cert(bio_err, *args, FORMAT_PEM,
|
||||||
NULL, e, "recipient certificate file"))) {
|
NULL, e, "recipient certificate file"))) {
|
||||||
#if 0 /* An appropriate message is already printed */
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"Can't read recipient certificate file %s\n",
|
|
||||||
*args);
|
|
||||||
#endif
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
sk_X509_push(encerts, cert);
|
sk_X509_push(encerts, cert);
|
||||||
|
16
apps/speed.c
16
apps/speed.c
@ -874,12 +874,6 @@ int MAIN(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
# if 0 /* was: #ifdef RSAref */
|
|
||||||
if (strcmp(*argv, "rsaref") == 0) {
|
|
||||||
RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
|
|
||||||
j--;
|
|
||||||
} else
|
|
||||||
# endif
|
|
||||||
# ifndef RSA_NULL
|
# ifndef RSA_NULL
|
||||||
if (strcmp(*argv, "openssl") == 0) {
|
if (strcmp(*argv, "openssl") == 0) {
|
||||||
RSA_set_default_method(RSA_PKCS1_SSLeay());
|
RSA_set_default_method(RSA_PKCS1_SSLeay());
|
||||||
@ -1273,16 +1267,6 @@ int MAIN(int argc, char **argv)
|
|||||||
i);
|
i);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
# if 0
|
|
||||||
else {
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
mr ? "+RK:%d:"
|
|
||||||
: "Loaded RSA key, %d bit modulus and e= 0x",
|
|
||||||
BN_num_bits(rsa_key[i]->n));
|
|
||||||
BN_print(bio_err, rsa_key[i]->e);
|
|
||||||
BIO_printf(bio_err, "\n");
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user