aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey_rsa.c
Commit message (Collapse)AuthorAgeFilesLines
* openssl: improve handling of password for encrypted PEMrhe2016-05-201-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/ossl.c (ossl_pem_passwd_value): Added. Convert the argument to String with StringValue() and validate the length is in 4..PEM_BUFSIZE. PEM_BUFSIZE is a macro defined in OpenSSL headers. (ossl_pem_passwd_cb): When reading/writing encrypted PEM format, we used to pass the password to PEM_def_callback() directly but it was problematic. It is not NUL character safe. And surprisingly, it silently truncates the password to 1024 bytes. [GH ruby/openssl#51] * ext/openssl/ossl.h: Add function prototype declaration of newly added ossl_pem_passwd_value(). * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): Use ossl_pem_passwd_value() to validate the password String. * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize, ossl_dsa_export): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize, ossl_ec_key_to_string): ditto. * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize, ossl_rsa_export): ditto. * test/openssl/test_pkey_{dsa,ec,rsa}.rb: test this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: clear OpenSSL error queue before return to Rubyrhe2016-05-181-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/ossl_x509cert.c (ossl_x509_verify): X509_verify() family may put errors on 0 return (0 means verification failure). Clear OpenSSL error queue before return to Ruby. Since the queue is thread global, remaining errors in the queue can cause an unexpected error in the next OpenSSL operation. [ruby-core:48284] [Bug #7215] * ext/openssl/ossl_x509crl.c (ossl_x509crl_verify): ditto. * ext/openssl/ossl_x509req.c (ossl_x509req_verify): ditto. * ext/openssl/ossl_x509store.c (ossl_x509stctx_verify): ditto. * ext/openssl/ossl_pkey_dh.c (dh_generate): clear the OpenSSL error queue before re-raising exception. * ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto. * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto. * ext/openssl/ossl_ssl.c (ossl_start_ssl): ditto. * test/openssl: check that OpenSSL.errors is empty every time after running a test case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/*: Remove svn commit id macros to make sync easierzzak2015-09-221-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: wrapper object before allocnobu2015-05-291-2/+4
| | | | | | | * ext/openssl: make wrapper objects before allocating structs to get rid of potential memory leaks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/*: use license instead of licence.hsbt2015-04-201-1/+1
| | | | | | | [fix GH-876][ci skip] Patch by @davydovanton * lib/net/https.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* protoize no-arguments functionsnobu2014-09-301-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/*: Document synonymous methods, by windwiny [GH-277]zzak2013-04-161-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_thread_call_without_gvlnobu2012-07-101-3/+3
| | | | | | | | | * include/ruby/thread.h: new header file for thread stuff. * thread.c (rb_thread_call_without_gvl): export. [Feature#4328] returns void* instead of VALUE. [Feature #5543] * thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl.cemboss2012-06-101-1/+4
| | | | | | | | | | | | | | | | | | | ext/openssl/ossl_pkey_rsa.c ext/openssl/ossl_pkey_dsa.c ext/openssl/ossl_pkey_ec.c: Forbid export passwords that are less than four characters long, as OpenSSL itself does not allow this. Issue found by Eric Hodel. * ext/openssl/ossl_pkey_ec.c: Add export as an alias of to_pem, following the PKey interface contract. * test/openssl/test_pkey_dsa.rb test/openssl/test_pkey_rsa.rb test/openssl/test_pkey_ec.rb: Add tests that assert correct behaviour when dealing with passwords that are less than four characters long. [ruby-core: 42281][ruby-trunk - Bug #5951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Refix Bug #6094: use unsigned long integer literal.naruse2012-03-231-4/+4
| | | | | | | * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type. [Bug #6094] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "* ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type."naruse2012-03-231-3/+3
| | | | | | | | | | | | | | | | | | | This reverts commit r35102. It breaks tests on FreeBSD. 6) Failure: test_new_with_exponent(OpenSSL::TestPKeyRSA) [/usr/home/chkbuild/build/ruby-trunk/20120323T010301Z/ruby/test/openssl/test_pkey_rsa.rb:59]: <3> expected but was <12884901891>. 7) Failure: test_new_exponent_default(OpenSSL::TestPKeyRSA) [/usr/home/chkbuild/build/ruby-trunk/20120323T010301Z/ruby/test/openssl/test_pkey_rsa.rb:52]: <65537> expected but was <281479271743489>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type.nobu2012-03-221-3/+3
| | | | | | [Bug #6094] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_dsa.c: remove redundant colon from erroremboss2011-11-231-1/+1
| | | | | | | | | | message. * ext/openssl/ossl_ssl.c: ditto. * ext/openssl/ossl_pkey_rsa: ditto. [Bug #5604] [ruby-core:40896] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_rsa.c (rsa_generate): [SECURITY] Set RSAnahi2011-11-041-1/+1
| | | | | | | | | | | | | | | exponent value correctly. Awful bug. This bug caused exponent of generated key to be always '1'. By default, and regardless of e given as a parameter. !!! Keys generated by this code (trunk after 2011-09-01) must be re-generated !!! (ruby_1_9_3 is safe) * test/openssl/test_pkey_rsa.rb: Add tests for default exponent and specifying exponent by a parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c: Remove set, but unused variables.emboss2011-10-191-1/+2
| | | | | | | | | | | | ext/openssl/ossl_pkey.c: ditto * ext/openssl/ossl_pkey_dh.c: Make functions passed to rb_thread_blocking_region return VALUE instead of void. ext/openssl/ossl_pkey_dsa.c: ditto ext/openssl/ossl_pkey_rsa.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Release GVL while OpenSSL's public key generation.nahi2011-09-011-3/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | t = Thread.new { print "."; sleep 0.1 } key = OpenSSL::PKey::RSA.new(2048) #=> Thread t works in parallel with public key generation if OS/machine allows it. This works with OpenSSL >= 0.9.8. From this version, it has new public key generation function which allows us to interrupt the execution while pkey generation iterations. * ext/openssl/extconf.rb: Check existence of OpenSSL's new public key generation function. (DH_generate_parameters_ex, DSA_generate_parameters_ex and RSA_generate_key_ex. * ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2, ossl_generate_cb_stop): Added new callback function for OpenSSL pkey generation which handles Thread interruption by Ruby. ossl_generate_cb_stop is the unblock function(ubf) for Ruby which sets a stop flag. New pkey generation callback ossl_generate_cb_2 checks the stop flag at each iterations of OpenSSL and interrupts pkey generation when the flag is set. * ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call rb_thread_blocking_region with the above unblock function to release GVL while pkey generation. * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto. * ext/openssl/ossl_pkey_dh.c (dh_generate): ditto. * test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl.h: Introduced OSSL_BIO_reset macro for PEM/DERemboss2011-06-221-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fallback scenarios. * ext/openssl/ossl_pkey_dsa.c * ext/openssl/ossl_x509req.c * ext/openssl/ossl_pkey_rsa.c * ext/openssl/ossl_pkey_ec.c * ext/openssl/ossl_ssl_session.c * ext/openssl/ossl_x509crl.c * ext/openssl/ossl_pkey.c * ext/openssl/ossl_pkey_dh.c * ext/openssl/ossl_x509cert.c * ext/openssl/ossl_pkcs7.c: Use OSSL_BIO_reset. * ext/openssl/ossl_ssl.c * ext/openssl/ossl_cipher.c * ext/openssl/ossl_pkey_ec.c * ext/openssl/ossl_pkcs12.c * ext/openssl/ossl_ssl_session.c: Replace rb_raise occurences by ossl_raise. This automatically flushes OpenSSL's error queue. * ext/openssl/ossl_pkcs7.c: Raise error if DER fallback for parsing fails. * test/openssl/test_pkey_ec.rb * test/openssl/test_pkey_dsa.rb * test/openssl/test_pkey_rsa.rb: Add assertions that OpenSSL.errors is empty. * test/openssl/test_pkey_rsa.rb: Remove initial OpenSSL.errors call in test_new. [ Ruby 1.9 - Bug #4885 ] [ruby-core:37134] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Tue Jun 30 06:45:21 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>emboss2011-05-301-0/+16
| | | | | | | * ext/openssl/ossl_pkey_rsa.c: Complete documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Thu May 12 07:27:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>emboss2011-05-111-7/+7
| | | | | | | | | | | | | | * ext/openssl/ossl_pkey_rsa.c: Use generic X.509 SubjectPublicKeyInfo format for encoding RSA public keys. [ruby-core:35327] [Bug #4421] Previous revision: 31507 M ChangeLog M ext/openssl/ossl_pkey_rsa.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize):naruse2011-04-061-1/+9
| | | | | | pop pushed error after each try of reading. fixes #4550 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl.c: surpress warning: shorten-64-to-32.naruse2011-03-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/ossl.h: ditto. * ext/openssl/ossl_asn1.c: ditto. * ext/openssl/ossl_bio.c: ditto. * ext/openssl/ossl_bn.c: ditto. * ext/openssl/ossl_cipher.c: ditto. * ext/openssl/ossl_hmac.c: ditto. * ext/openssl/ossl_ns_spki.c: ditto. * ext/openssl/ossl_ocsp.c: ditto. * ext/openssl/ossl_pkcs5.c: ditto. * ext/openssl/ossl_pkey.c: ditto. * ext/openssl/ossl_pkey_dh.c: ditto. * ext/openssl/ossl_pkey_dsa.c: ditto. * ext/openssl/ossl_pkey_ec.c: ditto. * ext/openssl/ossl_pkey_rsa.c: ditto. * ext/openssl/ossl_rand.c: ditto. * ext/openssl/ossl_ssl.c: ditto. * ext/openssl/ossl_x509ext.c: ditto. * ext/openssl/ossl_x509name.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_rsa.c: parenthesize macro arguments.akr2011-03-071-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Document RSA, RSA encryption/decryption and PKCS #5 encryption/decryptiondrbrain2010-12-101-54/+75
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add toplevel documentation for OpenSSLdrbrain2010-12-061-2/+2
| | | | | | | | | | | Add additional documentation for OpenSSL::SSL::SSLContext and OpenSSL::SSL::SSLSocket. Move "let rdoc know about mOSSL" comments so they don't show up in output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/**/*.[ch]: removed trailing spaces.nobu2010-04-221-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/**/*.[ch]: removed trailing spaces.nobu2010-04-221-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl: suppress warnings.akr2009-03-121-8/+8
| | | | | | | | | * ext/openssl/ossl.h (OSSL_Debug): don't use gcc extention for variadic macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl: suppress warnings.nobu2008-07-221-14/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_{ec,dh,dsa,rsa}.c: Remove useless warnings.technorama2008-02-261-2/+0
| | | | | | | | | | * ext/openssl/ossl_asn1.c: Simplify code. * ext/openssl/ossl_ssl_session.c Fix compiler warnings. Undefine #id if SSL_SESSION_get_id is not supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_bn.c: More documentation.technorama2007-04-031-1/+0
| | | | | | | | * ext/openssl/lib/ossl_{pkey,pkey_ec}.[ch]: Add elliptic curves. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_{bn,cipher,digest,hmac,rand,pkey_{dh,dsa,rsa}}.c: Add ↵technorama2007-03-291-2/+84
| | | | | | | | | | | | | | Documentation for various methods. * ext/openssl/lib/openssl/cipher.rb: Ditto * ext/openssl/ossl_bn.c: add lshift! and rshift! methods. * ext/openssl/ossl_digest.c: GetDigestPtr() also accept a string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_asn1.c (Init_ossl_asn1): Let rdoc know aboutknu2007-03-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | externally defined modules; submitted by Technorama Ltd. <oss-ruby AT technorama.net> in [ruby-bugs:PR#4704]. * ext/openssl/ossl_bn.c (Init_ossl_bn): Ditto. * ext/openssl/ossl_cipher.c (Init_ossl_cipher): Ditto. * ext/openssl/ossl_digest.c (Init_ossl_digest): Ditto. * ext/openssl/ossl_hmac.c (Init_ossl_hmac): Ditto. * ext/openssl/ossl_pkey.c (Init_ossl_pkey): Ditto. * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): Ditto. * ext/openssl/ossl_pkey_dsa.c (Init_ossl_dsa): Ditto. * ext/openssl/ossl_pkey_rsa.c (Init_ossl_rsa): Ditto. * ext/openssl/ossl_rand.c (Init_ossl_rand): Ditto. * ext/openssl/ossl_ssl.c (Init_ossl_ssl): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (struct RString): embed small strings.matz2006-08-311-17/+13
| | | | | | | | | | (RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey.h, ossl_pkey_rsa.c, ossl_pkey_dsa.c:gotoyuzo2005-09-181-10/+5
| | | | | | | | | | | | an instance variable "private" is added to OpenSSL::PKey class. this ivar is a flag that shows whether there is a private key in the instance. * ext/openssl/ossl_engine.c: (ossl_engine_load_privkey): set private key flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,gotoyuzo2004-12-051-25/+40
| | | | | | | | | | | | | | | ossl_rsa_public_decrypt, ossl_rsa_private_encrypt, ossl_rsa_private_decrypt): should take an optional argument to specify padding mode. [ruby-talk:122539] * ext/openssl/ossl_pkey_rsa.c (Init_ossl_rsa): add new constants PKCS1_PADDING, SSLV23_PADDING, NO_PADDING and PKCS1_OAEP_PADDING under OpenSSL::PKey::RSA. * test/openssl/test_pkey_rsa.rb: new file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize): should creategotoyuzo2004-06-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | empty pkey object if no argument is passed. [ruby-talk:103328] * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto. * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize): ditto. * ext/openssl/ossl_pkey_dh.c: add new methods: OpenSSL::PKey::DH#p, OpenSSL::PKey::DH#p=, OpenSSL::PKey::DH#g, OpenSSL::PKey::DH#g=, OpenSSL::PKey::DH#pub_key, OpenSSL::PKey::DH#pub_key=, OpenSSL::PKey::DH#priv_key and OpenSSL::PKey::DH#priv_key=. * ext/openssl/ossl_pkey_dsa.c: add new methods: OpenSSL::PKey::DSA#p, OpenSSL::PKey::DSA#p=, OpenSSL::PKey::DSA#q, OpenSSL::PKey::DSA#q=, OpenSSL::PKey::DSA#g, OpenSSL::PKey::DSA#g=, OpenSSL::PKey::DSA#pub_key, OpenSSL::PKey::DSA#pub_key=, OpenSSL::PKey::DSA#priv_key and OpenSSL::PKey::DSA#priv_key=. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey.c (ossl_pkey_to_der): removed; it returnsgotoyuzo2004-01-081-0/+26
| | | | | | | | | | | | | | | | public key only. * ext/openssl/ossl_pkey_dh.c (ossl_dh_to_der): new function for OpenSSL::PKey::DH#to_der. * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_to_der): new function for OpenSSL::PKey::DSA#to_der. * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_to_der): new function for OpenSSL::PKey::RSA#to_der. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_engine.c: add a new module OpenSSL::Engine.gotoyuzo2003-10-021-2/+8
| | | | | | | | | | | | | | | | | | | | it supports OpenSSL hardware cryptographic engine interface. * ext/openssl/ossl_engine.h: ditto. * ext/openssl/MANIFEST: add ossl_engine.c and ossl_engine.h. * ext/openssl/extconf.rb: add check for openssl/engine.h. * ext/openssl/ossl.c: call Init_ossl_engine(). * ext/openssl/ossl.h: include openssl/engine.h. * ext/openssl/ossl_pkey_{rsa,dsa,dh}.c: check if underlying EVP_PKEY referes engine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c, ext/openssl/ossl_pkey_dsa.c,nobu2003-09-241-1/+1
| | | | | | | | ext/openssl/ossl_pkey_rsa.c, ext/bigdecimal/bigdecimal.h: must not use C++ or C99 style comment yet. (ruby-bugs:PR#1184) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl: all files are reviewed to simplify and avoid memory leak.gotoyuzo2003-09-171-77/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/extconf.rb: add check for assert.h. * ext/openssl/ossl.c (ossl_buf2str): new function to convert C buffer to String and free buffer. * ext/openssl/ossl.c (ossl_x509_ary2sk): new function to convert Array of OpenSSL::X509 to STACK_OF(X509) with exception safe. * ext/openssl/ossl.c (ossl_to_der, ossl_to_der_if_possible): new functions to convert object to DER string. * ext/openssl/ossl.h: ditto. * ext/openssl/ossl_bio.c (ossl_membio2str): new function to convert BIO to String object and free BIO. * ext/openssl/ossl_bio.h: ditto. * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_to_der): add for "to_der". * ext/openssl/ossl_x509name.c (ossl_x509name_to_der): ditto. * ext/openssl/ossl_x509ext.c (ossl_x509ext_to_der): ditto. * ext/openssl/ossl_x509ext.c (create_ext_from_array): removed and reimplement in openssl/x509.rb. * ext/openssl/ossl_x509attr.c: reimplemented and disable some method temporarily. this class doesn't work fine without ASN.1 data support;-) I'll rewrite in near future. * ext/openssl/lib/openssl/x509.c (X509::Attribute): get rid off unused code. * ext/openssl/lib/openssl/x509.c (X509::ExtensionFactory): refine all. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* OpenSSL updatemichal2003-09-121-21/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl: imported.gotoyuzo2003-07-231-0/+515
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e