Commit 4a3dc3c0 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Add RSA ctrl for padding mode, add ctrl support in pkeyutl.

parent a2318e86
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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, ':');
+1 −0
Original line number Diff line number Diff line
@@ -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
+21 −2
Original line number Diff line number Diff line
@@ -154,7 +154,9 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_ENGINE
		else if(!strcmp(*argv, "-engine"))
			{
			if (--argc < 1) badarg = 1;
			if (--argc < 1)
				badarg = 1;
			else
				engine = *(++argv);
			}
#endif
@@ -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)
			{
+3 −0
Original line number Diff line number Diff line
@@ -917,8 +917,11 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type, ENGINE *e);
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey);
void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);

int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,
				int cmd, int p1, void *p2);
int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
						const char *value);


int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
+2 −1
Original line number Diff line number Diff line
@@ -171,7 +171,8 @@ int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,

	}

int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, char *name, char *value)
int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx,
					const char *name, const char *value)
	{
	if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl)
		{
Loading