jruby-openssl 0.10.5-java → 0.12.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +50 -0
  3. data/Mavenfile +24 -30
  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 +2 -2
  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/lib/org/bouncycastle/bcpkix-jdk15on/{1.65/bcpkix-jdk15on-1.65.jar → 1.68/bcpkix-jdk15on-1.68.jar} +0 -0
  22. data/lib/org/bouncycastle/bcprov-jdk15on/{1.65/bcprov-jdk15on-1.65.jar → 1.68/bcprov-jdk15on-1.68.jar} +0 -0
  23. data/lib/org/bouncycastle/bctls-jdk15on/1.68/bctls-jdk15on-1.68.jar +0 -0
  24. data/pom.xml +42 -134
  25. metadata +14 -48
  26. data/lib/jopenssl19/openssl/bn.rb +0 -29
  27. data/lib/jopenssl19/openssl/buffering.rb +0 -449
  28. data/lib/jopenssl19/openssl/cipher.rb +0 -28
  29. data/lib/jopenssl19/openssl/config.rb +0 -472
  30. data/lib/jopenssl19/openssl/digest.rb +0 -32
  31. data/lib/jopenssl19/openssl/ssl-internal.rb +0 -223
  32. data/lib/jopenssl19/openssl/ssl.rb +0 -2
  33. data/lib/jopenssl19/openssl/x509-internal.rb +0 -115
  34. data/lib/jopenssl19/openssl/x509.rb +0 -2
  35. data/lib/jopenssl19/openssl.rb +0 -22
  36. data/lib/jopenssl21/openssl/bn.rb +0 -28
  37. data/lib/jopenssl21/openssl/buffering.rb +0 -1
  38. data/lib/jopenssl21/openssl/cipher.rb +0 -1
  39. data/lib/jopenssl21/openssl/config.rb +0 -1
  40. data/lib/jopenssl21/openssl/digest.rb +0 -1
  41. data/lib/jopenssl21/openssl/ssl.rb +0 -1
  42. data/lib/jopenssl21/openssl/x509.rb +0 -119
  43. data/lib/jopenssl21/openssl.rb +0 -22
  44. data/lib/jopenssl22/openssl/bn.rb +0 -39
  45. data/lib/jopenssl22/openssl/buffering.rb +0 -456
  46. data/lib/jopenssl22/openssl/cipher.rb +0 -28
  47. data/lib/jopenssl22/openssl/config.rb +0 -313
  48. data/lib/jopenssl22/openssl/digest.rb +0 -54
  49. data/lib/jopenssl22/openssl/ssl.rb +0 -330
  50. data/lib/jopenssl22/openssl/x509.rb +0 -139
  51. data/lib/jopenssl22/openssl.rb +0 -22
  52. data/lib/jopenssl23/openssl/bn.rb +0 -38
  53. data/lib/jopenssl23/openssl/buffering.rb +0 -455
  54. data/lib/jopenssl23/openssl/cipher.rb +0 -25
  55. data/lib/jopenssl23/openssl/config.rb +0 -474
  56. data/lib/jopenssl23/openssl/digest.rb +0 -43
  57. data/lib/jopenssl23/openssl/pkey.rb +0 -25
  58. data/lib/jopenssl23/openssl/ssl.rb +0 -508
  59. data/lib/jopenssl23/openssl/x509.rb +0 -208
  60. data/lib/jopenssl23/openssl.rb +0 -19
  61. data/lib/openssl/ssl-internal.rb +0 -5
  62. data/lib/openssl/x509-internal.rb +0 -5
  63. data/lib/org/bouncycastle/bctls-jdk15on/1.65/bctls-jdk15on-1.65.jar +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d6499fed6e65be2c2ce456ff6aa60748cf25877
4
- data.tar.gz: eb002de6cd119571cd27844029a92034deb0e585
3
+ metadata.gz: 2b73e2783a26e7aa5254c66e325fa6c824c78b8d
4
+ data.tar.gz: feb0ad37fca2ead87ed151f8c543214f7912508b
5
5
  SHA512:
6
- metadata.gz: d720cada18be2c96df796c93fe545a72b58fc53d24d06781509f50751bafb340886840530b6b469c0c97b66aedff9a13bde58017cff5b1514330a1611ec31464
7
- data.tar.gz: 9eb17b1809536887e1c7beef398bebce95c86ed5ed0d46e43c658396387cec56f7fafbd4098fa4c2f273960faf5cae12fe980131eb6ab56bee8a694fdc75eea5
6
+ metadata.gz: aba588920a82b3a568183ee03bcbee3175c033863654521bfc6a624be84072d510853ea2b457f8742d222e19a230c8ce67592a3df16e1ae625d1b644c7e858bf
7
+ data.tar.gz: ce31f7f99e2352871b2fdefc084eef1d8497a97baacf4a99a6459e39abf0cb35e66a1a4b422e454db6e9433cd6c698b22e07dc1e7688e7c580a397cc0a7ae37b
data/History.md CHANGED
@@ -1,3 +1,53 @@
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
+
21
+ ## 0.11.0
22
+
23
+ NOTE: This release aims to adapt the certificate verification logic to be aligned
24
+ with OpenSSL 1.1.1 as a resolution to issues due *DST Root CA X3* expiration, more
25
+ details at: https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/
26
+
27
+ The port is expected to be superior compared to the simple legacy verification,
28
+ however in case of issues the previous algorithm is still around and can be toggled
29
+ using `JRUBY_OPTS="-J-Djruby.openssl.x509.store.verify=legacy"` system property.
30
+
31
+ * **OpenSSL 1.1.1 cert verification port** (fixes #236) (#239)
32
+ - as a side-effect part of the PR to "allow multiple certs with same SubjectDN"
33
+ (#198) got reverted, this has been causing verification regressions (since 0.10.5)
34
+ for some users (#232) and is expected to be fixed
35
+ * [fix] replace deprecated getPeerCertificateChain (#231)
36
+
37
+ ## 0.10.7
38
+
39
+ * [feat] upgrade BC library to 1.68
40
+ * [fix] SSLContext#ciphers= (fixes #221 and jruby/jruby#3100) (#222)
41
+ * [fix] Java::JavaLang::StringIndexOutOfBoundsException on ctx.cipher=[] (fixes #220) (#223)
42
+ * [fix] SSLContext#ciphers= compatibility (fixes #223) (#220)
43
+ * [fix] Match OpenSSL::X509::Name.hash implementation with Ruby (#216, #218)
44
+ * [fix] OpenSSL::SSL::SSLContext#min_version= failure (#215)
45
+ * [fix] adds OpenSSL::Cipher#iv_len= setter (#208)
46
+
47
+ ## 0.10.6 (yanked)
48
+
49
+ Due several regressions please update to version 0.10.7 or higher.
50
+
1
51
  ## 0.10.5
2
52
 
3
53
  * [fix] EC key sign/verify (#193)
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
91
- jar 'junit:junit', '4.11', :scope => :test
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
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}',
@@ -123,9 +118,8 @@ properties( 'jruby.plugins.version' => '1.1.8',
123
118
  'mavengem-wagon.version' => '1.0.3', # for polyglot-ruby
124
119
  # use this version of jruby for the jruby-maven-plugins
125
120
  'jruby.versions' => MVN_JRUBY_VERSION, 'jruby.version' => MVN_JRUBY_VERSION,
126
- # dump pom.xml as readonly when running 'rmvn'
127
- 'polyglot.dump.pom' => 'pom.xml',
128
- 'polyglot.dump.readonly' => true )
121
+ # dump pom.xml when running 'rmvn'
122
+ 'polyglot.dump.pom' => 'pom.xml', 'polyglot.dump.readonly' => false )
129
123
 
130
124
  # make sure we have the embedded jars in place before we run runit plugin
131
125
  plugin! :dependency do
@@ -152,8 +146,8 @@ invoker_run_options = {
152
146
  'runit.dir' => '${runit.dir}' }
153
147
  }
154
148
 
155
- 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 }
156
- 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 }
157
151
 
158
152
  jruby_9_K_versions.each { |version|
159
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,6 +1,6 @@
1
1
  module JOpenSSL
2
- VERSION = '0.10.5'
3
- BOUNCY_CASTLE_VERSION = '1.65'
2
+ VERSION = '0.12.1'
3
+ BOUNCY_CASTLE_VERSION = '1.68'
4
4
  end
5
5
 
6
6
  Object.class_eval do
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