提交 ca29cc14 编写于 作者: F Florian Mickler 提交者: Tomas Mraz

openssl ca: make index.txt parsing error more verbose

If index.txt exists but has some problems (like for example a single \n character in it) openssl will just exit without any error message.

Bug at least expirienced twice: https://superuser.com/questions/1327848/openssl-ca-fails-after-password-without-error-messageReviewed-by: NPaul Dale <pauli@openssl.org>
Reviewed-by: NTomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15360)
上级 669967fd
......@@ -556,8 +556,10 @@ end_of_options:
goto end;
db = load_index(dbfile, &db_attr);
if (db == NULL)
if (db == NULL) {
BIO_printf(bio_err, "Problem with index file: %s (could not load/parse file)\n", dbfile);
goto end;
}
if (index_index(db) <= 0)
goto end;
......@@ -684,8 +686,10 @@ end_of_options:
goto end;
db = load_index(dbfile, &db_attr);
if (db == NULL)
if (db == NULL) {
BIO_printf(bio_err, "Problem with index file: %s (could not load/parse file)\n", dbfile);
goto end;
}
/* Lets check some fields */
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册