summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_x509store.c
AgeCommit message (Collapse)Author
2016-06-05openssl: adapt to OpenSSL 1.1.0 opaque structsrhe
* ext/openssl/extconf.rb: Check existence of accessor functions that don't exist in OpenSSL 0.9.8. OpenSSL 1.1.0 made most of its structures opaque and requires use of these accessor functions. [ruby-core:75225] [Feature #12324] * ext/openssl/openssl_missing.[ch]: Implement them if missing. * ext/openssl/ossl*.c: Use these accessor functions. * test/openssl/test_hmac.rb: Add missing test for HMAC#reset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-05openssl: support OpenSSL 1.1.0's new multi-threading APIrhe
* ext/openssl/extconf.rb: Check absence of CRYPTO_lock() to see if the OpenSSL has the new threading API. In OpenSSL <= 1.0.2, an application had to set locking callbacks to use OpenSSL in a multi-threaded environment. OpenSSL 1.1.0 now finds pthreads or Windows threads so we don't need to do something special. [ruby-core:75225] [Feature #12324] Also check existence of *_up_ref(). Some structures in OpenSSL have a reference counter. We used to increment it with CRYPTO_add() which is a part of the old API. * ext/openssl/openssl_missing.h: Implement *_up_ref() if missing. * ext/openssl/ossl.c: Don't set locking callbacks if unneeded. * ext/openssl/ossl_pkey.c, ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509cert.c, ext/openssl/ossl_x509crl.c, ext/openssl/ossl_x509store.c: Use *_up_ref() instead of CRYPTO_add(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-25openssl: drop OpenSSL 0.9.6/0.9.7 supportrhe
* ext/openssl, test/openssl: Drop OpenSSL < 0.9.8 support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23openssl: use StringValueCStr() where NUL-terminated string is expectedrhe
* ext/openssl/ossl_asn1.c, ext/openssl/ossl_bn.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_digest.c ext/openssl/ossl_engine.c, ext/openssl/ossl_ns_spki.c ext/openssl/ossl_pkcs12.c, ext/openssl/ossl_pkcs7.c ext/openssl/ossl_pkey.c, ext/openssl/ossl_pkey_ec.c ext/openssl/ossl_rand.c, ext/openssl/ossl_ssl.c ext/openssl/ossl_x509attr.c, ext/openssl/ossl_x509cert.c ext/openssl/ossl_x509ext.c, ext/openssl/ossl_x509store.c: Use StringValueCStr() where NUL-terminated string is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19openssl: register ex_data index for X509_STORE{_CTX,} respectivelyrhe
* ext/openssl/ossl.c (Init_openssl): register an ex_data index for X509_STORE and X509_STORE_CTX respectively. Since they don't share the ex_data index registry, we can't use the same index. (ossl_verify_cb): use the the correct index. * ext/openssl/ossl_ssl.c (ossl_ssl_verify_callback): ditto. * ext/openssl/ossl_x509store.c (ossl_x509store_set_vfy_cb): ditto. (ossl_x509stctx_verify): ditto. * ext/openssl/ossl.h (void ossl_clear_error): add extern declarations of ossl_store_{ctx_,}ex_verify_cb_idx. * ext/openssl/openssl_missing.c: remove X509_STORE_set_ex_data and X509_STORE_get_ex_data. * ext/openssl/openssl_missing.h: implement X509_STORE_get_ex_data, X509_STORE_set_ex_data and X509_STORE_get_ex_new_index as macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18openssl: clear OpenSSL error queue before return to Rubyrhe
* 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
2015-09-22* ext/openssl/*: Remove svn commit id macros to make sync easierzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-29openssl: wrapper object before allocnobu
* 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
2015-04-20* ext/openssl/*: use license instead of licence.hsbt
[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
2014-12-13ossl_x509store.c: typed datanobu
* ext/openssl/ossl_x509store.c (ossl_x509stctx_type): use typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-13ossl_x509store.c: typed datanobu
* ext/openssl/ossl_x509store.c (ossl_x509store_type): use typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30protoize no-arguments functionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16* ext/openssl/*: Document synonymous methods, by windwiny [GH-277]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05use INT2FIX(0) instead of INT2NUM(0).kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-02* ext/openssl/ossl_x509store.c (ossl_x509store_add_file): Addeddrbrain
documentation * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths): ditto * ext/openssl/ossl_x509store.c (ossl_x509store_add_cert): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-02* ext/openssl/ossl_x509store.c: Add class documentation fordrbrain
OpenSSL::X509::Store git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-24* ext/openssl/ossl_rand.c (ossl_rand_egd_bytes): use NUM2INT becausenaruse
the result is used with functions whose argument is int. * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): ditto. * ext/openssl/ossl_x509store.c (ossl_x509store_set_purpose): ditto. * ext/openssl/ossl_x509store.c (ossl_x509store_set_trust): ditto. * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_purpose): ditto. * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_trust): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-20* ext/openssl/ossl_x509store.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-09* ext/openssl/ossl_x509store.c (ossl_x509stctx_cleanup): removing Ctenderlove
implementation of `cleanup`. * ext/openssl/lib/openssl/x509.rb: adding ruby implementation of `cleanup`. OpenSSL::X509::StoreContext#cleanup is deprecated since reusing the underlying struct doesn't make sense. [ruby-dev:42546] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30152 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-03-26* ext/openssl/ossl_x509store.c (ossl_x509store_initialize): initializemame
store->ex_data.sk. [ruby-core:28907] [ruby-core:23971] [ruby-core:18121] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-14* include/ruby/ruby.h (rb_check_safe_str): deprecated.nobu
* ext/openssl/ossl_x509store.c (ossl_x509store_add_{file,path}): replaced deprecated funtion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03* include/ruby/signal.h: removed.ko1
* common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c, io.c, process.c, signal.c: vm_core.h: ditto. Some unused external global variables are also removed. (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending, rb_thread_critical) * ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c, ext/readline/readline.c, ext/socket/depend, ext/socket/socket.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29* ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand),knu
ext/openssl/ossl_pkey_dh.c (ossl_dh_s_generate) (ossl_dh_initialize), ext/openssl/ossl_pkey_dsa.c (ossl_dsa_s_generate), ext/openssl/ossl_rand.c (ossl_rand_bytes) (ossl_rand_pseudo_bytes, ossl_rand_egd_bytes), ext/openssl/ossl_x509store.c (ossl_x509stctx_set_error): Do not use FIX2INT() without checking the value type. Use NUM2INT() instead; found by akr in [ruby-dev:34890]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-05* ext/openssl/ossl_{bn,x509{attr,cert,name,store}}.c:technorama
Add documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12153 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-08-22* ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): try to decodegotoyuzo
the argument as a string. * ext/openssl/ossl_ns_pki.c (ossl_spki_to_der): new method. * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): should set @time to avoid warning. * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths, X509_STORE_add_cert, X509_STORE_add_crl): should raise error if wrapped functions fails. * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): fix error message. * ext/openssl/ossl_x509req.c (ossl_x509req_set_attributes): get rid of unused variable. * test/openssl/test_ns_spki.rb: add new file. * test/openssl/test_x509store.rb: add test for error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-27* ext/openssl/ossl_x509store.c (ossl_x509stctx_set_time): shouldgotoyuzo
not set internal flag directry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-11* ext/openss/ossl_x509store.c (ossl_x509store_set_default_paths):gotoyuzo
new method OpenSSL::X509::Store#set_default_paths. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-15* lib/set.rb (Set#==): [ruby-dev:25206]matz
* ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198] * utf8.c (utf8_is_mbc_ambiguous): [ruby-talk:123561] * utf8.c (utf8_mbc_to_normalize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-15* ext/openssl/ossl_x509store.cgotoyuzo
(ossl_x509stctx_initialize): setup OpenSSL::X509::StoreContext with ossl_x509stctx_* functions instead of X509_STORE_CTX_*. (ossl_x509store_set_time): add OpenSSL::X509::Store#time=. (ossl_x509stctx_set_time): add OpenSSL::X509::StoreContext#time=. * test/openssl/ossl_x509store.rb: test certificate validity times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-06* ext/openssl/ruby_missing.c: rid of unnecessary backwardgotoyuzo
compatibility stuff. and remove DEFINE_ALLOC_WRAPPER from all sources. * ext/openssl/ossl_x509ext.c (X509::Extension.new): new method. * ext/openssl/ossl_x509ext.c (X509::Extension#oid=): new method. * ext/openssl/ossl_x509ext.c (X509::Extension#value=): new method. * ext/openssl/ossl_x509ext.c (X509::Extension#critical=): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4522 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