summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs7/pk7_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-05-16 00:25:36 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-05-16 00:25:36 +0000
commit84fa704c6f96eb22e827caadf337a590dce30adb (patch)
tree3dab829e81ff772261d98bfd4adea6c3fc290462 /crypto/pkcs7/pk7_lib.c
parenta74c55cd8f73b4ff4480a1ab425ac2d6d8df5039 (diff)
Fix some obvious bugs in the PKCS#7 library handling. It didn't try to
find the right RecipientInfo based on the recipient certificate (so would fail a lot of the time) and fixup cipher structures to correctly (maybe) modify the AlgorithmIdentifiers. Largely untested at present... this will be fixed in due course. Well the stuff was broken to begin with so if its broken now then you haven't lost anything :-)
Diffstat (limited to 'crypto/pkcs7/pk7_lib.c')
-rw-r--r--crypto/pkcs7/pk7_lib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c
index ea3a5a2c76..b931ac7e08 100644
--- a/crypto/pkcs7/pk7_lib.c
+++ b/crypto/pkcs7/pk7_lib.c
@@ -422,7 +422,7 @@ X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si)
return(NULL);
}
-int PKCS7_set_cipher(PKCS7 *p7, EVP_CIPHER *cipher)
+int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
{
int i;
PKCS7_ENC_CONTENT *ec;
@@ -441,7 +441,9 @@ int PKCS7_set_cipher(PKCS7 *p7, EVP_CIPHER *cipher)
return(0);
}
- ec->algorithm->algorithm=OBJ_nid2obj(EVP_CIPHER_type(cipher));
- return(ec->algorithm->algorithm != NULL);
+ /* Setup cipher OID */
+
+ ec->cipher = cipher;
+ return 1;
}