load_config() once when we start.
ok miod@
-/* $OpenBSD: apps.c,v 1.64 2014/07/09 21:13:34 tedu Exp $ */
+/* $OpenBSD: apps.c,v 1.65 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (load_config_called)
return 1;
load_config_called = 1;
- if (!cnf)
+ if (cnf == NULL)
cnf = config;
- if (!cnf)
+ if (cnf == NULL)
return 1;
OPENSSL_load_builtin_modules();
-/* $OpenBSD: asn1pars.c,v 1.25 2014/06/28 04:39:41 deraadt Exp $ */
+/* $OpenBSD: asn1pars.c,v 1.26 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
informat = FORMAT_PEM;
- if (!load_config(bio_err, NULL))
- goto end;
-
prog = argv[0];
argc--;
argv++;
-/* $OpenBSD: ca.c,v 1.61 2014/07/09 21:13:34 tedu Exp $ */
+/* $OpenBSD: ca.c,v 1.62 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
free(tofree);
tofree = NULL;
- if (!load_config(bio_err, conf))
- goto err;
-
#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0);
#endif
-/* $OpenBSD: ciphers.c,v 1.23 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: ciphers.c,v 1.24 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
meth = SSLv3_server_method();
STDout = BIO_new_fp(stdout, BIO_NOCLOSE);
- if (!load_config(bio_err, NULL))
- goto end;
argc--;
argv++;
-/* $OpenBSD: cms.c,v 1.18 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: cms.c,v 1.19 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
args = argv + 1;
ret = 1;
- if (!load_config(bio_err, NULL))
- goto end;
-
while (!badarg && *args && *args[0] == '-') {
if (!strcmp(*args, "-encrypt"))
operation = SMIME_ENCRYPT;
-/* $OpenBSD: crl.c,v 1.23 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: crl.c,v 1.24 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int do_ver = 0;
const EVP_MD *md_alg, *digest = EVP_sha1();
- if (!load_config(bio_err, NULL))
- goto end;
-
if (bio_out == NULL)
if ((bio_out = BIO_new(BIO_s_file())) != NULL) {
BIO_set_fp(bio_out, stdout, BIO_NOCLOSE);
-/* $OpenBSD: dgst.c,v 1.37 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: dgst.c,v 1.38 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
goto end;
}
- if (!load_config(bio_err, NULL))
- goto end;
-
/* first check the program name */
program_name(argv[0], pname, sizeof pname);
-/* $OpenBSD: dh.c,v 1.23 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: dh.c,v 1.24 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
char *engine;
#endif
- if (!load_config(bio_err, NULL))
- goto end;
-
#ifndef OPENSSL_NO_ENGINE
engine = NULL;
#endif
-/* $OpenBSD: dhparam.c,v 1.31 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: dhparam.c,v 1.32 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#endif
int num = 0, g = 0;
- if (!load_config(bio_err, NULL))
- goto end;
-
infile = NULL;
outfile = NULL;
informat = FORMAT_PEM;
-/* $OpenBSD: dsa.c,v 1.26 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: dsa.c,v 1.27 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int pvk_encr = 2;
- if (!load_config(bio_err, NULL))
- goto end;
-
#ifndef OPENSSL_NO_ENGINE
engine = NULL;
#endif
-/* $OpenBSD: dsaparam.c,v 1.32 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: dsaparam.c,v 1.33 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int timebomb = 0;
#endif
- if (!load_config(bio_err, NULL))
- goto end;
-
infile = NULL;
outfile = NULL;
informat = FORMAT_PEM;
-/* $OpenBSD: ec.c,v 1.14 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: ec.c,v 1.15 2014/07/12 17:54:31 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
int new_asn1_flag = 0;
- if (!load_config(bio_err, NULL))
- goto end;
-
engine = NULL;
infile = NULL;
outfile = NULL;
-/* $OpenBSD: ecparam.c,v 1.21 2014/06/24 05:39:29 logan Exp $ */
+/* $OpenBSD: ecparam.c,v 1.22 2014/07/12 17:54:31 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
*ec_order = NULL, *ec_cofactor = NULL;
unsigned char *buffer = NULL;
- if (!load_config(bio_err, NULL))
- goto end;
-
informat = FORMAT_PEM;
outformat = FORMAT_PEM;
-/* $OpenBSD: enc.c,v 1.36 2014/06/29 18:22:10 logan Exp $ */
+/* $OpenBSD: enc.c,v 1.37 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#endif
const EVP_MD *dgst = NULL;
- if (!load_config(bio_err, NULL))
- goto end;
-
/* first check the program name */
program_name(argv[0], pname, sizeof pname);
if (strcmp(pname, "base64") == 0)
-/* $OpenBSD: engine.c,v 1.24 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: engine.c,v 1.25 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Richard Levitte <richard@levitte.org> for the OpenSSL
* project 2000.
*/
SSL_load_error_strings();
- if (!load_config(bio_err, NULL))
- goto end;
-
bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
argc--;
-/* $OpenBSD: gendh.c,v 1.26 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: gendh.c,v 1.27 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BN_GENCB_set(&cb, dh_cb, bio_err);
- if (!load_config(bio_err, NULL))
- goto end;
-
argv++;
argc--;
for (;;) {
-/* $OpenBSD: gendsa.c,v 1.28 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: gendsa.c,v 1.29 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
char *engine = NULL;
#endif
- if (!load_config(bio_err, NULL))
- goto end;
-
argv++;
argc--;
for (;;) {
-/* $OpenBSD: genpkey.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: genpkey.c,v 1.12 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006
*/
int do_param = 0;
- if (!load_config(bio_err, NULL))
- goto end;
-
outformat = FORMAT_PEM;
ERR_load_crypto_strings();
-/* $OpenBSD: genrsa.c,v 1.35 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: genrsa.c,v 1.36 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BN_GENCB_set(&cb, genrsa_cb, bio_err);
- if (!load_config(bio_err, NULL))
- goto err;
-
if ((out = BIO_new(BIO_s_file())) == NULL) {
BIO_printf(bio_err, "unable to create BIO for output\n");
goto err;
-/* $OpenBSD: ocsp.c,v 1.27 2014/06/28 04:39:41 deraadt Exp $ */
+/* $OpenBSD: ocsp.c,v 1.28 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
const EVP_MD *cert_id_md = NULL;
const char *errstr = NULL;
- if (!load_config(bio_err, NULL))
- goto end;
-
SSL_load_error_strings();
OpenSSL_add_ssl_algorithms();
-/* $OpenBSD: openssl.c,v 1.39 2014/07/10 09:15:51 tedu Exp $ */
+/* $OpenBSD: openssl.c,v 1.40 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
exit(1);
}
}
+
+ if (!load_config(bio_err, NULL)) {
+ BIO_printf(bio_err, "failed to load configuration\n");
+ goto end;
+ }
+
prog = prog_init();
/* first check the program name */
list_type = FUNC_TYPE_CIPHER;
bio_stdout = BIO_new_fp(stdout, BIO_NOCLOSE);
- if (!load_config(bio_err, NULL))
- goto end;
-
if (list_type == FUNC_TYPE_PKEY)
list_pkey(bio_stdout);
if (list_type == FUNC_TYPE_MD_ALG)
-/* $OpenBSD: passwd.c,v 1.21 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: passwd.c,v 1.22 2014/07/12 17:54:31 jsing Exp $ */
#if defined OPENSSL_NO_MD5
#define NO_MD5CRYPT_1
int usecrypt = 0, use1 = 0, useapr1 = 0;
size_t pw_maxlen = 0;
- if (!load_config(bio_err, NULL))
- goto err;
-
out = BIO_new(BIO_s_file());
if (out == NULL)
goto err;
-/* $OpenBSD: pkcs12.c,v 1.36 2014/07/09 21:10:06 tedu Exp $ */
+/* $OpenBSD: pkcs12.c,v 1.37 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
enc = EVP_des_ede3_cbc();
- if (!load_config(bio_err, NULL))
- goto end;
-
args = argv + 1;
while (*args) {
-/* $OpenBSD: pkcs7.c,v 1.19 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: pkcs7.c,v 1.20 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
char *engine = NULL;
#endif
- if (!load_config(bio_err, NULL))
- goto end;
-
infile = NULL;
outfile = NULL;
informat = FORMAT_PEM;
-/* $OpenBSD: pkcs8.c,v 1.19 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: pkcs8.c,v 1.20 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999-2004.
*/
char *engine = NULL;
#endif
- if (!load_config(bio_err, NULL))
- goto end;
-
informat = FORMAT_PEM;
outformat = FORMAT_PEM;
-/* $OpenBSD: pkey.c,v 1.9 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: pkey.c,v 1.10 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006
*/
#endif
int ret = 1;
- if (!load_config(bio_err, NULL))
- goto end;
-
informat = FORMAT_PEM;
outformat = FORMAT_PEM;
-/* $OpenBSD: pkeyparam.c,v 1.7 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: pkeyparam.c,v 1.8 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006
*/
#endif
int ret = 1;
- if (!load_config(bio_err, NULL))
- goto end;
-
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
args = argv + 1;
-/* $OpenBSD: pkeyutl.c,v 1.12 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: pkeyutl.c,v 1.13 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
argc--;
argv++;
- if (!load_config(bio_err, NULL))
- goto end;
-
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
-/* $OpenBSD: rand.c,v 1.20 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: rand.c,v 1.21 2014/07/12 17:54:31 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
char *engine = NULL;
#endif
- if (!load_config(bio_err, NULL))
- goto err;
-
badopt = 0;
i = 0;
while (!badopt && argv[++i] != NULL) {
-/* $OpenBSD: rsa.c,v 1.25 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: rsa.c,v 1.26 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int pvk_encr = 2;
- if (!load_config(bio_err, NULL))
- goto end;
-
infile = NULL;
outfile = NULL;
informat = FORMAT_PEM;
-/* $OpenBSD: rsautl.c,v 1.22 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: rsautl.c,v 1.23 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
argc--;
argv++;
- if (!load_config(bio_err, NULL))
- goto end;
-
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
pad = RSA_PKCS1_PADDING;
-/* $OpenBSD: s_client.c,v 1.66 2014/07/11 09:24:44 beck Exp $ */
+/* $OpenBSD: s_client.c,v 1.67 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
c_msg = 0;
c_showcerts = 0;
- if (!load_config(bio_err, NULL))
- goto end;
-
if (((cbuf = malloc(BUFSIZZ)) == NULL) ||
((sbuf = malloc(BUFSIZZ)) == NULL) ||
((mbuf = malloc(BUFSIZZ + 1)) == NULL)) { /* NUL byte */
-/* $OpenBSD: s_server.c,v 1.58 2014/07/11 09:24:44 beck Exp $ */
+/* $OpenBSD: s_server.c,v 1.59 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
s_server_init();
- if (!load_config(bio_err, NULL))
- goto end;
-
verify_depth = 0;
s_nbio = 0;
s_nbio_test = 0;
-/* $OpenBSD: smime.c,v 1.26 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: smime.c,v 1.27 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
args = argv + 1;
ret = 1;
- if (!load_config(bio_err, NULL))
- goto end;
-
while (!badarg && *args && *args[0] == '-') {
if (!strcmp(*args, "-encrypt"))
operation = SMIME_ENCRYPT;
-/* $OpenBSD: speed.c,v 1.50 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: speed.c,v 1.51 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ecdh_b[i] = NULL;
}
- if (!load_config(bio_err, NULL))
- goto end;
-
memset(rsa_key, 0, sizeof(rsa_key));
for (i = 0; i < RSA_NUM; i++)
rsa_key[i] = NULL;
-/* $OpenBSD: spkac.c,v 1.19 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: spkac.c,v 1.20 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999. Based on an original idea by Massimiliano Pala
* (madwolf@openca.org).
char *engine = NULL;
#endif
- if (!load_config(bio_err, NULL))
- goto end;
-
prog = argv[0];
argc--;
argv++;
-/* $OpenBSD: ts.c,v 1.17 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: ts.c,v 1.18 2014/07/12 17:54:31 jsing Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
* project 2002.
*/
ERR_load_crypto_strings();
- if (!load_config(bio_err, NULL))
- goto cleanup;
-
for (argc--, argv++; argc > 0; argc--, argv++) {
if (strcmp(*argv, "-config") == 0) {
if (argc-- < 1)
-/* $OpenBSD: verify.c,v 1.24 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: verify.c,v 1.25 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ERR_load_crypto_strings();
- if (!load_config(bio_err, NULL))
- goto end;
-
argc--;
argv++;
for (;;) {
-/* $OpenBSD: x509.c,v 1.47 2014/07/09 21:02:35 tedu Exp $ */
+/* $OpenBSD: x509.c,v 1.48 2014/07/12 17:54:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
reqfile = 0;
- if (!load_config(bio_err, NULL))
- goto end;
-
STDout = BIO_new_fp(stdout, BIO_NOCLOSE);
informat = FORMAT_PEM;