summaryrefslogtreecommitdiffstats
path: root/apps/pkeyutl.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-04-09 12:42:09 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-04-09 12:42:09 +0000
commit4a3dc3c0e34d44590b6565f8a8f5f4f5192df988 (patch)
tree8d2584d9ec28b5222f9f19359b49ecfa1d66569d /apps/pkeyutl.c
parenta2318e86bdb3dc5fc2d17a12d3875964eedef424 (diff)
Add RSA ctrl for padding mode, add ctrl support in pkeyutl.
Diffstat (limited to 'apps/pkeyutl.c')
-rw-r--r--apps/pkeyutl.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index bac935c6d7..82b59a805c 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -154,8 +154,10 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_ENGINE
else if(!strcmp(*argv, "-engine"))
{
- if (--argc < 1) badarg = 1;
- engine = *(++argv);
+ if (--argc < 1)
+ badarg = 1;
+ else
+ engine = *(++argv);
}
#endif
else if(!strcmp(*argv, "-pubin"))
@@ -178,6 +180,23 @@ int MAIN(int argc, char **argv)
pkey_op = EVP_PKEY_OP_ENCRYPT;
else if(!strcmp(*argv, "-decrypt"))
pkey_op = EVP_PKEY_OP_DECRYPT;
+ else if (strcmp(*argv,"-param") == 0)
+ {
+ if (--argc < 1)
+ badarg = 1;
+ if (!ctx)
+ {
+ BIO_puts(bio_err,
+ "-param command before -inkey\n");
+ badarg = 1;
+ }
+ else if (pkey_ctrl_string(ctx, *(++argv)) <= 0)
+ {
+ BIO_puts(bio_err, "parameter setting error\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
else badarg = 1;
if(badarg)
{