Hello,

when working with 'openssl dsa -noout -text -in key.pem' I noticed a
minor error: above command always returns with an exit code of 1.
Attached patch will fix this issue.

Regards

        Ralph Wuerthner
openssl dsa: fix return code when -noout is used

'openssl dsa -noout ...' exits with rc=1 though no error occured. Fixed by
setting ret=0 when main() is exited via -noout.

---
 apps/dsa.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: openssl/apps/dsa.c
===================================================================
--- openssl.orig/apps/dsa.c
+++ openssl/apps/dsa.c
@@ -324,7 +324,11 @@ bad:
 		fprintf(stdout,"\n");
 		}
 
-	if (noout) goto end;
+	if (noout)
+		{
+                ret = 0;
+                goto end;
+                }
 	BIO_printf(bio_err,"writing DSA key\n");
 	if 	(outformat == FORMAT_ASN1) {
 		if(pubin || pubout) i=i2d_DSA_PUBKEY_bio(out,dsa);

Reply via email to