summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2015-02-08 10:22:45 +0000
committerdoug <doug@openbsd.org>2015-02-08 10:22:45 +0000
commit275363c24263e94c3408782ccd86b0f74b3da38f (patch)
treea7b7c4f64500b42e09c2a582b7310935cb16e8f2
parentConvert to if_input(). (diff)
downloadwireguard-openbsd-275363c24263e94c3408782ccd86b0f74b3da38f.tar.xz
wireguard-openbsd-275363c24263e94c3408782ccd86b0f74b3da38f.zip
Delete commented out code from openssl(1) apps.
From OpenSSL commits: 6f91b017bbb7140f816721141ac156d1b828a6b3 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 a2b18e657ea1a932d125154f4e13ab2258796d90 ok miod@, jsing@
-rw-r--r--usr.bin/openssl/ca.c14
-rw-r--r--usr.bin/openssl/dh.c11
-rw-r--r--usr.bin/openssl/engine.c5
-rw-r--r--usr.bin/openssl/s_cb.c7
-rw-r--r--usr.bin/openssl/s_time.c18
-rw-r--r--usr.bin/openssl/sess_id.c22
-rw-r--r--usr.bin/openssl/smime.c7
-rw-r--r--usr.bin/openssl/speed.c22
8 files changed, 11 insertions, 95 deletions
diff --git a/usr.bin/openssl/ca.c b/usr.bin/openssl/ca.c
index c5ab6916007..da195985371 100644
--- a/usr.bin/openssl/ca.c
+++ b/usr.bin/openssl/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.4 2015/02/07 04:09:43 bcook Exp $ */
+/* $OpenBSD: ca.c,v 1.5 2015/02/08 10:22:45 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -2017,18 +2017,6 @@ write_new_certificate(BIO * bp, X509 * x, int output_der, int notext)
(void) i2d_X509_bio(bp, x);
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)
X509_print(bp, x);
PEM_write_bio_X509(bp, x);
diff --git a/usr.bin/openssl/dh.c b/usr.bin/openssl/dh.c
index ce109980903..4f82143511a 100644
--- a/usr.bin/openssl/dh.c
+++ b/usr.bin/openssl/dh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.c,v 1.2 2014/08/28 14:23:52 jsing Exp $ */
+/* $OpenBSD: dh.c,v 1.3 2015/02/08 10:22:45 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -211,15 +211,6 @@ bad:
}
if (text) {
DHparams_print(out, dh);
-#ifdef undef
- printf("p=");
- BN_print(stdout, dh->p);
- printf("\ng=");
- BN_print(stdout, dh->g);
- printf("\n");
- if (dh->length != 0)
- printf("recommended private length=%ld\n", dh->length);
-#endif
}
if (check) {
if (!DH_check(dh, &i)) {
diff --git a/usr.bin/openssl/engine.c b/usr.bin/openssl/engine.c
index 009ecf77f78..e1f8d0d997a 100644
--- a/usr.bin/openssl/engine.c
+++ b/usr.bin/openssl/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.2 2014/12/07 15:08:32 jsing Exp $ */
+/* $OpenBSD: engine.c,v 1.3 2015/02/08 10:22:45 doug Exp $ */
/* Written by Richard Levitte <richard@levitte.org> for the OpenSSL
* project 2000.
*/
@@ -191,9 +191,6 @@ util_verbose(ENGINE * e, int verbose, BIO * bio_out, const char *indent)
if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
0, NULL, NULL)) <= 0)) {
-#if 0
- BIO_printf(bio_out, "%s<no control commands>\n", indent);
-#endif
return 1;
}
cmds = sk_OPENSSL_STRING_new_null();
diff --git a/usr.bin/openssl/s_cb.c b/usr.bin/openssl/s_cb.c
index f7d8a323a61..7e89e52104d 100644
--- a/usr.bin/openssl/s_cb.c
+++ b/usr.bin/openssl/s_cb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_cb.c,v 1.2 2014/10/22 13:54:03 jsing Exp $ */
+/* $OpenBSD: s_cb.c,v 1.3 2015/02/08 10:22:45 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -598,10 +598,7 @@ msg_cb(int write_p, int version, int content_type, const void *buf, size_t len,
BIO_printf(bio, " ");
num = len;
-#if 0
- if (num > 16)
- num = 16;
-#endif
+
for (i = 0; i < num; i++) {
if (i % 16 == 0 && i > 0)
BIO_printf(bio, "\n ");
diff --git a/usr.bin/openssl/s_time.c b/usr.bin/openssl/s_time.c
index fdbf1385a18..89f0d6becc0 100644
--- a/usr.bin/openssl/s_time.c
+++ b/usr.bin/openssl/s_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_time.c,v 1.3 2014/11/04 18:15:22 deraadt Exp $ */
+/* $OpenBSD: s_time.c,v 1.4 2015/02/08 10:22:45 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -198,17 +198,6 @@ parseArgs(int argc, char **argv)
goto bad;
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)
perform = 2;
else if (strcmp(*argv, "-new") == 0)
@@ -551,11 +540,6 @@ doConnection(SSL * scon)
SSL_set_bio(serverCon, conn, conn);
-#if 0
- if (scon != NULL)
- SSL_set_session(serverCon, SSL_get_session(scon));
-#endif
-
/* ok, lets connect */
for (;;) {
i = SSL_connect(serverCon);
diff --git a/usr.bin/openssl/sess_id.c b/usr.bin/openssl/sess_id.c
index 51720204bf0..cc47bad93bc 100644
--- a/usr.bin/openssl/sess_id.c
+++ b/usr.bin/openssl/sess_id.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sess_id.c,v 1.3 2015/01/24 09:44:29 doug Exp $ */
+/* $OpenBSD: sess_id.c,v 1.4 2015/02/08 10:22:45 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -182,26 +182,6 @@ sess_id_main(int argc, char **argv)
SSL_SESSION_set1_id_context(x,
(unsigned char *)sess_id_config.context, ctx_len);
}
-#ifdef undef
- /* just testing for memory leaks :-) */
- {
- SSL_SESSION *s;
- char buf[1024 * 10], *p;
- int i;
-
- s = SSL_SESSION_new();
-
- p = &buf;
- i = i2d_SSL_SESSION(x, &p);
- p = &buf;
- d2i_SSL_SESSION(&s, &p, (long) i);
- p = &buf;
- d2i_SSL_SESSION(&s, &p, (long) i);
- p = &buf;
- d2i_SSL_SESSION(&s, &p, (long) i);
- SSL_SESSION_free(s);
- }
-#endif
if (!sess_id_config.noout || sess_id_config.text) {
out = BIO_new(BIO_s_file());
diff --git a/usr.bin/openssl/smime.c b/usr.bin/openssl/smime.c
index 155bb8b03d8..8b76ea9e780 100644
--- a/usr.bin/openssl/smime.c
+++ b/usr.bin/openssl/smime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smime.c,v 1.1 2014/08/26 17:47:25 jsing Exp $ */
+/* $OpenBSD: smime.c,v 1.2 2015/02/08 10:22:45 doug Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@@ -446,10 +446,7 @@ argerr:
encerts = sk_X509_new_null();
while (*args) {
if (!(cert = load_cert(bio_err, *args, FORMAT_PEM,
- 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
+ NULL, e, "recipient certificate file"))) {
goto end;
}
sk_X509_push(encerts, cert);
diff --git a/usr.bin/openssl/speed.c b/usr.bin/openssl/speed.c
index e40607f940c..8795d6c4346 100644
--- a/usr.bin/openssl/speed.c
+++ b/usr.bin/openssl/speed.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: speed.c,v 1.4 2015/01/03 03:03:39 lteo Exp $ */
+/* $OpenBSD: speed.c,v 1.5 2015/02/08 10:22:45 doug Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -675,12 +675,6 @@ speed_main(int argc, char **argv)
doit[D_CBC_256_CML] = 1;
else
#endif
-#if 0 /* was: #ifdef RSAref */
- if (strcmp(*argv, "rsaref") == 0) {
- RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
- j--;
- } else
-#endif
#ifndef RSA_NULL
if (strcmp(*argv, "openssl") == 0) {
RSA_set_default_method(RSA_PKCS1_SSLeay());
@@ -1004,15 +998,6 @@ speed_main(int argc, char **argv)
BIO_printf(bio_err, "internal error loading RSA key number %d\n", i);
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
}
dsa_key[0] = get_dsa512();
@@ -1501,7 +1486,6 @@ speed_main(int argc, char **argv)
rsa_count = count;
}
-#if 1
ret = RSA_verify(NID_md5_sha1, buf, 36, buf2, rsa_num, rsa_key[j]);
if (ret <= 0) {
BIO_printf(bio_err, "RSA verify failure. No RSA verify will be done.\n");
@@ -1529,7 +1513,6 @@ speed_main(int argc, char **argv)
count, rsa_bits[j], d);
rsa_results[j][1] = d / (double) count;
}
-#endif
if (rsa_count <= 1) {
/* if longer than 10s, don't do any more */
@@ -1624,9 +1607,8 @@ speed_main(int argc, char **argv)
ERR_print_errors(bio_err);
rsa_count = 1;
} else {
-#if 1
EC_KEY_precompute_mult(ecdsa[j], NULL);
-#endif
+
/* Perform ECDSA signature test */
EC_KEY_generate_key(ecdsa[j]);
ret = ECDSA_sign(0, buf, 20, ecdsasig,