diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-03-15 23:21:33 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-03-15 23:21:33 +0000 |
commit | 4f1aa191b33f0bbda29c3289d50fee2991b77df0 (patch) | |
tree | 10c7eb9e8d1fcf55e78d6d2ad05d2fcefb835aab /crypto/rsa/rsa_ameth.c | |
parent | e540d1cd77d4cf0edea74212a5e598d073ce2e67 (diff) |
Initial support for enveloped data decrypt. Extent runex.pl to cover these
examples. All RFC4134 examples can not be processed.
Diffstat (limited to 'crypto/rsa/rsa_ameth.c')
-rw-r--r-- | crypto/rsa/rsa_ameth.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index 39fa9ec104..e705f16cb9 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -267,38 +267,29 @@ static int rsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) { + X509_ALGOR *alg = NULL; switch (op) { case ASN1_PKEY_CTRL_PKCS7_SIGN: if (arg1 == 0) - { - X509_ALGOR *alg; PKCS7_SIGNER_INFO_get0_algs(arg2, NULL, NULL, &alg); - X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaEncryption), - V_ASN1_NULL, 0); - } - return 1; + break; case ASN1_PKEY_CTRL_PKCS7_ENCRYPT: if (arg1 == 0) - { - X509_ALGOR *alg; PKCS7_RECIP_INFO_get0_alg(arg2, &alg); - X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaEncryption), - V_ASN1_NULL, 0); - } - return 1; + break; #ifndef OPENSSL_NO_CMS case ASN1_PKEY_CTRL_CMS_SIGN: if (arg1 == 0) - { - X509_ALGOR *alg; CMS_SignerInfo_get0_algs(arg2, NULL, NULL, NULL, &alg); - X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaEncryption), - V_ASN1_NULL, 0); - } - return 1; + break; + + case ASN1_PKEY_CTRL_CMS_ENVELOPE: + if (arg1 == 0) + CMS_RecipientInfo_ktri_get0_algs(arg2, NULL, NULL, &alg); + break; #endif case ASN1_PKEY_CTRL_DEFAULT_MD_NID: @@ -310,6 +301,12 @@ static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) } + if (alg) + X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaEncryption), + V_ASN1_NULL, 0); + + return 1; + } |