Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby-openssl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ea229e0dcc8d
Choose a base ref
...
head repository: jruby/jruby-openssl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 75ff3df1d465
Choose a head ref
  • 5 commits
  • 5 files changed
  • 1 contributor

Commits on Jun 9, 2016

  1. prepare for 0.9.17 release

    kares committed Jun 9, 2016
    Copy the full SHA
    26a7b92 View commit details
  2. Copy the full SHA
    1e51fe1 View commit details
  3. Copy the full SHA
    ff568d0 View commit details
  4. complete History.md for 0.9.17

    kares committed Jun 9, 2016
    Copy the full SHA
    ad7d173 View commit details
  5. Copy the full SHA
    75ff3df View commit details
Showing with 45 additions and 3 deletions.
  1. +1 −0 History.md
  2. +1 −1 lib/jopenssl/version.rb
  3. +1 −1 pom.xml
  4. +1 −1 src/main/java/org/jruby/ext/openssl/SecurityHelper.java
  5. +41 −0 src/test/ruby/test_security_helper.rb
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.9.17

* temporarily register BC provider on X.509 factory (work-around for #94)
* support Cipher#auth_tag and auth_data for GCM ciphers (e.g. aes-128-gcm)
* need to drop support for BC <= 1.50 due EC support (N/A in older BCs)
* (somehow working) draft at implementing PKey::EC (elliptic curve support)
2 changes: 1 addition & 1 deletion lib/jopenssl/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Jopenssl
VERSION = '0.9.17.dev'
VERSION = '0.9.18.dev'
BOUNCY_CASTLE_VERSION = '1.54'
# @deprecated
module Version
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
<modelVersion>4.0.0</modelVersion>
<groupId>rubygems</groupId>
<artifactId>jruby-openssl</artifactId>
<version>0.9.17.dev-SNAPSHOT</version>
<version>0.9.17</version>
<packaging>gem</packaging>
<name>JRuby OpenSSL</name>
<description>JRuby-OpenSSL is an add-on gem for JRuby that emulates the Ruby OpenSSL native library.</description>
2 changes: 1 addition & 1 deletion src/main/java/org/jruby/ext/openssl/SecurityHelper.java
Original file line number Diff line number Diff line change
@@ -193,7 +193,7 @@ public static CertificateFactory getCertificateFactory(final String type)
final Provider provider = getSecurityProvider();
if ( provider != null ) return getCertificateFactory(type, provider);
}
catch (CertificateException e) {e.printStackTrace(); }
catch (CertificateException e) { debugStackTrace(e); }
return CertificateFactory.getInstance(type);
}

41 changes: 41 additions & 0 deletions src/test/ruby/test_security_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding: US-ASCII
require File.expand_path('test_helper', File.dirname(__FILE__))

class TestSecurityHelper < TestCase

def setup; require 'openssl'; require 'java'
super
end

def test_cert_factory_provider_leak # GH-94
assert provider = org.jruby.ext.openssl.SecurityHelper.getSecurityProvider
assert_equal 'BC', provider.name
factory1 = org.jruby.ext.openssl.SecurityHelper.getCertificateFactory('X.509')
factory2 = org.jruby.ext.openssl.SecurityHelper.getCertificateFactory('X.509')
assert_not_same factory1, factory2
assert_equal 'BC', factory1.provider.name
assert_equal 'BC', factory2.provider.name
# assert_same factory1.getProvider, factory2.getProvider

java.security.cert.CertificateFactory.class_eval do
field_reader :certFacSpi
end

spi1 = factory1.certFacSpi; spi2 = factory2.certFacSpi

if spi1.is_a? org.bouncycastle.jcajce.provider.asymmetric.x509.CertificateFactory
org.bouncycastle.jcajce.provider.asymmetric.x509.CertificateFactory.class_eval do
field_reader :bcHelper
end
if (spi1.bcHelper rescue nil)
org.bouncycastle.jcajce.util.ProviderJcaJceHelper.class_eval do
field_reader :provider rescue nil
end
if spi1.bcHelper.respond_to?(:provider)
assert_same spi1.bcHelper.provider, spi2.bcHelper.provider
end
end
end
end if defined? JRUBY_VERSION

end