jruby-openssl-maven 0.7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. data/History.txt +171 -0
  2. data/License.txt +30 -0
  3. data/Manifest.txt +115 -0
  4. data/README.txt +13 -0
  5. data/Rakefile +79 -0
  6. data/lib/jopenssl.jar +0 -0
  7. data/lib/jopenssl/version.rb +5 -0
  8. data/lib/openssl.rb +76 -0
  9. data/lib/openssl/bn.rb +35 -0
  10. data/lib/openssl/buffering.rb +239 -0
  11. data/lib/openssl/cipher.rb +65 -0
  12. data/lib/openssl/config.rb +316 -0
  13. data/lib/openssl/digest.rb +61 -0
  14. data/lib/openssl/dummy.rb +33 -0
  15. data/lib/openssl/dummyssl.rb +14 -0
  16. data/lib/openssl/pkcs7.rb +25 -0
  17. data/lib/openssl/ssl.rb +179 -0
  18. data/lib/openssl/x509.rb +154 -0
  19. data/test/cert_with_ec_pk.cer +27 -0
  20. data/test/fixture/ca-bundle.crt +2794 -0
  21. data/test/fixture/ca_path/72fa7371.0 +19 -0
  22. data/test/fixture/ca_path/verisign.pem +19 -0
  23. data/test/fixture/cacert.pem +23 -0
  24. data/test/fixture/cert_localhost.pem +19 -0
  25. data/test/fixture/common.pem +48 -0
  26. data/test/fixture/imaps/cacert.pem +60 -0
  27. data/test/fixture/imaps/server.crt +61 -0
  28. data/test/fixture/imaps/server.key +15 -0
  29. data/test/fixture/key_then_cert.pem +34 -0
  30. data/test/fixture/keypair.pem +27 -0
  31. data/test/fixture/localhost_keypair.pem +18 -0
  32. data/test/fixture/max.pem +29 -0
  33. data/test/fixture/purpose/b70a5bc1.0 +24 -0
  34. data/test/fixture/purpose/ca/PASSWD_OF_CA_KEY_IS_1234 +0 -0
  35. data/test/fixture/purpose/ca/ca_config.rb +37 -0
  36. data/test/fixture/purpose/ca/cacert.pem +24 -0
  37. data/test/fixture/purpose/ca/newcerts/2_cert.pem +19 -0
  38. data/test/fixture/purpose/ca/newcerts/3_cert.pem +19 -0
  39. data/test/fixture/purpose/ca/private/cakeypair.pem +30 -0
  40. data/test/fixture/purpose/ca/serial +1 -0
  41. data/test/fixture/purpose/cacert.pem +24 -0
  42. data/test/fixture/purpose/scripts/gen_cert.rb +127 -0
  43. data/test/fixture/purpose/scripts/gen_csr.rb +50 -0
  44. data/test/fixture/purpose/scripts/init_ca.rb +66 -0
  45. data/test/fixture/purpose/sslclient.pem +19 -0
  46. data/test/fixture/purpose/sslclient/csr.pem +10 -0
  47. data/test/fixture/purpose/sslclient/keypair.pem +15 -0
  48. data/test/fixture/purpose/sslclient/sslclient.pem +19 -0
  49. data/test/fixture/purpose/sslserver.pem +19 -0
  50. data/test/fixture/purpose/sslserver/csr.pem +10 -0
  51. data/test/fixture/purpose/sslserver/keypair.pem +15 -0
  52. data/test/fixture/purpose/sslserver/sslserver.pem +19 -0
  53. data/test/fixture/selfcert.pem +23 -0
  54. data/test/fixture/verisign.pem +19 -0
  55. data/test/fixture/verisign_c3.pem +14 -0
  56. data/test/java/pkcs7_mime_enveloped.message +19 -0
  57. data/test/java/pkcs7_mime_signed.message +30 -0
  58. data/test/java/pkcs7_multipart_signed.message +45 -0
  59. data/test/java/test_java_attribute.rb +25 -0
  60. data/test/java/test_java_bio.rb +42 -0
  61. data/test/java/test_java_mime.rb +173 -0
  62. data/test/java/test_java_pkcs7.rb +772 -0
  63. data/test/java/test_java_smime.rb +177 -0
  64. data/test/openssl/ssl_server.rb +99 -0
  65. data/test/openssl/test_asn1.rb +197 -0
  66. data/test/openssl/test_cipher.rb +193 -0
  67. data/test/openssl/test_config.rb +290 -0
  68. data/test/openssl/test_digest.rb +88 -0
  69. data/test/openssl/test_ec.rb +128 -0
  70. data/test/openssl/test_hmac.rb +46 -0
  71. data/test/openssl/test_ns_spki.rb +59 -0
  72. data/test/openssl/test_pair.rb +141 -0
  73. data/test/openssl/test_pkcs7.rb +489 -0
  74. data/test/openssl/test_pkey_rsa.rb +49 -0
  75. data/test/openssl/test_ssl.rb +1035 -0
  76. data/test/openssl/test_x509cert.rb +277 -0
  77. data/test/openssl/test_x509crl.rb +253 -0
  78. data/test/openssl/test_x509ext.rb +99 -0
  79. data/test/openssl/test_x509name.rb +290 -0
  80. data/test/openssl/test_x509req.rb +195 -0
  81. data/test/openssl/test_x509store.rb +246 -0
  82. data/test/openssl/utils.rb +144 -0
  83. data/test/ref/a.out +0 -0
  84. data/test/ref/compile.rb +8 -0
  85. data/test/ref/pkcs1 +0 -0
  86. data/test/ref/pkcs1.c +21 -0
  87. data/test/test_all.rb +1 -0
  88. data/test/test_certificate.rb +123 -0
  89. data/test/test_cipher.rb +197 -0
  90. data/test/test_imaps.rb +107 -0
  91. data/test/test_integration.rb +144 -0
  92. data/test/test_java.rb +98 -0
  93. data/test/test_openssl.rb +4 -0
  94. data/test/test_parse_certificate.rb +27 -0
  95. data/test/test_pkcs7.rb +40 -0
  96. data/test/test_pkey.rb +204 -0
  97. data/test/test_ssl.rb +97 -0
  98. data/test/test_x509store.rb +160 -0
  99. data/test/ut_eof.rb +128 -0
  100. metadata +161 -0
@@ -0,0 +1,171 @@
1
+ == 0.7.4
2
+
3
+ - JRUBY-5519: Avoid String encoding dependency in DER loading. PEM loading failed on JRuby 1.6.x. Fixed.
4
+ - JRUBY-5510: Add debug information to released jar
5
+ - JRUBY-5478: Update bouncycastle jars to the latest version. (1.46)
6
+
7
+ == 0.7.3
8
+
9
+ - JRUBY-5200: Net::IMAP + SSL(imaps) login could hang. Fixed.
10
+ - JRUBY-5253: Allow to load the certificate file which includes private
11
+ key for activemarchant compatibility.
12
+ - JRUBY-5267: Added SSL socket error-checks to avoid busy loop under an
13
+ unknown condition.
14
+ - JRUBY-5316: Improvements for J9's IBMJCE support. Now all testcases
15
+ pass on J9 JDK 6.
16
+
17
+ == 0.7.2
18
+
19
+ - JRUBY-5126: Ignore Cipher#reset and Cipher#iv= when it's a stream
20
+ cipher (Net::SSH compatibility)
21
+ - JRUBY-5125: let Cipher#name for 'rc4' to be 'RC4' (Net::SSH
22
+ compatibility)
23
+ - JRUBY-5096: Fixed inconsistent Certificate verification behavior
24
+ - JRUBY-5060: Avoid NPE from to_pem for empty X509 Objects
25
+ - JRUBY-5059: SSLSocket ignores Timeout (Fixed)
26
+ - JRUBY-4965: implemented OpenSSL::Config
27
+ - JRUBY-5023: make Certificate#signature_algorithm return correct algo
28
+ name; "sha1WithRSAEncryption" instead of "SHA1"
29
+ - JRUBY-5024: let HMAC.new accept a String as a digest name
30
+ - JRUBY-5018: SSLSocket holds selectors, keys, preventing quick
31
+ cleanup of resources when dereferenced
32
+
33
+ == 0.7.1
34
+
35
+ - NOTE: Now BouncyCastle jars has moved out to its own gem
36
+ "bouncy-castle-java" (http://rubygems.org/gems/bouncy-castle-java).
37
+ You don't need to care about it because "jruby-openssl" gem depends
38
+ on it from now on.
39
+
40
+ === SSL bugfix
41
+
42
+ - JRUBY-4826 net/https client possibly raises "rbuf_fill': End of file
43
+ reached (EOFError)" for HTTP chunked read.
44
+
45
+ === Misc
46
+
47
+ - JRUBY-4900: Set proper String to OpenSSL::OPENSSL_VERSION. Make sure
48
+ it's not an OpenSSL artifact: "OpenSSL 0.9.8b 04 May 2006
49
+ (JRuby-OpenSSL fake)" -> "jruby-ossl 0.7.1"
50
+ - JRUBY-4975: Moving BouncyCastle jars out to its own gem.
51
+
52
+ == 0.7
53
+
54
+ - Follow MRI 1.8.7 openssl API changes
55
+ - Fixes so that jruby-openssl can run on appengine
56
+ - Many bug and compatibility fixes, see below.
57
+ - This is the last release that will be compatible with JRuby 1.4.x.
58
+ - Compatibility issues
59
+ -- JRUBY-4342: Follow ruby-openssl of CRuby 1.8.7.
60
+ -- JRUBY-4346: Sync tests with tests for ruby-openssl of CRuby 1.8.7.
61
+ -- JRUBY-4444: OpenSSL crash running RubyGems tests
62
+ -- JRUBY-4075: Net::SSH gives OpenSSL::Cipher::CipherError "No message available"
63
+ -- JRUBY-4076: Net::SSH padding error using 3des-cbc on Solaris
64
+ -- JRUBY-4541: jruby-openssl doesn't load on App Engine.
65
+ -- JRUBY-4077: Net::SSH "all authorization methods failed" Solaris -> Solaris
66
+ -- JRUBY-4535: Issues with the BouncyCastle provider
67
+ -- JRUBY-4510: JRuby-OpenSSL crashes when JCE fails a initialise bcprov
68
+ -- JRUBY-4343: Update BouncyCastle jar to upstream version; jdk14-139 -> jdk15-144
69
+ - Cipher issues
70
+ -- JRUBY-4012: Initialization vector length handled differently than in MRI (longer IV sequence are trimmed to fit the required)
71
+ -- JRUBY-4473: Implemented DSA key generation
72
+ -- JRUBY-4472: Cipher does not support RC4 and CAST
73
+ -- JRUBY-4577: InvalidParameterException 'Wrong keysize: must be equal to 112 or 168' for DES3 + SunJCE
74
+ - SSL and X.509(PKIX) issues
75
+ -- JRUBY-4384: TCP socket connection causes busy loop of SSL server
76
+ -- JRUBY-4370: Implement SSLContext#ciphers
77
+ -- JRUBY-4688: SSLContext#ciphers does not accept 'DEFAULT'
78
+ -- JRUBY-4357: SSLContext#{setup,ssl_version=} are not implemented
79
+ -- JRUBY-4397: SSLContext#extra_chain_cert and SSLContext#client_ca
80
+ -- JRUBY-4684: SSLContext#verify_depth is ignored
81
+ -- JRUBY-4398: SSLContext#options does not affect to SSL sessions
82
+ -- JRUBY-4360: Implement SSLSocket#verify_result and dependents
83
+ -- JRUBY-3829: SSLSocket#read should clear given buffer before concatenating (ByteBuffer.java:328:in `allocate': java.lang.IllegalArgumentException when returning SOAP queries over a certain size)
84
+ -- JRUBY-4686: SSLSocket can drop last chunk of data just before inbound channel close
85
+ -- JRUBY-4369: X509Store#verify_callback is not called
86
+ -- JRUBY-4409: OpenSSL::X509::Store#add_file corrupts when it includes certificates which have the same subject (problem with ruby-openid-apps-discovery (github jruby-openssl issue #2))
87
+ -- JRUBY-4333: PKCS#8 formatted privkey read
88
+ -- JRUBY-4454: Loading Key file as a Certificate causes NPE
89
+ -- JRUBY-4455: calling X509::Certificate#sign for the Certificate initialized from PEM causes IllegalStateException
90
+ - PKCS#7 issues
91
+ -- JRUBY-4379: PKCS7#sign failed for DES3 cipher algorithm
92
+ -- JRUBY-4428: Allow to use DES-EDE3-CBC in PKCS#7 w/o the Policy Files (rake test doesn't finish on JDK5 w/o policy files update)
93
+ - Misc
94
+ -- JRUBY-4574: jruby-openssl deprecation warning cleanup
95
+ -- JRUBY-4591: jruby-1.4 support
96
+
97
+ == 0.6
98
+
99
+ - This is a recommended upgrade to jruby-openssl. A security problem
100
+ involving peer certificate verification was found where failed
101
+ verification silently did nothing, making affected applications
102
+ vulnerable to attackers. Attackers could lead a client application
103
+ to believe that a secure connection to a rogue SSL server is
104
+ legitimate. Attackers could also penetrate client-validated SSL
105
+ server applications with a dummy certificate. Your application would
106
+ be vulnerable if you're using the 'net/https' library with
107
+ OpenSSL::SSL::VERIFY_PEER mode and any version of jruby-openssl
108
+ prior to 0.6. Thanks to NaHi (NAKAMURA Hiroshi) for finding the
109
+ problem and providing the fix. See
110
+ http://www.jruby.org/2009/12/07/vulnerability-in-jruby-openssl.html
111
+ for details.
112
+ - This release addresses CVE-2009-4123 which was reserved for the
113
+ above vulnerability.
114
+ - Many fixes from NaHi, including issues related to certificate
115
+ verification and certificate store purpose verification.
116
+ - implement OpenSSL::X509::Store#set_default_paths
117
+ - MRI compat. fix: OpenSSL::X509::Store#add_file
118
+ - Fix nsCertType handling.
119
+ - Fix Cipher#key_len for DES-EDE3: 16 should be 24.
120
+ - Modified test expectations around Cipher#final.
121
+ - Public keys are lazily instantiated when the
122
+ X509::Certificate#public_key method is called (Dave Garcia)
123
+
124
+ == 0.5.2
125
+
126
+ * Multiple bugs fixed:
127
+ ** JRUBY-3895 Could not verify server signature with net-ssh against Cygwin
128
+ ** JRUBY-3864 jruby-openssl depends on Base64Coder from JvYAMLb
129
+ ** JRUBY-3790 JRuby-OpenSSL test_post_connection_check is not passing
130
+ ** JRUBY-3767 OpenSSL ssl implementation doesn't support client auth
131
+ ** JRUBY-3673 jRuby-OpenSSL does not properly load certificate authority file
132
+
133
+ == 0.5.1
134
+
135
+ * Multiple fixes by Brice Figureau to get net/ssh working. Requires JRuby 1.3.1 to be 100%
136
+ * Fix by Frederic Jean for a character-decoding issue for some certificates
137
+
138
+ == 0.5
139
+
140
+ * Fixed JRUBY-3614: Unsupported HMAC algorithm (HMACSHA-256)
141
+ * Fixed JRUBY-3570: ActiveMerchant's AuthorizeNet Gateway throws OpenSSL Cert Validation Error, when there should be no error
142
+ * Fixed JRUBY-3557 Class cast exception in PKeyRSA.java
143
+ * Fixed JRUBY-3468 X.509 certificates: subjectKeyIdentifier corrupted
144
+ * Fixed JRUBY-3285 Unsupported HMAC algorithm (HMACSHA1) error when generating digest
145
+ * Misc code cleanup
146
+
147
+ == 0.2
148
+
149
+ - Enable remaining tests; fix a nil string issue in SSLSocket.sysread (JRUBY-1888)
150
+ - Fix socket buffering issue by setting socket IO sync = true
151
+ - Fix bad file descriptor issue caused by unnecessary close (JRUBY-2152)
152
+ - Fix AES key length (JRUBY-2187)
153
+ - Fix cipher initialization (JRUBY-1100)
154
+ - Now, only compatible with JRuby 1.1
155
+
156
+ == 0.1.1
157
+
158
+ - Fixed blocker issue preventing HTTPS/SSL from working (JRUBY-1222)
159
+
160
+ == 0.1
161
+
162
+ - PLEASE NOTE: This release is not compatible with JRuby releases earlier than
163
+ 1.0.3 or 1.1b2. If you must use JRuby 1.0.2 or earlier, please install the
164
+ 0.6 release.
165
+ - Release coincides with JRuby 1.0.3 and JRuby 1.1b2 releases
166
+ - Simultaneous support for JRuby trunk and 1.0 branch
167
+ - Start of support for OpenSSL::BN
168
+
169
+ == 0.0.5 and prior
170
+
171
+ - Initial versions with maintenance updates
@@ -0,0 +1,30 @@
1
+ JRuby-OpenSSL is distributed under the same license as JRuby (http://www.jruby.org/).
2
+
3
+ Version: CPL 1.0/GPL 2.0/LGPL 2.1
4
+
5
+ The contents of this file are subject to the Common Public
6
+ License Version 1.0 (the "License"); you may not use this file
7
+ except in compliance with the License. You may obtain a copy of
8
+ the License at http://www.eclipse.org/legal/cpl-v10.html
9
+
10
+ Software distributed under the License is distributed on an "AS
11
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
12
+ implied. See the License for the specific language governing
13
+ rights and limitations under the License.
14
+
15
+ Copyright (C) 2007 Ola Bini <ola.bini@gmail.com>
16
+
17
+ Alternatively, the contents of this file may be used under the terms of
18
+ either of the GNU General Public License Version 2 or later (the "GPL"),
19
+ or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
20
+ in which case the provisions of the GPL or the LGPL are applicable instead
21
+ of those above. If you wish to allow use of your version of this file only
22
+ under the terms of either the GPL or the LGPL, and not to allow others to
23
+ use your version of this file under the terms of the CPL, indicate your
24
+ decision by deleting the provisions above and replace them with the notice
25
+ and other provisions required by the GPL or the LGPL. If you do not delete
26
+ the provisions above, a recipient may use your version of this file under
27
+ the terms of any one of the CPL, the GPL or the LGPL.
28
+
29
+ JRuby-OpenSSL includes software by the Legion of the Bouncy Castle
30
+ (http://bouncycastle.org/license.html).
@@ -0,0 +1,115 @@
1
+ Rakefile
2
+ History.txt
3
+ Manifest.txt
4
+ README.txt
5
+ License.txt
6
+ lib/jopenssl.jar
7
+ lib/openssl
8
+ lib/jopenssl
9
+ lib/jopenssl.jar
10
+ lib/openssl.rb
11
+ lib/openssl/dummy.rb
12
+ lib/openssl/dummyssl.rb
13
+ lib/openssl/config.rb
14
+ lib/openssl/cipher.rb
15
+ lib/openssl/ssl.rb
16
+ lib/openssl/bn.rb
17
+ lib/openssl/x509.rb
18
+ lib/openssl/digest.rb
19
+ lib/openssl/buffering.rb
20
+ lib/openssl/pkcs7.rb
21
+ lib/jopenssl/version.rb
22
+ test/test_imaps.rb
23
+ test/test_all.rb
24
+ test/test_integration.rb
25
+ test/ut_eof.rb
26
+ test/openssl
27
+ test/test_java.rb
28
+ test/test_openssl.rb
29
+ test/test_pkey.rb
30
+ test/ref
31
+ test/test_cipher.rb
32
+ test/cert_with_ec_pk.cer
33
+ test/fixture
34
+ test/test_pkcs7.rb
35
+ test/test_x509store.rb
36
+ test/test_certificate.rb
37
+ test/test_parse_certificate.rb
38
+ test/test_ssl.rb
39
+ test/java
40
+ test/openssl/test_x509name.rb
41
+ test/openssl/test_ns_spki.rb
42
+ test/openssl/test_x509cert.rb
43
+ test/openssl/ssl_server.rb
44
+ test/openssl/test_pair.rb
45
+ test/openssl/test_ec.rb
46
+ test/openssl/test_config.rb
47
+ test/openssl/utils.rb
48
+ test/openssl/test_x509req.rb
49
+ test/openssl/test_cipher.rb
50
+ test/openssl/test_digest.rb
51
+ test/openssl/test_x509ext.rb
52
+ test/openssl/test_asn1.rb
53
+ test/openssl/test_pkcs7.rb
54
+ test/openssl/test_x509store.rb
55
+ test/openssl/test_pkey_rsa.rb
56
+ test/openssl/test_ssl.rb
57
+ test/openssl/test_x509crl.rb
58
+ test/openssl/test_hmac.rb
59
+ test/ref/compile.rb
60
+ test/ref/a.out
61
+ test/ref/pkcs1
62
+ test/ref/pkcs1.c
63
+ test/fixture/cacert.pem
64
+ test/fixture/ca-bundle.crt
65
+ test/fixture/common.pem
66
+ test/fixture/key_then_cert.pem
67
+ test/fixture/verisign.pem
68
+ test/fixture/cert_localhost.pem
69
+ test/fixture/localhost_keypair.pem
70
+ test/fixture/verisign_c3.pem
71
+ test/fixture/selfcert.pem
72
+ test/fixture/max.pem
73
+ test/fixture/keypair.pem
74
+ test/fixture/purpose
75
+ test/fixture/imaps
76
+ test/fixture/ca_path
77
+ test/fixture/purpose/cacert.pem
78
+ test/fixture/purpose/sslclient
79
+ test/fixture/purpose/b70a5bc1.0
80
+ test/fixture/purpose/ca
81
+ test/fixture/purpose/sslclient.pem
82
+ test/fixture/purpose/sslserver.pem
83
+ test/fixture/purpose/scripts
84
+ test/fixture/purpose/sslserver
85
+ test/fixture/purpose/sslclient/sslclient.pem
86
+ test/fixture/purpose/sslclient/csr.pem
87
+ test/fixture/purpose/sslclient/keypair.pem
88
+ test/fixture/purpose/ca/cacert.pem
89
+ test/fixture/purpose/ca/newcerts
90
+ test/fixture/purpose/ca/PASSWD_OF_CA_KEY_IS_1234
91
+ test/fixture/purpose/ca/ca_config.rb
92
+ test/fixture/purpose/ca/serial
93
+ test/fixture/purpose/ca/private
94
+ test/fixture/purpose/ca/newcerts/2_cert.pem
95
+ test/fixture/purpose/ca/newcerts/3_cert.pem
96
+ test/fixture/purpose/ca/private/cakeypair.pem
97
+ test/fixture/purpose/scripts/gen_cert.rb
98
+ test/fixture/purpose/scripts/init_ca.rb
99
+ test/fixture/purpose/scripts/gen_csr.rb
100
+ test/fixture/purpose/sslserver/sslserver.pem
101
+ test/fixture/purpose/sslserver/csr.pem
102
+ test/fixture/purpose/sslserver/keypair.pem
103
+ test/fixture/imaps/cacert.pem
104
+ test/fixture/imaps/server.crt
105
+ test/fixture/imaps/server.key
106
+ test/fixture/ca_path/verisign.pem
107
+ test/fixture/ca_path/72fa7371.0
108
+ test/java/pkcs7_mime_enveloped.message
109
+ test/java/pkcs7_mime_signed.message
110
+ test/java/test_java_pkcs7.rb
111
+ test/java/test_java_bio.rb
112
+ test/java/pkcs7_multipart_signed.message
113
+ test/java/test_java_mime.rb
114
+ test/java/test_java_attribute.rb
115
+ test/java/test_java_smime.rb
@@ -0,0 +1,13 @@
1
+ = JRuby-OpenSSL
2
+
3
+ * http://jruby-extras.rubyforge.org/jruby-openssl
4
+
5
+ == DESCRIPTION:
6
+
7
+ JRuby-OpenSSL is an add-on gem for JRuby that emulates the Ruby OpenSSL native library.
8
+
9
+ Please report bugs and incompatibilities (preferably with testcases) to either the JRuby
10
+ mailing list [1] or the JRuby bug tracker [2].
11
+
12
+ [1]: http://xircles.codehaus.org/projects/jruby/lists
13
+ [2]: http://jira.codehaus.org/browse/JRUBY
@@ -0,0 +1,79 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+
4
+ MANIFEST = FileList["Rakefile", "History.txt", "Manifest.txt", "README.txt", "License.txt", "lib/jopenssl.jar", "lib/**/*", "test/**/*"]
5
+ BC_JARS = FileList["build_lib/bc*.jar"]
6
+
7
+ task :default => [:java_compile, :test]
8
+
9
+ def java_classpath_arg # myriad of ways to discover JRuby classpath
10
+ begin
11
+ cpath = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
12
+ cpath += Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR)
13
+ jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR)
14
+ rescue => e
15
+ end
16
+ unless jruby_cpath
17
+ jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
18
+ FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
19
+ end
20
+ bc_jars = BC_JARS.join(File::PATH_SEPARATOR)
21
+ jruby_cpath ? "-cp \"#{jruby_cpath.gsub('\\', '/')}#{File::PATH_SEPARATOR}#{bc_jars}\"" : "-cp \"#{bc_jars}\""
22
+ end
23
+
24
+ desc "Compile the native Java code."
25
+ task :java_compile do
26
+ mkdir_p "pkg/classes"
27
+
28
+ File.open("pkg/compile_options", "w") do |f|
29
+ f << "-g -target 1.5 -source 1.5 -Xlint:unchecked -Xlint:deprecation -d pkg/classes"
30
+ end
31
+
32
+ File.open("pkg/compile_classpath", "w") do |f|
33
+ f << java_classpath_arg
34
+ end
35
+
36
+ File.open("pkg/compile_sourcefiles", "w") do |f|
37
+ f << FileList['src/java/**/*.java'].join(' ')
38
+ end
39
+
40
+ sh "javac @pkg/compile_options @pkg/compile_classpath @pkg/compile_sourcefiles"
41
+ sh "jar cf lib/jopenssl.jar -C pkg/classes/ ."
42
+ end
43
+ file "lib/jopenssl.jar" => :java_compile
44
+
45
+ task :more_clean do
46
+ rm_f FileList['lib/jopenssl.jar']
47
+ end
48
+ task :clean => :more_clean
49
+
50
+ File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f.puts n } }
51
+
52
+ begin
53
+ require 'hoe'
54
+ Hoe.plugin :gemcutter
55
+ Hoe.add_include_dirs('build_lib')
56
+ hoe = Hoe.spec("jruby-openssl") do |p|
57
+ load File.dirname(__FILE__) + "/lib/jopenssl/version.rb"
58
+ p.version = Jopenssl::Version::VERSION
59
+ p.rubyforge_name = "jruby-extras"
60
+ p.url = "http://jruby-extras.rubyforge.org/jruby-openssl"
61
+ p.author = "Ola Bini and JRuby contributors"
62
+ p.email = "ola.bini@gmail.com"
63
+ p.summary = "OpenSSL add-on for JRuby"
64
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
65
+ p.description = p.paragraphs_of('README.txt', 3...4).join("\n\n")
66
+ p.test_globs = ENV["TEST"] || ["test/test_all.rb"]
67
+ p.extra_deps << ['bouncy-castle-java', '>= 0']
68
+ end
69
+ hoe.spec.dependencies.delete_if { |dep| dep.name == "hoe" }
70
+
71
+ task :gemspec do
72
+ File.open("#{hoe.name}.gemspec", "w") {|f| f << hoe.spec.to_ruby }
73
+ end
74
+ task :package => :gemspec
75
+ rescue LoadError
76
+ puts "You really need Hoe installed to be able to package this gem"
77
+ rescue => e
78
+ puts "ignoring error while loading hoe: #{e.to_s}"
79
+ end
Binary file
@@ -0,0 +1,5 @@
1
+ module Jopenssl
2
+ module Version
3
+ VERSION = "0.7.4"
4
+ end
5
+ end
@@ -0,0 +1,76 @@
1
+ =begin
2
+ = $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions
3
+
4
+ = Info
5
+ 'OpenSSL for Ruby 2' project
6
+ Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
7
+ All rights reserved.
8
+
9
+ = Licence
10
+ This program is licenced under the same licence as Ruby.
11
+ (See the file 'LICENCE'.)
12
+
13
+ = Version
14
+ $Id: openssl.rb 12496 2007-06-08 15:02:04Z technorama $
15
+ =end
16
+
17
+ # TODO: remove this chunk after 1.4 support is dropped
18
+ require 'digest'
19
+ unless defined?(::Digest::Class)
20
+ # restricted support for jruby <= 1.4 (1.8.6 Digest compat)
21
+ module Digest
22
+ class Class
23
+ def self.hexdigest(name, data)
24
+ digest(name, data).unpack('H*')[0]
25
+ end
26
+
27
+ def self.digest(data, name)
28
+ digester = const_get(name).new
29
+ digester.update(data)
30
+ digester.finish
31
+ end
32
+
33
+ def hexdigest
34
+ digest.unpack('H*')[0]
35
+ end
36
+
37
+ def digest
38
+ dup.finish
39
+ end
40
+
41
+ def ==(oth)
42
+ digest == oth.digest
43
+ end
44
+
45
+ def to_s
46
+ hexdigest
47
+ end
48
+
49
+ def size
50
+ digest_length
51
+ end
52
+
53
+ def length
54
+ digest_length
55
+ end
56
+ end
57
+ end
58
+ end
59
+ # end of compat chunk.
60
+
61
+ begin
62
+ # require 'bouncy-castle-java'
63
+ rescue LoadError
64
+ # runs under restricted mode.
65
+ end
66
+ require 'jopenssl'
67
+
68
+
69
+ require 'openssl/bn'
70
+ require 'openssl/cipher'
71
+ require 'openssl/config'
72
+ require 'openssl/digest'
73
+ require 'openssl/pkcs7'
74
+ require 'openssl/ssl'
75
+ require 'openssl/x509'
76
+