summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1
diff options
context:
space:
mode:
authordoug <>2015-02-07 13:19:15 +0000
committerdoug <>2015-02-07 13:19:15 +0000
commitbd790e322a40e6362231f517d5795d4079eeb2a2 (patch)
tree1f11c8eab9ee5f3f265f1010c299c7fd574d9cdf /src/lib/libcrypto/asn1
parentff826d3cb94a579275eb6e97b3cf80ca69016d4b (diff)
downloadopenbsd-bd790e322a40e6362231f517d5795d4079eeb2a2.tar.gz
openbsd-bd790e322a40e6362231f517d5795d4079eeb2a2.tar.bz2
openbsd-bd790e322a40e6362231f517d5795d4079eeb2a2.zip
Delete a lot of #if 0 code in libressl.
There are a few instances where #if 1 is removed but the code remains. Based on the following OpenSSL commits. Some of the commits weren't strictly deletions so they are going to be split up into separate commits. 6f91b017bbb7140f816721141ac156d1b828a6b3 3d47c1d331fdc7574d2275cda1a630ccdb624b08 dfb56425b68314b2b57e17c82c1df42e7a015132 c8fa2356a00cbaada8963f739e5570298311a060 f16a64d11f55c01f56baa62ebf1dec7f8fe718cb 9ccc00ef6ea65567622e40c49aca43f2c6d79cdb 02a938c953b3e1ced71d9a832de1618f907eb96d 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 d6fbb194095312f4722c81c9362dbd0de66cb656 6f1a93ad111c7dfe36a09a976c4c009079b19ea1 1a5adcfb5edfe23908b350f8757df405b0f5f71f 8de24b792743d11e1d5a0dcd336a49368750c577 a2b18e657ea1a932d125154f4e13ab2258796d90 8e964419603d2478dfb391c66e7ccb2dcc9776b4 32dfde107636ac9bc62a5b3233fe2a54dbc27008 input + ok jsing@, miod@, tedu@
Diffstat (limited to 'src/lib/libcrypto/asn1')
-rw-r--r--src/lib/libcrypto/asn1/a_gentm.c39
-rw-r--r--src/lib/libcrypto/asn1/a_strex.c16
-rw-r--r--src/lib/libcrypto/asn1/a_time.c14
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c8
-rw-r--r--src/lib/libcrypto/asn1/asn1_par.c6
-rw-r--r--src/lib/libcrypto/asn1/t_x509.c10
-rw-r--r--src/lib/libcrypto/asn1/tasn_prn.c12
7 files changed, 7 insertions, 98 deletions
diff --git a/src/lib/libcrypto/asn1/a_gentm.c b/src/lib/libcrypto/asn1/a_gentm.c
index c658b1ea35..bc3453f410 100644
--- a/src/lib/libcrypto/asn1/a_gentm.c
+++ b/src/lib/libcrypto/asn1/a_gentm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_gentm.c,v 1.22 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_gentm.c,v 1.23 2015/02/07 13:19:15 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 *
@@ -67,43 +67,6 @@
67 67
68#include "o_time.h" 68#include "o_time.h"
69 69
70#if 0
71
72int
73i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
74{
75 return(i2d_ASN1_bytes((ASN1_STRING *)a, pp,
76 V_ASN1_GENERALIZEDTIME, V_ASN1_UNIVERSAL));
77}
78
79
80ASN1_GENERALIZEDTIME *
81d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a, unsigned char **pp,
82 long length)
83{
84 ASN1_GENERALIZEDTIME *ret = NULL;
85
86 ret = (ASN1_GENERALIZEDTIME *)d2i_ASN1_bytes((ASN1_STRING **)a, pp, length,
87 V_ASN1_GENERALIZEDTIME, V_ASN1_UNIVERSAL);
88 if (ret == NULL) {
89 ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME, ERR_R_NESTED_ASN1_ERROR);
90 return (NULL);
91 }
92 if (!ASN1_GENERALIZEDTIME_check(ret)) {
93 ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME, ASN1_R_INVALID_TIME_FORMAT);
94 goto err;
95 }
96
97 return (ret);
98
99err:
100 if ((ret != NULL) && ((a == NULL) || (*a != ret)))
101 M_ASN1_GENERALIZEDTIME_free(ret);
102 return (NULL);
103}
104
105#endif
106
107int 70int
108ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) 71ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
109{ 72{
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c
index b592c0e18a..f60a70d94d 100644
--- a/src/lib/libcrypto/asn1/a_strex.c
+++ b/src/lib/libcrypto/asn1/a_strex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_strex.c,v 1.24 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_strex.c,v 1.25 2015/02/07 13:19:15 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 2000. 3 * project 2000.
4 */ 4 */
@@ -84,20 +84,6 @@
84/* Three IO functions for sending data to memory, a BIO and 84/* Three IO functions for sending data to memory, a BIO and
85 * and a FILE pointer. 85 * and a FILE pointer.
86 */ 86 */
87#if 0 /* never used */
88static int
89send_mem_chars(void *arg, const void *buf, int len)
90{
91 unsigned char **out = arg;
92
93 if (!out)
94 return 1;
95 memcpy(*out, buf, len);
96 *out += len;
97 return 1;
98}
99#endif
100
101static int 87static int
102send_bio_chars(void *arg, const void *buf, int len) 88send_bio_chars(void *arg, const void *buf, int len)
103{ 89{
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c
index 94e249960a..c5e882a4f6 100644
--- a/src/lib/libcrypto/asn1/a_time.c
+++ b/src/lib/libcrypto/asn1/a_time.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_time.c,v 1.21 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_time.c,v 1.22 2015/02/07 13:19:15 doug Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -73,18 +73,6 @@ IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME)
73 73
74IMPLEMENT_ASN1_FUNCTIONS(ASN1_TIME) 74IMPLEMENT_ASN1_FUNCTIONS(ASN1_TIME)
75 75
76#if 0
77int
78i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp)
79{
80 if (a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME)
81 return(i2d_ASN1_bytes((ASN1_STRING *)a, pp,
82 a->type, V_ASN1_UNIVERSAL));
83 ASN1err(ASN1_F_I2D_ASN1_TIME, ASN1_R_EXPECTING_A_TIME);
84 return -1;
85}
86#endif
87
88ASN1_TIME * 76ASN1_TIME *
89ASN1_TIME_set(ASN1_TIME *s, time_t t) 77ASN1_TIME_set(ASN1_TIME *s, time_t t)
90{ 78{
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index 2b952abae6..46de52a050 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.32 2014/07/11 14:49:12 miod Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.33 2015/02/07 13:19:15 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 *
@@ -140,12 +140,6 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
140 if (inf && !(ret & V_ASN1_CONSTRUCTED)) 140 if (inf && !(ret & V_ASN1_CONSTRUCTED))
141 goto err; 141 goto err;
142 142
143#if 0
144 fprintf(stderr, "p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n",
145 (int)p, *plength, omax, (int)*pp, (int)(p+ *plength),
146 (int)(omax+ *pp));
147
148#endif
149 if (*plength > (omax - (p - *pp))) { 143 if (*plength > (omax - (p - *pp))) {
150 ASN1err(ASN1_F_ASN1_GET_OBJECT, ASN1_R_TOO_LONG); 144 ASN1err(ASN1_F_ASN1_GET_OBJECT, ASN1_R_TOO_LONG);
151 /* Set this so that even if things are not long enough 145 /* Set this so that even if things are not long enough
diff --git a/src/lib/libcrypto/asn1/asn1_par.c b/src/lib/libcrypto/asn1/asn1_par.c
index 2c8062bb8a..b5742fe97d 100644
--- a/src/lib/libcrypto/asn1/asn1_par.c
+++ b/src/lib/libcrypto/asn1/asn1_par.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_par.c,v 1.21 2014/10/03 06:02:38 doug Exp $ */ 1/* $OpenBSD: asn1_par.c,v 1.22 2015/02/07 13:19:15 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 *
@@ -126,11 +126,7 @@ asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset,
126 /* ASN1_BMPSTRING *bmp=NULL;*/ 126 /* ASN1_BMPSTRING *bmp=NULL;*/
127 int dump_indent; 127 int dump_indent;
128 128
129#if 0
130 dump_indent = indent;
131#else
132 dump_indent = 6; /* Because we know BIO_dump_indent() */ 129 dump_indent = 6; /* Because we know BIO_dump_indent() */
133#endif
134 p = *pp; 130 p = *pp;
135 tot = p + length; 131 tot = p + length;
136 op = p - 1; 132 op = p - 1;
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c
index f4872d8b24..1c83fc5608 100644
--- a/src/lib/libcrypto/asn1/t_x509.c
+++ b/src/lib/libcrypto/asn1/t_x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_x509.c,v 1.25 2014/07/12 16:33:25 miod Exp $ */ 1/* $OpenBSD: t_x509.c,v 1.26 2015/02/07 13:19:15 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 *
@@ -172,14 +172,6 @@ X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
172 if (!(cflag & X509_FLAG_NO_SIGNAME)) { 172 if (!(cflag & X509_FLAG_NO_SIGNAME)) {
173 if (X509_signature_print(bp, x->sig_alg, NULL) <= 0) 173 if (X509_signature_print(bp, x->sig_alg, NULL) <= 0)
174 goto err; 174 goto err;
175#if 0
176 if (BIO_printf(bp, "%8sSignature Algorithm: ", "") <= 0)
177 goto err;
178 if (i2a_ASN1_OBJECT(bp, ci->signature->algorithm) <= 0)
179 goto err;
180 if (BIO_puts(bp, "\n") <= 0)
181 goto err;
182#endif
183 } 175 }
184 176
185 if (!(cflag & X509_FLAG_NO_ISSUER)) { 177 if (!(cflag & X509_FLAG_NO_ISSUER)) {
diff --git a/src/lib/libcrypto/asn1/tasn_prn.c b/src/lib/libcrypto/asn1/tasn_prn.c
index 9383750a82..844960fc77 100644
--- a/src/lib/libcrypto/asn1/tasn_prn.c
+++ b/src/lib/libcrypto/asn1/tasn_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_prn.c,v 1.11 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: tasn_prn.c,v 1.12 2015/02/07 13:19:15 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 2000. 3 * project 2000.
4 */ 4 */
@@ -260,11 +260,6 @@ asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, const ASN1_ITEM *it,
260 break; 260 break;
261 261
262 case ASN1_ITYPE_CHOICE: 262 case ASN1_ITYPE_CHOICE:
263#if 0
264 if (!nohdr &&
265 !asn1_print_fsname(out, indent, fname, sname, pctx))
266 return 0;
267#endif
268 /* CHOICE type, get selector */ 263 /* CHOICE type, get selector */
269 i = asn1_get_choice_selector(fld, it); 264 i = asn1_get_choice_selector(fld, it);
270 /* This should never happen... */ 265 /* This should never happen... */
@@ -395,11 +390,6 @@ asn1_print_fsname(BIO *out, int indent, const char *fname, const char *sname,
395 static char spaces[] = " "; 390 static char spaces[] = " ";
396 const int nspaces = sizeof(spaces) - 1; 391 const int nspaces = sizeof(spaces) - 1;
397 392
398#if 0
399 if (!sname && !fname)
400 return 1;
401#endif
402
403 while (indent > nspaces) { 393 while (indent > nspaces) {
404 if (BIO_write(out, spaces, nspaces) != nspaces) 394 if (BIO_write(out, spaces, nspaces) != nspaces)
405 return 0; 395 return 0;