diff options
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/req.c b/apps/req.c index 6fd28a2aba..6dd119be7a 100644 --- a/apps/req.c +++ b/apps/req.c @@ -881,9 +881,19 @@ int req_main(int argc, char **argv) if (text) { if (x509) - X509_print_ex(out, x509ss, get_nameopt(), reqflag); + ret = X509_print_ex(out, x509ss, get_nameopt(), reqflag); else - X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + ret = X509_REQ_print_ex(out, req, get_nameopt(), reqflag); + + if (ret == 0) { + if (x509) + BIO_printf(bio_err, "Error printing certificate\n"); + else + BIO_printf(bio_err, "Error printing certificate request\n"); + + ERR_print_errors(bio_err); + goto end; + } } if (subject) { |