openssl ocsp: make index.txt parsing error more verbose
authorFlorian Mickler <florian@mickler.org>
Mon, 13 Jan 2020 01:05:22 +0000 (02:05 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 24 May 2021 12:37:00 +0000 (14:37 +0200)
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)

apps/ocsp.c

index c7cee0faf03974e72edb09c7f5e4d23af0815e24..cf4f629db14d49529a89f5a9ab9cee9ac8ae499f 100644 (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;
         }