aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGOTOU Yuuzou <gotoyuzo@notwork.org>2003-07-09 19:58:03 +0000
committerGOTOU Yuuzou <gotoyuzo@notwork.org>2003-07-09 19:58:03 +0000
commit43ecdc1c17871b80957884e398ccaa3fa9c14ba2 (patch)
treeb7f254c67518c884ba677ae8e066d09bcdc5e397
parent1fde4e52509ad11a7b28b03565f7e7e18a9f6db5 (diff)
downloadruby-openssl-history-43ecdc1c17871b80957884e398ccaa3fa9c14ba2.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog7
-rw-r--r--ossl_pkcs7.c18
2 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f7fe46..e962904 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
+Thu, 10 Jul 2003 04:56:38 +0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ossl_pkcs7.c: PKCS7#encrypt(): use EVP_rc2_40_cbc() by default.
+
Wed, 09 Jul 2003 21:09:10 +0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ossl_pkcs7.c: write_smime(): should add PKCS7_DETACHED to flags
- if the PKCS7 is detached and @data is given.
+ * ossl_pkcs7.c: PKCS7#write_smime(): should add PKCS7_DETACHED to
+ flags if the PKCS7 is detached and @data is given.
Wed, 09 Jul 2003 12:41:14 +0200 -- Michal Rokos <m.rokos@sh.cvut.cz>
* extconf.rb: Start checking for OpenSSL' missing functions...
diff --git a/ossl_pkcs7.c b/ossl_pkcs7.c
index 2f2210e..8471957 100644
--- a/ossl_pkcs7.c
+++ b/ossl_pkcs7.c
@@ -203,8 +203,22 @@ ossl_pkcs7_s_encrypt(int argc, VALUE *argv, VALUE klass)
VALUE ret;
PKCS7 *p7;
- rb_scan_args(argc, argv, "31", &certs, &data, &cipher, &flags);
- ciph = GetCipherPtr(cipher); /* NO NEED TO DUP */
+ rb_scan_args(argc, argv, "22", &certs, &data, &cipher, &flags);
+ if(NIL_P(cipher)){
+#if !defined(OPENSSL_NO_RC2)
+ ciph = EVP_rc2_40_cbc();
+#elif !defined(OPENSSL_NO_DES)
+ ciph = EVP_des_ede3_cbc();
+#elif !defined(OPENSSL_NO_RC2)
+ ciph = EVP_rc2_40_cbc();
+#elif !defined(OPENSSL_NO_AES)
+ ciph = EVP_EVP_aes_128_cbc();
+#else
+ ossl_raise(ePKCS7Error, "Must specify cipher");
+#endif
+
+ }
+ else ciph = GetCipherPtr(cipher); /* NO NEED TO DUP */
in = ossl_obj2bio(data);
x509s = ossl_protect_x509_ary2sk(certs, &status);
if(status){