jruby-openssl 0.9.20-java → 0.10.7-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +132 -1
  3. data/LICENSE.txt +1 -1
  4. data/Mavenfile +49 -69
  5. data/README.md +14 -16
  6. data/Rakefile +4 -0
  7. data/lib/jopenssl/_compat23.rb +71 -0
  8. data/lib/jopenssl/load.rb +21 -12
  9. data/lib/jopenssl/version.rb +8 -10
  10. data/lib/jopenssl.jar +0 -0
  11. data/lib/jopenssl19/openssl/ssl-internal.rb +104 -0
  12. data/lib/jopenssl22/openssl/ssl.rb +16 -16
  13. data/lib/jopenssl23/openssl/bn.rb +2 -1
  14. data/lib/jopenssl23/openssl/buffering.rb +39 -35
  15. data/lib/jopenssl23/openssl/config.rb +12 -11
  16. data/lib/jopenssl23/openssl/digest.rb +1 -1
  17. data/lib/jopenssl23/openssl/pkey.rb +22 -34
  18. data/lib/jopenssl23/openssl/ssl.rb +210 -125
  19. data/lib/jopenssl23/openssl/x509.rb +76 -1
  20. data/lib/jopenssl23/openssl.rb +1 -1
  21. data/lib/openssl/bn.rb +1 -3
  22. data/lib/openssl/buffering.rb +1 -3
  23. data/lib/openssl/cipher.rb +1 -3
  24. data/lib/openssl/config.rb +10 -4
  25. data/lib/openssl/digest.rb +1 -3
  26. data/lib/openssl/pkcs12.rb +1 -3
  27. data/lib/openssl/pkcs5.rb +22 -0
  28. data/lib/openssl/ssl-internal.rb +1 -3
  29. data/lib/openssl/ssl.rb +1 -3
  30. data/lib/openssl/x509-internal.rb +1 -3
  31. data/lib/openssl/x509.rb +1 -3
  32. data/lib/org/bouncycastle/bcpkix-jdk15on/1.68/bcpkix-jdk15on-1.68.jar +0 -0
  33. data/lib/org/bouncycastle/bcprov-jdk15on/1.68/bcprov-jdk15on-1.68.jar +0 -0
  34. data/lib/org/bouncycastle/bctls-jdk15on/1.68/bctls-jdk15on-1.68.jar +0 -0
  35. data/pom.xml +100 -322
  36. metadata +19 -75
  37. data/integration/1.47/pom.xml +0 -15
  38. data/integration/1.48/pom.xml +0 -15
  39. data/integration/1.49/pom.xml +0 -15
  40. data/integration/1.50/pom.xml +0 -15
  41. data/integration/Mavenfile +0 -57
  42. data/integration/pom.xml +0 -122
  43. data/lib/jopenssl18/openssl/bn.rb +0 -25
  44. data/lib/jopenssl18/openssl/buffering.rb +0 -241
  45. data/lib/jopenssl18/openssl/cipher.rb +0 -28
  46. data/lib/jopenssl18/openssl/config.rb +0 -316
  47. data/lib/jopenssl18/openssl/digest.rb +0 -32
  48. data/lib/jopenssl18/openssl/pkcs7.rb +0 -25
  49. data/lib/jopenssl18/openssl/ssl-internal.rb +0 -112
  50. data/lib/jopenssl18/openssl/ssl.rb +0 -1
  51. data/lib/jopenssl18/openssl/x509-internal.rb +0 -110
  52. data/lib/jopenssl18/openssl/x509.rb +0 -1
  53. data/lib/jopenssl18/openssl.rb +0 -23
  54. data/lib/jopenssl24.rb +0 -112
  55. data/lib/openssl/pkcs7.rb +0 -5
  56. data/lib/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar +0 -0
  57. data/lib/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 577486949f6eaa93a6143c4da6663196785ca64a
4
- data.tar.gz: deadd1567288f80226d39a751db2802a12169000
3
+ metadata.gz: 5556d31972e0e74ffc7e20e662b8e1666cce85b0
4
+ data.tar.gz: '0439ad0115cdb8ebef38c1a10a514ee4dc48d58c'
5
5
  SHA512:
6
- metadata.gz: f7aa39d4de5becaa47abd8ad85c5f2f4e83cbdcdfc95293f1294457baf3faa81e0559f443c63a18954ab33dcf4450cbd3f0ba5db63f80a947ef4f41a1b715011
7
- data.tar.gz: f4c3eed0ae106c414ba730b1b78ae045e79c8ea9b1957b5f73a75f796ab1aeb6fd35007dd26fc325363cd8362636333f612baaf93cd6d12561e735126536e807
6
+ metadata.gz: fcd2ba1d6d0e2c43a9f30250c441590a1d1490b271c09ff8f08f014daf48c4f6ad77de55a59d7dc33bef17f93f3b9bdd6fa613418db9a6b7736fe95b6bce2865
7
+ data.tar.gz: 9dbb39508d7f2685c428605493984908c506251e4fcaf15c2dafb3f4ead92e5a556de3687ae273ca602e555cf8c9a8329b697c68a5e9da1794f0b66cf6f1b486
data/History.md CHANGED
@@ -1,10 +1,141 @@
1
+ ## 0.10.7
2
+
3
+ * [feat] upgrade BC library to 1.68
4
+ * [fix] SSLContext#ciphers= (fixes #221 and jruby/jruby#3100) (#222)
5
+ * [fix] Java::JavaLang::StringIndexOutOfBoundsException on ctx.cipher=[] (fixes #220) (#223)
6
+ * [fix] SSLContext#ciphers= compatibility (fixes #223) (#220)
7
+ * [fix] Match OpenSSL::X509::Name.hash implementation with Ruby (#216, #218)
8
+ * [fix] OpenSSL::SSL::SSLContext#min_version= failure (#215)
9
+ * [fix] adds OpenSSL::Cipher#iv_len= setter (#208)
10
+
11
+ ## 0.10.6 (yanked)
12
+
13
+ Due several regressions please update to version 0.10.7 or higher.
14
+
15
+ ## 0.10.5
16
+
17
+ * [fix] EC key sign/verify (#193)
18
+ * [feat] upgrade BC library to 1.65
19
+ * [refactor] clean security helpers to avoid reflection (#197)
20
+ * Just use normal getInstance to get KeyFactory (fixes #197)
21
+ * Allow multiple Certificates with the same SubjectDN in the store (#198)
22
+ * Try direct path for MessageDigest before invasive path (#194)
23
+ (relates to jruby/jruby#6098)
24
+ * [refactor] avoid NativeException usage (jruby/jruby#5646)
25
+
26
+ ## 0.10.4
27
+
28
+ * Use CertificateFactory.getInstance rather than reflection
29
+ eliminates one of the module warnings we have been seeing (#161)
30
+
31
+ ## 0.10.3
32
+
33
+ * [fix] implement (missing) PKey::DSA#params
34
+ * [fix] authorityKeyIdentifier ext (general-name) value
35
+ * [fix] authority keyid extension's :always part optional (#174)
36
+ * [fix] work-around for not setting certificate serial
37
+ raise a more friendly error (jruby/jruby#1691)
38
+ * [fix] PKey.read not parsing RSA pub-key (#176)
39
+ * [feat] support reading DSA (public key) in full DER
40
+ * [fix] RSA key DER format to closely follow OpenSSL
41
+ * [fix] add missing ASN1 factory methods (Null, EndOfContent)
42
+ * [fix] support getting password from block for PKeys
43
+ * [fix] incorrect ASN.1 for wrapped Integer type
44
+ * [fix] correct public key for subjectKeyIdentifier ext (#173)
45
+ * [fix] invalid Cert#sign handling -> raise (instead of ClassCastException)
46
+ * [feat] more TLS (GCM) ciphers - supported on Java 8+
47
+ * [feat] add ECDHE-RSA-AES128-GCM-SHA256 as supported cipher (#185)
48
+ * [feat] add support for ECDHE-RSA-AES256-GCM-SHA384 (#187)
49
+ * [fix] try hard not to fail on unkown oids (OpenSSL::X509::Certificate#to_text)
50
+ * update Bouncy-Castle to 1.62 (and handle supported BC compatibility)
51
+
52
+ ## 0.10.2
53
+
54
+ * update Bouncy-Castle to 1.61 (and handle supported BC compatibility)
55
+ * [fix] avoid NPE when CRL fails to parse (invalid str) (jruby/jruby#5619)
56
+ * hide (deprecated) Jopenssl constant
57
+ * default OpenSSL.warn to warnings-enabled flag
58
+ * only un-restrict jce when its restricted
59
+ * OpenSSL::Cipher#update additional buffer argument (#170) (jruby/jruby#5242)
60
+
61
+ ## 0.10.1
62
+
63
+ * loading JOpenSSL's native ext part the JRuby 9.2 (internal) way
64
+ * avoid, once again, installing BC provider on boot (due OCSP support)
65
+ * [feat] support OpenSSL::KDF as a (semi) OpenSSL::PKCS5 replacement
66
+ * rename ugly-sh "Jopenssl" constant to **JOpenSSL**
67
+ * support PKCS7#decrypt with 1 argument (pkey only - without certificate)
68
+ * undo some of the call-sites in SSLSocket - account for sub-classes (#165)
69
+ * follow-up to provide == for X.509 types (like C-OpenSSL does in 2.1)
70
+ * validate iter parameter on Cipher#pkcs5_keyivgen (since OpenSSL 2.0.8)
71
+ * remove openssl/pkcs7.rb -> since 1.8 no longer supported
72
+
73
+ ## 0.10.0
74
+
75
+ **NOTE:** dropped support for anything below ~ JRuby 1.7.20
76
+
77
+ * drop support for Java 1.6 and compile using Java 7
78
+ * improve java.version detection for Java 9/10 (pre-releases)
79
+ * subject alt name parsing fixes (#140) - thanks @roadrunner2
80
+ * fix loading of Subject/Issuer-Alt-Name extensions. (#144)
81
+ * normalize all constants in CipherStrings as public (#146)
82
+ * upgrade BC to **1.59** and dropped support for BC < 1.55
83
+ * include BC's JSSE provider as we're planning on using it, eventually
84
+ * setup OpenSSL::ExtConfig emulation - mostly (conservative) guesses
85
+ * at last, do BN comparison `==` vs `eql?` properly - just like MRI
86
+ * get `BN.new("...", 0)` working as OpenSSL does - using MPI format
87
+ * allow for SSLContext#dup to work (copy-ing Ruby level i-vars only)
88
+ * fix signature-alg to default to NULL and report it as 0.0 (like MRI)
89
+ * account for ASN1Integers when transforming issuer serial numbers
90
+ to_text in AuthorityKeyIdentifier extensions (#147) - thanks @lampad
91
+ * copy bytes since it might be a shared (unsafe) buffer (#150)
92
+ * don't use padding for streaming cipher modes (#155) - thanks @dgolombek
93
+ * avoid ByteList#length() usage for forward (JRuby 9.2) compatibility
94
+ * prepare for using BC's JSSE implementation as an SSL support backend
95
+ allow to set SSL provider name (-Djruby.openssl.ssl.provider=...)
96
+
97
+ ## 0.9.21
98
+
99
+ * adjust X.509 value handling to parse subjectAltName recursively (#134)
100
+ * SKI expected to be always octet wrapped - do not check for length (#131)
101
+ * respect jruby.preferred.prng and use/tune its SecureRandom defaults
102
+ trying to avoid BC generator's constant attempts for seeding itself
103
+ as an attempt to 'fix' low-entropy systems wating for */dev/random*
104
+ * Random#add; Random#egd shall return true on JVM
105
+ * move "DEFAULT" special case handling to match OpenSSL behaviour (#136)
106
+ (jruby/jruby#2193)
107
+ * If data is not provided, extract it from the PKCS7 instance (#132)
108
+ * Add cipher suite strings for IBM JRE (#126) - thanks @ysohda
109
+ * use the helper to printStackTrace (no System.err printing by default)
110
+ * add OCSP support (#124) - thanks so very much @lampad
111
+ * add support for renegotiation_cb on SSLContext (#121) - thanks @lampad
112
+
113
+ ## 0.9.20
114
+
115
+ * upgrade Bouncy-Castle to 1.56 http://bouncycastle.org/releasenotes.html
116
+ (additional security and robustness with 10 CVEs submitted as a result)
117
+ * add a dummy SSLContext#security_level= implementation
118
+ * no dup-ing for SSLContext/SSLSocket and X509 Store/StoreContext
119
+ * implement PKey initialize_copy (dup-ing)
120
+ * digest can be passed in as a String on PKey#sign/verify
121
+ * DSA+SHA1 is actually a supported algorithm
122
+ * reset signed-request -> sub-sequent req.verify will work correctly
123
+ * allow for digest name to be passed into Cert#sign
124
+ * be less fatal on Java 9
125
+ won't attempt reflective SPIs when accessibility checks fail!
126
+ * remove obsolete (deprecated) renamed classes
127
+ * verify correct WaitReadable is raised on connect_nonblock (jruby/jruby#1716)
128
+ * non-connected ssl socket raises EPIPE on connect_nonblock (MRI compat)
129
+ * fine to close a SSLSocket which is not-yet-connected (like in MRI)
130
+ * fix NPE when reading private keys (with passwd) (jruby/jruby#1784)
131
+
1
132
  ## 0.9.19
2
133
 
3
134
  * re-use secure random from thread-context on SSL context initialization
4
135
  * preliminary OpenSSL 1.1 (Ruby 2.4) compatibility bits (#112)
5
136
  * try using thread-shared secure random gen (in PKey-s) where possible
6
137
  * implement PKeyDSA#syssign and PKeyDSA#sysverify methods
7
- * avoid (unnecessary) byte[] copies in PKey#sign/verify
138
+ * avoid (unnecessary) byte[] copies in PKey#sign/verify
8
139
  * fix ClassCastException error in X509Store.verify (#113)
9
140
  * align BH#hash with eql? (+ equals/hashCode on Java)
10
141
 
data/LICENSE.txt CHANGED
@@ -18,7 +18,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
18
  DEALINGS IN THE SOFTWARE.
19
19
 
20
20
  Copyright (C) 2007-2009 Ola Bini <ola.bini@gmail.com>
21
- Copyright (C) 2009-2017 The JRuby Team
21
+ Copyright (C) 2009-2018 The JRuby Team
22
22
 
23
23
  Alternatively, the contents of this file may be used under the terms of
24
24
  either of the GNU General Public License Version 2 or later (the "GPL"),
data/Mavenfile CHANGED
@@ -2,15 +2,12 @@
2
2
 
3
3
  gemspec :jar => 'jopenssl', :include_jars => true
4
4
 
5
- sonatype_url = 'https://oss.sonatype.org/content/repositories/snapshots/'
6
- snapshot_repository :id => 'sonatype', :url => sonatype_url
7
-
8
5
  distribution_management do
9
6
  snapshot_repository :id => :ossrh, :url => 'https://oss.sonatype.org/content/repositories/snapshots'
10
7
  repository :id => :ossrh, :url => 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
11
8
  end
12
9
 
13
- java_target = '1.6'
10
+ java_target = '1.7'
14
11
  gen_sources = '${basedir}/target/generated-sources' # hard-coded in AnnotationBinder
15
12
 
16
13
  plugin( 'org.codehaus.mojo:exec-maven-plugin', '1.3.2' ) do
@@ -49,13 +46,14 @@ plugin( 'org.codehaus.mojo:build-helper-maven-plugin', '1.9' ) do
49
46
  end
50
47
 
51
48
  plugin( :compiler, '3.1',
52
- :source => java_target, :target => java_target,
49
+ :source => '1.7', :target => java_target,
53
50
  :encoding => 'UTF-8', :debug => true,
54
51
  :showWarnings => true, :showDeprecation => true,
52
+ :excludes => [ 'module-info.java' ],
53
+ #:jdkToolchain => { :version => '[1.7,11)' },
55
54
 
56
55
  :generatedSourcesDirectory => gen_sources,
57
- :annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ],
58
- :compilerArgs => [ '-XDignore.symbol.file=true' ] ) do
56
+ :annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ]) do
59
57
 
60
58
  #execute_goal :compile, :id => 'annotation-binder', :phase => 'compile',
61
59
  # :generatedSourcesDirectory => gen_sources, #:outputDirectory => gen_sources,
@@ -64,10 +62,19 @@ plugin( :compiler, '3.1',
64
62
  # :useIncrementalCompilation => false, :fork => true, :verbose => true,
65
63
  # :compilerArgs => [ '-XDignore.symbol.file=true', '-J-Dfile.encoding=UTF-8' ]
66
64
 
67
- execute_goal :compile, :id => 'compile-populators', :phase => 'process-classes',
68
- :includes => [ 'org/jruby/gen/**/*.java' ], :optimize => true,
69
- :compilerArgs => [ '-XDignore.symbol.file=true' ]
70
- # NOTE: maybe '-J-Xbootclasspath/p:${unsafe.jar}' ... as well ?!
65
+ execute_goal :compile,
66
+ :id => 'compile-populators', :phase => 'process-classes',
67
+ :includes => [ 'org/jruby/gen/**/*.java' ],
68
+ :optimize => true,
69
+ :compilerArgs => [ '', '-XDignore.symbol.file=true' ]
70
+ end
71
+
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' ]
71
78
  end
72
79
 
73
80
  plugin :clean do
@@ -80,49 +87,52 @@ plugin :clean do
80
87
  'failOnError' => 'false' )
81
88
  end
82
89
 
83
- # NOTE: unfortunately we can not use 1.6.8 to generate invokers ...
84
- # although we'd like to compile against 1.6 to make sure all is well
85
- jar 'org.jruby:jruby-core', '1.7.17', :scope => :provided # 1.6.8
86
- jar 'junit:junit', '4.11', :scope => :test
90
+ jar 'org.jruby:jruby-core', '1.7.20', :scope => :provided
91
+ jar 'junit:junit', '[4.13.1,)', :scope => :test
92
+
93
+ # 9.1.17.0 is Java 7 compatible (till supporting JRuby 1.7)
94
+ # NOTE: to build on Java 11 - installing gems fails (due old jossl) with:
95
+ # 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'
87
97
 
88
98
  jruby_plugin! :gem do
89
- # when installing dependent gems we want to use the built in openssl
90
- # not the one from this lib directory
91
- # we compile against jruby-core-1.7.17 and want to keep this out of
92
- # the plugin execution here
99
+ # 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
93
101
  execute_goal :id => 'default-initialize', :addProjectClasspath => false, :libDirectory => 'something-which-does-not-exists'
94
102
  execute_goals :id => 'default-push', :skip => true
95
103
  end
96
104
 
97
- # we want to have the snapshots on oss.sonatype.org and the released gems
98
- # on maven central
105
+ # we want to have the snapshots on oss.sonatype.org and the released gems on maven central
99
106
  plugin :deploy, '2.8.1' do
100
107
  execute_goals( :deploy, :skip => false )
101
108
  end
102
109
 
103
- supported_bc_versions = %w{ 1.51 1.52 1.53 1.54 } # due EC support dropped <= 1.50
110
+ supported_bc_versions = %w{ 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 }
104
111
 
105
- default_bc_version = File.expand_path('lib/jopenssl/version.rb', File.dirname(__FILE__))
112
+ default_bc_version = File.read File.expand_path('lib/jopenssl/version.rb', File.dirname(__FILE__))
106
113
  default_bc_version = default_bc_version[/BOUNCY_CASTLE_VERSION\s?=\s?'(.*?)'/, 1]
107
114
 
108
- properties( 'jruby.plugins.version' => '1.0.10',
109
- 'jruby.versions' => '1.7.18',
115
+ properties( 'jruby.plugins.version' => '1.1.8',
116
+ 'jruby.switches' => '-W0', # https://github.com/torquebox/jruby-maven-plugins/issues/94
110
117
  'bc.versions' => default_bc_version,
111
118
  'invoker.test' => '${bc.versions}',
112
119
  # allow to skip all tests with -Dmaven.test.skip
113
120
  'invoker.skip' => '${maven.test.skip}',
114
121
  'runit.dir' => 'src/test/ruby/**/test_*.rb',
115
- # use this version of jruby for ALL the jruby-maven-plugins
116
- 'jruby.version' => '1.7.18',
117
- # dump pom.xml as readonly when running 'rmvn'
118
- 'polyglot.dump.pom' => 'pom.xml',
119
- 'polyglot.dump.readonly' => true,
120
- 'tesla.dump.pom' => 'pom.xml',
121
- 'tesla.dump.readonly' => true )
122
+ 'mavengem.wagon.version' => '1.0.3', # for jruby plugin
123
+ 'mavengem-wagon.version' => '1.0.3', # for polyglot-ruby
124
+ # use this version of jruby for the jruby-maven-plugins
125
+ 'jruby.versions' => MVN_JRUBY_VERSION, 'jruby.version' => MVN_JRUBY_VERSION,
126
+ # dump pom.xml when running 'rmvn'
127
+ 'polyglot.dump.pom' => 'pom.xml', 'polyglot.dump.readonly' => false )
122
128
 
123
129
  # make sure we have the embedded jars in place before we run runit plugin
124
130
  plugin! :dependency do
125
- execute_goal 'copy-dependencies', :phase => 'generate-test-resources', :outputDirectory => '${basedir}/lib', :useRepositoryLayout => true, :includeGroupIds => 'org.bouncycastle'
131
+ execute_goal 'copy-dependencies',
132
+ :phase => 'generate-test-resources',
133
+ :outputDirectory => '${basedir}/lib',
134
+ :useRepositoryLayout => true,
135
+ :includeGroupIds => 'org.bouncycastle'
126
136
  end
127
137
 
128
138
  jruby_plugin(:runit) { execute_goal( :test, :runitDirectory => '${runit.dir}' ) }
@@ -141,54 +151,24 @@ invoker_run_options = {
141
151
  'runit.dir' => '${runit.dir}' }
142
152
  }
143
153
 
144
- profile :id => 'test-1.6.8' do
145
- plugin :invoker, '1.8' do
146
- execute_goals( :install, :run, invoker_run_options )
147
- end
148
- properties 'jruby.versions' => '1.6.8', 'jruby.modes' => '1.8,1.9',
149
- 'bc.versions' => supported_bc_versions.join(',')
150
- end
151
-
152
- profile :id => 'test-1.7.4' do
153
- plugin :invoker, '1.8' do
154
- execute_goals( :install, :run, invoker_run_options )
155
- end
156
- properties 'jruby.versions' => '1.7.4', 'jruby.modes' => '1.8,1.9',
157
- 'bc.versions' => supported_bc_versions.join(',')
158
- end
159
-
160
- jruby_1_7_versions = %w{ 1.7.13 1.7.15 1.7.16 1.7.18 1.7.20 1.7.22 1.7.23 }
161
- jruby_1_7_versions += %w{ 1.7.24 1.7.25 1.7.26 }
162
-
163
- jruby_1_7_versions.each { |version|
164
-
165
- profile :id => "test-#{version}" do
166
- plugin :invoker, '1.8' do
167
- execute_goals( :install, :run, invoker_run_options )
168
- end
169
- properties 'jruby.versions' => version, 'jruby.modes' => '1.8,1.9,2.0',
170
- 'bc.versions' => supported_bc_versions.join(',')
171
- end
172
-
173
- }
174
-
175
- jruby_9_K_versions = %w{ 9.0.1.0 9.0.5.0 9.1.0.0 9.1.1.0 9.1.2.0 9.1.5.0 }
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 }
176
156
 
177
157
  jruby_9_K_versions.each { |version|
178
158
  profile :id => "test-#{version}" do
179
159
  plugin :invoker, '1.8' do
180
160
  execute_goals( :install, :run, invoker_run_options )
181
161
  end
182
- # NOTE: we're work-around 9K maven-runit version bug (due minitest changes) !
183
- # ... still can not build with 9K : https://github.com/jruby/jruby/issues/3184
184
- properties 'jruby.version' => version, 'jruby.versions' => version,
162
+ properties 'jruby.version' => version,
163
+ 'jruby.versions' => version,
185
164
  'bc.versions' => supported_bc_versions.join(',')
186
165
  end
187
166
  }
188
167
 
189
168
  profile :id => 'release' do
190
- plugin :gpg, '1.5' do
169
+ plugin :gpg, '1.6' do
191
170
  execute_goal :sign, :phase => :verify
192
171
  end
193
172
  end
173
+
194
174
  # vim: syntax=Ruby
data/README.md CHANGED
@@ -16,12 +16,14 @@ the JRuby [mailing list][1] or the [bug tracker][2].
16
16
 
17
17
  | JRuby-OpenSSL | JRuby compat | JVM compat | supported BC |
18
18
  | ------------- |:-------------:| ----------:| ------------:|
19
- | 0.9.6 | 1.6.8-9.0.2 | Java 6-8 | 1.47-1.50 |
20
- | 0.9.12 | 1.6.8-9.0.5 | Java 6-8 | 1.47-1.52 |
21
- | 0.9.13 | 1.6.8-9.1.2 | Java 6-8 | 1.49-1.52 |
22
- | 0.9.14 | 1.6.8-9.1.5 | Java 6-8 | 1.49-1.54 |
23
- | 0.9.17 | 1.6.8-9.1.5 | Java 6-8 | 1.50-1.54 |
24
- | 0.9.18 | 1.6.8-9.1.7 | Java 6-8 | 1.50-1.55 |
19
+ | 0.9.6 | 1.6.8-9.0.2 | Java 6-8 | 1.47-1.50 |
20
+ | 0.9.12 | 1.6.8-9.0.5 | Java 6-8 | 1.47-1.52 |
21
+ | 0.9.13 | 1.6.8-9.1.2 | Java 6-8 | 1.49-1.52 |
22
+ | 0.9.14 | 1.6.8-9.1.5 | Java 6-8 | 1.49-1.54 |
23
+ | 0.9.17 | 1.6.8-9.1.5 | Java 6-8 | 1.50-1.54 |
24
+ | ~>0.9.18 | 1.6.8-9.1.x | Java 6-8 | 1.50-1.55 |
25
+ | 0.10.0 | 1.7.20-9.2.x | Java 7-10 | 1.55-1.59 |
26
+ | 0.10.3 | 1.7.20-9.2.x | Java 7-11 | 1.56-1.62 |
25
27
 
26
28
  NOTE: backwards JRuby compatibility was not handled for versions <= **0.9.6**
27
29
 
@@ -41,30 +43,26 @@ any of OpenSSL's C code, only Ruby parts (*.rb) are the same as in MRI's OpenSSL
41
43
  mvn test
42
44
 
43
45
  will run (junit as well as ruby) tests and a some ruby tests against the default
44
- jruby version. to pick a different version and/or modes (1.8, 1.9, 2.0, 2.1) run
46
+ jruby version. to pick a different JRuby version run
45
47
 
46
- mvn test -Djruby.versions=1.7.12 -Djruby.modes=1.8
48
+ mvn test -Djruby.versions=9.2.8.0
47
49
 
48
50
  for running integration-tests the gem will be first installed and then the same
49
51
  tests run for each possible bouncy-castle version (see [listing][3]), run with
50
52
 
51
- mvn verify -P test-9.0.4.0,test-1.7.22
53
+ mvn verify -P test-9.2.9.0,test-9.1.17.0
52
54
 
53
55
  or pick a bouncy-castle version
54
56
 
55
- mvn verify -P test-1.6.8 -Dbc.versions=1.50
56
-
57
- or simply be more picky
58
-
59
- mvn verify -P test-1.7.4 -Dbc.versions=1.49 -Djruby.modes=1.9
57
+ mvn verify -P test-9.2.9.0 -Dbc.versions=1.60
60
58
 
61
59
  NOTE: you can pick any jruby version which is on [central][4] or on [ci.jruby][5]
62
60
 
63
61
  ## License
64
62
 
65
- (c) 2009-2017 JRuby distributed under EPL 1.0/GPL 2.0/LGPL 2.1
63
+ (c) 2009-2020 JRuby distributed under EPL 1.0/GPL 2.0/LGPL 2.1
66
64
 
67
- [0]: https://secure.travis-ci.org/jruby/jruby-openssl.png
65
+ [0]: https://secure.travis-ci.org/jruby/jruby-openssl.svg
68
66
  [1]: http://xircles.codehaus.org/projects/jruby/lists
69
67
  [2]: https://github.com/jruby/jruby/issues
70
68
  [3]: https://github.com/jruby/jruby-openssl/tree/master/integration
data/Rakefile CHANGED
@@ -27,6 +27,10 @@ else
27
27
  RubyMaven.exec( 'package -Dmaven.test.skip=true' )
28
28
  end
29
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
33
+ end
30
34
  end
31
35
 
32
36
  task :build do
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: false
2
+
3
+ module OpenSSL
4
+
5
+ module PKey
6
+
7
+ class DH
8
+
9
+ def set_key(pub_key, priv_key)
10
+ self.pub_key = pub_key
11
+ self.priv_key = priv_key
12
+ self
13
+ end
14
+
15
+ def set_pqg(p, q, g)
16
+ self.p = p
17
+ if respond_to?(:q)
18
+ self.q = q
19
+ else # TODO self.q = q
20
+ OpenSSL.warn "JRuby-OpenSSL does not support setting q param on #{inspect}" if q
21
+ end
22
+ self.g = g
23
+ self
24
+ end
25
+
26
+ end
27
+
28
+ class DSA
29
+
30
+ def set_key(pub_key, priv_key)
31
+ self.pub_key = pub_key
32
+ self.priv_key = priv_key
33
+ self
34
+ end
35
+
36
+ def set_pqg(p, q, g)
37
+ self.p = p
38
+ self.q = q
39
+ self.g = g
40
+ self
41
+ end
42
+
43
+ end
44
+
45
+ class RSA
46
+
47
+ def set_key(n, e, d)
48
+ self.n = n
49
+ self.e = e
50
+ self.d = d
51
+ self
52
+ end
53
+
54
+ def set_factors(p, q)
55
+ self.p = p
56
+ self.q = q
57
+ self
58
+ end
59
+
60
+ def set_crt_params(dmp1, dmq1, iqmp)
61
+ self.dmp1 = dmp1
62
+ self.dmq1 = dmq1
63
+ self.iqmp = iqmp
64
+ self
65
+ end
66
+
67
+ end
68
+
69
+ end
70
+
71
+ end
data/lib/jopenssl/load.rb CHANGED
@@ -1,41 +1,50 @@
1
- warn 'Loading jruby-openssl in a non-JRuby interpreter' unless defined? JRUBY_VERSION
1
+ warn 'Loading jruby-openssl gem in a non-JRuby interpreter' unless defined? JRUBY_VERSION
2
2
 
3
- require 'java'
4
3
  require 'jopenssl/version'
5
4
 
5
+ warn "JRuby #{JRUBY_VERSION} is not supported by jruby-openssl #{JOpenSSL::VERSION}" if JRUBY_VERSION < '1.7.20'
6
+
6
7
  # NOTE: assuming user does pull in BC .jars from somewhere else on the CP
7
8
  unless ENV_JAVA['jruby.openssl.load.jars'].eql?('false')
8
- version = Jopenssl::Version::BOUNCY_CASTLE_VERSION
9
+ version = JOpenSSL::BOUNCY_CASTLE_VERSION
9
10
  bc_jars = nil
10
11
  begin
11
12
  require 'jar-dependencies'
12
13
  # if we have jar-dependencies we let it track the jars
13
- require_jar( 'org.bouncycastle', 'bcpkix-jdk15on', version )
14
14
  require_jar( 'org.bouncycastle', 'bcprov-jdk15on', version )
15
+ require_jar( 'org.bouncycastle', 'bcpkix-jdk15on', version )
16
+ require_jar( 'org.bouncycastle', 'bctls-jdk15on', version )
15
17
  bc_jars = true
16
18
  rescue LoadError
19
+ bc_jars = false
17
20
  end
18
21
  unless bc_jars
19
- load "org/bouncycastle/bcpkix-jdk15on/#{version}/bcpkix-jdk15on-#{version}.jar"
20
22
  load "org/bouncycastle/bcprov-jdk15on/#{version}/bcprov-jdk15on-#{version}.jar"
23
+ load "org/bouncycastle/bcpkix-jdk15on/#{version}/bcpkix-jdk15on-#{version}.jar"
24
+ load "org/bouncycastle/bctls-jdk15on/#{version}/bctls-jdk15on-#{version}.jar"
21
25
  end
22
26
  end
23
27
 
24
- require 'jruby'
25
28
  require 'jopenssl.jar'
26
- org.jruby.ext.openssl.OpenSSL.load(JRuby.runtime)
29
+
30
+ if JRuby::Util.respond_to?(:load_ext) # JRuby 9.2
31
+ JRuby::Util.load_ext('org.jruby.ext.openssl.OpenSSL')
32
+ else; require 'jruby'
33
+ org.jruby.ext.openssl.OpenSSL.load(JRuby.runtime)
34
+ end
27
35
 
28
36
  if RUBY_VERSION > '2.3'
29
37
  load 'jopenssl23/openssl.rb'
30
- load 'jopenssl24.rb' if RUBY_VERSION >= '2.4'
38
+ load 'jopenssl/_compat23.rb'
31
39
  elsif RUBY_VERSION > '2.2'
32
40
  load 'jopenssl22/openssl.rb'
33
41
  elsif RUBY_VERSION > '2.1'
34
42
  load 'jopenssl21/openssl.rb'
35
- elsif RUBY_VERSION > '1.9'
36
- load 'jopenssl19/openssl.rb'
37
43
  else
38
- load 'jopenssl18/openssl.rb'
44
+ load 'jopenssl19/openssl.rb'
39
45
  end
40
46
 
41
- require 'openssl/pkcs12'
47
+ module OpenSSL
48
+ autoload :Config, 'openssl/config' unless const_defined?(:Config, false)
49
+ autoload :PKCS12, 'openssl/pkcs12'
50
+ end
@@ -1,11 +1,9 @@
1
- module Jopenssl
2
- VERSION = '0.9.20'
3
- BOUNCY_CASTLE_VERSION = '1.56'
4
- # @deprecated
5
- module Version
6
- # @private
7
- VERSION = Jopenssl::VERSION
8
- # @private
9
- BOUNCY_CASTLE_VERSION = Jopenssl::BOUNCY_CASTLE_VERSION
10
- end
1
+ module JOpenSSL
2
+ VERSION = '0.10.7'
3
+ BOUNCY_CASTLE_VERSION = '1.68'
4
+ end
5
+
6
+ Object.class_eval do
7
+ Jopenssl = JOpenSSL
8
+ private_constant :Jopenssl if respond_to?(:private_constant)
11
9
  end
data/lib/jopenssl.jar CHANGED
Binary file