summaryrefslogtreecommitdiffstats
path: root/apps/ocsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/ocsp.c')
-rw-r--r--apps/ocsp.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c
index bd16a5b869..0f2690030d 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -514,6 +514,21 @@ int ocsp_main(int argc, char **argv)
if (rkey == NULL)
goto end;
}
+
+ if (ridx_filename && (!rkey || !rsigner || !rca_cert)) {
+ BIO_printf(bio_err,
+ "Responder mode requires certificate, key, and CA.\n");
+ goto end;
+ }
+
+ if (ridx_filename) {
+ rdb = load_index(ridx_filename, NULL);
+ if (!rdb || !index_index(rdb)) {
+ ret = 1;
+ goto end;
+ }
+ }
+
if (acbio != NULL)
BIO_printf(bio_err, "Waiting for OCSP client connections...\n");
@@ -577,21 +592,6 @@ redo_accept:
BIO_free(derbio);
}
- if (ridx_filename != NULL
- && (rkey == NULL || rsigner == NULL || rca_cert == NULL)) {
- BIO_printf(bio_err,
- "Need a responder certificate, key and CA for this operation!\n");
- goto end;
- }
-
- if (ridx_filename != NULL && rdb == NULL) {
- rdb = load_index(ridx_filename, NULL);
- if (rdb == NULL)
- goto end;
- if (!index_index(rdb))
- goto end;
- }
-
if (rdb != NULL) {
make_ocsp_response(bio_err, &resp, req, rdb, rca_cert, rsigner, rkey,
rsign_md, rsign_sigopts, rother, rflags, nmin, ndays, badsig);