openssl ocsp: make index.txt parsing error more verbose

If index.txt exists but has some problems (like for example consisting of a single \n character in it,
or some field-number error in one of the lines) openssl will just exit without any error message.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15360)
This commit is contained in:
Florian Mickler 2020-01-13 02:05:22 +01:00 committed by Tomas Mraz
parent ca29cc1453
commit 2c6e33d863
1 changed files with 3 additions and 0 deletions

View File

@ -620,6 +620,9 @@ int ocsp_main(int argc, char **argv)
if (ridx_filename != NULL) {
rdb = load_index(ridx_filename, NULL);
if (rdb == NULL || index_index(rdb) <= 0) {
BIO_printf(bio_err,
"Problem with index file: %s (could not load/parse file)\n",
ridx_filename);
ret = 1;
goto end;
}