diff options
author | doug <> | 2015-02-07 13:19:15 +0000 |
---|---|---|
committer | doug <> | 2015-02-07 13:19:15 +0000 |
commit | bd790e322a40e6362231f517d5795d4079eeb2a2 (patch) | |
tree | 1f11c8eab9ee5f3f265f1010c299c7fd574d9cdf /src/lib/libcrypto/conf | |
parent | ff826d3cb94a579275eb6e97b3cf80ca69016d4b (diff) | |
download | openbsd-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/conf')
-rw-r--r-- | src/lib/libcrypto/conf/conf.h | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/conf/conf_api.c | 24 | ||||
-rw-r--r-- | src/lib/libcrypto/conf/conf_def.c | 19 | ||||
-rw-r--r-- | src/lib/libcrypto/conf/conf_lib.c | 20 |
4 files changed, 5 insertions, 68 deletions
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h index ba7fb69794..095066d31b 100644 --- a/src/lib/libcrypto/conf/conf.h +++ b/src/lib/libcrypto/conf/conf.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf.h,v 1.13 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: conf.h,v 1.14 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 | * |
@@ -149,9 +149,6 @@ struct conf_st { | |||
149 | CONF *NCONF_new(CONF_METHOD *meth); | 149 | CONF *NCONF_new(CONF_METHOD *meth); |
150 | CONF_METHOD *NCONF_default(void); | 150 | CONF_METHOD *NCONF_default(void); |
151 | CONF_METHOD *NCONF_WIN32(void); | 151 | CONF_METHOD *NCONF_WIN32(void); |
152 | #if 0 /* Just to give you an idea of what I have in mind */ | ||
153 | CONF_METHOD *NCONF_XML(void); | ||
154 | #endif | ||
155 | void NCONF_free(CONF *conf); | 152 | void NCONF_free(CONF *conf); |
156 | void NCONF_free_data(CONF *conf); | 153 | void NCONF_free_data(CONF *conf); |
157 | 154 | ||
@@ -165,12 +162,7 @@ int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, | |||
165 | int NCONF_dump_fp(const CONF *conf, FILE *out); | 162 | int NCONF_dump_fp(const CONF *conf, FILE *out); |
166 | int NCONF_dump_bio(const CONF *conf, BIO *out); | 163 | int NCONF_dump_bio(const CONF *conf, BIO *out); |
167 | 164 | ||
168 | #if 0 /* The following function has no error checking, | ||
169 | and should therefore be avoided */ | ||
170 | long NCONF_get_number(CONF *conf, char *group, char *name); | ||
171 | #else | ||
172 | #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) | 165 | #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) |
173 | #endif | ||
174 | 166 | ||
175 | /* Module functions */ | 167 | /* Module functions */ |
176 | 168 | ||
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c index 7480dda3d5..56a4f249ad 100644 --- a/src/lib/libcrypto/conf/conf_api.c +++ b/src/lib/libcrypto/conf/conf_api.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_api.c,v 1.11 2014/06/23 22:19:02 deraadt Exp $ */ | 1 | /* $OpenBSD: conf_api.c,v 1.12 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 | * |
@@ -165,28 +165,6 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | #if 0 /* There's no way to provide error checking with this function, so | ||
169 | force implementors of the higher levels to get a string and read | ||
170 | the number themselves. */ | ||
171 | long | ||
172 | _CONF_get_number(CONF *conf, char *section, char *name) | ||
173 | { | ||
174 | char *str; | ||
175 | long ret = 0; | ||
176 | |||
177 | str = _CONF_get_string(conf, section, name); | ||
178 | if (str == NULL) | ||
179 | return (0); | ||
180 | for (;;) { | ||
181 | if (conf->meth->is_number(conf, *str)) | ||
182 | ret = ret * 10 + conf->meth->to_int(conf, *str); | ||
183 | else | ||
184 | return (ret); | ||
185 | str++; | ||
186 | } | ||
187 | } | ||
188 | #endif | ||
189 | |||
190 | static unsigned long | 168 | static unsigned long |
191 | conf_value_hash(const CONF_VALUE *v) | 169 | conf_value_hash(const CONF_VALUE *v) |
192 | { | 170 | { |
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c index c437aeb457..e608e5fe9d 100644 --- a/src/lib/libcrypto/conf/conf_def.c +++ b/src/lib/libcrypto/conf/conf_def.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_def.c,v 1.28 2014/07/11 15:38:03 miod Exp $ */ | 1 | /* $OpenBSD: conf_def.c,v 1.29 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 | * |
@@ -388,27 +388,12 @@ again: | |||
388 | } | 388 | } |
389 | } else | 389 | } else |
390 | tv = sv; | 390 | tv = sv; |
391 | #if 1 | 391 | |
392 | if (_CONF_add_string(conf, tv, v) == 0) { | 392 | if (_CONF_add_string(conf, tv, v) == 0) { |
393 | CONFerr(CONF_F_DEF_LOAD_BIO, | 393 | CONFerr(CONF_F_DEF_LOAD_BIO, |
394 | ERR_R_MALLOC_FAILURE); | 394 | ERR_R_MALLOC_FAILURE); |
395 | goto err; | 395 | goto err; |
396 | } | 396 | } |
397 | #else | ||
398 | v->section = tv->section; | ||
399 | if (!sk_CONF_VALUE_push(ts, v)) { | ||
400 | CONFerr(CONF_F_DEF_LOAD_BIO, | ||
401 | ERR_R_MALLOC_FAILURE); | ||
402 | goto err; | ||
403 | } | ||
404 | vv = (CONF_VALUE *)lh_insert(conf->data, v); | ||
405 | if (vv != NULL) { | ||
406 | sk_CONF_VALUE_delete_ptr(ts, vv); | ||
407 | free(vv->name); | ||
408 | free(vv->value); | ||
409 | free(vv); | ||
410 | } | ||
411 | #endif | ||
412 | v = NULL; | 397 | v = NULL; |
413 | } | 398 | } |
414 | } | 399 | } |
diff --git a/src/lib/libcrypto/conf/conf_lib.c b/src/lib/libcrypto/conf/conf_lib.c index 2119eb6219..a7c8be7c0d 100644 --- a/src/lib/libcrypto/conf/conf_lib.c +++ b/src/lib/libcrypto/conf/conf_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_lib.c,v 1.12 2014/07/09 11:10:50 bcook Exp $ */ | 1 | /* $OpenBSD: conf_lib.c,v 1.13 2015/02/07 13:19:15 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 | */ |
@@ -373,21 +373,3 @@ NCONF_dump_bio(const CONF *conf, BIO *out) | |||
373 | 373 | ||
374 | return conf->meth->dump(conf, out); | 374 | return conf->meth->dump(conf, out); |
375 | } | 375 | } |
376 | |||
377 | |||
378 | /* This function should be avoided */ | ||
379 | #if 0 | ||
380 | long | ||
381 | NCONF_get_number(CONF *conf, char *group, char *name) | ||
382 | { | ||
383 | int status; | ||
384 | long ret = 0; | ||
385 | |||
386 | status = NCONF_get_number_e(conf, group, name, &ret); | ||
387 | if (status == 0) { | ||
388 | /* This function does not believe in errors... */ | ||
389 | ERR_get_error(); | ||
390 | } | ||
391 | return ret; | ||
392 | } | ||
393 | #endif | ||