jruby-openssl 0.11.0-java → 0.12.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +20 -0
  3. data/Mavenfile +21 -26
  4. data/README.md +3 -0
  5. data/Rakefile +21 -35
  6. data/lib/jopenssl/load.rb +0 -14
  7. data/lib/jopenssl/version.rb +1 -1
  8. data/lib/jopenssl.jar +0 -0
  9. data/lib/openssl/bn.rb +40 -9
  10. data/lib/openssl/buffering.rb +478 -9
  11. data/lib/openssl/cipher.rb +67 -9
  12. data/lib/openssl/config.rb +496 -12
  13. data/lib/openssl/digest.rb +73 -9
  14. data/lib/openssl/hmac.rb +13 -0
  15. data/lib/openssl/marshal.rb +30 -0
  16. data/lib/openssl/pkcs5.rb +3 -3
  17. data/lib/openssl/pkey.rb +42 -5
  18. data/lib/openssl/ssl.rb +543 -9
  19. data/lib/openssl/x509.rb +369 -9
  20. data/lib/openssl.rb +43 -1
  21. data/pom.xml +35 -127
  22. metadata +8 -42
  23. data/lib/jopenssl19/openssl/bn.rb +0 -29
  24. data/lib/jopenssl19/openssl/buffering.rb +0 -449
  25. data/lib/jopenssl19/openssl/cipher.rb +0 -28
  26. data/lib/jopenssl19/openssl/config.rb +0 -472
  27. data/lib/jopenssl19/openssl/digest.rb +0 -32
  28. data/lib/jopenssl19/openssl/ssl-internal.rb +0 -223
  29. data/lib/jopenssl19/openssl/ssl.rb +0 -2
  30. data/lib/jopenssl19/openssl/x509-internal.rb +0 -115
  31. data/lib/jopenssl19/openssl/x509.rb +0 -2
  32. data/lib/jopenssl19/openssl.rb +0 -22
  33. data/lib/jopenssl21/openssl/bn.rb +0 -28
  34. data/lib/jopenssl21/openssl/buffering.rb +0 -1
  35. data/lib/jopenssl21/openssl/cipher.rb +0 -1
  36. data/lib/jopenssl21/openssl/config.rb +0 -1
  37. data/lib/jopenssl21/openssl/digest.rb +0 -1
  38. data/lib/jopenssl21/openssl/ssl.rb +0 -1
  39. data/lib/jopenssl21/openssl/x509.rb +0 -119
  40. data/lib/jopenssl21/openssl.rb +0 -22
  41. data/lib/jopenssl22/openssl/bn.rb +0 -39
  42. data/lib/jopenssl22/openssl/buffering.rb +0 -456
  43. data/lib/jopenssl22/openssl/cipher.rb +0 -28
  44. data/lib/jopenssl22/openssl/config.rb +0 -313
  45. data/lib/jopenssl22/openssl/digest.rb +0 -54
  46. data/lib/jopenssl22/openssl/ssl.rb +0 -330
  47. data/lib/jopenssl22/openssl/x509.rb +0 -139
  48. data/lib/jopenssl22/openssl.rb +0 -22
  49. data/lib/jopenssl23/openssl/bn.rb +0 -38
  50. data/lib/jopenssl23/openssl/buffering.rb +0 -455
  51. data/lib/jopenssl23/openssl/cipher.rb +0 -25
  52. data/lib/jopenssl23/openssl/config.rb +0 -474
  53. data/lib/jopenssl23/openssl/digest.rb +0 -43
  54. data/lib/jopenssl23/openssl/pkey.rb +0 -25
  55. data/lib/jopenssl23/openssl/ssl.rb +0 -508
  56. data/lib/jopenssl23/openssl/x509.rb +0 -208
  57. data/lib/jopenssl23/openssl.rb +0 -19
  58. data/lib/openssl/ssl-internal.rb +0 -5
  59. data/lib/openssl/x509-internal.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b0af65b0a40658f2bfafdd3d8a6bd3112dd0c13
4
- data.tar.gz: a5d16510be892effe0c7e3004823136f5eaaf196
3
+ metadata.gz: 2b73e2783a26e7aa5254c66e325fa6c824c78b8d
4
+ data.tar.gz: feb0ad37fca2ead87ed151f8c543214f7912508b
5
5
  SHA512:
6
- metadata.gz: 14b8ac25affa194b9de7637468d1cf73934c99d6eaa35e6d1882de3e42aaaba27c86409423850c23b9f554f21d6bb9fc64688655de32361723ef9a1cd469df5a
7
- data.tar.gz: 48cb81a70fd513ffec64a8eea55132eaaa244e61c0a1b809e7fbc32650eb8960345c4b3d527b30e0927a0158d736026d764b23dd2857982c29682e366dd11ec0
6
+ metadata.gz: aba588920a82b3a568183ee03bcbee3175c033863654521bfc6a624be84072d510853ea2b457f8742d222e19a230c8ce67592a3df16e1ae625d1b644c7e858bf
7
+ data.tar.gz: ce31f7f99e2352871b2fdefc084eef1d8497a97baacf4a99a6459e39abf0cb35e66a1a4b422e454db6e9433cd6c698b22e07dc1e7688e7c580a397cc0a7ae37b
data/History.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 0.12.1
2
+
3
+ * improved compatibility with the openssl gem (version 2.2.1)
4
+ * JOSSL now ships with a single set of openssl .rb files
5
+ - providing compat with `required_ruby_version = '>= 2.3.0'`
6
+ - flat set of .rb files at *lib/openssl/* (based on openssl gem)
7
+ * revisited `OpenSSL::SSL::SSLContext::DEFAULT_PARAMS` defaults
8
+ - implicit `verify_hostname` default .rb callback still a noop
9
+ - TLS continues to rely on the Java SSL engine for hostname checks
10
+ * working TLS 1.3 support
11
+ * droped Java 1.7 support (at least Java 8 needed to use the gem)
12
+ * fixed `SSLContext#options` matches C OpenSSL (using `OP_ALL`)
13
+ * no longer filter out SSLv2 (for improved OpenSSL compatibility)
14
+ * implemented naive `SSLContext#ciphers` caching to speed-up TLS
15
+ * `StoreError` raised due a Java exception now retain native cause
16
+
17
+ ## 0.12.0 (yanked)
18
+
19
+ There were Java 8 and JRuby 9.3 regressions in this release, use 0.12.1 instead.
20
+
1
21
  ## 0.11.0
2
22
 
3
23
  NOTE: This release aims to adapt the certificate verification logic to be aligned
data/Mavenfile CHANGED
@@ -7,7 +7,7 @@ distribution_management do
7
7
  repository :id => :ossrh, :url => 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
8
8
  end
9
9
 
10
- java_target = '1.7'
10
+ java_target = '1.8'
11
11
  gen_sources = '${basedir}/target/generated-sources' # hard-coded in AnnotationBinder
12
12
 
13
13
  plugin( 'org.codehaus.mojo:exec-maven-plugin', '1.3.2' ) do
@@ -45,15 +45,18 @@ plugin( 'org.codehaus.mojo:build-helper-maven-plugin', '1.9' ) do
45
45
  execute_goal 'add-source', :phase => 'process-classes', :sources => [ gen_sources ]
46
46
  end
47
47
 
48
- plugin( :compiler, '3.1',
49
- :source => '1.7', :target => java_target,
50
- :encoding => 'UTF-8', :debug => true,
51
- :showWarnings => true, :showDeprecation => true,
52
- :excludes => [ 'module-info.java' ],
53
- #:jdkToolchain => { :version => '[1.7,11)' },
48
+ compiler_configuration = {
49
+ :source => '1.8', :target => java_target, :release => '8',
50
+ :encoding => 'UTF-8', :debug => true,
51
+ :showWarnings => true, :showDeprecation => true,
52
+ :excludes => [ 'module-info.java' ],
53
+ #:jdkToolchain => { :version => '[1.7,11)' },
54
+ :generatedSourcesDirectory => gen_sources,
55
+ :annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ]
56
+ }
57
+ compiler_configuration.delete(:release) if ENV_JAVA['java.specification.version'] == '1.8'
54
58
 
55
- :generatedSourcesDirectory => gen_sources,
56
- :annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ]) do
59
+ plugin( :compiler, '3.9.0', compiler_configuration) do
57
60
 
58
61
  #execute_goal :compile, :id => 'annotation-binder', :phase => 'compile',
59
62
  # :generatedSourcesDirectory => gen_sources, #:outputDirectory => gen_sources,
@@ -69,14 +72,6 @@ plugin( :compiler, '3.1',
69
72
  :compilerArgs => [ '', '-XDignore.symbol.file=true' ]
70
73
  end
71
74
 
72
- profile 'module-info' do
73
- activation { jdk '[9,)' }
74
- plugin :compiler, '3.8.1',
75
- :source => '9', :target => java_target,
76
- :release => '9',
77
- :includes => [ 'module-info.java' ]
78
- end
79
-
80
75
  plugin :clean do
81
76
  execute_goals( 'clean', :id => 'default-clean', :phase => 'clean',
82
77
  'filesets' => [
@@ -87,18 +82,18 @@ plugin :clean do
87
82
  'failOnError' => 'false' )
88
83
  end
89
84
 
90
- jar 'org.jruby:jruby-core', '1.7.20', :scope => :provided
85
+ jar 'org.jruby:jruby-core', '9.1.11.0', :scope => :provided
86
+ # for invoker generated classes we need to add javax.annotation when on Java > 8
87
+ jar 'javax.annotation:javax.annotation-api', '1.3.1', :scope => :compile
91
88
  jar 'junit:junit', '[4.13.1,)', :scope => :test
92
89
 
93
- # 9.1.17.0 is Java 7 compatible (till supporting JRuby 1.7)
94
90
  # NOTE: to build on Java 11 - installing gems fails (due old jossl) with:
95
91
  # load error: jopenssl/load -- java.lang.StringIndexOutOfBoundsException
96
- MVN_JRUBY_VERSION = ENV_JAVA['java.version'].to_i >= 9 ? '9.2.9.0' : '9.1.17.0'
92
+ MVN_JRUBY_VERSION = ENV_JAVA['java.version'].to_i >= 9 ? '9.2.19.0' : '9.1.17.0'
97
93
 
98
94
  jruby_plugin! :gem do
99
95
  # when installing dependent gems we want to use the built in openssl not the one from this lib directory
100
- # we compile against jruby-core-1.7.20 and want to keep this out of the plugin execution here
101
- execute_goal :id => 'default-initialize', :addProjectClasspath => false, :libDirectory => 'something-which-does-not-exists'
96
+ execute_goal :id => 'default-package', :addProjectClasspath => false, :libDirectory => 'something-which-does-not-exists'
102
97
  execute_goals :id => 'default-push', :skip => true
103
98
  end
104
99
 
@@ -107,12 +102,12 @@ plugin :deploy, '2.8.1' do
107
102
  execute_goals( :deploy, :skip => false )
108
103
  end
109
104
 
110
- supported_bc_versions = %w{ 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 }
105
+ supported_bc_versions = %w{ 1.60 1.61 1.62 1.63 1.64 1.65 1.66 1.67 1.68 }
111
106
 
112
107
  default_bc_version = File.read File.expand_path('lib/jopenssl/version.rb', File.dirname(__FILE__))
113
108
  default_bc_version = default_bc_version[/BOUNCY_CASTLE_VERSION\s?=\s?'(.*?)'/, 1]
114
109
 
115
- properties( 'jruby.plugins.version' => '1.1.8',
110
+ properties( 'jruby.plugins.version' => '2.0.1', # 2.0.1
116
111
  'jruby.switches' => '-W0', # https://github.com/torquebox/jruby-maven-plugins/issues/94
117
112
  'bc.versions' => default_bc_version,
118
113
  'invoker.test' => '${bc.versions}',
@@ -151,8 +146,8 @@ invoker_run_options = {
151
146
  'runit.dir' => '${runit.dir}' }
152
147
  }
153
148
 
154
- jruby_9_K_versions = %w{ 9.0.5.0 9.1.2.0 9.1.8.0 9.1.12.0 9.1.16.0 9.1.17.0 }
155
- jruby_9_K_versions += %w{ 9.2.0.0 9.2.5.0 9.2.6.0 9.2.7.0 9.2.8.0 9.2.9.0 }
149
+ jruby_9_K_versions = %w{ 9.1.2.0 9.1.8.0 9.1.12.0 9.1.16.0 9.1.17.0 }
150
+ jruby_9_K_versions += %w{ 9.2.0.0 9.2.5.0 9.2.10.0 9.2.17.0 9.2.19.0 }
156
151
 
157
152
  jruby_9_K_versions.each { |version|
158
153
  profile :id => "test-#{version}" do
data/README.md CHANGED
@@ -24,6 +24,9 @@ the JRuby [mailing list][1] or the [bug tracker][2].
24
24
  | ~>0.9.18 | 1.6.8-9.1.x | Java 6-8 | 1.50-1.55 |
25
25
  | 0.10.0 | 1.7.20-9.2.x | Java 7-10 | 1.55-1.59 |
26
26
  | 0.10.3 | 1.7.20-9.2.x | Java 7-11 | 1.56-1.62 |
27
+ | ~>0.10.5 | 1.7.20-9.3.x | Java 7-11 | 1.60-1.68 |
28
+ | ~>0.11.x | 9.0.x-9.3.x | Java 7-11 | 1.62-1.68 |
29
+ | ~>0.12.x | 9.1.x-9.3.x | Java 8-15 | 1.65-1.68 |
27
30
 
28
31
  NOTE: backwards JRuby compatibility was not handled for versions <= **0.9.6**
29
32
 
data/Rakefile CHANGED
@@ -1,40 +1,27 @@
1
1
  #-*- mode: ruby -*-
2
2
 
3
- begin
4
- require 'ruby-maven'
5
- rescue LoadError
6
- warn "ruby-maven not available - some tasks will not work " <<
7
- "either `gem install ruby-maven' or use mvn instead of rake"
8
- desc "Package jopenssl.jar with the compiled classes"
9
- task :jar do
10
- sh "mvn prepare-package -Dmaven.test.skip=true"
11
- end
12
- namespace :jar do
13
- desc "Package jopenssl.jar file (and dependendent jars)"
14
- task :all do
15
- sh "mvn package -Dmaven.test.skip=true"
16
- end
17
- end
18
- else
19
- #Rake::Task[:jar].clear rescue nil
20
- desc "Package jopenssl.jar with the compiled classes"
21
- task :jar do
22
- RubyMaven.exec( 'prepare-package -Dmaven.test.skip=true' )
23
- end
24
- namespace :jar do
25
- desc "Package jopenssl.jar file (and dependendent jars)"
26
- task :all do
27
- RubyMaven.exec( 'package -Dmaven.test.skip=true' )
28
- end
29
- end
30
- task :test_prepare do
31
- RubyMaven.exec( 'prepare-package -Dmaven.test.skip=true' )
32
- RubyMaven.exec( 'test-compile' ) # separate step due -Dmaven.test.skip=true
3
+ #Rake::Task[:jar].clear rescue nil
4
+ desc "Package jopenssl.jar with the compiled classes"
5
+ task :jar do
6
+ sh( './mvnw prepare-package -Dmaven.test.skip=true' )
7
+ end
8
+ namespace :jar do
9
+ desc "Package jopenssl.jar file (and dependendent jars)"
10
+ task :all do
11
+ sh( './mvnw package -Dmaven.test.skip=true' )
33
12
  end
34
13
  end
14
+ task :test_prepare do
15
+ sh( './mvnw prepare-package -Dmaven.test.skip=true' )
16
+ sh( './mvnw test-compile' ) # separate step due -Dmaven.test.skip=true
17
+ end
18
+
19
+ task :clean do
20
+ sh( './mvnw clean' )
21
+ end
35
22
 
36
23
  task :build do
37
- RubyMaven.exec('package -Dmaven.test.skip')
24
+ sh( './mvnw clean package -Dmaven.test.skip=true' )
38
25
  end
39
26
 
40
27
  task :default => :build
@@ -55,16 +42,15 @@ task :test => 'lib/jopenssl.jar'
55
42
  namespace :integration do
56
43
  it_path = File.expand_path('../src/test/integration', __FILE__)
57
44
  task :install do
58
- Dir.chdir(it_path) do
59
- ruby "-S bundle install --gemfile '#{it_path}/Gemfile'"
60
- end
45
+ ruby "-C #{it_path} -S bundle install"
61
46
  end
62
47
  # desc "Run IT tests"
63
48
  task :test => 'lib/jopenssl.jar' do
64
49
  unless File.exist?(File.join(it_path, 'Gemfile.lock'))
65
50
  raise "bundle not installed, run `rake integration:install'"
66
51
  end
67
- loader = "ARGV.each { |f| require f }" ; lib = [ 'lib', it_path ]
52
+ loader = "ARGV.each { |f| require f }"
53
+ lib = [ File.expand_path('../lib', __FILE__), it_path ]
68
54
  test_files = FileList['src/test/integration/*_test.rb'].map { |path| path.sub('src/test/integration/', '') }
69
55
  ruby "-I#{lib.join(':')} -C src/test/integration -e \"#{loader}\" #{test_files.map { |f| "\"#{f}\"" }.join(' ')}"
70
56
  end
data/lib/jopenssl/load.rb CHANGED
@@ -2,8 +2,6 @@ warn 'Loading jruby-openssl gem in a non-JRuby interpreter' unless defined? JRUB
2
2
 
3
3
  require 'jopenssl/version'
4
4
 
5
- warn "JRuby #{JRUBY_VERSION} is not supported by jruby-openssl #{JOpenSSL::VERSION}" if JRUBY_VERSION < '1.7.20'
6
-
7
5
  # NOTE: assuming user does pull in BC .jars from somewhere else on the CP
8
6
  unless ENV_JAVA['jruby.openssl.load.jars'].eql?('false')
9
7
  version = JOpenSSL::BOUNCY_CASTLE_VERSION
@@ -34,17 +32,5 @@ else; require 'jruby'
34
32
  end
35
33
 
36
34
  if RUBY_VERSION > '2.3'
37
- load 'jopenssl23/openssl.rb'
38
35
  load 'jopenssl/_compat23.rb'
39
- elsif RUBY_VERSION > '2.2'
40
- load 'jopenssl22/openssl.rb'
41
- elsif RUBY_VERSION > '2.1'
42
- load 'jopenssl21/openssl.rb'
43
- else
44
- load 'jopenssl19/openssl.rb'
45
- end
46
-
47
- module OpenSSL
48
- autoload :Config, 'openssl/config' unless const_defined?(:Config, false)
49
- autoload :PKCS12, 'openssl/pkcs12'
50
36
  end
@@ -1,5 +1,5 @@
1
1
  module JOpenSSL
2
- VERSION = '0.11.0'
2
+ VERSION = '0.12.1'
3
3
  BOUNCY_CASTLE_VERSION = '1.68'
4
4
  end
5
5
 
data/lib/jopenssl.jar CHANGED
Binary file
data/lib/openssl/bn.rb CHANGED
@@ -1,9 +1,40 @@
1
- if RUBY_VERSION > '2.3'
2
- load "jopenssl23/openssl/#{File.basename(__FILE__)}"
3
- elsif RUBY_VERSION > '2.2'
4
- load "jopenssl22/openssl/#{File.basename(__FILE__)}"
5
- elsif RUBY_VERSION > '2.1'
6
- load "jopenssl21/openssl/#{File.basename(__FILE__)}"
7
- else
8
- load "jopenssl19/openssl/#{File.basename(__FILE__)}"
9
- end
1
+ # frozen_string_literal: true
2
+ #--
3
+ #
4
+ # = Ruby-space definitions that completes C-space funcs for BN
5
+ #
6
+ # = Info
7
+ # 'OpenSSL for Ruby 2' project
8
+ # Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
9
+ # All rights reserved.
10
+ #
11
+ # = Licence
12
+ # This program is licensed under the same licence as Ruby.
13
+ # (See the file 'LICENCE'.)
14
+ #++
15
+
16
+ module OpenSSL
17
+ class BN
18
+ include Comparable
19
+
20
+ def pretty_print(q)
21
+ q.object_group(self) {
22
+ q.text ' '
23
+ q.text to_i.to_s
24
+ }
25
+ end
26
+ end # BN
27
+ end # OpenSSL
28
+
29
+ ##
30
+ #--
31
+ # Add double dispatch to Integer
32
+ #++
33
+ class Integer
34
+ # Casts an Integer as an OpenSSL::BN
35
+ #
36
+ # See `man bn` for more info.
37
+ def to_bn
38
+ OpenSSL::BN::new(self)
39
+ end
40
+ end # Integer