Skip to content

Commit

Permalink
openssl srp: make index.txt parsing error more verbose
Browse files Browse the repository at this point in the history
If index.txt exists but has some problems (like for example
consisting of a single \n character or number of fields wrong in one of the lines)
then openssl will just exit. This fixes it by printing an error when
load_index returns null.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#15360)
  • Loading branch information
FlorianMickler authored and devnexen committed Jul 7, 2021
1 parent 59fbb18 commit a532d79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/srp.c
Expand Up @@ -379,8 +379,10 @@ int srp_main(int argc, char **argv)
srpvfile);

db = load_index(srpvfile, NULL);
if (db == NULL)
if (db == NULL) {
BIO_printf(bio_err, "Problem with index file: %s (could not load/parse file)\n", srpvfile);
goto end;
}

/* Lets check some fields */
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
Expand Down

0 comments on commit a532d79

Please sign in to comment.