jruby-openssl 0.7.4 → 0.7.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/.gemtest +0 -0
  2. data/History.txt +51 -14
  3. data/Manifest.txt +136 -79
  4. data/README.txt +1 -1
  5. data/Rakefile +17 -8
  6. data/lib/{openssl → 1.8/openssl}/bn.rb +2 -2
  7. data/lib/{openssl → 1.8/openssl}/buffering.rb +3 -1
  8. data/lib/{openssl → 1.8/openssl}/cipher.rb +0 -0
  9. data/lib/{openssl → 1.8/openssl}/config.rb +1 -1
  10. data/lib/{openssl → 1.8/openssl}/digest.rb +2 -2
  11. data/lib/{openssl → 1.8/openssl}/pkcs7.rb +0 -0
  12. data/lib/{openssl/ssl.rb → 1.8/openssl/ssl-internal.rb} +2 -2
  13. data/lib/1.8/openssl/ssl.rb +1 -0
  14. data/lib/{openssl/x509.rb → 1.8/openssl/x509-internal.rb} +8 -9
  15. data/lib/1.8/openssl/x509.rb +1 -0
  16. data/lib/{openssl.rb → 1.8/openssl.rb} +2 -11
  17. data/lib/1.9/openssl/bn.rb +35 -0
  18. data/lib/1.9/openssl/buffering.rb +448 -0
  19. data/lib/1.9/openssl/cipher.rb +65 -0
  20. data/lib/1.9/openssl/config.rb +313 -0
  21. data/lib/1.9/openssl/digest.rb +72 -0
  22. data/lib/1.9/openssl/ssl-internal.rb +177 -0
  23. data/lib/1.9/openssl/ssl.rb +2 -0
  24. data/lib/1.9/openssl/x509-internal.rb +158 -0
  25. data/lib/1.9/openssl/x509.rb +2 -0
  26. data/lib/1.9/openssl.rb +22 -0
  27. data/lib/{jopenssl → shared/jopenssl}/version.rb +1 -1
  28. data/lib/shared/jopenssl.jar +0 -0
  29. data/lib/{openssl → shared/openssl}/dummy.rb +0 -0
  30. data/lib/{openssl → shared/openssl}/dummyssl.rb +0 -0
  31. data/lib/shared/openssl/pkcs12.rb +50 -0
  32. data/lib/shared/openssl/ssl.rb +1 -0
  33. data/lib/shared/openssl/x509.rb +1 -0
  34. data/lib/shared/openssl.rb +20 -0
  35. data/test/{openssl → 1.8}/ssl_server.rb +0 -0
  36. data/test/{openssl → 1.8}/test_asn1.rb +15 -0
  37. data/test/{openssl → 1.8}/test_cipher.rb +0 -0
  38. data/test/{openssl → 1.8}/test_config.rb +0 -0
  39. data/test/{openssl → 1.8}/test_digest.rb +0 -0
  40. data/test/{openssl → 1.8}/test_ec.rb +0 -0
  41. data/test/{openssl → 1.8}/test_hmac.rb +0 -0
  42. data/test/{openssl → 1.8}/test_ns_spki.rb +0 -0
  43. data/test/{openssl → 1.8}/test_pair.rb +10 -2
  44. data/test/{openssl → 1.8}/test_pkcs7.rb +0 -0
  45. data/test/{openssl → 1.8}/test_pkey_rsa.rb +0 -0
  46. data/test/{openssl → 1.8}/test_ssl.rb +17 -20
  47. data/test/{openssl → 1.8}/test_x509cert.rb +0 -0
  48. data/test/{openssl → 1.8}/test_x509crl.rb +0 -0
  49. data/test/{openssl → 1.8}/test_x509ext.rb +0 -0
  50. data/test/{openssl → 1.8}/test_x509name.rb +0 -0
  51. data/test/{openssl → 1.8}/test_x509req.rb +0 -0
  52. data/test/{openssl → 1.8}/test_x509store.rb +0 -0
  53. data/test/{openssl → 1.8}/utils.rb +0 -0
  54. data/test/1.9/ssl_server.rb +81 -0
  55. data/test/1.9/test_asn1.rb +589 -0
  56. data/test/1.9/test_bn.rb +23 -0
  57. data/test/1.9/test_buffering.rb +88 -0
  58. data/test/1.9/test_cipher.rb +107 -0
  59. data/test/1.9/test_config.rb +288 -0
  60. data/test/1.9/test_digest.rb +118 -0
  61. data/test/1.9/test_engine.rb +15 -0
  62. data/test/1.9/test_hmac.rb +32 -0
  63. data/test/1.9/test_ns_spki.rb +50 -0
  64. data/test/1.9/test_ocsp.rb +47 -0
  65. data/test/1.9/test_pair.rb +257 -0
  66. data/test/1.9/test_pkcs12.rb +209 -0
  67. data/test/1.9/test_pkcs7.rb +151 -0
  68. data/test/1.9/test_pkey_dh.rb +72 -0
  69. data/test/1.9/test_pkey_dsa.rb +224 -0
  70. data/test/1.9/test_pkey_ec.rb +182 -0
  71. data/test/1.9/test_pkey_rsa.rb +244 -0
  72. data/test/1.9/test_ssl.rb +455 -0
  73. data/test/1.9/test_ssl_session.rb +327 -0
  74. data/test/1.9/test_x509cert.rb +217 -0
  75. data/test/1.9/test_x509crl.rb +221 -0
  76. data/test/1.9/test_x509ext.rb +69 -0
  77. data/test/1.9/test_x509name.rb +296 -0
  78. data/test/1.9/test_x509req.rb +150 -0
  79. data/test/1.9/test_x509store.rb +229 -0
  80. data/test/1.9/utils.rb +304 -0
  81. data/test/fixture/ids_in_subject_rdn_set.pem +31 -0
  82. data/test/fixture/purpose/ca/ca_config.rb +1 -1
  83. data/test/fixture/purpose/ca/gen_cert.rb +128 -0
  84. data/test/fixture/purpose/ca/newcerts/4_cert.pem +19 -0
  85. data/test/fixture/purpose/ca/serial +1 -1
  86. data/test/fixture/purpose/sslserver_no_dsig_in_keyUsage.pem +19 -0
  87. data/test/ruby/envutil.rb +208 -0
  88. data/test/ruby/ut_eof.rb +128 -0
  89. data/test/test_certificate.rb +9 -0
  90. data/test/test_java.rb +1 -1
  91. data/test/test_openssl.rb +1 -1
  92. data/test/test_pkcs7.rb +16 -0
  93. data/test/test_pkey_dsa.rb +180 -0
  94. data/test/test_pkey_rsa.rb +298 -0
  95. data/test/test_ssl.rb +1 -1
  96. data/test/test_x509store.rb +8 -0
  97. metadata +133 -73
  98. data/lib/jopenssl.jar +0 -0
  99. data/test/test_pkey.rb +0 -204
data/.gemtest ADDED
File without changes
data/History.txt CHANGED
@@ -1,6 +1,28 @@
1
+ == 0.7.6
2
+
3
+ This release includes initial implementation of PKCS12 by Owen Ou.
4
+
5
+ - JRUBY-5066: Implement OpenSSL::PKCS12 (only for simple case)
6
+ - JRUBY-6385: Assertion failure with -J-ea
7
+
8
+ == 0.7.5
9
+
10
+ This release improved 1.9 mode support with help of
11
+ Duncan Mak <duncan@earthaid.net>. Now jruby-ossl gem includes both 1.8 and 1.9
12
+ libraries and part of features should work fine on 1.9 mode, too.
13
+
14
+ - JRUBY-6270: Wrong keyUsage check for SSL server
15
+ - JRUBY-6260: OpenSSL::ASN1::Integer#value incompatibility
16
+ - JRUBY-6044: Improve Ecrypted RSA/DSA pem support
17
+ - JRUBY-5972: Allow to load/dump empty PKCS7 data
18
+ - JRUBY-5834: Fix X509Name handling; X509Name RDN can include multiple elements
19
+ - JRUBY-5362: Improved 1.9 support
20
+ - JRUBY-4992: Warn if loaded by non JRuby interpreter
21
+
1
22
  == 0.7.4
2
23
 
3
- - JRUBY-5519: Avoid String encoding dependency in DER loading. PEM loading failed on JRuby 1.6.x. Fixed.
24
+ - JRUBY-5519: Avoid String encoding dependency in DER loading. PEM loading
25
+ failed on JRuby 1.6.x. Fixed.
4
26
  - JRUBY-5510: Add debug information to released jar
5
27
  - JRUBY-5478: Update bouncycastle jars to the latest version. (1.46)
6
28
 
@@ -59,18 +81,22 @@
59
81
  -- JRUBY-4342: Follow ruby-openssl of CRuby 1.8.7.
60
82
  -- JRUBY-4346: Sync tests with tests for ruby-openssl of CRuby 1.8.7.
61
83
  -- JRUBY-4444: OpenSSL crash running RubyGems tests
62
- -- JRUBY-4075: Net::SSH gives OpenSSL::Cipher::CipherError "No message available"
84
+ -- JRUBY-4075: Net::SSH gives OpenSSL::Cipher::CipherError "No message
85
+ available"
63
86
  -- JRUBY-4076: Net::SSH padding error using 3des-cbc on Solaris
64
87
  -- JRUBY-4541: jruby-openssl doesn't load on App Engine.
65
88
  -- JRUBY-4077: Net::SSH "all authorization methods failed" Solaris -> Solaris
66
89
  -- JRUBY-4535: Issues with the BouncyCastle provider
67
90
  -- JRUBY-4510: JRuby-OpenSSL crashes when JCE fails a initialise bcprov
68
- -- JRUBY-4343: Update BouncyCastle jar to upstream version; jdk14-139 -> jdk15-144
91
+ -- JRUBY-4343: Update BouncyCastle jar to upstream version; jdk14-139 ->
92
+ jdk15-144
69
93
  - Cipher issues
70
- -- JRUBY-4012: Initialization vector length handled differently than in MRI (longer IV sequence are trimmed to fit the required)
94
+ -- JRUBY-4012: Initialization vector length handled differently than in MRI
95
+ (longer IV sequence are trimmed to fit the required)
71
96
  -- JRUBY-4473: Implemented DSA key generation
72
97
  -- 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
98
+ -- JRUBY-4577: InvalidParameterException 'Wrong keysize: must be equal to 112 or
99
+ 168' for DES3 + SunJCE
74
100
  - SSL and X.509(PKIX) issues
75
101
  -- JRUBY-4384: TCP socket connection causes busy loop of SSL server
76
102
  -- JRUBY-4370: Implement SSLContext#ciphers
@@ -80,16 +106,23 @@
80
106
  -- JRUBY-4684: SSLContext#verify_depth is ignored
81
107
  -- JRUBY-4398: SSLContext#options does not affect to SSL sessions
82
108
  -- 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
109
+ -- JRUBY-3829: SSLSocket#read should clear given buffer before concatenating
110
+ (ByteBuffer.java:328:in `allocate': java.lang.IllegalArgumentException when
111
+ returning SOAP queries over a certain size)
112
+ -- JRUBY-4686: SSLSocket can drop last chunk of data just before inbound channel
113
+ close
85
114
  -- 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))
115
+ -- JRUBY-4409: OpenSSL::X509::Store#add_file corrupts when it includes
116
+ certificates which have the same subject (problem with
117
+ ruby-openid-apps-discovery (github jruby-openssl issue #2))
87
118
  -- JRUBY-4333: PKCS#8 formatted privkey read
88
119
  -- 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
120
+ -- JRUBY-4455: calling X509::Certificate#sign for the Certificate initialized
121
+ from PEM causes IllegalStateException
90
122
  - PKCS#7 issues
91
123
  -- 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)
124
+ -- JRUBY-4428: Allow to use DES-EDE3-CBC in PKCS#7 w/o the Policy Files (rake
125
+ test doesn't finish on JDK5 w/o policy files update)
93
126
  - Misc
94
127
  -- JRUBY-4574: jruby-openssl deprecation warning cleanup
95
128
  -- JRUBY-4591: jruby-1.4 support
@@ -132,21 +165,25 @@
132
165
 
133
166
  == 0.5.1
134
167
 
135
- * Multiple fixes by Brice Figureau to get net/ssh working. Requires JRuby 1.3.1 to be 100%
168
+ * Multiple fixes by Brice Figureau to get net/ssh working. Requires JRuby 1.3.1
169
+ to be 100%
136
170
  * Fix by Frederic Jean for a character-decoding issue for some certificates
137
171
 
138
172
  == 0.5
139
173
 
140
174
  * 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
175
+ * Fixed JRUBY-3570: ActiveMerchant's AuthorizeNet Gateway throws OpenSSL Cert
176
+ Validation Error, when there should be no error
142
177
  * Fixed JRUBY-3557 Class cast exception in PKeyRSA.java
143
178
  * Fixed JRUBY-3468 X.509 certificates: subjectKeyIdentifier corrupted
144
- * Fixed JRUBY-3285 Unsupported HMAC algorithm (HMACSHA1) error when generating digest
179
+ * Fixed JRUBY-3285 Unsupported HMAC algorithm (HMACSHA1) error when generating
180
+ digest
145
181
  * Misc code cleanup
146
182
 
147
183
  == 0.2
148
184
 
149
- - Enable remaining tests; fix a nil string issue in SSLSocket.sysread (JRUBY-1888)
185
+ - Enable remaining tests; fix a nil string issue in SSLSocket.sysread
186
+ (JRUBY-1888)
150
187
  - Fix socket buffering issue by setting socket IO sync = true
151
188
  - Fix bad file descriptor issue caused by unnecessary close (JRUBY-2152)
152
189
  - Fix AES key length (JRUBY-2187)
data/Manifest.txt CHANGED
@@ -3,113 +3,170 @@ History.txt
3
3
  Manifest.txt
4
4
  README.txt
5
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
6
+ lib/shared/jopenssl.jar
7
+ lib/1.9
8
+ lib/shared
9
+ lib/1.8
10
+ lib/1.9/openssl.rb
11
+ lib/1.9/openssl
12
+ lib/1.9/openssl/bn.rb
13
+ lib/1.9/openssl/x509-internal.rb
14
+ lib/1.9/openssl/cipher.rb
15
+ lib/1.9/openssl/digest.rb
16
+ lib/1.9/openssl/ssl.rb
17
+ lib/1.9/openssl/buffering.rb
18
+ lib/1.9/openssl/ssl-internal.rb
19
+ lib/1.9/openssl/x509.rb
20
+ lib/1.9/openssl/config.rb
21
+ lib/shared/jopenssl.jar
22
+ lib/shared/openssl.rb
23
+ lib/shared/openssl
24
+ lib/shared/jopenssl
25
+ lib/shared/openssl/dummyssl.rb
26
+ lib/shared/openssl/ssl.rb
27
+ lib/shared/openssl/pkcs12.rb
28
+ lib/shared/openssl/x509.rb
29
+ lib/shared/openssl/dummy.rb
30
+ lib/shared/jopenssl/version.rb
31
+ lib/1.8/openssl.rb
32
+ lib/1.8/openssl
33
+ lib/1.8/openssl/bn.rb
34
+ lib/1.8/openssl/pkcs7.rb
35
+ lib/1.8/openssl/x509-internal.rb
36
+ lib/1.8/openssl/cipher.rb
37
+ lib/1.8/openssl/digest.rb
38
+ lib/1.8/openssl/ssl.rb
39
+ lib/1.8/openssl/buffering.rb
40
+ lib/1.8/openssl/ssl-internal.rb
41
+ lib/1.8/openssl/x509.rb
42
+ lib/1.8/openssl/config.rb
43
+ test/1.9
44
+ test/ref
23
45
  test/test_all.rb
46
+ test/test_pkey_dsa.rb
47
+ test/fixture
24
48
  test/test_integration.rb
25
- test/ut_eof.rb
26
- test/openssl
27
- test/test_java.rb
49
+ test/ruby
50
+ test/test_ssl.rb
51
+ test/test_parse_certificate.rb
28
52
  test/test_openssl.rb
29
- test/test_pkey.rb
30
- test/ref
31
- test/test_cipher.rb
32
53
  test/cert_with_ec_pk.cer
33
- test/fixture
34
- test/test_pkcs7.rb
54
+ test/java
55
+ test/ut_eof.rb
35
56
  test/test_x509store.rb
57
+ test/test_imaps.rb
36
58
  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
59
+ test/test_pkcs7.rb
60
+ test/test_cipher.rb
61
+ test/1.8
62
+ test/test_pkey_rsa.rb
63
+ test/test_java.rb
64
+ test/1.9/test_ssl_session.rb
65
+ test/1.9/test_engine.rb
66
+ test/1.9/test_asn1.rb
67
+ test/1.9/test_pkey_dh.rb
68
+ test/1.9/test_pkey_dsa.rb
69
+ test/1.9/test_ocsp.rb
70
+ test/1.9/ssl_server.rb
71
+ test/1.9/test_x509ext.rb
72
+ test/1.9/utils.rb
73
+ test/1.9/test_ssl.rb
74
+ test/1.9/test_buffering.rb
75
+ test/1.9/test_ns_spki.rb
76
+ test/1.9/test_digest.rb
77
+ test/1.9/test_pair.rb
78
+ test/1.9/test_x509crl.rb
79
+ test/1.9/test_x509store.rb
80
+ test/1.9/test_bn.rb
81
+ test/1.9/test_pkey_ec.rb
82
+ test/1.9/test_pkcs7.rb
83
+ test/1.9/test_pkcs12.rb
84
+ test/1.9/test_cipher.rb
85
+ test/1.9/test_pkey_rsa.rb
86
+ test/1.9/test_x509req.rb
87
+ test/1.9/test_x509name.rb
88
+ test/1.9/test_hmac.rb
89
+ test/1.9/test_x509cert.rb
90
+ test/1.9/test_config.rb
60
91
  test/ref/a.out
61
92
  test/ref/pkcs1
62
93
  test/ref/pkcs1.c
63
- test/fixture/cacert.pem
64
- test/fixture/ca-bundle.crt
94
+ test/ref/compile.rb
65
95
  test/fixture/common.pem
96
+ test/fixture/ca_path
66
97
  test/fixture/key_then_cert.pem
98
+ test/fixture/imaps
99
+ test/fixture/keypair.pem
100
+ test/fixture/cacert.pem
67
101
  test/fixture/verisign.pem
102
+ test/fixture/purpose
68
103
  test/fixture/cert_localhost.pem
69
- test/fixture/localhost_keypair.pem
70
- test/fixture/verisign_c3.pem
71
104
  test/fixture/selfcert.pem
72
105
  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
106
+ test/fixture/localhost_keypair.pem
107
+ test/fixture/ids_in_subject_rdn_set.pem
108
+ test/fixture/ca-bundle.crt
109
+ test/fixture/verisign_c3.pem
110
+ test/fixture/ca_path/72fa7371.0
111
+ test/fixture/ca_path/verisign.pem
112
+ test/fixture/imaps/cacert.pem
113
+ test/fixture/imaps/server.crt
114
+ test/fixture/imaps/server.key
80
115
  test/fixture/purpose/ca
81
- test/fixture/purpose/sslclient.pem
82
- test/fixture/purpose/sslserver.pem
116
+ test/fixture/purpose/sslclient
83
117
  test/fixture/purpose/scripts
118
+ test/fixture/purpose/sslserver_no_dsig_in_keyUsage.pem
119
+ test/fixture/purpose/cacert.pem
84
120
  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
121
+ test/fixture/purpose/sslserver.pem
122
+ test/fixture/purpose/sslclient.pem
123
+ test/fixture/purpose/b70a5bc1.0
124
+ test/fixture/purpose/ca/serial
125
+ test/fixture/purpose/ca/gen_cert.rb
90
126
  test/fixture/purpose/ca/PASSWD_OF_CA_KEY_IS_1234
91
127
  test/fixture/purpose/ca/ca_config.rb
92
- test/fixture/purpose/ca/serial
128
+ test/fixture/purpose/ca/cacert.pem
93
129
  test/fixture/purpose/ca/private
94
- test/fixture/purpose/ca/newcerts/2_cert.pem
95
- test/fixture/purpose/ca/newcerts/3_cert.pem
130
+ test/fixture/purpose/ca/newcerts
96
131
  test/fixture/purpose/ca/private/cakeypair.pem
132
+ test/fixture/purpose/ca/newcerts/4_cert.pem
133
+ test/fixture/purpose/ca/newcerts/3_cert.pem
134
+ test/fixture/purpose/ca/newcerts/2_cert.pem
135
+ test/fixture/purpose/sslclient/csr.pem
136
+ test/fixture/purpose/sslclient/keypair.pem
137
+ test/fixture/purpose/sslclient/sslclient.pem
97
138
  test/fixture/purpose/scripts/gen_cert.rb
98
139
  test/fixture/purpose/scripts/init_ca.rb
99
140
  test/fixture/purpose/scripts/gen_csr.rb
100
- test/fixture/purpose/sslserver/sslserver.pem
101
141
  test/fixture/purpose/sslserver/csr.pem
102
142
  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
143
+ test/fixture/purpose/sslserver/sslserver.pem
144
+ test/ruby/ut_eof.rb
145
+ test/ruby/envutil.rb
108
146
  test/java/pkcs7_mime_enveloped.message
109
- test/java/pkcs7_mime_signed.message
147
+ test/java/test_java_attribute.rb
110
148
  test/java/test_java_pkcs7.rb
111
- test/java/test_java_bio.rb
112
- test/java/pkcs7_multipart_signed.message
113
149
  test/java/test_java_mime.rb
114
- test/java/test_java_attribute.rb
150
+ test/java/pkcs7_mime_signed.message
115
151
  test/java/test_java_smime.rb
152
+ test/java/pkcs7_multipart_signed.message
153
+ test/java/test_java_bio.rb
154
+ test/1.8/test_asn1.rb
155
+ test/1.8/ssl_server.rb
156
+ test/1.8/test_x509ext.rb
157
+ test/1.8/utils.rb
158
+ test/1.8/test_ssl.rb
159
+ test/1.8/test_ec.rb
160
+ test/1.8/test_ns_spki.rb
161
+ test/1.8/test_digest.rb
162
+ test/1.8/test_pair.rb
163
+ test/1.8/test_x509crl.rb
164
+ test/1.8/test_x509store.rb
165
+ test/1.8/test_pkcs7.rb
166
+ test/1.8/test_cipher.rb
167
+ test/1.8/test_pkey_rsa.rb
168
+ test/1.8/test_x509req.rb
169
+ test/1.8/test_x509name.rb
170
+ test/1.8/test_hmac.rb
171
+ test/1.8/test_x509cert.rb
172
+ test/1.8/test_config.rb
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  = JRuby-OpenSSL
2
2
 
3
- * http://jruby-extras.rubyforge.org/jruby-openssl
3
+ * https://github.com/jruby/jruby-ossl
4
4
 
5
5
  == DESCRIPTION:
6
6
 
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
3
 
4
- MANIFEST = FileList["Rakefile", "History.txt", "Manifest.txt", "README.txt", "License.txt", "lib/jopenssl.jar", "lib/**/*", "test/**/*"]
4
+ MANIFEST = FileList["Rakefile", "History.txt", "Manifest.txt", "README.txt", "License.txt", "lib/shared/jopenssl.jar", "lib/**/*", "test/**/*"]
5
5
  BC_JARS = FileList["build_lib/bc*.jar"]
6
6
 
7
7
  task :default => [:java_compile, :test]
@@ -38,35 +38,44 @@ task :java_compile do
38
38
  end
39
39
 
40
40
  sh "javac @pkg/compile_options @pkg/compile_classpath @pkg/compile_sourcefiles"
41
- sh "jar cf lib/jopenssl.jar -C pkg/classes/ ."
41
+ sh "jar cf lib/shared/jopenssl.jar -C pkg/classes/ ."
42
42
  end
43
- file "lib/jopenssl.jar" => :java_compile
43
+ file "lib/shared/jopenssl.jar" => :java_compile
44
44
 
45
45
  task :more_clean do
46
- rm_f FileList['lib/jopenssl.jar']
46
+ rm_f FileList['lib/shared/jopenssl.jar']
47
47
  end
48
48
  task :clean => :more_clean
49
49
 
50
50
  File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f.puts n } }
51
51
 
52
52
  begin
53
+ # easiest way to configure ruby_flags for Hoe.
54
+ ENV['RUBY_FLAGS'] ||= [
55
+ (RUBY_VERSION >= '1.9.0' ? '--1.9' : '--1.8'),
56
+ '-w',
57
+ '-Ibuild_lib:lib/shared:lib:test',
58
+ '-J-ea',
59
+ ENV['RUBY_DEBUG']
60
+ ].compact.join(' ')
53
61
  require 'hoe'
54
62
  Hoe.plugin :gemcutter
55
- Hoe.add_include_dirs('build_lib')
56
63
  hoe = Hoe.spec("jruby-openssl") do |p|
57
- load File.dirname(__FILE__) + "/lib/jopenssl/version.rb"
64
+ load File.dirname(__FILE__) + "/lib/shared/jopenssl/version.rb"
58
65
  p.version = Jopenssl::Version::VERSION
59
66
  p.rubyforge_name = "jruby-extras"
60
- p.url = "http://jruby-extras.rubyforge.org/jruby-openssl"
67
+ p.url = "https://github.com/jruby/jruby-ossl"
61
68
  p.author = "Ola Bini and JRuby contributors"
62
69
  p.email = "ola.bini@gmail.com"
63
70
  p.summary = "OpenSSL add-on for JRuby"
64
71
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
65
72
  p.description = p.paragraphs_of('README.txt', 3...4).join("\n\n")
66
73
  p.test_globs = ENV["TEST"] || ["test/test_all.rb"]
67
- p.extra_deps << ['bouncy-castle-java', '>= 0']
74
+ p.extra_deps << ['bouncy-castle-java', '>= 1.5.0146.1']
68
75
  end
69
76
  hoe.spec.dependencies.delete_if { |dep| dep.name == "hoe" }
77
+ # Either lib/1.8 or lib/1.9 is added to $LOAD_PATH dynamically.
78
+ hoe.spec.require_paths = ['lib/shared']
70
79
 
71
80
  task :gemspec do
72
81
  File.open("#{hoe.name}.gemspec", "w") {|f| f << hoe.spec.to_ruby }
@@ -11,7 +11,7 @@
11
11
  (See the file 'LICENCE'.)
12
12
 
13
13
  = Version
14
- $Id: bn.rb 11708 2007-02-12 23:01:19Z shyouhei $
14
+ $Id: bn.rb 31657 2011-05-20 22:25:35Z shyouhei $
15
15
  =end
16
16
 
17
17
  ##
@@ -29,7 +29,7 @@ end # OpenSSL
29
29
  #
30
30
  class Integer
31
31
  def to_bn
32
- OpenSSL::BN::new(self)
32
+ OpenSSL::BN::new(self.to_s(16), 16)
33
33
  end
34
34
  end # Integer
35
35
 
@@ -11,9 +11,10 @@
11
11
  (See the file 'LICENCE'.)
12
12
 
13
13
  = Version
14
- $Id: buffering.rb 13706 2007-10-15 08:29:08Z usa $
14
+ $Id: buffering.rb 28004 2010-05-24 23:58:49Z shyouhei $
15
15
  =end
16
16
 
17
+ module OpenSSL
17
18
  module Buffering
18
19
  include Enumerable
19
20
  attr_accessor :sync
@@ -237,3 +238,4 @@ module Buffering
237
238
  sysclose
238
239
  end
239
240
  end
241
+ end
File without changes
@@ -284,7 +284,7 @@ module OpenSSL
284
284
  def each
285
285
  @data.each do |section, hash|
286
286
  hash.each do |key, value|
287
- yield [section, key, value]
287
+ yield(section, key, value)
288
288
  end
289
289
  end
290
290
  end
@@ -11,7 +11,7 @@
11
11
  (See the file 'LICENCE'.)
12
12
 
13
13
  = Version
14
- $Id: digest.rb 15600 2008-02-25 08:48:57Z technorama $
14
+ $Id: digest.rb 28004 2010-05-24 23:58:49Z shyouhei $
15
15
  =end
16
16
 
17
17
  ##
@@ -40,7 +40,7 @@ module OpenSSL
40
40
  super(name, data.first)
41
41
  }
42
42
  }
43
- singleton = (class <<klass; self; end)
43
+ singleton = (class << klass; self; end)
44
44
  singleton.class_eval{
45
45
  define_method(:digest){|data| Digest.digest(name, data) }
46
46
  define_method(:hexdigest){|data| Digest.hexdigest(name, data) }
File without changes
@@ -11,10 +11,9 @@
11
11
  (See the file 'LICENCE'.)
12
12
 
13
13
  = Version
14
- $Id: ssl.rb 16193 2008-04-25 06:51:21Z knu $
14
+ $Id$
15
15
  =end
16
16
 
17
- require "openssl"
18
17
  require "openssl/buffering"
19
18
  require "fcntl"
20
19
 
@@ -36,6 +35,7 @@ module OpenSSL
36
35
 
37
36
  def set_params(params={})
38
37
  params = DEFAULT_PARAMS.merge(params)
38
+ # ssl_version need to be set at first.
39
39
  self.ssl_version = params.delete(:ssl_version)
40
40
  params.each{|name, value| self.__send__("#{name}=", value) }
41
41
  if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
@@ -0,0 +1 @@
1
+ require 'openssl'
@@ -11,11 +11,9 @@
11
11
  (See the file 'LICENCE'.)
12
12
 
13
13
  = Version
14
- $Id: x509.rb 11708 2007-02-12 23:01:19Z shyouhei $
14
+ $Id$
15
15
  =end
16
16
 
17
- require "openssl"
18
-
19
17
  module OpenSSL
20
18
  module X509
21
19
  class ExtensionFactory
@@ -28,7 +26,7 @@ module OpenSSL
28
26
  end
29
27
 
30
28
  def create_ext_from_array(ary)
31
- raise ExtensionError, "unexpected array form" if ary.size > 3
29
+ raise ExtensionError, "unexpected array form" if ary.size > 3
32
30
  create_ext(ary[0], ary[1], ary[2])
33
31
  end
34
32
 
@@ -38,12 +36,12 @@ module OpenSSL
38
36
  value.strip!
39
37
  create_ext(oid, value)
40
38
  end
41
-
39
+
42
40
  def create_ext_from_hash(hash)
43
41
  create_ext(hash["oid"], hash["value"], hash["critical"])
44
42
  end
45
43
  end
46
-
44
+
47
45
  class Extension
48
46
  def to_s # "oid = critical, value"
49
47
  str = self.oid
@@ -51,7 +49,7 @@ module OpenSSL
51
49
  str << "critical, " if self.critical?
52
50
  str << self.value.gsub(/\n/, ", ")
53
51
  end
54
-
52
+
55
53
  def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
56
54
  {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
57
55
  end
@@ -82,7 +80,8 @@ module OpenSSL
82
80
 
83
81
  def expand_pair(str)
84
82
  return nil unless str
85
- return str.gsub(Pair){|pair|
83
+ return str.gsub(Pair){
84
+ pair = $&
86
85
  case pair.size
87
86
  when 2 then pair[1,1]
88
87
  when 3 then Integer("0x#{pair[1,2]}").chr
@@ -93,7 +92,7 @@ module OpenSSL
93
92
 
94
93
  def expand_hexstring(str)
95
94
  return nil unless str
96
- der = str.gsub(HexPair){|hex| Integer("0x#{hex}").chr }
95
+ der = str.gsub(HexPair){$&.to_i(16).chr }
97
96
  a1 = OpenSSL::ASN1.decode(der)
98
97
  return a1.value, a1.tag
99
98
  end
@@ -0,0 +1 @@
1
+ require 'openssl'
@@ -58,19 +58,10 @@ unless defined?(::Digest::Class)
58
58
  end
59
59
  # end of compat chunk.
60
60
 
61
- begin
62
- require 'bouncy-castle-java'
63
- rescue LoadError
64
- # runs under restricted mode.
65
- end
66
- require 'jopenssl'
67
-
68
-
69
61
  require 'openssl/bn'
70
62
  require 'openssl/cipher'
71
63
  require 'openssl/config'
72
64
  require 'openssl/digest'
73
65
  require 'openssl/pkcs7'
74
- require 'openssl/ssl'
75
- require 'openssl/x509'
76
-
66
+ require 'openssl/ssl-internal'
67
+ require 'openssl/x509-internal'
@@ -0,0 +1,35 @@
1
+ #--
2
+ #
3
+ # $RCSfile$
4
+ #
5
+ # = Ruby-space definitions that completes C-space funcs for BN
6
+ #
7
+ # = Info
8
+ # 'OpenSSL for Ruby 2' project
9
+ # Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
10
+ # All rights reserved.
11
+ #
12
+ # = Licence
13
+ # This program is licenced under the same licence as Ruby.
14
+ # (See the file 'LICENCE'.)
15
+ #
16
+ # = Version
17
+ # $Id: bn.rb 33067 2011-08-25 00:52:10Z drbrain $
18
+ #
19
+ #++
20
+
21
+ module OpenSSL
22
+ class BN
23
+ include Comparable
24
+ end # BN
25
+ end # OpenSSL
26
+
27
+ ##
28
+ # Add double dispatch to Integer
29
+ #
30
+ class Integer
31
+ def to_bn
32
+ OpenSSL::BN::new(self.to_s(16), 16)
33
+ end
34
+ end # Integer
35
+