summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl.c
AgeCommit message (Collapse)Author
2013-07-10ossl.c: fix argument typenobu
* ext/openssl/ossl.c (ossl_lock_callback): fix argument type, and remove redundant casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10ossl.c: rb_gc_register_mark_objectnobu
* ext/openssl/ossl.c (Init_ossl_locks): use rb_gc_register_mark_object instead of rb_global_variable. probably RArray may be used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10ossl.c: check allocationnobu
* ext/openssl/ossl.c (Init_ossl_locks): check if locks array is allocated successfully. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10ossl.c: check integer overflownobu
* ext/openssl/ossl.c (Init_ossl_locks): check integer overflow. OPENSSL_malloc() takes int only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05* ext/openssl/ossl.c: Provide CRYPTO_set_locking_callback() andemboss
CRYPTO_set_id_callback() callback functions ossl_thread_id and ossl_lock_callback to ensure the OpenSSL extension is usable in multi-threaded environments. [ruby-core:54900] [Bug #8386] Thanks, Dirkjan Bussink, for the patch! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-19* ext/openssl/ossl.c (class OpenSSL): Use only inner parenthesis indrbrain
create_extension examples. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-19* ext/openssl/ossl.c (class OpenSSL): Fixed ExtensionFactory example.drbrain
Patch by Richard Bradley. [ruby-trunk - Bug #7551] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20ossl.c: RTESTnobu
* ext/openssl/ossl.c (ossl_fips_mode_set): do not assume RTEST() to be parenthesized always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20* ext/openssl/ossl.c: do not use FIPS_mode_set if not available.emboss
* test/openssl/utils.rb: revise comment about setting FIPS mode to false. * test/openssl/test_fips.rb: remove tests that cause errors on ruby-ci. [Feature #6946] [ruby-core:47345] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20* ext/openssl/ossl.c: add OpenSSL.fips_mode= to allow enabling FIPSemboss
mode manually. * test/openssl/utils.rb: turn off FIPS mode for tests. This prevents OpenSSL installations with FIPS mode enabled by default from raising FIPS-related errors during the tests. * test/openssl/test_fips.rb: add tests for FIPS-capable OpenSSL installations. [Feature #6946] [ruby-core:47345] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-04remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-03remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-03* ext/openssl/extconf.rb: Detect OpenSSL_FIPS macroemboss
ext/openssl/ossl.c: Expose OpenSSL::OPENSSL_FIPS constant to indicate whether OpenSSL runs in FIPS mode. test/openssl/test_pkey_dh.rb: Generate 256 bit keys for non-FIPS installations to improve test performance (e.g. for rubyci). test/openssl/utils.rb: Replace DSS1 as certificate signature digest with SHA1 for FIPS installations when using DSA by introducing TestUtils::DSA_SIGNATURE_DIGEST. test/openssl/test_x509cert.rb: test/openssl/test_x509crl.rb: test/openssl/test_x509req.rb: Use DSA_SIGNATURE_DIGEST NEWS: Introduce OpenSSL::OPENSSL_FIPS These changes allow running the OpenSSL tests in FIPS mode while keeping a high performance for non-FIPS installations. Introduction of OpenSSL::OPENSSL_FIPS allows for applications to react to special requirements when using OpenSSL in FIPS mode. [Feature #6946] [ruby-core:47345] - Diese und die folgenden Zeilen werden ignoriert -- M ext/openssl/extconf.rb M ext/openssl/ossl.c M NEWS M ChangeLog M test/openssl/utils.rb M test/openssl/test_x509crl.rb M test/openssl/test_x509req.rb M test/openssl/test_x509cert.rb M test/openssl/test_pkey_dh.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* ext/openssl/ossl.c: Fix error in example. Patch by David Albert.emboss
Add/extend existing documentation. Examples now also cover RSA signatures and PBKDF2. [ruby-core: 45154][ruby-trunk - Bug #6475] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20* Make sure to clear $! when ignoring an exceptionnahi
* ext/openssl/ossl.c (ossl_pem_passwd_cb0, ossl_verify_cb): pem_passwd_cb and verify_cb ignores the exception raised in a callback proc so it should clear $! for subsequent execution. That's said, both subsequent processes for pem_passwd_cb and verify_cb raises another exception before leaking $! to Ruby world. We cannot test this fix in Ruby land. * test/openssl/test_pkey_rsa.rb (test_read_private_key_pem_pw_exception): Test for pem_passwd_cb + exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-14* ext/openssl/ossl.c (ossl_verify_cb): trap the exception fromnahi
verify callback of SSLContext and X509Store and make the verification fail normally. Raising exception directly from callback causes orphan resouces in OpenSSL stack. Patched by Ippei Obayashi. See #4445. * test/openssl/test_ssl.rb (test_exception_in_verify_callback_is_ignored): test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30* ext/openssl/ossl.c/.h: Added ossl_x509_name_sk2ary.emboss
* ext/openssl/ossl.c: Replaced ossl_x509_ary2k by generic macro to simplify future conversions. * ext/openssl/ossl_ssl.c: Implement SSLSocket#client_ca. * test/openssl/test_ssl.rb: Add test for SSLSocket#client_ca. Thanks to Ippei Obayashi for providing the patch! [ Ruby 1.9 - Feature #4481 ] [ruby-core:35461] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-10 * ext/openssl/ossl.c: Fix typo, document version constants.drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-24* ext/openssl/ossl.c: surpress warning: shorten-64-to-32.naruse
* 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
2010-12-10Document RSA, RSA encryption/decryption and PKCS #5 encryption/decryptiondrbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-06Add toplevel documentation for OpenSSLdrbrain
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
2010-04-22* ext/**/*.[ch]: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22* ext/**/*.[ch]: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28* openssl/ossl.c (OSSL_IMPL_SK2ARY): for OpenSSL 1.0.naruse
patched by Jeroen van Meeuwen at [ruby-core:25210] fixed by Nobuyoshi Nakada [ruby-core:25238], Hongli Lai [ruby-core:27417], and Motohiro KOSAKI [ruby-core:28063] * ext/openssl/ossl_ssl.c (ossl_ssl_method_tab), (ossl_ssl_cipher_to_ary): constified. * ext/openssl/ossl_pkcs7.c (pkcs7_get_certs, pkcs7_get_crls): split pkcs7_get_certs_or_crls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19* io.c (rb_mWaitReadable): defined.akr
(rb_mWaitWritable): defined. (io_getpartial): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. (rb_io_write_nonblock): extend IO::WaitWritable on EWOULDBLOCK and EAGAIN. * error.c (make_errno_exc): extracted from rb_sys_fail. (rb_mod_sys_fail): new function. * include/ruby/ruby.h (rb_mod_sys_fail): declared. (rb_mWaitReadable): declared. (rb_mWaitWritable): declared. * ext/socket/init.c (rsock_s_recvfrom_nonblock): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. (rsock_s_accept_nonblock): extend IO::WaitReadable on EWOULDBLOCK, EAGAIN, ECONNABORTED and EPROTO. * ext/socket/socket.c (sock_connect_nonblock): extend IO::WaitWritable on EINPROGRESS. * ext/socket/ancdata.c (bsock_sendmsg_internal): extend IO::WaitWritable on EWOULDBLOCK and EAGAIN. (bsock_recvmsg_internal): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): raise SSLError extended by IO::WaitReadable/IO::WaitWritable on SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE. * ext/openssl/ossl.c (ossl_make_error): extracted from ossl_raise. (ossl_exc_new): new function. * ext/openssl/ossl.h (ossl_exc_new): declared. * lib/net/protocol.rb (rbuf_fill): rescue IO::WaitReadable and IO::WaitWritable. [ruby-core:22539], [ruby-dev:38140] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-14* gc.c (negative_size_allocation_error_with_gvl): abolish a warning.akr
(negative_size_allocation_error): ditto. * ext/openssl/ossl.c (ossl_raise): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-09* configure.in (rb_cv_missing__dtos18, rb_cv_missing_fconvert),nobu
ext/digest/md5/md5.c, ext/openssl/ossl.c (main), ext/socket/extconf.rb (ipv6, wide-getaddrinfo): main should be int. * main.c (main), win32/winmain.c, wince/wincemain.c (WinMain): envp is no longer used so long time. based on a patch from Peter Bowen at [ruby-core:18208] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22* ext/openssl: suppress warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-05* ext/openssl/ossl_pkcs5.c: New module.technorama
* ext/openssl/ossl_{cipher,digest,pkcs7,pkcs12}.c: Remove redundant module namespace. * ext/openssl/lib/openssl/{cipher,digest}.rb Add backwards compatibile classes for rearranged classes. * ext/openssl/ossl_{pkcs7,pkcs12}.c: Add documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-02* ext/openssl/{ossl.[ch],ossl_pkey.c} Add documentation.technorama
* ext/openssl/ossl_hmac.c Add reset method. * ext/openssl/ossl_cipher.c (Cipher#update) Take additional buffer argument. * ext/openssl/{ossl_bio.c,ossl_ssl.c,ruby_missing.h} compatibility with 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02* ruby.h (struct RArray): embed small arrays.matz
(RARRAY_LEN): defined for accessing array members. (RARRAY_PTR): ditto. * array.c: use RARRAY_LEN and RARRAY_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31* ruby.h (struct RString): embed small strings.matz
(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
2005-11-01* ext/openssl/extconf.rb: should check ERR_peek_last_error().gotoyuzo
[ruby-dev:27597] * ext/openssl/ossl.c (ossl_raise): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-12* ext/openssl/ossl.c (Init_openssl): should call OpenSSL_add_ssl_algorithms().gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-08-07* ext/openssl/ossl.c (ossl_raise): should use ERR_peek_last_errorgotoyuzo
to get last error on the current thread. And should report if errors are on the stack while OpenSSL.debug is true. * ext/openssl/ossl.c (ossl_get_errors): new method for debugging this library. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-16* ext/openssl/ossl.c (ossl_raise): refine message format.gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-14* ext/openssl/ossl.c (ossl_raise): avoid buffer overrun. [ruby-dev:25187]gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-29* exception message clean-up by Ian Macdonald <ian@caliban.org>.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11* ext/openssl/ossl_pkcs12.[ch]: new files. add OpenSSL::PKCS12.gotoyuzo
* ext/openssl/ossl_ossl.[ch]: ditto. * ext/openssl/MANIFEST: add ossl_pkcs12.[ch]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-11* ext/openssl/ossl.c (ossl_x509_sk2ary, ossl_x509crl_sk2ary): addgotoyuzo
functions to convert STACK into Array. * ext/openssl/ossl.h: add prototypes. * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_set_certificates, ossl_pkcs7_get_certificates, ossl_pkcs7_get_crls, ossl_pkcs7_set_crls): add functions for PKCS7#certificates= PKCS7#certificates, PKCS7#crls= and PKCS7#crls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-03* ext/openssl/ossl_asn1.c: add DER encoder and decoder.gotoyuzo
* ext/openssl/ossl_asn1.h: add OpenSSL::ASN1 module. * ext/openssl/ossl.c (Init_openssl): call Init_ossl_asn1. * ext/openssl/ossl.h: include ossl_asn1.h. * ext/openssl/extconf.rb: check if X509_ATTRIBUTE has field "single". * ext/openssl/ossl_x509attr.c (ossl_x509attr_set_value): accept DER encoded data argument. * ext/openssl/ossl_x509attr.c (ossl_x509attr_get_value): return DER encoded data in OpenSSL::ASN1 types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-02* ext/openssl/ossl_engine.c: add a new module OpenSSL::Engine.gotoyuzo
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
2003-09-25 * ext/openssl/ossl.c (ossl_buf2str): fix type of 1st argument forusa
rb_protect. * ext/openssl/ossl_hmac.c (ossl_hmac_digest): should return meaningful value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-17should check retuen value of rb_protect.gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-17* ext/openssl: all files are reviewed to simplify and avoid memory leak.gotoyuzo
* 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
2003-09-12OpenSSL updatemichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-25* ext/openssl/ossl.h: fix comment.gotoyuzo
* ext/openssl/ossl.c (ossl_debug): should enable if no va-args macro supplied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-23* ext/openssl/ssl.h: undef X509_NAME and PKCS7_SIGNER_INFO togotoyuzo
avoid name confliction on mswin32. * ext/openssl/ssl.c (ossl_protect_obj2bio): avoid VC++ warnings in function prototype. * ext/openssl/ssl.c (ossl_protect_membio2str): ditto. * ext/openssl/ssl.c (ossl_protect_x509_ary2sk): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-23* ext/openssl: imported.gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e