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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 615bbf8825f4
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 424fa720525c
Choose a head ref
  • 13 commits
  • 26 files changed
  • 2 contributors

Commits on Feb 1, 2015

  1. Copy the full SHA
    c912fa4 View commit details
  2. we can not guarantee extension ordering using Java APIs (otherwise th…

    …is rolls fine)
    
    ... and there's the same test without the extension order passing at :
    jruby/jruby-openssl@eb30f9bd73ae25750593
    kares authored and mkristian committed Feb 1, 2015
    Copy the full SHA
    e41958f View commit details
  3. Copy the full SHA
    4f772d7 View commit details
  4. Copy the full SHA
    43f2b89 View commit details
  5. Copy the full SHA
    39798ba View commit details
  6. Copy the full SHA
    c795e25 View commit details
  7. Copy the full SHA
    563ca61 View commit details
  8. follow the fix of jruby/jruby-openssl#18

    Sponsored by Lookout Inc.
    mkristian committed Feb 1, 2015
    Copy the full SHA
    d5e1479 View commit details
  9. Copy the full SHA
    4a8c35b View commit details
  10. Copy the full SHA
    146627b View commit details
  11. use jruby-openssl-0.9.6

    mkristian committed Feb 1, 2015
    Copy the full SHA
    3aca0f8 View commit details
  12. small fix in runnable test

    mkristian committed Feb 1, 2015
    Copy the full SHA
    1a04dad View commit details
  13. Copy the full SHA
    424fa72 View commit details
Showing with 60 additions and 108 deletions.
  1. +1 −0 antlib/extra.xml
  2. +2 −24 lib/pom.rb
  3. +1 −25 lib/pom.xml
  4. +0 −1 maven/jruby-complete/src/it/integrity/pom.xml
  5. +2 −2 maven/jruby-complete/src/it/integrity/verify.bsh
  6. +3 −3 ...y_bundles_with_embedded_gems/test/src/test/java/org/jruby/embed/osgi/test/JRubyOsgiEmbedTest.java
  7. +0 −1 maven/jruby-dist/src/it/integrity/pom.xml
  8. +2 −2 maven/jruby-dist/src/it/integrity/verify.bsh
  9. +0 −1 maven/jruby-jars/src/it/integrity/pom.xml
  10. +2 −2 maven/jruby-jars/src/it/integrity/verify.bsh
  11. +0 −1 maven/jruby-noasm/src/it/integrity/pom.xml
  12. +2 −2 maven/jruby-noasm/src/it/integrity/verify.bsh
  13. +0 −1 maven/jruby/src/it/integrity/pom.xml
  14. +2 −2 maven/jruby/src/it/integrity/verify.bsh
  15. +1 −1 maven/jruby/src/it/runnable/src/main/java/Main.java
  16. +3 −3 .../src/templates/osgi_all_inclusive/src/test/java/org/jruby/embed/osgi/test/JRubyOsgiEmbedTest.java
  17. +0 −20 spec/regression/GH-1800_krypt_ffi_regression_spec.rb
  18. +1 −7 test/externals/ruby1.9/excludes/OpenSSL/TestASN1.rb
  19. +1 −1 test/externals/ruby1.9/excludes/OpenSSL/TestCipher.rb
  20. +0 −1 test/externals/ruby1.9/excludes/OpenSSL/TestDigest.rb
  21. +1 −0 test/externals/ruby1.9/excludes/OpenSSL/TestX509CRL.rb
  22. +0 −2 test/externals/ruby1.9/excludes/OpenSSL/TestX509Name.rb
  23. +1 −1 test/externals/ruby1.9/excludes/OpenSSL/TestX509Request.rb
  24. +7 −2 test/externals/ruby1.9/openssl/test_asn1.rb
  25. +7 −3 test/externals/ruby1.9/openssl/test_certificate.rb
  26. +21 −0 test/test_adding_pem_to_x509store.rb
1 change: 1 addition & 0 deletions antlib/extra.xml
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ build jruby-complete.jar
<arg value='-rminitest/excludes'/>
<arg value='lib/ruby/gems/shared/gems/rake-10.1.0/lib/rake/rake_test_loader.rb'/>
<arg value='test/test_globals.rb'/>
<arg value='test/test_adding_pem_to_x509store.rb'/>
<arg value='test/test_argf.rb'/>
<arg value='test/test_array.rb'/>
<arg value='test/test_autoload.rb'/>
26 changes: 2 additions & 24 deletions lib/pom.rb
Original file line number Diff line number Diff line change
@@ -24,19 +24,13 @@ def version
require 'rexml/document'
require 'rexml/xpath'

KRYPT_VERSION = '0.0.2'

# the versions are declared in ../pom.xml
default_gems =
[
ImportedGem.new( 'jruby-openssl', '0.9.5', true ),
ImportedGem.new( 'jruby-openssl', '0.9.6', true ),
ImportedGem.new( 'rake', 'rake.version', true ),
ImportedGem.new( 'rdoc', 'rdoc.version', true ),
ImportedGem.new( 'json', 'json.version', true, false ),
ImportedGem.new( 'krypt', KRYPT_VERSION, true ),
ImportedGem.new( 'krypt-core', KRYPT_VERSION, true ),
ImportedGem.new( 'krypt-provider-jdk', KRYPT_VERSION, true ),
ImportedGem.new( 'ffi', '1.9.3', true ),
ImportedGem.new( 'jar-dependencies', '0.1.2', true )
]

@@ -194,22 +188,6 @@ def to_pathname
f = File.join( ruby_dir, 'shared', 'jruby-openssl.rb' )
File.delete( f ) if File.exists?( f )

# PATCH krypt
if KRYPT_VERSION == '0.0.2'
file = ctx.basedir.to_pathname + '/ruby/shared/krypt/provider.rb'
content = File.read( file )
content.sub! /begin(.|[\n])*/, <<EOS
unless java?
require_relative 'provider/ffi'
end
EOS
File.open( file, 'w' ) do |f|
f.print content
end
else
raise "please remove the obsolete PATCH for krypt in lib/pom.rb"
end

# we do not want rubygems_plugin.rb within jruby
f = File.join( ruby_dir, 'shared', 'rubygems_plugin.rb' )
File.delete( f ) if File.exists?( f )
@@ -218,5 +196,5 @@ def to_pathname
( Dir[ File.join( jruby_gems, '**/*' ) ] + Dir[ File.join( jruby_gems, '**/.*' ) ] ).each do |f|
File.chmod( 0644, f ) rescue nil if File.file?( f )
end
end
end
end
26 changes: 1 addition & 25 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
<dependency>
<groupId>rubygems</groupId>
<artifactId>jruby-openssl</artifactId>
<version>0.9.5</version>
<version>0.9.6</version>
<type>gem</type>
</dependency>
<dependency>
@@ -47,30 +47,6 @@
<version>${json.version}</version>
<type>gem</type>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>krypt</artifactId>
<version>0.0.2</version>
<type>gem</type>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>krypt-core</artifactId>
<version>0.0.2</version>
<type>gem</type>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>krypt-provider-jdk</artifactId>
<version>0.0.2</version>
<type>gem</type>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>ffi</artifactId>
<version>1.9.3</version>
<type>gem</type>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>jar-dependencies</artifactId>
1 change: 0 additions & 1 deletion maven/jruby-complete/src/it/integrity/pom.xml
Original file line number Diff line number Diff line change
@@ -125,7 +125,6 @@
<argument>
require 'jar-dependencies'
require 'openssl'
require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
4 changes: 2 additions & 2 deletions maven/jruby-complete/src/it/integrity/verify.bsh
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "gems count 9";
expected = "gems count 5";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "jar-dependencies,jruby-openssl";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
Original file line number Diff line number Diff line change
@@ -110,15 +110,15 @@ public void testJRubyCreate() throws Exception {
loaded = (Boolean) jruby.runScriptlet( "require 'openssl'" );
assertEquals(true, loaded);

jruby.runScriptlet( "require 'jar-dependencies'; require 'krypt'" );
jruby.runScriptlet( "require 'jar-dependencies'" );
list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\"]");

// ensure we can load can load embedded gems
loaded = (Boolean) jruby.runScriptlet( "require 'virtus'" );
assertEquals(true, loaded);

list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
}
}
1 change: 0 additions & 1 deletion maven/jruby-dist/src/it/integrity/pom.xml
Original file line number Diff line number Diff line change
@@ -142,7 +142,6 @@
<argument>
require 'jar-dependencies'
require 'openssl'
require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
4 changes: 2 additions & 2 deletions maven/jruby-dist/src/it/integrity/verify.bsh
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "gems count 9";
expected = "gems count 5";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "jar-dependencies,jruby-openssl";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
1 change: 0 additions & 1 deletion maven/jruby-jars/src/it/integrity/pom.xml
Original file line number Diff line number Diff line change
@@ -131,7 +131,6 @@
<argument>
require 'jar-dependencies'
require 'openssl'
require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
4 changes: 2 additions & 2 deletions maven/jruby-jars/src/it/integrity/verify.bsh
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "gems count 9";
expected = "gems count 5";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "jar-dependencies,jruby-openssl";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
1 change: 0 additions & 1 deletion maven/jruby-noasm/src/it/integrity/pom.xml
Original file line number Diff line number Diff line change
@@ -125,7 +125,6 @@
<argument>
require 'jar-dependencies'
require 'openssl'
require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
4 changes: 2 additions & 2 deletions maven/jruby-noasm/src/it/integrity/verify.bsh
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "gems count 9";
expected = "gems count 5";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "jar-dependencies,jruby-openssl";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
1 change: 0 additions & 1 deletion maven/jruby/src/it/integrity/pom.xml
Original file line number Diff line number Diff line change
@@ -125,7 +125,6 @@
<argument>
require 'jar-dependencies'
require 'openssl'
require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
4 changes: 2 additions & 2 deletions maven/jruby/src/it/integrity/verify.bsh
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "gems count 9";
expected = "gems count 5";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "jar-dependencies,jruby-openssl";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
2 changes: 1 addition & 1 deletion maven/jruby/src/it/runnable/src/main/java/Main.java
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ private Main(org.jruby.RubyInstanceConfig config) {
config.setHardExit(true);
config.setCurrentDirectory( "uri:classloader://" );
config.setJRubyHome( "uri:classloader://META-INF/jruby.home" );
config.setLoadPaths( java.util.Arrays.asList("uri:classloader://") );
config.setLoadPaths( java.util.Arrays.asList("uri:classloader:/") );
java.util.Map env = new java.util.HashMap( System.getenv() );
env.put( "JARS_HOME", "uri:classloader://" );
// needed for jruby version before 1.7.19
Original file line number Diff line number Diff line change
@@ -95,15 +95,15 @@ public void testJRubyCreate() throws InterruptedException {
gemPath = gemPath.replaceAll( "bundle[^:]*://[^/]*", "bundle:/" );
assertEquals( gemPath, "[\"uri:classloader:/specifications\", \"uri:classloader:/META-INF/jruby.home/lib/ruby/gems/shared/specifications\"]" );

jruby.runScriptlet( "require 'jar-dependencies'; require 'krypt'" );
jruby.runScriptlet( "require 'jar-dependencies'" );
list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\"]");

// ensure we can load can load embedded gems
loaded = (Boolean) jruby.runScriptlet( "require 'virtus'" );
assertEquals(true, loaded);

list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
}
}
20 changes: 0 additions & 20 deletions spec/regression/GH-1800_krypt_ffi_regression_spec.rb

This file was deleted.

8 changes: 1 addition & 7 deletions test/externals/ruby1.9/excludes/OpenSSL/TestASN1.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
exclude :test_bit_string_infinite_length, 'needs investigation'
exclude :test_bit_string_infinite_length, 'encoding works but decoding not implemented'
exclude :test_cons_explicit_tagging, 'needs investigation'
exclude :test_cons_explicit_tagging_inf_length, 'needs investigation'
exclude :test_cons_implicit_tagging, 'needs investigation'
exclude :test_cons_implicit_tagging_inf_length, 'needs investigation'
exclude :test_cons_without_array_forbidden, 'needs investigation'
exclude :test_cons_without_inf_length_forbidden, 'needs investigation'
exclude :test_create_inf_length_primitive, 'needs investigation'
exclude :test_decode_all, 'needs investigation'
exclude :test_decode_pem, 'needs investigation'
exclude :test_octet_string_infinite_length, 'needs investigation'
exclude :test_octet_string_infinite_length_explicit_tagging, 'needs investigation'
exclude :test_octet_string_infinite_length_implicit_tagging, 'needs investigation'
exclude :test_parse_empty_sequence, 'needs investigation'
exclude :test_parse_tagged_0_infinite, 'needs investigation'
exclude :test_prim_explicit_tagging, 'needs investigation'
exclude :test_prim_implicit_tagging, 'needs investigation'
exclude :test_primitive_inf_length, 'needs investigation'
exclude :test_recursive_octet_string_infinite_length, 'needs investigation'
exclude :test_recursive_octet_string_parse, 'needs investigation'
exclude :test_seq_infinite_length, 'needs investigation'
exclude :test_set_infinite_length, 'needs investigation'
2 changes: 1 addition & 1 deletion test/externals/ruby1.9/excludes/OpenSSL/TestCipher.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
exclude :test_AES, 'needs investigation'
exclude :test_AES, 'works - just need to enable JCE unlimited strength'
exclude :test_AES_crush, 'needs investigation'
1 change: 0 additions & 1 deletion test/externals/ruby1.9/excludes/OpenSSL/TestDigest.rb
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
exclude :test_digest_by_oid_and_name_sha2, 'Java exception raised'
1 change: 1 addition & 0 deletions test/externals/ruby1.9/excludes/OpenSSL/TestX509CRL.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude :test_extension, 'Can not guarantee extension order using Java APIs'
2 changes: 0 additions & 2 deletions test/externals/ruby1.9/excludes/OpenSSL/TestX509Name.rb
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
exclude :test_spaceship, 'needs investigation'
exclude :test_unrecognized_oid, 'needs investigation'
2 changes: 1 addition & 1 deletion test/externals/ruby1.9/excludes/OpenSSL/TestX509Request.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
exclude :test_attr, 'Java exception raised'
exclude :test_attr, 'fails with <2> expected but was <0> [test_x509req.rb:94]'
exclude :test_sign_and_verify, 'Version broke in recent rewrite'
exclude :test_version, 'Version broke in recent rewrite'
9 changes: 7 additions & 2 deletions test/externals/ruby1.9/openssl/test_asn1.rb
Original file line number Diff line number Diff line change
@@ -186,8 +186,13 @@ def test_decode
assert_equal(OpenSSL::ASN1::Null, pkey.value[0].value[1].class)

assert_equal(OpenSSL::ASN1::BitString, sig_val.class)
cululated_sig = key.sign(OpenSSL::Digest::SHA1.new, tbs_cert.to_der)
assert_equal(cululated_sig, sig_val.value)

# since the direct compare of signatures does not work
# we verify the signature via the certificate itself
assert OpenSSL::X509::Certificate.new( cert.to_der ).verify key

#cululated_sig = key.sign(OpenSSL::Digest::SHA1.new, tbs_cert.to_der)
#assert_equal(cululated_sig, sig_val.value)
end

def test_encode_boolean
10 changes: 7 additions & 3 deletions test/externals/ruby1.9/openssl/test_certificate.rb
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ def test_sign_for_pem_initialized_certificate
end

def test_set_public_key
pkey = @cert.public_key
newkey = OpenSSL::PKey::RSA.new(1024)
@cert.public_key = newkey
assert_equal(newkey.public_key.to_pem, @cert.public_key.to_pem)
@@ -57,6 +56,7 @@ def test_cert_extensions
END

cert = OpenSSL::X509::Certificate.new(pem_cert)
keyid = '24:D1:34:18:66:91:2A:63:76:AA:19:CE:17:20:56:56:5E:10:8F:AA'
cert.extensions.each do |ext|
value = ext.value
crit = ext.critical?
@@ -69,10 +69,14 @@ def test_cert_extensions
assert_equal "CA:TRUE", value
when "authorityKeyIdentifier"
assert_equal false, crit
assert_equal "keyid:80:14:24:D1:34:18:66:91:2A:63:76:AA:19:CE:17:20:56:56:5E:10:8F:AA", value
expected = "keyid:#{keyid}\n"
# NOTE: behavior matched against MRI 1.8.7/1.9.3/2.1.2 :
expected << "DirName:/C=JP/O=ctor.org/OU=Development/CN=http-access2\n"
expected << "serial:01\n"
assert_equal expected, value
when "subjectKeyIdentifier"
assert_equal false, crit
assert_equal "24:D1:34:18:66:91:2A:63:76:AA:19:CE:17:20:56:56:5E:10:8F:AA", value
assert_equal keyid, value
when "nsComment"
assert_equal false, crit
assert_equal "Ruby/OpenSSL Generated Certificate", value
21 changes: 21 additions & 0 deletions test/test_adding_pem_to_x509store.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'test/unit'
require 'openssl'

class TestOpenssl < Test::Unit::TestCase
def test_adding_pem
OpenSSL.debug = true
# mimic what rubygems/request#add_rubygems_trusted_certs does
# to find the pem certificates
p base = $LOAD_PATH.detect { |p| p =~ /ruby\/shared/ }
pems = Dir[ File.join(base, 'rubygems/ssl_certs/*pem') ]
assert_equal( 9, pems.size )
pems.each do |pem|
store = OpenSSL::X509::Store.new
cert = OpenSSL::X509::Certificate.new(File.read(pem))
assert( !store.verify(cert) )
store.add_file(pem)
# only verify on self signed certifactes
assert( store.verify(cert) ) unless pem =~ /AddTrustExternalCARoot.pem/
end
end
end