diff options
author | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2003-07-09 19:58:03 +0000 |
---|---|---|
committer | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2003-07-09 19:58:03 +0000 |
commit | 43ecdc1c17871b80957884e398ccaa3fa9c14ba2 (patch) | |
tree | b7f254c67518c884ba677ae8e066d09bcdc5e397 | |
parent | 1fde4e52509ad11a7b28b03565f7e7e18a9f6db5 (diff) | |
download | ruby-openssl-history-43ecdc1c17871b80957884e398ccaa3fa9c14ba2.tar.gz |
*** empty log message ***
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ossl_pkcs7.c | 18 |
2 files changed, 21 insertions, 4 deletions
@@ -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){ |