diff options
author | Pauli <paul.dale@oracle.com> | 2020-08-07 12:59:49 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-08-11 08:08:24 +1000 |
commit | 33b4f731451bcd7321ddae002c7945cd83d52f78 (patch) | |
tree | 533ea3ce2489b02acd656dbadbd1df2f806d32f0 /crypto/conf | |
parent | 711ae5d359d9fa89a9aef90ac197ba26c8de3330 (diff) |
conf: add an error if the openssl_conf section isn't found.
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/12602)
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_err.c | 4 | ||||
-rw-r--r-- | crypto/conf/conf_mod.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/crypto/conf/conf_err.c b/crypto/conf/conf_err.c index daf2320a19..9c3c2d6878 100644 --- a/crypto/conf/conf_err.c +++ b/crypto/conf/conf_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -36,6 +36,8 @@ static const ERR_STRING_DATA CONF_str_reasons[] = { {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_SUCH_FILE), "no such file"}, {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NO_VALUE), "no value"}, {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_NUMBER_TOO_LARGE), "number too large"}, + {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION), + "openssl conf references missing section"}, {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_RECURSIVE_DIRECTORY_INCLUDE), "recursive directory include"}, {ERR_PACK(ERR_LIB_CONF, 0, CONF_R_SSL_COMMAND_SECTION_EMPTY), diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index 64473417e9..aebf38292a 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -107,8 +107,13 @@ int CONF_modules_load(const CONF *cnf, const char *appname, OSSL_TRACE1(CONF, "Configuration in section %s\n", vsection); values = NCONF_get_section(cnf, vsection); - if (!values) + if (values == NULL) { + if (!(flags & CONF_MFLAGS_SILENT)) { + CONFerr(0, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION); + ERR_add_error_data(2, "openssl_conf=", vsection); + } return 0; + } for (i = 0; i < sk_CONF_VALUE_num(values); i++) { vl = sk_CONF_VALUE_value(values, i); |