summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_engine.c
AgeCommit message (Collapse)Author
2016-06-07openssl: adjust tests for OpenSSL 1.1.0rhe
This fixes `make test-all TESTS=openssl` with OpenSSL master. * test/openssl/test_x509name.rb: Don't register OID for 'emailAddress' and 'serialNumber'. A recent change in OpenSSL made OBJ_create() reject an already existing OID. They were needed to run tests with OpenSSL 0.9.6 which is now unsupported. https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=52832e470f5fe8c222249ae5b539aeb3c74cdb25 [ruby-core:75225] [Feature #12324] * test/openssl/test_ssl_session.rb (test_server_session): Duplicate SSL::Session before re-adding to the session store. OpenSSL 1.1.0 starts rejecting SSL_SESSION once removed by SSL_CTX_remove_session(). https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=7c2d4fee2547650102cd16d23f8125b76112ae75 * test/openssl/test_pkey_ec.rb (setup): Remove X25519 from @keys. X25519 is new in OpenSSL 1.1.0 but this is for key agreement and not for signing. * test/openssl/test_pair.rb, test/openssl/test_ssl.rb, test/openssl/utils.rb: Set security level to 0 when using aNULL cipher suites. * test/openssl/utils.rb: Use 1024 bits DSA key for client certificates. * test/openssl/test_engine.rb: Run each test in separate process. We can no longer cleanup engines explicitly as ENGINE_cleanup() was removed. https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=6d4fb1d59e61aacefa25edc4fe5acfe1ac93f743 * ext/openssl/ossl_engine.c (ossl_engine_s_cleanup): Add a note to the RDoc for Engine.cleanup. * ext/openssl/lib/openssl/digest.rb: Don't define constants for DSS, DSS1 and SHA(-0) when using with OpenSSL 1.1.0. They are removed. * test/openssl/test_digest.rb, test/openssl/test_pkey_dsa.rb, test/openssl/test_pkey_dsa.rb, test/openssl/test_ssl.rb, test/openssl/test_x509cert.rb, test/openssl/test_x509req.rb: Don't test unsupported hash functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55314 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-18openssl: report errors in OpenSSL error queue when clear itrhe
* ext/openssl/ossl.c (ossl_clear_error): Extracted from ossl_make_error(). This prints errors in the OpenSSL error queue if OpenSSL.debug is true, and clears the queue. (ossl_make_error): use ossl_clear_error(). * ext/openssl/ossl.h: add prototype declaration of ossl_make_error(). (OSSL_BIO_reset) use ossl_clear_error() to clear the queue. Clearing silently makes debugging difficult. * ext/openssl/ossl_engine.c (ossl_engine_s_by_id): ditto. * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): ditto. * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_verify): ditto. * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize): ditto. (ossl_ec_group_initialize): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55050 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-12ossl_engine.c: typed datanobu
* ext/openssl/ossl_engine.c (ossl_engine_type): use typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48792 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
2014-01-13ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUEnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21* ext/openssl/ossl_engine.c: [DOC] Documentation for OpenSSL::Enginezzak
This patch is based off work by @vbatts in GH-436 completing the documentation for this class and its methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04* whitespace cleanup.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03* ext/openssl/extconf.rb:emboss
* ext/openssl/ossl_engine.c: add some missing OpenSSL engines. Thanks, Yui Naruse, for providing the patch! [Bug #5548] [ruby-core:40670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22* ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.emboss
* test/openssl/test_engine.rb: Add a test for it. Thanks to Ippei Obayashi for providing the patch. [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-23* ext/openssl/ossl_engine.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-23* ext/openssl/ossl_config.c: OpenSSL 1.0.0 support.usa
* ext/openssl/extconf.rb: check some functions added/removed at OpenSSL 1.0.0. * ext/openssl/ossl_engine.c (ossl_engine_s_load): use engines which exists. * ext/openssl/ossl_ssl_session (SSL_SESSION_cmp): removed at 1.0.0, so implement compatible fuction here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27457 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
2009-04-18* ext/readline/readline.c: use rb_f_notimplement for methods notakr
implemented. * ext/openssl/ossl_engine.c: ditto. * ext/openssl/ossl_config.c: ditto. * ext/openssl/ossl_cipher.c: ditto. * ext/openssl/ossl_pkcs5.c: ditto. * ext/openssl/ossl_x509ext.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/basicsocket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. * ext/iconv/iconv.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-13* ext/openssl/openssl_missing.h (i2d_of_void): cast for callbacks.nobu
[ruby-core:22860] * ext/openssl/ossl_engine.c (ossl_engine_s_by_id): suppress a warning. * ext/openssl/ossl_ssl.c (ossl_sslctx_flush_sessions): time_t may be larger than long. * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_get_time), (ossl_ssl_session_get_timeout): use TIMET2NUM() to convert time_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22925 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
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-09-18* ext/openssl/ossl_pkey.h, ossl_pkey_rsa.c, ossl_pkey_dsa.c:gotoyuzo
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
2005-09-07* ext/openssl/ossl_engine.c (ossl_engine_s_by_id):gotoyuzo
OpenSSL::Engine.by_id calls given block before calling ENGINE_init (block parameter is the return value of this method itself). this functionality is useful to load dynamic shared engines. require "openssl" pkcs11 = OpenSSL::Engine.by_id("dynamic"){|e| e.ctrl_cmd("SO_PATH", "/usr/lib/opensc/engine_pkcs11.so") e.ctrl_cmd("LIST_ADD", "1") e.ctrl_cmd("LOAD") } pkcs11.ctrl_cmd("PIN", "secret") key = pkcs11.load_private_key * ext/openssl/ossl_engine.c (ossl_engine_ctrl_cmd): new method OpenSSL::Engine#ctrl_cmd. it wraps ENGINE_ctrl_cmd_string. * ext/openssl/ossl_engine.c (ossl_engine_get_cmds): new method OpenSSL::Engine#cmds. it returms engine command definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-23* ext/openssl/ossl_engine.c (ossl_engine_s_load): should checkgotoyuzo
OPENSSL_NO_STATIC_ENGINE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-31* ext/openssl/ossl_engine.c (ossl_engine_s_load): should returngotoyuzo
value. [ruby-dev:25971] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-30* ext/openssl/ossl_engine.c (ossl_engine_s_load): should not raisegotoyuzo
error even if the specified engine could not be loaded. (Dynamic engines don't have fixed name to load.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8223 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
2003-10-05* lib/ext/openssl/extconf.rb: add check for some engine functionsgotoyuzo
unavailable in OpenSSL-0.9.6. * lib/ext/openssl/ossl_engine.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-02ENGINE_load_public_key takes four arguments since OpenSSL-0.9.7gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-02ENGINE_load_private_key takes four arguments since OpenSSL-0.9.7gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4655 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