summaryrefslogtreecommitdiffstats
path: root/apps/srp.c
diff options
context:
space:
mode:
authorFlorian Mickler <florian@mickler.org>2020-01-13 02:06:49 +0100
committerTomas Mraz <tomas@openssl.org>2021-05-24 14:37:00 +0200
commite16d9afe4106503ba6c4b22c9b7c5bd367e3b565 (patch)
tree7592f09c4365892fd0824509e1a0a9f3a2f96137 /apps/srp.c
parent2c6e33d86362e1b1201edef62205237f1c8e3724 (diff)
openssl srp: make index.txt parsing error more verbose
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 https://github.com/openssl/openssl/pull/15360)
Diffstat (limited to 'apps/srp.c')
-rw-r--r--apps/srp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/srp.c b/apps/srp.c
index 48b99da2af..a9466f8302 100644
--- a/apps/srp.c
+++ b/apps/srp.c
@@ -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++) {