summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoug <>2015-02-08 10:22:45 +0000
committerdoug <>2015-02-08 10:22:45 +0000
commitf5656e5948afd96eceeae5f83939965ba96edc28 (patch)
treeba58b46fda227cb1089ceb084bb49a3366291f24
parent653ed322d15a6087960710834e7221c7ff8b0af1 (diff)
downloadopenbsd-f5656e5948afd96eceeae5f83939965ba96edc28.tar.gz
openbsd-f5656e5948afd96eceeae5f83939965ba96edc28.tar.bz2
openbsd-f5656e5948afd96eceeae5f83939965ba96edc28.zip
Delete commented out code from openssl(1) apps.
From OpenSSL commits: 6f91b017bbb7140f816721141ac156d1b828a6b3 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 a2b18e657ea1a932d125154f4e13ab2258796d90 ok miod@, jsing@
-rw-r--r--src/usr.bin/openssl/ca.c14
-rw-r--r--src/usr.bin/openssl/dh.c11
-rw-r--r--src/usr.bin/openssl/engine.c5
-rw-r--r--src/usr.bin/openssl/s_cb.c7
-rw-r--r--src/usr.bin/openssl/s_time.c18
-rw-r--r--src/usr.bin/openssl/sess_id.c22
-rw-r--r--src/usr.bin/openssl/smime.c7
-rw-r--r--src/usr.bin/openssl/speed.c22
8 files changed, 11 insertions, 95 deletions
diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c
index c5ab691600..da19598537 100644
--- a/src/usr.bin/openssl/ca.c
+++ b/src/usr.bin/openssl/ca.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ca.c,v 1.4 2015/02/07 04:09:43 bcook Exp $ */ 1/* $OpenBSD: ca.c,v 1.5 2015/02/08 10:22:45 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -2017,18 +2017,6 @@ write_new_certificate(BIO * bp, X509 * x, int output_der, int notext)
2017 (void) i2d_X509_bio(bp, x); 2017 (void) i2d_X509_bio(bp, x);
2018 return; 2018 return;
2019 } 2019 }
2020#if 0
2021 /* ??? Not needed since X509_print prints all this stuff anyway */
2022 f = X509_NAME_oneline(X509_get_issuer_name(x), buf, 256);
2023 BIO_printf(bp, "issuer :%s\n", f);
2024
2025 f = X509_NAME_oneline(X509_get_subject_name(x), buf, 256);
2026 BIO_printf(bp, "subject:%s\n", f);
2027
2028 BIO_puts(bp, "serial :");
2029 i2a_ASN1_INTEGER(bp, x->cert_info->serialNumber);
2030 BIO_puts(bp, "\n\n");
2031#endif
2032 if (!notext) 2020 if (!notext)
2033 X509_print(bp, x); 2021 X509_print(bp, x);
2034 PEM_write_bio_X509(bp, x); 2022 PEM_write_bio_X509(bp, x);
diff --git a/src/usr.bin/openssl/dh.c b/src/usr.bin/openssl/dh.c
index ce10998090..4f82143511 100644
--- a/src/usr.bin/openssl/dh.c
+++ b/src/usr.bin/openssl/dh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh.c,v 1.2 2014/08/28 14:23:52 jsing Exp $ */ 1/* $OpenBSD: dh.c,v 1.3 2015/02/08 10:22:45 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -211,15 +211,6 @@ bad:
211 } 211 }
212 if (text) { 212 if (text) {
213 DHparams_print(out, dh); 213 DHparams_print(out, dh);
214#ifdef undef
215 printf("p=");
216 BN_print(stdout, dh->p);
217 printf("\ng=");
218 BN_print(stdout, dh->g);
219 printf("\n");
220 if (dh->length != 0)
221 printf("recommended private length=%ld\n", dh->length);
222#endif
223 } 214 }
224 if (check) { 215 if (check) {
225 if (!DH_check(dh, &i)) { 216 if (!DH_check(dh, &i)) {
diff --git a/src/usr.bin/openssl/engine.c b/src/usr.bin/openssl/engine.c
index 009ecf77f7..e1f8d0d997 100644
--- a/src/usr.bin/openssl/engine.c
+++ b/src/usr.bin/openssl/engine.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: engine.c,v 1.2 2014/12/07 15:08:32 jsing Exp $ */ 1/* $OpenBSD: engine.c,v 1.3 2015/02/08 10:22:45 doug Exp $ */
2/* Written by Richard Levitte <richard@levitte.org> for the OpenSSL 2/* Written by Richard Levitte <richard@levitte.org> for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -191,9 +191,6 @@ util_verbose(ENGINE * e, int verbose, BIO * bio_out, const char *indent)
191 if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) || 191 if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
192 ((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE, 192 ((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
193 0, NULL, NULL)) <= 0)) { 193 0, NULL, NULL)) <= 0)) {
194#if 0
195 BIO_printf(bio_out, "%s<no control commands>\n", indent);
196#endif
197 return 1; 194 return 1;
198 } 195 }
199 cmds = sk_OPENSSL_STRING_new_null(); 196 cmds = sk_OPENSSL_STRING_new_null();
diff --git a/src/usr.bin/openssl/s_cb.c b/src/usr.bin/openssl/s_cb.c
index f7d8a323a6..7e89e52104 100644
--- a/src/usr.bin/openssl/s_cb.c
+++ b/src/usr.bin/openssl/s_cb.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s_cb.c,v 1.2 2014/10/22 13:54:03 jsing Exp $ */ 1/* $OpenBSD: s_cb.c,v 1.3 2015/02/08 10:22:45 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -598,10 +598,7 @@ msg_cb(int write_p, int version, int content_type, const void *buf, size_t len,
598 598
599 BIO_printf(bio, " "); 599 BIO_printf(bio, " ");
600 num = len; 600 num = len;
601#if 0 601
602 if (num > 16)
603 num = 16;
604#endif
605 for (i = 0; i < num; i++) { 602 for (i = 0; i < num; i++) {
606 if (i % 16 == 0 && i > 0) 603 if (i % 16 == 0 && i > 0)
607 BIO_printf(bio, "\n "); 604 BIO_printf(bio, "\n ");
diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c
index fdbf1385a1..89f0d6becc 100644
--- a/src/usr.bin/openssl/s_time.c
+++ b/src/usr.bin/openssl/s_time.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s_time.c,v 1.3 2014/11/04 18:15:22 deraadt Exp $ */ 1/* $OpenBSD: s_time.c,v 1.4 2015/02/08 10:22:45 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -198,17 +198,6 @@ parseArgs(int argc, char **argv)
198 goto bad; 198 goto bad;
199 host = *(++argv); 199 host = *(++argv);
200 } 200 }
201#if 0
202 else if (strcmp(*argv, "-host") == 0) {
203 if (--argc < 1)
204 goto bad;
205 host = *(++argv);
206 } else if (strcmp(*argv, "-port") == 0) {
207 if (--argc < 1)
208 goto bad;
209 port = *(++argv);
210 }
211#endif
212 else if (strcmp(*argv, "-reuse") == 0) 201 else if (strcmp(*argv, "-reuse") == 0)
213 perform = 2; 202 perform = 2;
214 else if (strcmp(*argv, "-new") == 0) 203 else if (strcmp(*argv, "-new") == 0)
@@ -551,11 +540,6 @@ doConnection(SSL * scon)
551 540
552 SSL_set_bio(serverCon, conn, conn); 541 SSL_set_bio(serverCon, conn, conn);
553 542
554#if 0
555 if (scon != NULL)
556 SSL_set_session(serverCon, SSL_get_session(scon));
557#endif
558
559 /* ok, lets connect */ 543 /* ok, lets connect */
560 for (;;) { 544 for (;;) {
561 i = SSL_connect(serverCon); 545 i = SSL_connect(serverCon);
diff --git a/src/usr.bin/openssl/sess_id.c b/src/usr.bin/openssl/sess_id.c
index 51720204bf..cc47bad93b 100644
--- a/src/usr.bin/openssl/sess_id.c
+++ b/src/usr.bin/openssl/sess_id.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sess_id.c,v 1.3 2015/01/24 09:44:29 doug Exp $ */ 1/* $OpenBSD: sess_id.c,v 1.4 2015/02/08 10:22:45 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -182,26 +182,6 @@ sess_id_main(int argc, char **argv)
182 SSL_SESSION_set1_id_context(x, 182 SSL_SESSION_set1_id_context(x,
183 (unsigned char *)sess_id_config.context, ctx_len); 183 (unsigned char *)sess_id_config.context, ctx_len);
184 } 184 }
185#ifdef undef
186 /* just testing for memory leaks :-) */
187 {
188 SSL_SESSION *s;
189 char buf[1024 * 10], *p;
190 int i;
191
192 s = SSL_SESSION_new();
193
194 p = &buf;
195 i = i2d_SSL_SESSION(x, &p);
196 p = &buf;
197 d2i_SSL_SESSION(&s, &p, (long) i);
198 p = &buf;
199 d2i_SSL_SESSION(&s, &p, (long) i);
200 p = &buf;
201 d2i_SSL_SESSION(&s, &p, (long) i);
202 SSL_SESSION_free(s);
203 }
204#endif
205 185
206 if (!sess_id_config.noout || sess_id_config.text) { 186 if (!sess_id_config.noout || sess_id_config.text) {
207 out = BIO_new(BIO_s_file()); 187 out = BIO_new(BIO_s_file());
diff --git a/src/usr.bin/openssl/smime.c b/src/usr.bin/openssl/smime.c
index 155bb8b03d..8b76ea9e78 100644
--- a/src/usr.bin/openssl/smime.c
+++ b/src/usr.bin/openssl/smime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: smime.c,v 1.1 2014/08/26 17:47:25 jsing Exp $ */ 1/* $OpenBSD: smime.c,v 1.2 2015/02/08 10:22:45 doug Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -446,10 +446,7 @@ argerr:
446 encerts = sk_X509_new_null(); 446 encerts = sk_X509_new_null();
447 while (*args) { 447 while (*args) {
448 if (!(cert = load_cert(bio_err, *args, FORMAT_PEM, 448 if (!(cert = load_cert(bio_err, *args, FORMAT_PEM,
449 NULL, e, "recipient certificate file"))) { 449 NULL, e, "recipient certificate file"))) {
450#if 0 /* An appropriate message is already printed */
451 BIO_printf(bio_err, "Can't read recipient certificate file %s\n", *args);
452#endif
453 goto end; 450 goto end;
454 } 451 }
455 sk_X509_push(encerts, cert); 452 sk_X509_push(encerts, cert);
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c
index e40607f940..8795d6c434 100644
--- a/src/usr.bin/openssl/speed.c
+++ b/src/usr.bin/openssl/speed.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: speed.c,v 1.4 2015/01/03 03:03:39 lteo Exp $ */ 1/* $OpenBSD: speed.c,v 1.5 2015/02/08 10:22:45 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -675,12 +675,6 @@ speed_main(int argc, char **argv)
675 doit[D_CBC_256_CML] = 1; 675 doit[D_CBC_256_CML] = 1;
676 else 676 else
677#endif 677#endif
678#if 0 /* was: #ifdef RSAref */
679 if (strcmp(*argv, "rsaref") == 0) {
680 RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
681 j--;
682 } else
683#endif
684#ifndef RSA_NULL 678#ifndef RSA_NULL
685 if (strcmp(*argv, "openssl") == 0) { 679 if (strcmp(*argv, "openssl") == 0) {
686 RSA_set_default_method(RSA_PKCS1_SSLeay()); 680 RSA_set_default_method(RSA_PKCS1_SSLeay());
@@ -1004,15 +998,6 @@ speed_main(int argc, char **argv)
1004 BIO_printf(bio_err, "internal error loading RSA key number %d\n", i); 998 BIO_printf(bio_err, "internal error loading RSA key number %d\n", i);
1005 goto end; 999 goto end;
1006 } 1000 }
1007#if 0
1008 else {
1009 BIO_printf(bio_err, mr ? "+RK:%d:"
1010 : "Loaded RSA key, %d bit modulus and e= 0x",
1011 BN_num_bits(rsa_key[i]->n));
1012 BN_print(bio_err, rsa_key[i]->e);
1013 BIO_printf(bio_err, "\n");
1014 }
1015#endif
1016 } 1001 }
1017 1002
1018 dsa_key[0] = get_dsa512(); 1003 dsa_key[0] = get_dsa512();
@@ -1501,7 +1486,6 @@ speed_main(int argc, char **argv)
1501 rsa_count = count; 1486 rsa_count = count;
1502 } 1487 }
1503 1488
1504#if 1
1505 ret = RSA_verify(NID_md5_sha1, buf, 36, buf2, rsa_num, rsa_key[j]); 1489 ret = RSA_verify(NID_md5_sha1, buf, 36, buf2, rsa_num, rsa_key[j]);
1506 if (ret <= 0) { 1490 if (ret <= 0) {
1507 BIO_printf(bio_err, "RSA verify failure. No RSA verify will be done.\n"); 1491 BIO_printf(bio_err, "RSA verify failure. No RSA verify will be done.\n");
@@ -1529,7 +1513,6 @@ speed_main(int argc, char **argv)
1529 count, rsa_bits[j], d); 1513 count, rsa_bits[j], d);
1530 rsa_results[j][1] = d / (double) count; 1514 rsa_results[j][1] = d / (double) count;
1531 } 1515 }
1532#endif
1533 1516
1534 if (rsa_count <= 1) { 1517 if (rsa_count <= 1) {
1535 /* if longer than 10s, don't do any more */ 1518 /* if longer than 10s, don't do any more */
@@ -1624,9 +1607,8 @@ speed_main(int argc, char **argv)
1624 ERR_print_errors(bio_err); 1607 ERR_print_errors(bio_err);
1625 rsa_count = 1; 1608 rsa_count = 1;
1626 } else { 1609 } else {
1627#if 1
1628 EC_KEY_precompute_mult(ecdsa[j], NULL); 1610 EC_KEY_precompute_mult(ecdsa[j], NULL);
1629#endif 1611
1630 /* Perform ECDSA signature test */ 1612 /* Perform ECDSA signature test */
1631 EC_KEY_generate_key(ecdsa[j]); 1613 EC_KEY_generate_key(ecdsa[j]);
1632 ret = ECDSA_sign(0, buf, 20, ecdsasig, 1614 ret = ECDSA_sign(0, buf, 20, ecdsasig,