diff options
author | beck <> | 2017-01-29 17:49:23 +0000 |
---|---|---|
committer | beck <> | 2017-01-29 17:49:23 +0000 |
commit | 957b11334a7afb14537322f0e4795b2e368b3f59 (patch) | |
tree | 1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/conf/conf_lib.c | |
parent | df96e020e729c6c37a8c7fe311fdd1fe6a8718c5 (diff) | |
download | openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.gz openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.bz2 openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.zip |
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing
libssl had more reacharounds into this.
ok jsing@ inoguchi@
Diffstat (limited to 'src/lib/libcrypto/conf/conf_lib.c')
-rw-r--r-- | src/lib/libcrypto/conf/conf_lib.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/lib/libcrypto/conf/conf_lib.c b/src/lib/libcrypto/conf/conf_lib.c index c7e026e725..995ba3ef67 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.14 2016/08/05 17:25:51 deraadt Exp $ */ | 1 | /* $OpenBSD: conf_lib.c,v 1.15 2017/01/29 17:49:22 beck 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 | */ |
@@ -94,7 +94,7 @@ LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, | |||
94 | 94 | ||
95 | in = BIO_new_file(file, "rb"); | 95 | in = BIO_new_file(file, "rb"); |
96 | if (in == NULL) { | 96 | if (in == NULL) { |
97 | CONFerr(CONF_F_CONF_LOAD, ERR_R_SYS_LIB); | 97 | CONFerror(ERR_R_SYS_LIB); |
98 | return NULL; | 98 | return NULL; |
99 | } | 99 | } |
100 | 100 | ||
@@ -111,7 +111,7 @@ LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, | |||
111 | LHASH_OF(CONF_VALUE) *ltmp; | 111 | LHASH_OF(CONF_VALUE) *ltmp; |
112 | 112 | ||
113 | if (!(btmp = BIO_new_fp(fp, BIO_NOCLOSE))) { | 113 | if (!(btmp = BIO_new_fp(fp, BIO_NOCLOSE))) { |
114 | CONFerr(CONF_F_CONF_LOAD_FP, ERR_R_BUF_LIB); | 114 | CONFerror(ERR_R_BUF_LIB); |
115 | return NULL; | 115 | return NULL; |
116 | } | 116 | } |
117 | ltmp = CONF_load_bio(conf, btmp, eline); | 117 | ltmp = CONF_load_bio(conf, btmp, eline); |
@@ -196,7 +196,7 @@ CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out) | |||
196 | int ret; | 196 | int ret; |
197 | 197 | ||
198 | if (!(btmp = BIO_new_fp(out, BIO_NOCLOSE))) { | 198 | if (!(btmp = BIO_new_fp(out, BIO_NOCLOSE))) { |
199 | CONFerr(CONF_F_CONF_DUMP_FP, ERR_R_BUF_LIB); | 199 | CONFerror(ERR_R_BUF_LIB); |
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | ret = CONF_dump_bio(conf, btmp); | 202 | ret = CONF_dump_bio(conf, btmp); |
@@ -229,7 +229,7 @@ NCONF_new(CONF_METHOD *meth) | |||
229 | 229 | ||
230 | ret = meth->create(meth); | 230 | ret = meth->create(meth); |
231 | if (ret == NULL) { | 231 | if (ret == NULL) { |
232 | CONFerr(CONF_F_NCONF_NEW, ERR_R_MALLOC_FAILURE); | 232 | CONFerror(ERR_R_MALLOC_FAILURE); |
233 | return (NULL); | 233 | return (NULL); |
234 | } | 234 | } |
235 | 235 | ||
@@ -256,7 +256,7 @@ int | |||
256 | NCONF_load(CONF *conf, const char *file, long *eline) | 256 | NCONF_load(CONF *conf, const char *file, long *eline) |
257 | { | 257 | { |
258 | if (conf == NULL) { | 258 | if (conf == NULL) { |
259 | CONFerr(CONF_F_NCONF_LOAD, CONF_R_NO_CONF); | 259 | CONFerror(CONF_R_NO_CONF); |
260 | return 0; | 260 | return 0; |
261 | } | 261 | } |
262 | 262 | ||
@@ -270,7 +270,7 @@ NCONF_load_fp(CONF *conf, FILE *fp, long *eline) | |||
270 | int ret; | 270 | int ret; |
271 | 271 | ||
272 | if (!(btmp = BIO_new_fp(fp, BIO_NOCLOSE))) { | 272 | if (!(btmp = BIO_new_fp(fp, BIO_NOCLOSE))) { |
273 | CONFerr(CONF_F_NCONF_LOAD_FP, ERR_R_BUF_LIB); | 273 | CONFerror(ERR_R_BUF_LIB); |
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
276 | ret = NCONF_load_bio(conf, btmp, eline); | 276 | ret = NCONF_load_bio(conf, btmp, eline); |
@@ -282,7 +282,7 @@ int | |||
282 | NCONF_load_bio(CONF *conf, BIO *bp, long *eline) | 282 | NCONF_load_bio(CONF *conf, BIO *bp, long *eline) |
283 | { | 283 | { |
284 | if (conf == NULL) { | 284 | if (conf == NULL) { |
285 | CONFerr(CONF_F_NCONF_LOAD_BIO, CONF_R_NO_CONF); | 285 | CONFerror(CONF_R_NO_CONF); |
286 | return 0; | 286 | return 0; |
287 | } | 287 | } |
288 | 288 | ||
@@ -293,12 +293,12 @@ STACK_OF(CONF_VALUE) * | |||
293 | NCONF_get_section(const CONF *conf, const char *section) | 293 | NCONF_get_section(const CONF *conf, const char *section) |
294 | { | 294 | { |
295 | if (conf == NULL) { | 295 | if (conf == NULL) { |
296 | CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_CONF); | 296 | CONFerror(CONF_R_NO_CONF); |
297 | return NULL; | 297 | return NULL; |
298 | } | 298 | } |
299 | 299 | ||
300 | if (section == NULL) { | 300 | if (section == NULL) { |
301 | CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_SECTION); | 301 | CONFerror(CONF_R_NO_SECTION); |
302 | return NULL; | 302 | return NULL; |
303 | } | 303 | } |
304 | 304 | ||
@@ -316,11 +316,10 @@ NCONF_get_string(const CONF *conf, const char *group, const char *name) | |||
316 | return s; | 316 | return s; |
317 | 317 | ||
318 | if (conf == NULL) { | 318 | if (conf == NULL) { |
319 | CONFerr(CONF_F_NCONF_GET_STRING, | 319 | CONFerror(CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE); |
320 | CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE); | ||
321 | return NULL; | 320 | return NULL; |
322 | } | 321 | } |
323 | CONFerr(CONF_F_NCONF_GET_STRING, CONF_R_NO_VALUE); | 322 | CONFerror(CONF_R_NO_VALUE); |
324 | ERR_asprintf_error_data("group=%s name=%s", | 323 | ERR_asprintf_error_data("group=%s name=%s", |
325 | group ? group : "", name); | 324 | group ? group : "", name); |
326 | return NULL; | 325 | return NULL; |
@@ -333,7 +332,7 @@ NCONF_get_number_e(const CONF *conf, const char *group, const char *name, | |||
333 | char *str; | 332 | char *str; |
334 | 333 | ||
335 | if (result == NULL) { | 334 | if (result == NULL) { |
336 | CONFerr(CONF_F_NCONF_GET_NUMBER_E, ERR_R_PASSED_NULL_PARAMETER); | 335 | CONFerror(ERR_R_PASSED_NULL_PARAMETER); |
337 | return 0; | 336 | return 0; |
338 | } | 337 | } |
339 | 338 | ||
@@ -356,7 +355,7 @@ NCONF_dump_fp(const CONF *conf, FILE *out) | |||
356 | BIO *btmp; | 355 | BIO *btmp; |
357 | int ret; | 356 | int ret; |
358 | if (!(btmp = BIO_new_fp(out, BIO_NOCLOSE))) { | 357 | if (!(btmp = BIO_new_fp(out, BIO_NOCLOSE))) { |
359 | CONFerr(CONF_F_NCONF_DUMP_FP, ERR_R_BUF_LIB); | 358 | CONFerror(ERR_R_BUF_LIB); |
360 | return 0; | 359 | return 0; |
361 | } | 360 | } |
362 | ret = NCONF_dump_bio(conf, btmp); | 361 | ret = NCONF_dump_bio(conf, btmp); |
@@ -368,7 +367,7 @@ int | |||
368 | NCONF_dump_bio(const CONF *conf, BIO *out) | 367 | NCONF_dump_bio(const CONF *conf, BIO *out) |
369 | { | 368 | { |
370 | if (conf == NULL) { | 369 | if (conf == NULL) { |
371 | CONFerr(CONF_F_NCONF_DUMP_BIO, CONF_R_NO_CONF); | 370 | CONFerror(CONF_R_NO_CONF); |
372 | return 0; | 371 | return 0; |
373 | } | 372 | } |
374 | 373 | ||