Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/ext/openssl/lib/openssl.rb b/ext/openssl/lib/openssl.rb
- index 3cff8d9..fb215cd 100644
- --- a/ext/openssl/lib/openssl.rb
- +++ b/ext/openssl/lib/openssl.rb
- @@ -20,6 +20,7 @@ require 'openssl/bn'
- require 'openssl/cipher'
- require 'openssl/config'
- require 'openssl/digest'
- +require 'openssl/x509'
- require 'openssl/ssl-internal'
- require 'openssl/x509-internal'
- diff --git a/ext/openssl/lib/openssl/x509.rb b/ext/openssl/lib/openssl/x509.rb
- index 3f17f5a..aae75a3 100644
- --- a/ext/openssl/lib/openssl/x509.rb
- +++ b/ext/openssl/lib/openssl/x509.rb
- @@ -1 +1,9 @@
- -require 'openssl'
- +module OpenSSL
- + module X509
- + class StoreContext
- + def cleanup
- + warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
- + end
- + end
- + end
- +end
- diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
- index 7b4a005..317fc35 100644
- --- a/ext/openssl/ossl_x509store.c
- +++ b/ext/openssl/ossl_x509store.c
- @@ -511,17 +511,6 @@ ossl_x509stctx_get_curr_crl(VALUE self)
- }
- static VALUE
- -ossl_x509stctx_cleanup(VALUE self)
- -{
- - X509_STORE_CTX *ctx;
- -
- - GetX509StCtx(self, ctx);
- - X509_STORE_CTX_cleanup(ctx);
- -
- - return self;
- -}
- -
- -static VALUE
- ossl_x509stctx_set_flags(VALUE self, VALUE flags)
- {
- X509_STORE_CTX *store;
- @@ -615,7 +604,6 @@ Init_ossl_x509store()
- rb_define_method(x509stctx,"error_depth", ossl_x509stctx_get_err_depth, 0);
- rb_define_method(x509stctx,"current_cert",ossl_x509stctx_get_curr_cert, 0);
- rb_define_method(x509stctx,"current_crl", ossl_x509stctx_get_curr_crl, 0);
- - rb_define_method(x509stctx,"cleanup", ossl_x509stctx_cleanup, 0);
- rb_define_method(x509stctx,"flags=", ossl_x509stctx_set_flags, 1);
- rb_define_method(x509stctx,"purpose=", ossl_x509stctx_set_purpose, 1);
- rb_define_method(x509stctx,"trust=", ossl_x509stctx_set_trust, 1);
- diff --git a/test/openssl/test_x509store.rb b/test/openssl/test_x509store.rb
- index 238ee90..81fa0b0 100644
- --- a/test/openssl/test_x509store.rb
- +++ b/test/openssl/test_x509store.rb
- @@ -22,6 +22,14 @@ class OpenSSL::TestX509Store < Test::Unit::TestCase
- def teardown
- end
- + def test_nosegv_on_cleanup
- + cert = OpenSSL::X509::Certificate.new
- + store = OpenSSL::X509::Store.new
- + ctx = OpenSSL::X509::StoreContext.new(store, cert, [])
- + ctx.cleanup
- + ctx.verify
- + end
- +
- def issue_cert(*args)
- OpenSSL::TestUtils.issue_cert(*args)
- end
Add Comment
Please, Sign In to add comment