diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2006-04-09 12:42:09 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2006-04-09 12:42:09 +0000 |
commit | 4a3dc3c0e34d44590b6565f8a8f5f4f5192df988 (patch) | |
tree | 8d2584d9ec28b5222f9f19359b49ecfa1d66569d /apps | |
parent | a2318e86bdb3dc5fc2d17a12d3875964eedef424 (diff) |
Add RSA ctrl for padding mode, add ctrl support in pkeyutl.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/apps.c | 4 | ||||
-rw-r--r-- | apps/apps.h | 1 | ||||
-rw-r--r-- | apps/pkeyutl.c | 23 |
3 files changed, 24 insertions, 4 deletions
diff --git a/apps/apps.c b/apps/apps.c index 1b7ca6961f..365287f488 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -2304,11 +2304,11 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in) return ret; } -int pkey_ctrl_string(BIO *err, EVP_PKEY_CTX *ctx, char *value) +int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value) { + int rv; char *stmp, *vtmp = NULL; stmp = BUF_strdup(value); - int rv; if (!stmp) return -1; vtmp = strchr(stmp, ':'); diff --git a/apps/apps.h b/apps/apps.h index d15127e7aa..00522341ff 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -286,6 +286,7 @@ int args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, X509_VERIFY_PARAM **pm); void policies_print(BIO *out, X509_STORE_CTX *ctx); int bio_to_mem(unsigned char **out, int maxlen, BIO *in); +int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); #define FORMAT_UNDEF 0 #define FORMAT_ASN1 1 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) { |