summaryrefslogtreecommitdiffstats
path: root/apps/pkeyutl.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-03-01 17:22:51 +0000
committerDr. Stephen Henson <steve@openssl.org>2016-03-01 17:25:35 +0000
commit7852414967b87400b08bfdf321732cfbd07286e2 (patch)
treefd7fec62e6378280949d4415b26bb76cac8bbd16 /apps/pkeyutl.c
parent09977dd095f3c655c99b9e1810a213f7eafa7364 (diff)
Fix -pkeyopt and fix error check.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/pkeyutl.c')
-rw-r--r--apps/pkeyutl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index 91ef8d73b4..3d78499cb0 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -217,7 +217,7 @@ int pkeyutl_main(int argc, char **argv)
case OPT_PKEYOPT:
if ((pkeyopts == NULL &&
(pkeyopts = sk_OPENSSL_STRING_new_null()) == NULL) ||
- sk_OPENSSL_STRING_push(pkeyopts, *++argv) == 0) {
+ sk_OPENSSL_STRING_push(pkeyopts, opt_arg()) == 0) {
BIO_puts(bio_err, "out of memory\n");
goto end;
}
@@ -334,7 +334,8 @@ int pkeyutl_main(int argc, char **argv)
buf_out, (size_t *)&buf_outlen,
buf_in, (size_t)buf_inlen);
}
- if (rv < 0) {
+ if (rv <= 0) {
+ BIO_puts(bio_err, "Public Key operation error\n");
ERR_print_errors(bio_err);
goto end;
}