summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/conf')
-rw-r--r--src/lib/libcrypto/conf/conf.h10
-rw-r--r--src/lib/libcrypto/conf/conf_api.c24
-rw-r--r--src/lib/libcrypto/conf/conf_def.c19
-rw-r--r--src/lib/libcrypto/conf/conf_lib.c20
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 {
149CONF *NCONF_new(CONF_METHOD *meth); 149CONF *NCONF_new(CONF_METHOD *meth);
150CONF_METHOD *NCONF_default(void); 150CONF_METHOD *NCONF_default(void);
151CONF_METHOD *NCONF_WIN32(void); 151CONF_METHOD *NCONF_WIN32(void);
152#if 0 /* Just to give you an idea of what I have in mind */
153CONF_METHOD *NCONF_XML(void);
154#endif
155void NCONF_free(CONF *conf); 152void NCONF_free(CONF *conf);
156void NCONF_free_data(CONF *conf); 153void 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,
165int NCONF_dump_fp(const CONF *conf, FILE *out); 162int NCONF_dump_fp(const CONF *conf, FILE *out);
166int NCONF_dump_bio(const CONF *conf, BIO *out); 163int 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 */
170long 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. */
171long
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
190static unsigned long 168static unsigned long
191conf_value_hash(const CONF_VALUE *v) 169conf_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
380long
381NCONF_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