[virgil] r156 committed - Adding jruby-openssl support.

91 views
Skip to first unread message

virgil.apach...@codespot.com

unread,
Jan 26, 2012, 5:03:48 PM1/26/12
to virgil...@gmail.com
Revision: 156
Author: boneill42
Date: Thu Jan 26 14:01:22 2012
Log: Adding jruby-openssl support.


http://code.google.com/a/apache-extras.org/p/virgil/source/detail?r=156

Added:
/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1

/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/LICENSE.html

/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/README
/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/lib

/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/lib/bcmail-jdk15-146.jar

/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/lib/bcprov-jdk15-146.jar

/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/lib/bouncy-castle-java.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/.gemtest
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/History.txt
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/License.txt
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/Manifest.txt
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/README.txt
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/Rakefile
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/bn.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/buffering.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/cipher.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/config.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/digest.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/pkcs7.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/ssl-internal.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/ssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/x509-internal.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/x509.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/bn.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/buffering.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/cipher.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/config.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/digest.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/ssl-internal.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/ssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/x509-internal.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/x509.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/jopenssl

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/jopenssl/version.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/jopenssl.jar

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/dummy.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/dummyssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/ssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/x509.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/ssl_server.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_asn1.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_cipher.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_config.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_digest.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_ec.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_hmac.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_ns_spki.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_pair.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_pkcs7.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_pkey_rsa.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_ssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_x509cert.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_x509crl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_x509ext.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_x509name.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_x509req.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/test_x509store.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.8/utils.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/ssl_server.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_asn1.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_bn.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_buffering.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_cipher.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_config.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_digest.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_engine.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_hmac.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_ns_spki.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_ocsp.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_pair.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_pkcs12.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_pkcs7.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_pkey_dh.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_pkey_dsa.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_pkey_ec.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_pkey_rsa.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_ssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_ssl_session.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_x509cert.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_x509crl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_x509ext.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_x509name.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_x509req.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/test_x509store.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/1.9/utils.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/cert_with_ec_pk.cer
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/ca-bundle.crt

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/ca_path

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/ca_path/72fa7371.0

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/ca_path/verisign.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/cacert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/cert_localhost.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/common.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/ids_in_subject_rdn_set.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/imaps

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/imaps/cacert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/imaps/server.crt

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/imaps/server.key

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/key_then_cert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/keypair.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/localhost_keypair.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/max.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/b70a5bc1.0

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/PASSWD_OF_CA_KEY_IS_1234

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/ca_config.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/cacert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/gen_cert.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/newcerts

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/newcerts/2_cert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/newcerts/3_cert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/newcerts/4_cert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/private

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/private/cakeypair.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/ca/serial

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/cacert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/scripts

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/scripts/gen_cert.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/scripts/gen_csr.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/scripts/init_ca.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslclient

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslclient/csr.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslclient/keypair.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslclient/sslclient.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslclient.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslserver

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslserver/csr.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslserver/keypair.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslserver/sslserver.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslserver.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/purpose/sslserver_no_dsig_in_keyUsage.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/selfcert.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/verisign.pem

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/fixture/verisign_c3.pem
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/pkcs7_mime_enveloped.message

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/pkcs7_mime_signed.message

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/pkcs7_multipart_signed.message

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/test_java_attribute.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/test_java_bio.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/test_java_mime.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/test_java_pkcs7.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/java/test_java_smime.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ref
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ref/a.out

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ref/compile.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ref/pkcs1

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ref/pkcs1.c
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ruby

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ruby/envutil.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ruby/ut_eof.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_all.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_certificate.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_cipher.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_imaps.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_integration.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_java.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_openssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_parse_certificate.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_pkcs7.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_pkey_dsa.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_pkey_rsa.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_ssl.rb

/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/test_x509store.rb
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/test/ut_eof.rb
Modified:
/trunk/mapreduce/pom.xml

/trunk/mapreduce/src/main/java/org/apache/virgil/mapreduce/RubyMapReduce.java

/trunk/mapreduce/src/test/java/org/apache/virgil/mapreduce/RubyInvokerTest.java
/trunk/pom.xml
/trunk/release/assembly/mapreduce/jars/virgil-mapreduce-hdeploy.jar
/trunk/release/pom.xml
/trunk/server/pom.xml
/trunk/server/src/main/java/org/apache/virgil/triggers/TriggerStore.java

=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/LICENSE.html
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,22 @@
+<html>
+<body bgcolor=#ffffff>
+
+Copyright (c) 2000-2009 The Legion Of The Bouncy Castle
(http://www.bouncycastle.org)
+<p>
+Permission is hereby granted, free of charge, to any person obtaining a
copy of this software
+and associated documentation files (the "Software"), to deal in the
Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so,
+subject to the following conditions:
+<p>
+The above copyright notice and this permission notice shall be included in
all copies or substantial
+portions of the Software.
+<p>
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+</body>
+</html>
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/README
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,13 @@
+'bouncy-castle-java' is a gem redistribution of "Legion of the Bouncy
Castle Java cryptography APIs" at http://www.bouncycastle.org/java.html
+
+Redistributed by Hiroshi Nakamura <na...@ruby-lang.org>.
+
+This package is redistributed under the same terms of Bouncy Castle's
license; see LICENSE.html for more details.
+
+Object code and source location:
+ lib/bouncy-castle-java.rb: http://github.com/nahi/bouncy-castle-java/
+ lib/bcmail-jdk15-146.jar:
http://www.bouncycastle.org/download/bcmail-jdk15-146.tar.gz
+ lib/bcprov-jdk15-146.jar:
http://www.bouncycastle.org/download/bcprov-jdk15-146.tar.gz
+
+For export classification in the United States of America, see;
+ http://www.bouncycastle.org/wiki/display/JA1/Frequently+Asked+Questions
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/lib/bcmail-jdk15-146.jar
Thu Jan 26 14:01:22 2012
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/lib/bcprov-jdk15-146.jar
Thu Jan 26 14:01:22 2012
File is too large to display a diff.
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/bouncy-castle-java-1.5.0146.1/lib/bouncy-castle-java.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,3 @@
+Dir[File.expand_path('bc*.jar', File.dirname(__FILE__))].each do |file|
+ require File.basename(file)
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/History.txt
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,201 @@
+== 0.7.5
+
+This release improved 1.9 mode support with help of
+Duncan Mak <dun...@earthaid.net>. Now jruby-ossl gem includes both 1.8
and 1.9
+libraries and part of features should work fine on 1.9 mode, too.
+
+- JRUBY-6270: Wrong keyUsage check for SSL server
+- JRUBY-6260: OpenSSL::ASN1::Integer#value incompatibility
+- JRUBY-6044: Improve Ecrypted RSA/DSA pem support
+- JRUBY-5972: Allow to load/dump empty PKCS7 data
+- JRUBY-5833: Fix X509Name handling; X509Name RDN can include multiple
elements
+- JRUBY-5362: Improved 1.9 support
+- JRUBY-4992: Warn if loaded by non JRuby interpreter
+
+== 0.7.4
+
+- JRUBY-5519: Avoid String encoding dependency in DER loading. PEM loading
+ failed on JRuby 1.6.x. Fixed.
+- JRUBY-5510: Add debug information to released jar
+- JRUBY-5478: Update bouncycastle jars to the latest version. (1.46)
+
+== 0.7.3
+
+- JRUBY-5200: Net::IMAP + SSL(imaps) login could hang. Fixed.
+- JRUBY-5253: Allow to load the certificate file which includes private
+ key for activemarchant compatibility.
+- JRUBY-5267: Added SSL socket error-checks to avoid busy loop under an
+ unknown condition.
+- JRUBY-5316: Improvements for J9's IBMJCE support. Now all testcases
+ pass on J9 JDK 6.
+
+== 0.7.2
+
+- JRUBY-5126: Ignore Cipher#reset and Cipher#iv= when it's a stream
+ cipher (Net::SSH compatibility)
+- JRUBY-5125: let Cipher#name for 'rc4' to be 'RC4' (Net::SSH
+ compatibility)
+- JRUBY-5096: Fixed inconsistent Certificate verification behavior
+- JRUBY-5060: Avoid NPE from to_pem for empty X509 Objects
+- JRUBY-5059: SSLSocket ignores Timeout (Fixed)
+- JRUBY-4965: implemented OpenSSL::Config
+- JRUBY-5023: make Certificate#signature_algorithm return correct algo
+ name; "sha1WithRSAEncryption" instead of "SHA1"
+- JRUBY-5024: let HMAC.new accept a String as a digest name
+- JRUBY-5018: SSLSocket holds selectors, keys, preventing quick
+ cleanup of resources when dereferenced
+
+== 0.7.1
+
+- NOTE: Now BouncyCastle jars has moved out to its own gem
+ "bouncy-castle-java" (http://rubygems.org/gems/bouncy-castle-java).
+ You don't need to care about it because "jruby-openssl" gem depends
+ on it from now on.
+
+=== SSL bugfix
+
+- JRUBY-4826 net/https client possibly raises "rbuf_fill': End of file
+ reached (EOFError)" for HTTP chunked read.
+
+=== Misc
+
+- JRUBY-4900: Set proper String to OpenSSL::OPENSSL_VERSION. Make sure
+ it's not an OpenSSL artifact: "OpenSSL 0.9.8b 04 May 2006
+ (JRuby-OpenSSL fake)" -> "jruby-ossl 0.7.1"
+- JRUBY-4975: Moving BouncyCastle jars out to its own gem.
+
+== 0.7
+
+- Follow MRI 1.8.7 openssl API changes
+- Fixes so that jruby-openssl can run on appengine
+- Many bug and compatibility fixes, see below.
+- This is the last release that will be compatible with JRuby 1.4.x.
+- Compatibility issues
+-- JRUBY-4342: Follow ruby-openssl of CRuby 1.8.7.
+-- JRUBY-4346: Sync tests with tests for ruby-openssl of CRuby 1.8.7.
+-- JRUBY-4444: OpenSSL crash running RubyGems tests
+-- JRUBY-4075: Net::SSH gives OpenSSL::Cipher::CipherError "No message
+ available"
+-- JRUBY-4076: Net::SSH padding error using 3des-cbc on Solaris
+-- JRUBY-4541: jruby-openssl doesn't load on App Engine.
+-- JRUBY-4077: Net::SSH "all authorization methods failed" Solaris ->
Solaris
+-- JRUBY-4535: Issues with the BouncyCastle provider
+-- JRUBY-4510: JRuby-OpenSSL crashes when JCE fails a initialise bcprov
+-- JRUBY-4343: Update BouncyCastle jar to upstream version; jdk14-139 ->
+ jdk15-144
+- Cipher issues
+-- JRUBY-4012: Initialization vector length handled differently than in MRI
+ (longer IV sequence are trimmed to fit the required)
+-- JRUBY-4473: Implemented DSA key generation
+-- JRUBY-4472: Cipher does not support RC4 and CAST
+-- JRUBY-4577: InvalidParameterException 'Wrong keysize: must be equal to
112 or
+ 168' for DES3 + SunJCE
+- SSL and X.509(PKIX) issues
+-- JRUBY-4384: TCP socket connection causes busy loop of SSL server
+-- JRUBY-4370: Implement SSLContext#ciphers
+-- JRUBY-4688: SSLContext#ciphers does not accept 'DEFAULT'
+-- JRUBY-4357: SSLContext#{setup,ssl_version=} are not implemented
+-- JRUBY-4397: SSLContext#extra_chain_cert and SSLContext#client_ca
+-- JRUBY-4684: SSLContext#verify_depth is ignored
+-- JRUBY-4398: SSLContext#options does not affect to SSL sessions
+-- JRUBY-4360: Implement SSLSocket#verify_result and dependents
+-- 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)
+-- JRUBY-4686: SSLSocket can drop last chunk of data just before inbound
channel
+ close
+-- JRUBY-4369: X509Store#verify_callback is not called
+-- 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))
+-- JRUBY-4333: PKCS#8 formatted privkey read
+-- JRUBY-4454: Loading Key file as a Certificate causes NPE
+-- JRUBY-4455: calling X509::Certificate#sign for the Certificate
initialized
+ from PEM causes IllegalStateException
+- PKCS#7 issues
+-- JRUBY-4379: PKCS7#sign failed for DES3 cipher algorithm
+-- 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)
+- Misc
+-- JRUBY-4574: jruby-openssl deprecation warning cleanup
+-- JRUBY-4591: jruby-1.4 support
+
+== 0.6
+
+- This is a recommended upgrade to jruby-openssl. A security problem
+ involving peer certificate verification was found where failed
+ verification silently did nothing, making affected applications
+ vulnerable to attackers. Attackers could lead a client application
+ to believe that a secure connection to a rogue SSL server is
+ legitimate. Attackers could also penetrate client-validated SSL
+ server applications with a dummy certificate. Your application would
+ be vulnerable if you're using the 'net/https' library with
+ OpenSSL::SSL::VERIFY_PEER mode and any version of jruby-openssl
+ prior to 0.6. Thanks to NaHi (NAKAMURA Hiroshi) for finding the
+ problem and providing the fix. See
+ http://www.jruby.org/2009/12/07/vulnerability-in-jruby-openssl.html
+ for details.
+- This release addresses CVE-2009-4123 which was reserved for the
+ above vulnerability.
+- Many fixes from NaHi, including issues related to certificate
+ verification and certificate store purpose verification.
+ - implement OpenSSL::X509::Store#set_default_paths
+ - MRI compat. fix: OpenSSL::X509::Store#add_file
+ - Fix nsCertType handling.
+ - Fix Cipher#key_len for DES-EDE3: 16 should be 24.
+ - Modified test expectations around Cipher#final.
+- Public keys are lazily instantiated when the
+ X509::Certificate#public_key method is called (Dave Garcia)
+
+== 0.5.2
+
+* Multiple bugs fixed:
+** JRUBY-3895 Could not verify server signature with net-ssh against Cygwin
+** JRUBY-3864 jruby-openssl depends on Base64Coder from JvYAMLb
+** JRUBY-3790 JRuby-OpenSSL test_post_connection_check is not passing
+** JRUBY-3767 OpenSSL ssl implementation doesn't support client auth
+** JRUBY-3673 jRuby-OpenSSL does not properly load certificate authority
file
+
+== 0.5.1
+
+* Multiple fixes by Brice Figureau to get net/ssh working. Requires JRuby
1.3.1
+ to be 100%
+* Fix by Frederic Jean for a character-decoding issue for some certificates
+
+== 0.5
+
+* Fixed JRUBY-3614: Unsupported HMAC algorithm (HMACSHA-256)
+* Fixed JRUBY-3570: ActiveMerchant's AuthorizeNet Gateway throws OpenSSL
Cert
+ Validation Error, when there should be no error
+* Fixed JRUBY-3557 Class cast exception in PKeyRSA.java
+* Fixed JRUBY-3468 X.509 certificates: subjectKeyIdentifier corrupted
+* Fixed JRUBY-3285 Unsupported HMAC algorithm (HMACSHA1) error when
generating
+ digest
+* Misc code cleanup
+
+== 0.2
+
+- Enable remaining tests; fix a nil string issue in SSLSocket.sysread
+ (JRUBY-1888)
+- Fix socket buffering issue by setting socket IO sync = true
+- Fix bad file descriptor issue caused by unnecessary close (JRUBY-2152)
+- Fix AES key length (JRUBY-2187)
+- Fix cipher initialization (JRUBY-1100)
+- Now, only compatible with JRuby 1.1
+
+== 0.1.1
+
+- Fixed blocker issue preventing HTTPS/SSL from working (JRUBY-1222)
+
+== 0.1
+
+- PLEASE NOTE: This release is not compatible with JRuby releases earlier
than
+ 1.0.3 or 1.1b2. If you must use JRuby 1.0.2 or earlier, please install
the
+ 0.6 release.
+- Release coincides with JRuby 1.0.3 and JRuby 1.1b2 releases
+- Simultaneous support for JRuby trunk and 1.0 branch
+- Start of support for OpenSSL::BN
+
+== 0.0.5 and prior
+
+- Initial versions with maintenance updates
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/License.txt
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,30 @@
+JRuby-OpenSSL is distributed under the same license as JRuby
(http://www.jruby.org/).
+
+Version: CPL 1.0/GPL 2.0/LGPL 2.1
+
+The contents of this file are subject to the Common Public
+License Version 1.0 (the "License"); you may not use this file
+except in compliance with the License. You may obtain a copy of
+the License at http://www.eclipse.org/legal/cpl-v10.html
+
+Software distributed under the License is distributed on an "AS
+IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+implied. See the License for the specific language governing
+rights and limitations under the License.
+
+Copyright (C) 2007 Ola Bini <ola....@gmail.com>
+
+Alternatively, the contents of this file may be used under the terms of
+either of the GNU General Public License Version 2 or later (the "GPL"),
+or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the CPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the CPL, the GPL or the LGPL.
+
+JRuby-OpenSSL includes software by the Legion of the Bouncy Castle
+(http://bouncycastle.org/license.html).
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/Manifest.txt
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,171 @@
+Rakefile
+History.txt
+Manifest.txt
+README.txt
+License.txt
+lib/shared/jopenssl.jar
+lib/1.9
+lib/shared
+lib/1.8
+lib/1.9/openssl.rb
+lib/1.9/openssl
+lib/1.9/openssl/bn.rb
+lib/1.9/openssl/x509-internal.rb
+lib/1.9/openssl/cipher.rb
+lib/1.9/openssl/digest.rb
+lib/1.9/openssl/ssl.rb
+lib/1.9/openssl/buffering.rb
+lib/1.9/openssl/ssl-internal.rb
+lib/1.9/openssl/x509.rb
+lib/1.9/openssl/config.rb
+lib/shared/jopenssl.jar
+lib/shared/openssl.rb
+lib/shared/openssl
+lib/shared/jopenssl
+lib/shared/openssl/dummyssl.rb
+lib/shared/openssl/ssl.rb
+lib/shared/openssl/x509.rb
+lib/shared/openssl/dummy.rb
+lib/shared/jopenssl/version.rb
+lib/1.8/openssl.rb
+lib/1.8/openssl
+lib/1.8/openssl/bn.rb
+lib/1.8/openssl/pkcs7.rb
+lib/1.8/openssl/x509-internal.rb
+lib/1.8/openssl/cipher.rb
+lib/1.8/openssl/digest.rb
+lib/1.8/openssl/ssl.rb
+lib/1.8/openssl/buffering.rb
+lib/1.8/openssl/ssl-internal.rb
+lib/1.8/openssl/x509.rb
+lib/1.8/openssl/config.rb
+test/1.9
+test/ref
+test/test_all.rb
+test/test_pkey_dsa.rb
+test/fixture
+test/test_integration.rb
+test/ruby
+test/test_ssl.rb
+test/test_parse_certificate.rb
+test/test_openssl.rb
+test/cert_with_ec_pk.cer
+test/java
+test/ut_eof.rb
+test/test_x509store.rb
+test/test_imaps.rb
+test/test_certificate.rb
+test/test_pkcs7.rb
+test/test_cipher.rb
+test/1.8
+test/test_pkey_rsa.rb
+test/test_java.rb
+test/1.9/test_ssl_session.rb
+test/1.9/test_engine.rb
+test/1.9/test_asn1.rb
+test/1.9/test_pkey_dh.rb
+test/1.9/test_pkey_dsa.rb
+test/1.9/test_ocsp.rb
+test/1.9/ssl_server.rb
+test/1.9/test_x509ext.rb
+test/1.9/utils.rb
+test/1.9/test_ssl.rb
+test/1.9/test_buffering.rb
+test/1.9/test_ns_spki.rb
+test/1.9/test_digest.rb
+test/1.9/test_pair.rb
+test/1.9/test_x509crl.rb
+test/1.9/test_x509store.rb
+test/1.9/test_bn.rb
+test/1.9/test_pkey_ec.rb
+test/1.9/test_pkcs7.rb
+test/1.9/test_pkcs12.rb
+test/1.9/test_cipher.rb
+test/1.9/test_pkey_rsa.rb
+test/1.9/test_x509req.rb
+test/1.9/test_x509name.rb
+test/1.9/test_hmac.rb
+test/1.9/test_x509cert.rb
+test/1.9/test_config.rb
+test/ref/a.out
+test/ref/pkcs1
+test/ref/pkcs1.c
+test/ref/compile.rb
+test/fixture/common.pem
+test/fixture/ca_path
+test/fixture/key_then_cert.pem
+test/fixture/imaps
+test/fixture/keypair.pem
+test/fixture/cacert.pem
+test/fixture/verisign.pem
+test/fixture/purpose
+test/fixture/cert_localhost.pem
+test/fixture/selfcert.pem
+test/fixture/max.pem
+test/fixture/localhost_keypair.pem
+test/fixture/ids_in_subject_rdn_set.pem
+test/fixture/ca-bundle.crt
+test/fixture/verisign_c3.pem
+test/fixture/ca_path/72fa7371.0
+test/fixture/ca_path/verisign.pem
+test/fixture/imaps/cacert.pem
+test/fixture/imaps/server.crt
+test/fixture/imaps/server.key
+test/fixture/purpose/ca
+test/fixture/purpose/sslclient
+test/fixture/purpose/scripts
+test/fixture/purpose/sslserver_no_dsig_in_keyUsage.pem
+test/fixture/purpose/cacert.pem
+test/fixture/purpose/sslserver
+test/fixture/purpose/sslserver.pem
+test/fixture/purpose/sslclient.pem
+test/fixture/purpose/b70a5bc1.0
+test/fixture/purpose/ca/serial
+test/fixture/purpose/ca/gen_cert.rb
+test/fixture/purpose/ca/PASSWD_OF_CA_KEY_IS_1234
+test/fixture/purpose/ca/ca_config.rb
+test/fixture/purpose/ca/cacert.pem
+test/fixture/purpose/ca/private
+test/fixture/purpose/ca/newcerts
+test/fixture/purpose/ca/private/cakeypair.pem
+test/fixture/purpose/ca/newcerts/4_cert.pem
+test/fixture/purpose/ca/newcerts/3_cert.pem
+test/fixture/purpose/ca/newcerts/2_cert.pem
+test/fixture/purpose/sslclient/csr.pem
+test/fixture/purpose/sslclient/keypair.pem
+test/fixture/purpose/sslclient/sslclient.pem
+test/fixture/purpose/scripts/gen_cert.rb
+test/fixture/purpose/scripts/init_ca.rb
+test/fixture/purpose/scripts/gen_csr.rb
+test/fixture/purpose/sslserver/csr.pem
+test/fixture/purpose/sslserver/keypair.pem
+test/fixture/purpose/sslserver/sslserver.pem
+test/ruby/ut_eof.rb
+test/ruby/envutil.rb
+test/java/pkcs7_mime_enveloped.message
+test/java/test_java_attribute.rb
+test/java/test_java_pkcs7.rb
+test/java/test_java_mime.rb
+test/java/pkcs7_mime_signed.message
+test/java/test_java_smime.rb
+test/java/pkcs7_multipart_signed.message
+test/java/test_java_bio.rb
+test/1.8/test_asn1.rb
+test/1.8/ssl_server.rb
+test/1.8/test_x509ext.rb
+test/1.8/utils.rb
+test/1.8/test_ssl.rb
+test/1.8/test_ec.rb
+test/1.8/test_ns_spki.rb
+test/1.8/test_digest.rb
+test/1.8/test_pair.rb
+test/1.8/test_x509crl.rb
+test/1.8/test_x509store.rb
+test/1.8/test_pkcs7.rb
+test/1.8/test_cipher.rb
+test/1.8/test_pkey_rsa.rb
+test/1.8/test_x509req.rb
+test/1.8/test_x509name.rb
+test/1.8/test_hmac.rb
+test/1.8/test_x509cert.rb
+test/1.8/test_config.rb
=======================================
--- /dev/null
+++ /trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/README.txt
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,13 @@
+= JRuby-OpenSSL
+
+* http://jruby-extras.rubyforge.org/jruby-openssl
+
+== DESCRIPTION:
+
+JRuby-OpenSSL is an add-on gem for JRuby that emulates the Ruby OpenSSL
native library.
+
+Please report bugs and incompatibilities (preferably with testcases) to
either the JRuby
+mailing list [1] or the JRuby bug tracker [2].
+
+[1]: http://xircles.codehaus.org/projects/jruby/lists
+[2]: http://jira.codehaus.org/browse/JRUBY
=======================================
--- /dev/null
+++ /trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/Rakefile
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,87 @@
+require 'rake'
+require 'rake/testtask'
+
+MANIFEST =
FileList["Rakefile", "History.txt", "Manifest.txt", "README.txt", "License.txt", "lib/shared/jopenssl.jar", "lib/**/*", "test/**/*"]
+BC_JARS = FileList["build_lib/bc*.jar"]
+
+task :default => [:java_compile, :test]
+
+def java_classpath_arg # myriad of ways to discover JRuby classpath
+ begin
+ cpath =
Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
+ cpath +=
Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR)
+ jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR)
+ rescue => e
+ end
+ unless jruby_cpath
+ jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
+ FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
+ end
+ bc_jars = BC_JARS.join(File::PATH_SEPARATOR)
+ jruby_cpath ? "-cp
\"#{jruby_cpath.gsub('\\', '/')}#{File::PATH_SEPARATOR}#{bc_jars}\"" : "-cp
\"#{bc_jars}\""
+end
+
+desc "Compile the native Java code."
+task :java_compile do
+ mkdir_p "pkg/classes"
+
+ File.open("pkg/compile_options", "w") do |f|
+ f << "-g -target 1.5 -source 1.5 -Xlint:unchecked -Xlint:deprecation
-d pkg/classes"
+ end
+
+ File.open("pkg/compile_classpath", "w") do |f|
+ f << java_classpath_arg
+ end
+
+ File.open("pkg/compile_sourcefiles", "w") do |f|
+ f << FileList['src/java/**/*.java'].join(' ')
+ end
+
+ sh "javac @pkg/compile_options @pkg/compile_classpath
@pkg/compile_sourcefiles"
+ sh "jar cf lib/shared/jopenssl.jar -C pkg/classes/ ."
+end
+file "lib/shared/jopenssl.jar" => :java_compile
+
+task :more_clean do
+ rm_f FileList['lib/shared/jopenssl.jar']
+end
+task :clean => :more_clean
+
+File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f.puts n } }
+
+begin
+ # easiest way to configure ruby_flags for Hoe.
+ ENV['RUBY_FLAGS'] ||= [
+ (RUBY_VERSION >= '1.9.0' ? '--1.9' : '--1.8'),
+ '-w',
+ '-Ibuild_lib:lib/shared:lib:test',
+ ENV['RUBY_DEBUG']
+ ].compact.join(' ')
+ require 'hoe'
+ Hoe.plugin :gemcutter
+ hoe = Hoe.spec("jruby-openssl") do |p|
+ load File.dirname(__FILE__) + "/lib/shared/jopenssl/version.rb"
+ p.version = Jopenssl::Version::VERSION
+ p.rubyforge_name = "jruby-extras"
+ p.url = "http://jruby-extras.rubyforge.org/jruby-openssl"
+ p.author = "Ola Bini and JRuby contributors"
+ p.email = "ola....@gmail.com"
+ p.summary = "OpenSSL add-on for JRuby"
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
+ p.description = p.paragraphs_of('README.txt', 3...4).join("\n\n")
+ p.test_globs = ENV["TEST"] || ["test/test_all.rb"]
+ p.extra_deps << ['bouncy-castle-java', '>= 1.5.0146.1']
+ end
+ hoe.spec.dependencies.delete_if { |dep| dep.name == "hoe" }
+ # Either lib/1.8 or lib/1.9 is added to $LOAD_PATH dynamically.
+ hoe.spec.require_paths = ['lib/shared']
+
+ task :gemspec do
+ File.open("#{hoe.name}.gemspec", "w") {|f| f << hoe.spec.to_ruby }
+ end
+ task :package => :gemspec
+rescue LoadError
+ puts "You really need Hoe installed to be able to package this gem"
+rescue => e
+ puts "ignoring error while loading hoe: #{e.to_s}"
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/bn.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,35 @@
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for BN
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: bn.rb 31657 2011-05-20 22:25:35Z shyouhei $
+=end
+
+##
+# Should we care what if somebody require this file directly?
+#require 'openssl'
+
+module OpenSSL
+ class BN
+ include Comparable
+ end # BN
+end # OpenSSL
+
+##
+# Add double dispatch to Integer
+#
+class Integer
+ def to_bn
+ OpenSSL::BN::new(self.to_s(16), 16)
+ end
+end # Integer
+
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/buffering.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,241 @@
+=begin
+= $RCSfile$ -- Buffering mix-in module.
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2001 GOTOU YUUZOU <goto...@notwork.org>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: buffering.rb 28004 2010-05-24 23:58:49Z shyouhei $
+=end
+
+module OpenSSL
+module Buffering
+ include Enumerable
+ attr_accessor :sync
+ BLOCK_SIZE = 1024*16
+
+ def initialize(*args)
+ @eof = false
+ @rbuffer = ""
+ @sync = @io.sync
+ end
+
+ #
+ # for reading.
+ #
+ private
+
+ def fill_rbuff
+ begin
+ @rbuffer << self.sysread(BLOCK_SIZE)
+ rescue Errno::EAGAIN
+ retry
+ rescue EOFError
+ @eof = true
+ end
+ end
+
+ def consume_rbuff(size=nil)
+ if @rbuffer.empty?
+ nil
+ else
+ size = @rbuffer.size unless size
+ ret = @rbuffer[0, size]
+ @rbuffer[0, size] = ""
+ ret
+ end
+ end
+
+ public
+
+ def read(size=nil, buf=nil)
+ if size == 0
+ if buf
+ buf.clear
+ else
+ buf = ""
+ end
+ return @eof ? nil : buf
+ end
+ until @eof
+ break if size && size <= @rbuffer.size
+ fill_rbuff
+ end
+ ret = consume_rbuff(size) || ""
+ if buf
+ buf.replace(ret)
+ ret = buf
+ end
+ (size && ret.empty?) ? nil : ret
+ end
+
+ def readpartial(maxlen, buf=nil)
+ if maxlen == 0
+ if buf
+ buf.clear
+ else
+ buf = ""
+ end
+ return @eof ? nil : buf
+ end
+ if @rbuffer.empty?
+ begin
+ return sysread(maxlen, buf)
+ rescue Errno::EAGAIN
+ retry
+ end
+ end
+ ret = consume_rbuff(maxlen)
+ if buf
+ buf.replace(ret)
+ ret = buf
+ end
+ raise EOFError if ret.empty?
+ ret
+ end
+
+ def gets(eol=$/)
+ idx = @rbuffer.index(eol)
+ until @eof
+ break if idx
+ fill_rbuff
+ idx = @rbuffer.index(eol)
+ end
+ if eol.is_a?(Regexp)
+ size = idx ? idx+$&.size : nil
+ else
+ size = idx ? idx+eol.size : nil
+ end
+ consume_rbuff(size)
+ end
+
+ def each(eol=$/)
+ while line = self.gets(eol)
+ yield line
+ end
+ end
+ alias each_line each
+
+ def readlines(eol=$/)
+ ary = []
+ while line = self.gets(eol)
+ ary << line
+ end
+ ary
+ end
+
+ def readline(eol=$/)
+ raise EOFError if eof?
+ gets(eol)
+ end
+
+ def getc
+ c = read(1)
+ c ? c[0] : nil
+ end
+
+ def each_byte
+ while c = getc
+ yield(c)
+ end
+ end
+
+ def readchar
+ raise EOFError if eof?
+ getc
+ end
+
+ def ungetc(c)
+ @rbuffer[0,0] = c.chr
+ end
+
+ def eof?
+ fill_rbuff if !@eof && @rbuffer.empty?
+ @eof && @rbuffer.empty?
+ end
+ alias eof eof?
+
+ #
+ # for writing.
+ #
+ private
+
+ def do_write(s)
+ @wbuffer = "" unless defined? @wbuffer
+ @wbuffer << s
+ @sync ||= false
+ if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)
+ remain = idx ? idx + $/.size : @wbuffer.length
+ nwritten = 0
+ while remain > 0
+ str = @wbuffer[nwritten,remain]
+ begin
+ nwrote = syswrite(str)
+ rescue Errno::EAGAIN
+ retry
+ end
+ remain -= nwrote
+ nwritten += nwrote
+ end
+ @wbuffer[0,nwritten] = ""
+ end
+ end
+
+ public
+
+ def write(s)
+ do_write(s)
+ s.length
+ end
+
+ def << (s)
+ do_write(s)
+ self
+ end
+
+ def puts(*args)
+ s = ""
+ if args.empty?
+ s << "\n"
+ end
+ args.each{|arg|
+ s << arg.to_s
+ if $/ && /\n\z/ !~ s
+ s << "\n"
+ end
+ }
+ do_write(s)
+ nil
+ end
+
+ def print(*args)
+ s = ""
+ args.each{ |arg| s << arg.to_s }
+ do_write(s)
+ nil
+ end
+
+ def printf(s, *args)
+ do_write(s % args)
+ nil
+ end
+
+ def flush
+ osync = @sync
+ @sync = true
+ do_write ""
+ @sync = osync
+ end
+
+ def close
+ flush rescue nil
+ sysclose
+ end
+end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/cipher.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,65 @@
+=begin
+= $RCSfile$ -- Ruby-space predefined Cipher subclasses
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: cipher.rb 12496 2007-06-08 15:02:04Z technorama $
+=end
+
+##
+# Should we care what if somebody require this file directly?
+#require 'openssl'
+
+module OpenSSL
+ class Cipher
+ %w(AES CAST5 BF DES IDEA RC2 RC4 RC5).each{|name|
+ klass = Class.new(Cipher){
+ define_method(:initialize){|*args|
+ cipher_name = args.inject(name){|n, arg| "#{n}-#{arg}" }
+ super(cipher_name)
+ }
+ }
+ const_set(name, klass)
+ }
+
+ %w(128 192 256).each{|keylen|
+ klass = Class.new(Cipher){
+ define_method(:initialize){|mode|
+ mode ||= "CBC"
+ cipher_name = "AES-#{keylen}-#{mode}"
+ super(cipher_name)
+ }
+ }
+ const_set("AES#{keylen}", klass)
+ }
+
+ # Generate, set, and return a random key.
+ # You must call cipher.encrypt or cipher.decrypt before calling this
method.
+ def random_key
+ str = OpenSSL::Random.random_bytes(self.key_len)
+ self.key = str
+ return str
+ end
+
+ # Generate, set, and return a random iv.
+ # You must call cipher.encrypt or cipher.decrypt before calling this
method.
+ def random_iv
+ str = OpenSSL::Random.random_bytes(self.iv_len)
+ self.iv = str
+ return str
+ end
+
+ # This class is only provided for backwards compatibility. Use
OpenSSL::Digest in the future.
+ class Cipher < Cipher
+ # add warning
+ end
+ end # Cipher
+end # OpenSSL
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/config.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,316 @@
+=begin
+= Ruby-space definitions that completes C-space funcs for Config
+
+= Info
+ Copyright (C) 2010 Hiroshi Nakamura <na...@ruby-lang.org>
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+=end
+
+##
+# Should we care what if somebody require this file directly?
+#require 'openssl'
+require 'stringio'
+
+module OpenSSL
+ class Config
+ include Enumerable
+
+ class << self
+ def parse(str)
+ c = new()
+ parse_config(StringIO.new(str)).each do |section, hash|
+ c[section] = hash
+ end
+ c
+ end
+
+ alias load new
+
+ def parse_config(io)
+ begin
+ parse_config_lines(io)
+ rescue ConfigError => e
+ e.message.replace("error in line #{io.lineno}: " + e.message)
+ raise
+ end
+ end
+
+ def get_key_string(data, section, key) # :nodoc:
+ if v = data[section] && data[section][key]
+ return v
+ elsif section == 'ENV'
+ if v = ENV[key]
+ return v
+ end
+ end
+ if v = data['default'] && data['default'][key]
+ return v
+ end
+ end
+
+ private
+
+ def parse_config_lines(io)
+ section = 'default'
+ data = {section => {}}
+ while definition = get_definition(io)
+ definition = clear_comments(definition)
+ next if definition.empty?
+ if definition[0] == ?[
+ if /\[([^\]]*)\]/ =~ definition
+ section = $1.strip
+ data[section] ||= {}
+ else
+ raise ConfigError, "missing close square bracket"
+ end
+ else
+ if /\A([^:\s]*)(?:::([^:\s]*))?\s*=(.*)\z/ =~ definition
+ if $2
+ section = $1
+ key = $2
+ else
+ key = $1
+ end
+ value = unescape_value(data, section, $3)
+ (data[section] ||= {})[key] = value.strip
+ else
+ raise ConfigError, "missing equal sign"
+ end
+ end
+ end
+ data
+ end
+
+ # escape with backslash
+ QUOTE_REGEXP_SQ = /\A([^'\\]*(?:\\.[^'\\]*)*)'/
+ # escape with backslash and doubled dq
+ QUOTE_REGEXP_DQ = /\A([^"\\]*(?:""[^"\\]*|\\.[^"\\]*)*)"/
+ # escaped char map
+ ESCAPE_MAP = {
+ "r" => "\r",
+ "n" => "\n",
+ "b" => "\b",
+ "t" => "\t",
+ }
+
+ def unescape_value(data, section, value)
+ scanned = []
+ while m = value.match(/['"\\$]/)
+ scanned << m.pre_match
+ c = m[0]
+ value = m.post_match
+ case c
+ when "'"
+ if m = value.match(QUOTE_REGEXP_SQ)
+ scanned << m[1].gsub(/\\(.)/, '\\1')
+ value = m.post_match
+ else
+ break
+ end
+ when '"'
+ if m = value.match(QUOTE_REGEXP_DQ)
+ scanned << m[1].gsub(/""/, '').gsub(/\\(.)/, '\\1')
+ value = m.post_match
+ else
+ break
+ end
+ when "\\"
+ c = value.slice!(0, 1)
+ scanned << (ESCAPE_MAP[c] || c)
+ when "$"
+ ref, value = extract_reference(value)
+ refsec = section
+ if ref.index('::')
+ refsec, ref = ref.split('::', 2)
+ end
+ if v = get_key_string(data, refsec, ref)
+ scanned << v
+ else
+ raise ConfigError, "variable has no value"
+ end
+ else
+ raise 'must not reaced'
+ end
+ end
+ scanned << value
+ scanned.join
+ end
+
+ def extract_reference(value)
+ rest = ''
+ if m = value.match(/\(([^)]*)\)|\{([^}]*)\}/)
+ value = m[1] || m[2]
+ rest = m.post_match
+ elsif [?(, ?{].include?(value[0])
+ raise ConfigError, "no close brace"
+ end
+ if m = value.match(/[a-zA-Z0-9_]*(?:::[a-zA-Z0-9_]*)?/)
+ return m[0], m.post_match + rest
+ else
+ raise
+ end
+ end
+
+ def clear_comments(line)
+ # FCOMMENT
+ if m = line.match(/\A([\t\n\f ]*);.*\z/)
+ return m[1]
+ end
+ # COMMENT
+ scanned = []
+ while m = line.match(/[#'"\\]/)
+ scanned << m.pre_match
+ c = m[0]
+ line = m.post_match
+ case c
+ when '#'
+ line = nil
+ break
+ when "'", '"'
+ regexp = (c == "'") ? QUOTE_REGEXP_SQ : QUOTE_REGEXP_DQ
+ scanned << c
+ if m = line.match(regexp)
+ scanned << m[0]
+ line = m.post_match
+ else
+ scanned << line
+ line = nil
+ break
+ end
+ when "\\"
+ scanned << c
+ scanned << line.slice!(0, 1)
+ else
+ raise 'must not reaced'
+ end
+ end
+ scanned << line
+ scanned.join
+ end
+
+ def get_definition(io)
+ if line = get_line(io)
+ while /[^\\]\\\z/ =~ line
+ if extra = get_line(io)
+ line += extra
+ else
+ break
+ end
+ end
+ return line.strip
+ end
+ end
+
+ def get_line(io)
+ if line = io.gets
+ line.gsub(/[\r\n]*/, '')
+ end
+ end
+ end
+
+ def initialize(filename = nil)
+ @data = {}
+ if filename
+ File.open(filename.to_s) do |file|
+ Config.parse_config(file).each do |section, hash|
+ self[section] = hash
+ end
+ end
+ end
+ end
+
+ def get_value(section, key)
+ if section.nil?
+ raise TypeError.new('nil not allowed')
+ end
+ section = 'default' if section.empty?
+ get_key_string(section, key)
+ end
+
+ def value(arg1, arg2 = nil)
+ warn('Config#value is deprecated; use Config#get_value')
+ if arg2.nil?
+ section, key = 'default', arg1
+ else
+ section, key = arg1, arg2
+ end
+ section ||= 'default'
+ section = 'default' if section.empty?
+ get_key_string(section, key)
+ end
+
+ def add_value(section, key, value)
+ check_modify
+ (@data[section] ||= {})[key] = value
+ end
+
+ def [](section)
+ @data[section] || {}
+ end
+
+ def section(name)
+ warn('Config#section is deprecated; use Config#[]')
+ @data[name] || {}
+ end
+
+ def []=(section, pairs)
+ check_modify
+ @data[section] ||= {}
+ pairs.each do |key, value|
+ self.add_value(section, key, value)
+ end
+ end
+
+ def sections
+ @data.keys
+ end
+
+ def to_s
+ ary = []
+ @data.keys.sort.each do |section|
+ ary << "[ #{section} ]\n"
+ @data[section].keys.each do |key|
+ ary << "#{key}=#{@data[section][key]}\n"
+ end
+ ary << "\n"
+ end
+ ary.join
+ end
+
+ def each
+ @data.each do |section, hash|
+ hash.each do |key, value|
+ yield(section, key, value)
+ end
+ end
+ end
+
+ def inspect
+ "#<#{self.class.name} sections=#{sections.inspect}>"
+ end
+
+ protected
+
+ def data
+ @data
+ end
+
+ private
+
+ def initialize_copy(other)
+ @data = other.data.dup
+ end
+
+ def check_modify
+ raise TypeError.new("Insecure: can't modify OpenSSL config") if
frozen?
+ end
+
+ def get_key_string(section, key)
+ Config.get_key_string(@data, section, key)
+ end
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/digest.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,61 @@
+=begin
+= $RCSfile$ -- Ruby-space predefined Digest subclasses
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: digest.rb 28004 2010-05-24 23:58:49Z shyouhei $
+=end
+
+##
+# Should we care what if somebody require this file directly?
+#require 'openssl'
+
+module OpenSSL
+ class Digest
+
+ alg = %w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1)
+ if OPENSSL_VERSION_NUMBER > 0x00908000
+ alg += %w(SHA224 SHA256 SHA384 SHA512)
+ end
+
+ def self.digest(name, data)
+ super(data, name)
+ end
+
+ alg.each{|name|
+ klass = Class.new(Digest){
+ define_method(:initialize){|*data|
+ if data.length > 1
+ raise ArgumentError,
+ "wrong number of arguments (#{data.length} for 1)"
+ end
+ super(name, data.first)
+ }
+ }
+ singleton = (class << klass; self; end)
+ singleton.class_eval{
+ define_method(:digest){|data| Digest.digest(name, data) }
+ define_method(:hexdigest){|data| Digest.hexdigest(name, data) }
+ }
+ const_set(name, klass)
+ }
+
+ # This class is only provided for backwards compatibility. Use
OpenSSL::Digest in the future.
+ class Digest < Digest
+ def initialize(*args)
+ # add warning
+ super(*args)
+ end
+ end
+
+ end # Digest
+end # OpenSSL
+
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/pkcs7.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,25 @@
+=begin
+= $RCSfile$ -- PKCS7
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: digest.rb 12148 2007-04-05 05:59:22Z technorama $
+=end
+
+module OpenSSL
+ class PKCS7
+ # This class is only provided for backwards compatibility. Use
OpenSSL::PKCS7 in the future.
+ class PKCS7 < PKCS7
+ def initialize(*args)
+ super(*args)
+
+ warn("Warning: OpenSSL::PKCS7::PKCS7 is deprecated after Ruby 1.9;
use OpenSSL::PKCS7 instead")
+ end
+ end
+
+ end # PKCS7
+end # OpenSSL
+
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/ssl-internal.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,179 @@
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for SSL
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2001 GOTOU YUUZOU <goto...@notwork.org>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id$
+=end
+
+require "openssl/buffering"
+require "fcntl"
+
+module OpenSSL
+ module SSL
+ class SSLContext
+ DEFAULT_PARAMS = {
+ :ssl_version => "SSLv23",
+ :verify_mode => OpenSSL::SSL::VERIFY_PEER,
+ :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
+ :options => OpenSSL::SSL::OP_ALL,
+ }
+
+ DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
+ DEFAULT_CERT_STORE.set_default_paths
+ if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
+ DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
+ end
+
+ def set_params(params={})
+ params = DEFAULT_PARAMS.merge(params)
+ # ssl_version need to be set at first.
+ self.ssl_version = params.delete(:ssl_version)
+ params.each{|name, value| self.__send__("#{name}=", value) }
+ if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
+ unless self.ca_file or self.ca_path or self.cert_store
+ self.cert_store = DEFAULT_CERT_STORE
+ end
+ end
+ return params
+ end
+ end
+
+ module SocketForwarder
+ def addr
+ to_io.addr
+ end
+
+ def peeraddr
+ to_io.peeraddr
+ end
+
+ def setsockopt(level, optname, optval)
+ to_io.setsockopt(level, optname, optval)
+ end
+
+ def getsockopt(level, optname)
+ to_io.getsockopt(level, optname)
+ end
+
+ def fcntl(*args)
+ to_io.fcntl(*args)
+ end
+
+ def closed?
+ to_io.closed?
+ end
+
+ def do_not_reverse_lookup=(flag)
+ to_io.do_not_reverse_lookup = flag
+ end
+ end
+
+ module Nonblock
+ def initialize(*args)
+ flag = File::NONBLOCK
+ flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL)
+ @io.fcntl(Fcntl::F_SETFL, flag)
+ super
+ end
+ end
+
+ def verify_certificate_identity(cert, hostname)
+ should_verify_common_name = true
+ cert.extensions.each{|ext|
+ next if ext.oid != "subjectAltName"
+ ext.value.split(/,\s+/).each{|general_name|
+ if /\ADNS:(.*)/ =~ general_name
+ should_verify_common_name = false
+ reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ elsif /\AIP Address:(.*)/ =~ general_name
+ should_verify_common_name = false
+ return true if $1 == hostname
+ end
+ }
+ }
+ if should_verify_common_name
+ cert.subject.to_a.each{|oid, value|
+ if oid == "CN"
+ reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ end
+ }
+ end
+ return false
+ end
+ module_function :verify_certificate_identity
+
+ class SSLSocket
+ include Buffering
+ include SocketForwarder
+ include Nonblock
+
+ def post_connection_check(hostname)
+ unless OpenSSL::SSL.verify_certificate_identity(peer_cert,
hostname)
+ raise SSLError, "hostname was not match with the server
certificate"
+ end
+ return true
+ end
+
+ def session
+ SSL::Session.new(self)
+ rescue SSL::Session::SessionError
+ nil
+ end
+ end
+
+ class SSLServer
+ include SocketForwarder
+ attr_accessor :start_immediately
+
+ def initialize(svr, ctx)
+ @svr = svr
+ @ctx = ctx
+ unless ctx.session_id_context
+ session_id = OpenSSL::Digest::MD5.hexdigest($0)
+ @ctx.session_id_context = session_id
+ end
+ @start_immediately = true
+ end
+
+ def to_io
+ @svr
+ end
+
+ def listen(backlog=5)
+ @svr.listen(backlog)
+ end
+
+ def shutdown(how=Socket::SHUT_RDWR)
+ @svr.shutdown(how)
+ end
+
+ def accept
+ sock = @svr.accept
+ begin
+ ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
+ ssl.sync_close = true
+ ssl.accept if @start_immediately
+ ssl
+ rescue SSLError => ex
+ sock.close
+ raise ex
+ end
+ end
+
+ def close
+ @svr.close
+ end
+ end
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/ssl.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,1 @@
+require 'openssl'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/x509-internal.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,153 @@
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for
X509 and subclasses
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id$
+=end
+
+module OpenSSL
+ module X509
+ class ExtensionFactory
+ def create_extension(*arg)
+ if arg.size > 1
+ create_ext(*arg)
+ else
+ send("create_ext_from_"+arg[0].class.name.downcase, arg[0])
+ end
+ end
+
+ def create_ext_from_array(ary)
+ raise ExtensionError, "unexpected array form" if ary.size > 3
+ create_ext(ary[0], ary[1], ary[2])
+ end
+
+ def create_ext_from_string(str) # "oid = critical, value"
+ oid, value = str.split(/=/, 2)
+ oid.strip!
+ value.strip!
+ create_ext(oid, value)
+ end
+
+ def create_ext_from_hash(hash)
+ create_ext(hash["oid"], hash["value"], hash["critical"])
+ end
+ end
+
+ class Extension
+ def to_s # "oid = critical, value"
+ str = self.oid
+ str << " = "
+ str << "critical, " if self.critical?
+ str << self.value.gsub(/\n/, ", ")
+ end
+
+ def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
+ {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
+ end
+
+ def to_a
+ [ self.oid, self.value, self.critical? ]
+ end
+ end
+
+ class Name
+ module RFC2253DN
+ Special = ',=+<>#;'
+ HexChar = /[0-9a-fA-F]/
+ HexPair = /#{HexChar}#{HexChar}/
+ HexString = /#{HexPair}+/
+ Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
+ StringChar = /[^#{Special}\\"]/
+ QuoteChar = /[^\\"]/
+ AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
+ AttributeValue = /
+ (?!["#])((?:#{StringChar}|#{Pair})*)|
+ \#(#{HexString})|
+ "((?:#{QuoteChar}|#{Pair})*)"
+ /x
+ TypeAndValue = /\A(#{AttributeType})=#{AttributeValue}/
+
+ module_function
+
+ def expand_pair(str)
+ return nil unless str
+ return str.gsub(Pair){
+ pair = $&
+ case pair.size
+ when 2 then pair[1,1]
+ when 3 then Integer("0x#{pair[1,2]}").chr
+ else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
+ end
+ }
+ end
+
+ def expand_hexstring(str)
+ return nil unless str
+ der = str.gsub(HexPair){$&.to_i(16).chr }
+ a1 = OpenSSL::ASN1.decode(der)
+ return a1.value, a1.tag
+ end
+
+ def expand_value(str1, str2, str3)
+ value = expand_pair(str1)
+ value, tag = expand_hexstring(str2) unless value
+ value = expand_pair(str3) unless value
+ return value, tag
+ end
+
+ def scan(dn)
+ str = dn
+ ary = []
+ while true
+ if md = TypeAndValue.match(str)
+ matched = md.to_s
+ remain = md.post_match
+ type = md[1]
+ value, tag = expand_value(md[2], md[3], md[4]) rescue nil
+ if value
+ type_and_value = [type, value]
+ type_and_value.push(tag) if tag
+ ary.unshift(type_and_value)
+ if remain.length > 2 && remain[0] == ?,
+ str = remain[1..-1]
+ next
+ elsif remain.length > 2 && remain[0] == ?+
+ raise OpenSSL::X509::NameError,
+ "multi-valued RDN is not supported: #{dn}"
+ elsif remain.empty?
+ break
+ end
+ end
+ end
+ msg_dn = dn[0, dn.length - str.length] + " =>" + str
+ raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}"
+ end
+ return ary
+ end
+ end
+
+ class <<self
+ def parse_rfc2253(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = OpenSSL::X509::Name::RFC2253DN.scan(str)
+ self.new(ary, template)
+ end
+
+ def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2)
}
+ self.new(ary, template)
+ end
+
+ alias parse parse_openssl
+ end
+ end
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl/x509.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,1 @@
+require 'openssl'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.8/openssl.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,67 @@
+=begin
+= $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: openssl.rb 12496 2007-06-08 15:02:04Z technorama $
+=end
+
+# TODO: remove this chunk after 1.4 support is dropped
+require 'digest'
+unless defined?(::Digest::Class)
+ # restricted support for jruby <= 1.4 (1.8.6 Digest compat)
+ module Digest
+ class Class
+ def self.hexdigest(name, data)
+ digest(name, data).unpack('H*')[0]
+ end
+
+ def self.digest(data, name)
+ digester = const_get(name).new
+ digester.update(data)
+ digester.finish
+ end
+
+ def hexdigest
+ digest.unpack('H*')[0]
+ end
+
+ def digest
+ dup.finish
+ end
+
+ def ==(oth)
+ digest == oth.digest
+ end
+
+ def to_s
+ hexdigest
+ end
+
+ def size
+ digest_length
+ end
+
+ def length
+ digest_length
+ end
+ end
+ end
+end
+# end of compat chunk.
+
+require 'openssl/bn'
+require 'openssl/cipher'
+require 'openssl/config'
+require 'openssl/digest'
+require 'openssl/pkcs7'
+require 'openssl/ssl-internal'
+require 'openssl/x509-internal'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/bn.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,35 @@
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space definitions that completes C-space funcs for BN
+#
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+# All rights reserved.
+#
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id: bn.rb 33067 2011-08-25 00:52:10Z drbrain $
+#
+#++
+
+module OpenSSL
+ class BN
+ include Comparable
+ end # BN
+end # OpenSSL
+
+##
+# Add double dispatch to Integer
+#
+class Integer
+ def to_bn
+ OpenSSL::BN::new(self.to_s(16), 16)
+ end
+end # Integer
+
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/buffering.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,448 @@
+=begin
+= $RCSfile$ -- Buffering mix-in module.
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2001 GOTOU YUUZOU <goto...@notwork.org>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: buffering.rb 32012 2011-06-11 14:07:42Z nahi $
+=end
+
+##
+# OpenSSL IO buffering mix-in module.
+#
+# This module allows an OpenSSL::SSL::SSLSocket to behave like an IO.
+
+module OpenSSL::Buffering
+ include Enumerable
+
+ ##
+ # The "sync mode" of the SSLSocket.
+ #
+ # See IO#sync for full details.
+
+ attr_accessor :sync
+
+ ##
+ # Default size to read from or write to the SSLSocket for buffer
operations.
+
+ BLOCK_SIZE = 1024*16
+
+ def initialize(*args)
+ @eof = false
+ @rbuffer = ""
+ @sync = @io.sync
+ end
+
+ #
+ # for reading.
+ #
+ private
+
+ ##
+ # Fills the buffer from the underlying SSLSocket
+
+ def fill_rbuff
+ begin
+ @rbuffer << self.sysread(BLOCK_SIZE)
+ rescue Errno::EAGAIN
+ retry
+ rescue EOFError
+ @eof = true
+ end
+ end
+
+ ##
+ # Consumes +size+ bytes from the buffer
+
+ def consume_rbuff(size=nil)
+ if @rbuffer.empty?
+ nil
+ else
+ size = @rbuffer.size unless size
+ ret = @rbuffer[0, size]
+ @rbuffer[0, size] = ""
+ ret
+ end
+ end
+
+ public
+
+ ##
+ # Reads +size+ bytes from the stream. If +buf+ is provided it must
+ # reference a string which will receive the data.
+ #
+ # See IO#read for full details.
+
+ def read(size=nil, buf=nil)
+ if size == 0
+ if buf
+ buf.clear
+ return buf
+ else
+ return ""
+ end
+ end
+ until @eof
+ break if size && size <= @rbuffer.size
+ fill_rbuff
+ end
+ ret = consume_rbuff(size) || ""
+ if buf
+ buf.replace(ret)
+ ret = buf
+ end
+ (size && ret.empty?) ? nil : ret
+ end
+
+ ##
+ # Reads at most +maxlen+ bytes from the stream. If +buf+ is provided it
+ # must reference a string which will receive the data.
+ #
+ # See IO#readpartial for full details.
+
+ def readpartial(maxlen, buf=nil)
+ if maxlen == 0
+ if buf
+ buf.clear
+ return buf
+ else
+ return ""
+ end
+ end
+ if @rbuffer.empty?
+ begin
+ return sysread(maxlen, buf)
+ rescue Errno::EAGAIN
+ retry
+ end
+ end
+ ret = consume_rbuff(maxlen)
+ if buf
+ buf.replace(ret)
+ ret = buf
+ end
+ raise EOFError if ret.empty?
+ ret
+ end
+
+ ##
+ # Reads at most +maxlen+ bytes in the non-blocking manner.
+ #
+ # When no data can be read without blocking it raises
+ # OpenSSL::SSL::SSLError extended by IO::WaitReadable or
IO::WaitWritable.
+ #
+ # IO::WaitReadable means SSL needs to read internally so read_nonblock
+ # should be called again when the underlying IO is readable.
+ #
+ # IO::WaitWritable means SSL needs to write internally so read_nonblock
+ # should be called again after the underlying IO is writable.
+ #
+ # OpenSSL::Buffering#read_nonblock needs two rescue clause as follows:
+ #
+ # # emulates blocking read (readpartial).
+ # begin
+ # result = ssl.read_nonblock(maxlen)
+ # rescue IO::WaitReadable
+ # IO.select([io])
+ # retry
+ # rescue IO::WaitWritable
+ # IO.select(nil, [io])
+ # retry
+ # end
+ #
+ # Note that one reason that read_nonblock writes to the underlying IO is
+ # when the peer requests a new TLS/SSL handshake. See openssl the FAQ
for
+ # more details. http://www.openssl.org/support/faq.html
+
+ def read_nonblock(maxlen, buf=nil)
+ if maxlen == 0
+ if buf
+ buf.clear
+ return buf
+ else
+ return ""
+ end
+ end
+ if @rbuffer.empty?
+ return sysread_nonblock(maxlen, buf)
+ end
+ ret = consume_rbuff(maxlen)
+ if buf
+ buf.replace(ret)
+ ret = buf
+ end
+ raise EOFError if ret.empty?
+ ret
+ end
+
+ ##
+ # Reads the next "line+ from the stream. Lines are separated by +eol+.
If
+ # +limit+ is provided the result will not be longer than the given
number of
+ # bytes.
+ #
+ # +eol+ may be a String or Regexp.
+ #
+ # Unlike IO#gets the line read will not be assigned to +$_+.
+ #
+ # Unlike IO#gets the separator must be provided if a limit is provided.
+
+ def gets(eol=$/, limit=nil)
+ idx = @rbuffer.index(eol)
+ until @eof
+ break if idx
+ fill_rbuff
+ idx = @rbuffer.index(eol)
+ end
+ if eol.is_a?(Regexp)
+ size = idx ? idx+$&.size : nil
+ else
+ size = idx ? idx+eol.size : nil
+ end
+ if limit and limit >= 0
+ size = [size, limit].min
+ end
+ consume_rbuff(size)
+ end
+
+ ##
+ # Executes the block for every line in the stream where lines are
separated
+ # by +eol+.
+ #
+ # See also #gets
+
+ def each(eol=$/)
+ while line = self.gets(eol)
+ yield line
+ end
+ end
+ alias each_line each
+
+ ##
+ # Reads lines from the stream which are separated by +eol+.
+ #
+ # See also #gets
+
+ def readlines(eol=$/)
+ ary = []
+ while line = self.gets(eol)
+ ary << line
+ end
+ ary
+ end
+
+ ##
+ # Reads a line from the stream which is separated by +eol+.
+ #
+ # Raises EOFError if at end of file.
+
+ def readline(eol=$/)
+ raise EOFError if eof?
+ gets(eol)
+ end
+
+ ##
+ # Reads one character from the stream. Returns nil if called at end of
+ # file.
+
+ def getc
+ read(1)
+ end
+
+ ##
+ # Calls the given block once for each byte in the stream.
+
+ def each_byte # :yields: byte
+ while c = getc
+ yield(c.ord)
+ end
+ end
+
+ ##
+ # Reads a one-character string from the stream. Raises an EOFError at
end
+ # of file.
+
+ def readchar
+ raise EOFError if eof?
+ getc
+ end
+
+ ##
+ # Pushes character +c+ back onto the stream such that a subsequent
buffered
+ # character read will return it.
+ #
+ # Unlike IO#getc multiple bytes may be pushed back onto the stream.
+ #
+ # Has no effect on unbuffered reads (such as #sysread).
+
+ def ungetc(c)
+ @rbuffer[0,0] = c.chr
+ end
+
+ ##
+ # Returns true if the stream is at file which means there is no more
data to
+ # be read.
+
+ def eof?
+ fill_rbuff if !@eof && @rbuffer.empty?
+ @eof && @rbuffer.empty?
+ end
+ alias eof eof?
+
+ #
+ # for writing.
+ #
+ private
+
+ ##
+ # Writes +s+ to the buffer. When the buffer is full or #sync is true the
+ # buffer is flushed to the underlying socket.
+
+ def do_write(s)
+ @wbuffer = "" unless defined? @wbuffer
+ @wbuffer << s
+ @sync ||= false
+ if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)
+ remain = idx ? idx + $/.size : @wbuffer.length
+ nwritten = 0
+ while remain > 0
+ str = @wbuffer[nwritten,remain]
+ begin
+ nwrote = syswrite(str)
+ rescue Errno::EAGAIN
+ retry
+ end
+ remain -= nwrote
+ nwritten += nwrote
+ end
+ @wbuffer[0,nwritten] = ""
+ end
+ end
+
+ public
+
+ ##
+ # Writes +s+ to the stream. If the argument is not a string it will be
+ # converted using String#to_s. Returns the number of bytes written.
+
+ def write(s)
+ do_write(s)
+ s.length
+ end
+
+ ##
+ # Writes +str+ in the non-blocking manner.
+ #
+ # If there is buffered data, it is flushed first. This may block.
+ #
+ # write_nonblock returns number of bytes written to the SSL connection.
+ #
+ # When no data can be written without blocking it raises
+ # OpenSSL::SSL::SSLError extended by IO::WaitReadable or
IO::WaitWritable.
+ #
+ # IO::WaitReadable means SSL needs to read internally so write_nonblock
+ # should be called again after the underlying IO is readable.
+ #
+ # IO::WaitWritable means SSL needs to write internally so write_nonblock
+ # should be called again after underlying IO is writable.
+ #
+ # So OpenSSL::Buffering#write_nonblock needs two rescue clause as
follows.
+ #
+ # # emulates blocking write.
+ # begin
+ # result = ssl.write_nonblock(str)
+ # rescue IO::WaitReadable
+ # IO.select([io])
+ # retry
+ # rescue IO::WaitWritable
+ # IO.select(nil, [io])
+ # retry
+ # end
+ #
+ # Note that one reason that write_nonblock reads from the underlying IO
+ # is when the peer requests a new TLS/SSL handshake. See the openssl FAQ
+ # for more details. http://www.openssl.org/support/faq.html
+
+ def write_nonblock(s)
+ flush
+ syswrite_nonblock(s)
+ end
+
+ ##
+ # Writes +s+ to the stream. +s+ will be converted to a String using
+ # String#to_s.
+
+ def << (s)
+ do_write(s)
+ self
+ end
+
+ ##
+ # Writes +args+ to the stream along with a record separator.
+ #
+ # See IO#puts for full details.
+
+ def puts(*args)
+ s = ""
+ if args.empty?
+ s << "\n"
+ end
+ args.each{|arg|
+ s << arg.to_s
+ if $/ && /\n\z/ !~ s
+ s << "\n"
+ end
+ }
+ do_write(s)
+ nil
+ end
+
+ ##
+ # Writes +args+ to the stream.
+ #
+ # See IO#print for full details.
+
+ def print(*args)
+ s = ""
+ args.each{ |arg| s << arg.to_s }
+ do_write(s)
+ nil
+ end
+
+ ##
+ # Formats and writes to the stream converting parameters under control of
+ # the format string.
+ #
+ # See Kernel#sprintf for format string details.
+
+ def printf(s, *args)
+ do_write(s % args)
+ nil
+ end
+
+ ##
+ # Flushes buffered data to the SSLSocket.
+
+ def flush
+ osync = @sync
+ @sync = true
+ do_write ""
+ return self
+ ensure
+ @sync = osync
+ end
+
+ ##
+ # Closes the SSLSocket and flushes any unwritten data.
+
+ def close
+ flush rescue nil
+ sysclose
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/cipher.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,65 @@
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space predefined Cipher subclasses
+#
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+# All rights reserved.
+#
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id: cipher.rb 33067 2011-08-25 00:52:10Z drbrain $
+#
+#++
+
+module OpenSSL
+ class Cipher
+ %w(AES CAST5 BF DES IDEA RC2 RC4 RC5).each{|name|
+ klass = Class.new(Cipher){
+ define_method(:initialize){|*args|
+ cipher_name = args.inject(name){|n, arg| "#{n}-#{arg}" }
+ super(cipher_name)
+ }
+ }
+ const_set(name, klass)
+ }
+
+ %w(128 192 256).each{|keylen|
+ klass = Class.new(Cipher){
+ define_method(:initialize){|mode|
+ mode ||= "CBC"
+ cipher_name = "AES-#{keylen}-#{mode}"
+ super(cipher_name)
+ }
+ }
+ const_set("AES#{keylen}", klass)
+ }
+
+ # Generate, set, and return a random key.
+ # You must call cipher.encrypt or cipher.decrypt before calling this
method.
+ def random_key
+ str = OpenSSL::Random.random_bytes(self.key_len)
+ self.key = str
+ return str
+ end
+
+ # Generate, set, and return a random iv.
+ # You must call cipher.encrypt or cipher.decrypt before calling this
method.
+ def random_iv
+ str = OpenSSL::Random.random_bytes(self.iv_len)
+ self.iv = str
+ return str
+ end
+
+ # This class is only provided for backwards compatibility. Use
OpenSSL::Cipher in the future.
+ class Cipher < Cipher
+ # add warning
+ end
+ end # Cipher
+end # OpenSSL
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/config.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,313 @@
+=begin
+= Ruby-space definitions that completes C-space funcs for Config
+
+= Info
+ Copyright (C) 2010 Hiroshi Nakamura <na...@ruby-lang.org>
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+=end
+
+require 'stringio'
+
+module OpenSSL
+ class Config
+ include Enumerable
+
+ class << self
+ def parse(str)
+ c = new()
+ parse_config(StringIO.new(str)).each do |section, hash|
+ c[section] = hash
+ end
+ c
+ end
+
+ alias load new
+
+ def parse_config(io)
+ begin
+ parse_config_lines(io)
+ rescue ConfigError => e
+ e.message.replace("error in line #{io.lineno}: " + e.message)
+ raise
+ end
+ end
+
+ def get_key_string(data, section, key) # :nodoc:
+ if v = data[section] && data[section][key]
+ return v
+ elsif section == 'ENV'
+ if v = ENV[key]
+ return v
+ end
+ end
+ if v = data['default'] && data['default'][key]
+ return v
+ end
+ end
+
+ private
+
+ def parse_config_lines(io)
+ section = 'default'
+ data = {section => {}}
+ while definition = get_definition(io)
+ definition = clear_comments(definition)
+ next if definition.empty?
+ if definition[0] == ?[
+ if /\[([^\]]*)\]/ =~ definition
+ section = $1.strip
+ data[section] ||= {}
+ else
+ raise ConfigError, "missing close square bracket"
+ end
+ else
+ if /\A([^:\s]*)(?:::([^:\s]*))?\s*=(.*)\z/ =~ definition
+ if $2
+ section = $1
+ key = $2
+ else
+ key = $1
+ end
+ value = unescape_value(data, section, $3)
+ (data[section] ||= {})[key] = value.strip
+ else
+ raise ConfigError, "missing equal sign"
+ end
+ end
+ end
+ data
+ end
+
+ # escape with backslash
+ QUOTE_REGEXP_SQ = /\A([^'\\]*(?:\\.[^'\\]*)*)'/
+ # escape with backslash and doubled dq
+ QUOTE_REGEXP_DQ = /\A([^"\\]*(?:""[^"\\]*|\\.[^"\\]*)*)"/
+ # escaped char map
+ ESCAPE_MAP = {
+ "r" => "\r",
+ "n" => "\n",
+ "b" => "\b",
+ "t" => "\t",
+ }
+
+ def unescape_value(data, section, value)
+ scanned = []
+ while m = value.match(/['"\\$]/)
+ scanned << m.pre_match
+ c = m[0]
+ value = m.post_match
+ case c
+ when "'"
+ if m = value.match(QUOTE_REGEXP_SQ)
+ scanned << m[1].gsub(/\\(.)/, '\\1')
+ value = m.post_match
+ else
+ break
+ end
+ when '"'
+ if m = value.match(QUOTE_REGEXP_DQ)
+ scanned << m[1].gsub(/""/, '').gsub(/\\(.)/, '\\1')
+ value = m.post_match
+ else
+ break
+ end
+ when "\\"
+ c = value.slice!(0, 1)
+ scanned << (ESCAPE_MAP[c] || c)
+ when "$"
+ ref, value = extract_reference(value)
+ refsec = section
+ if ref.index('::')
+ refsec, ref = ref.split('::', 2)
+ end
+ if v = get_key_string(data, refsec, ref)
+ scanned << v
+ else
+ raise ConfigError, "variable has no value"
+ end
+ else
+ raise 'must not reaced'
+ end
+ end
+ scanned << value
+ scanned.join
+ end
+
+ def extract_reference(value)
+ rest = ''
+ if m = value.match(/\(([^)]*)\)|\{([^}]*)\}/)
+ value = m[1] || m[2]
+ rest = m.post_match
+ elsif [?(, ?{].include?(value[0])
+ raise ConfigError, "no close brace"
+ end
+ if m = value.match(/[a-zA-Z0-9_]*(?:::[a-zA-Z0-9_]*)?/)
+ return m[0], m.post_match + rest
+ else
+ raise
+ end
+ end
+
+ def clear_comments(line)
+ # FCOMMENT
+ if m = line.match(/\A([\t\n\f ]*);.*\z/)
+ return m[1]
+ end
+ # COMMENT
+ scanned = []
+ while m = line.match(/[#'"\\]/)
+ scanned << m.pre_match
+ c = m[0]
+ line = m.post_match
+ case c
+ when '#'
+ line = nil
+ break
+ when "'", '"'
+ regexp = (c == "'") ? QUOTE_REGEXP_SQ : QUOTE_REGEXP_DQ
+ scanned << c
+ if m = line.match(regexp)
+ scanned << m[0]
+ line = m.post_match
+ else
+ scanned << line
+ line = nil
+ break
+ end
+ when "\\"
+ scanned << c
+ scanned << line.slice!(0, 1)
+ else
+ raise 'must not reaced'
+ end
+ end
+ scanned << line
+ scanned.join
+ end
+
+ def get_definition(io)
+ if line = get_line(io)
+ while /[^\\]\\\z/ =~ line
+ if extra = get_line(io)
+ line += extra
+ else
+ break
+ end
+ end
+ return line.strip
+ end
+ end
+
+ def get_line(io)
+ if line = io.gets
+ line.gsub(/[\r\n]*/, '')
+ end
+ end
+ end
+
+ def initialize(filename = nil)
+ @data = {}
+ if filename
+ File.open(filename.to_s) do |file|
+ Config.parse_config(file).each do |section, hash|
+ self[section] = hash
+ end
+ end
+ end
+ end
+
+ def get_value(section, key)
+ if section.nil?
+ raise TypeError.new('nil not allowed')
+ end
+ section = 'default' if section.empty?
+ get_key_string(section, key)
+ end
+
+ def value(arg1, arg2 = nil)
+ warn('Config#value is deprecated; use Config#get_value')
+ if arg2.nil?
+ section, key = 'default', arg1
+ else
+ section, key = arg1, arg2
+ end
+ section ||= 'default'
+ section = 'default' if section.empty?
+ get_key_string(section, key)
+ end
+
+ def add_value(section, key, value)
+ check_modify
+ (@data[section] ||= {})[key] = value
+ end
+
+ def [](section)
+ @data[section] || {}
+ end
+
+ def section(name)
+ warn('Config#section is deprecated; use Config#[]')
+ @data[name] || {}
+ end
+
+ def []=(section, pairs)
+ check_modify
+ @data[section] ||= {}
+ pairs.each do |key, value|
+ self.add_value(section, key, value)
+ end
+ end
+
+ def sections
+ @data.keys
+ end
+
+ def to_s
+ ary = []
+ @data.keys.sort.each do |section|
+ ary << "[ #{section} ]\n"
+ @data[section].keys.each do |key|
+ ary << "#{key}=#{@data[section][key]}\n"
+ end
+ ary << "\n"
+ end
+ ary.join
+ end
+
+ def each
+ @data.each do |section, hash|
+ hash.each do |key, value|
+ yield [section, key, value]
+ end
+ end
+ end
+
+ def inspect
+ "#<#{self.class.name} sections=#{sections.inspect}>"
+ end
+
+ protected
+
+ def data
+ @data
+ end
+
+ private
+
+ def initialize_copy(other)
+ @data = other.data.dup
+ end
+
+ def check_modify
+ raise TypeError.new("Insecure: can't modify OpenSSL config") if
frozen?
+ end
+
+ def get_key_string(section, key)
+ Config.get_key_string(@data, section, key)
+ end
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/digest.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,72 @@
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space predefined Digest subclasses
+#
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+# All rights reserved.
+#
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id: digest.rb 33067 2011-08-25 00:52:10Z drbrain $
+#
+#++
+
+module OpenSSL
+ class Digest
+
+ alg = %w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1)
+ if OPENSSL_VERSION_NUMBER > 0x00908000
+ alg += %w(SHA224 SHA256 SHA384 SHA512)
+ end
+
+ # Return the +data+ hash computed with +name+ Digest. +name+ is either
the
+ # long name or short name of a supported digest algorithm.
+ #
+ # === Examples
+ #
+ # OpenSSL::Digest.digest("SHA256, "abc")
+ #
+ # which is equivalent to:
+ #
+ # OpenSSL::Digest::SHA256.digest("abc")
+
+ def self.digest(name, data)
+ super(data, name)
+ end
+
+ alg.each{|name|
+ klass = Class.new(Digest){
+ define_method(:initialize){|*data|
+ if data.length > 1
+ raise ArgumentError,
+ "wrong number of arguments (#{data.length} for 1)"
+ end
+ super(name, data.first)
+ }
+ }
+ singleton = (class << klass; self; end)
+ singleton.class_eval{
+ define_method(:digest){|data| Digest.digest(name, data) }
+ define_method(:hexdigest){|data| Digest.hexdigest(name, data) }
+ }
+ const_set(name, klass)
+ }
+
+ # This class is only provided for backwards compatibility. Use
OpenSSL::Digest in the future.
+ class Digest < Digest
+ def initialize(*args)
+ # add warning
+ super(*args)
+ end
+ end
+
+ end # Digest
+end # OpenSSL
+
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/ssl-internal.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,177 @@
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for SSL
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2001 GOTOU YUUZOU <goto...@notwork.org>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: ssl-internal.rb 29189 2010-09-06 01:53:00Z nahi $
+=end
+
+require "openssl/buffering"
+require "fcntl"
+
+module OpenSSL
+ module SSL
+ class SSLContext
+ DEFAULT_PARAMS = {
+ :ssl_version => "SSLv23",
+ :verify_mode => OpenSSL::SSL::VERIFY_PEER,
+ :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
+ :options => OpenSSL::SSL::OP_ALL,
+ }
+
+ DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
+ DEFAULT_CERT_STORE.set_default_paths
+ if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
+ DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
+ end
+
+ def set_params(params={})
+ params = DEFAULT_PARAMS.merge(params)
+ params.each{|name, value| self.__send__("#{name}=", value) }
+ if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
+ unless self.ca_file or self.ca_path or self.cert_store
+ self.cert_store = DEFAULT_CERT_STORE
+ end
+ end
+ return params
+ end
+ end
+
+ module SocketForwarder
+ def addr
+ to_io.addr
+ end
+
+ def peeraddr
+ to_io.peeraddr
+ end
+
+ def setsockopt(level, optname, optval)
+ to_io.setsockopt(level, optname, optval)
+ end
+
+ def getsockopt(level, optname)
+ to_io.getsockopt(level, optname)
+ end
+
+ def fcntl(*args)
+ to_io.fcntl(*args)
+ end
+
+ def closed?
+ to_io.closed?
+ end
+
+ def do_not_reverse_lookup=(flag)
+ to_io.do_not_reverse_lookup = flag
+ end
+ end
+
+ module Nonblock
+ def initialize(*args)
+ flag = File::NONBLOCK
+ flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL)
+ @io.fcntl(Fcntl::F_SETFL, flag)
+ super
+ end
+ end
+
+ def verify_certificate_identity(cert, hostname)
+ should_verify_common_name = true
+ cert.extensions.each{|ext|
+ next if ext.oid != "subjectAltName"
+ ext.value.split(/,\s+/).each{|general_name|
+ if /\ADNS:(.*)/ =~ general_name
+ should_verify_common_name = false
+ reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ elsif /\AIP Address:(.*)/ =~ general_name
+ should_verify_common_name = false
+ return true if $1 == hostname
+ end
+ }
+ }
+ if should_verify_common_name
+ cert.subject.to_a.each{|oid, value|
+ if oid == "CN"
+ reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ end
+ }
+ end
+ return false
+ end
+ module_function :verify_certificate_identity
+
+ class SSLSocket
+ include Buffering
+ include SocketForwarder
+ include Nonblock
+
+ def post_connection_check(hostname)
+ unless OpenSSL::SSL.verify_certificate_identity(peer_cert,
hostname)
+ raise SSLError, "hostname does not match the server certificate"
+ end
+ return true
+ end
+
+ def session
+ SSL::Session.new(self)
+ rescue SSL::Session::SessionError
+ nil
+ end
+ end
+
+ class SSLServer
+ include SocketForwarder
+ attr_accessor :start_immediately
+
+ def initialize(svr, ctx)
+ @svr = svr
+ @ctx = ctx
+ unless ctx.session_id_context
+ session_id = OpenSSL::Digest::MD5.hexdigest($0)
+ @ctx.session_id_context = session_id
+ end
+ @start_immediately = true
+ end
+
+ def to_io
+ @svr
+ end
+
+ def listen(backlog=5)
+ @svr.listen(backlog)
+ end
+
+ def shutdown(how=Socket::SHUT_RDWR)
+ @svr.shutdown(how)
+ end
+
+ def accept
+ sock = @svr.accept
+ begin
+ ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
+ ssl.sync_close = true
+ ssl.accept if @start_immediately
+ ssl
+ rescue SSLError => ex
+ sock.close
+ raise ex
+ end
+ end
+
+ def close
+ @svr.close
+ end
+ end
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/ssl.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,2 @@
+warn 'deprecated openssl/ssl use: require "openssl" instead
of "openssl/ssl"'
+require 'openssl'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/x509-internal.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,158 @@
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for
X509 and subclasses
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id: x509-internal.rb 32663 2011-07-25 04:51:26Z nahi $
+=end
+
+module OpenSSL
+ module X509
+ class ExtensionFactory
+ def create_extension(*arg)
+ if arg.size > 1
+ create_ext(*arg)
+ else
+ send("create_ext_from_"+arg[0].class.name.downcase, arg[0])
+ end
+ end
+
+ def create_ext_from_array(ary)
+ raise ExtensionError, "unexpected array form" if ary.size > 3
+ create_ext(ary[0], ary[1], ary[2])
+ end
+
+ def create_ext_from_string(str) # "oid = critical, value"
+ oid, value = str.split(/=/, 2)
+ oid.strip!
+ value.strip!
+ create_ext(oid, value)
+ end
+
+ def create_ext_from_hash(hash)
+ create_ext(hash["oid"], hash["value"], hash["critical"])
+ end
+ end
+
+ class Extension
+ def to_s # "oid = critical, value"
+ str = self.oid
+ str << " = "
+ str << "critical, " if self.critical?
+ str << self.value.gsub(/\n/, ", ")
+ end
+
+ def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
+ {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
+ end
+
+ def to_a
+ [ self.oid, self.value, self.critical? ]
+ end
+ end
+
+ class Name
+ module RFC2253DN
+ Special = ',=+<>#;'
+ HexChar = /[0-9a-fA-F]/
+ HexPair = /#{HexChar}#{HexChar}/
+ HexString = /#{HexPair}+/
+ Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
+ StringChar = /[^#{Special}\\"]/
+ QuoteChar = /[^\\"]/
+ AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
+ AttributeValue = /
+ (?!["#])((?:#{StringChar}|#{Pair})*)|
+ \#(#{HexString})|
+ "((?:#{QuoteChar}|#{Pair})*)"
+ /x
+ TypeAndValue = /\A(#{AttributeType})=#{AttributeValue}/
+
+ module_function
+
+ def expand_pair(str)
+ return nil unless str
+ return str.gsub(Pair){
+ pair = $&
+ case pair.size
+ when 2 then pair[1,1]
+ when 3 then Integer("0x#{pair[1,2]}").chr
+ else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
+ end
+ }
+ end
+
+ def expand_hexstring(str)
+ return nil unless str
+ der = str.gsub(HexPair){$&.to_i(16).chr }
+ a1 = OpenSSL::ASN1.decode(der)
+ return a1.value, a1.tag
+ end
+
+ def expand_value(str1, str2, str3)
+ value = expand_pair(str1)
+ value, tag = expand_hexstring(str2) unless value
+ value = expand_pair(str3) unless value
+ return value, tag
+ end
+
+ def scan(dn)
+ str = dn
+ ary = []
+ while true
+ if md = TypeAndValue.match(str)
+ remain = md.post_match
+ type = md[1]
+ value, tag = expand_value(md[2], md[3], md[4]) rescue nil
+ if value
+ type_and_value = [type, value]
+ type_and_value.push(tag) if tag
+ ary.unshift(type_and_value)
+ if remain.length > 2 && remain[0] == ?,
+ str = remain[1..-1]
+ next
+ elsif remain.length > 2 && remain[0] == ?+
+ raise OpenSSL::X509::NameError,
+ "multi-valued RDN is not supported: #{dn}"
+ elsif remain.empty?
+ break
+ end
+ end
+ end
+ msg_dn = dn[0, dn.length - str.length] + " =>" + str
+ raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}"
+ end
+ return ary
+ end
+ end
+
+ class << self
+ def parse_rfc2253(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = OpenSSL::X509::Name::RFC2253DN.scan(str)
+ self.new(ary, template)
+ end
+
+ def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2)
}
+ self.new(ary, template)
+ end
+
+ alias parse parse_openssl
+ end
+ end
+
+ class StoreContext
+ def cleanup
+ warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is
deprecated with no replacement" if $VERBOSE
+ end
+ end
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl/x509.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,2 @@
+warn 'deprecated openssl/x509 use: require "openssl" instead
of "openssl/x509"'
+require 'openssl'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/1.9/openssl.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,22 @@
+=begin
+= $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2002 Michal Rokos <m.r...@sh.cvut.cz>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id$
+=end
+
+require 'openssl/bn'
+require 'openssl/cipher'
+require 'openssl/config'
+require 'openssl/digest'
+require 'openssl/ssl-internal'
+require 'openssl/x509-internal'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/jopenssl/version.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,5 @@
+module Jopenssl
+ module Version
+ VERSION = "0.7.5"
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/jopenssl.jar
Thu Jan 26 14:01:22 2012
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/dummy.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,33 @@
+warn "OpenSSL ASN1/PKey/X509/Netscape/PKCS7 implementation unavailable"
+warn "gem install bouncy-castle-java for full support."
+module OpenSSL
+ module ASN1
+ class ASN1Error < OpenSSLError; end
+ class ASN1Data; end
+ class Primitive; end
+ class Constructive; end
+ end
+ module X509
+ class Name; end
+ class Certificate; end
+ class Extension; end
+ class CRL; end
+ class Revoked; end
+ class Store
+ def set_default_paths; end
+ end
+ class Request; end
+ class Attribute; end
+ end
+ module Netscape
+ class SPKI; end
+ end
+ class PKCS7
+ # this definition causes TypeError "superclass mismatch for class
PKCS7"
+ # MRI also crashes following definition;
+ # class Foo; class Foo < Foo; end; end
+ # class Foo; class Foo < Foo; end; end
+ #
+ # class PKCS7 < PKCS7; end
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/dummyssl.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,14 @@
+warn "Warning: OpenSSL SSL implementation unavailable"
+warn "You must run on JDK 1.5 (Java 5) or higher to use SSL"
+module OpenSSL
+ module SSL
+ class SSLError < OpenSSLError; end
+ class SSLContext; end
+ class SSLSocket; end
+ VERIFY_NONE = 0
+ VERIFY_PEER = 1
+ VERIFY_FAIL_IF_NO_PEER_CERT = 2
+ VERIFY_CLIENT_ONCE = 4
+ OP_ALL = 0x00000FFF
+ end
+end
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/ssl.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,1 @@
+require 'openssl'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl/x509.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,1 @@
+require 'openssl'
=======================================
--- /dev/null
+++
/trunk/mapreduce/src/main/resources/gems/jruby-openssl-0.7.5/lib/shared/openssl.rb
Thu Jan 26 14:01:22 2012
@@ -0,0 +1,18 @@
+unless defined? JRUBY_VERSION
+ warn 'Loading jruby-openssl in a non-JRuby interpreter'
+end
+
+begin
+ require 'bouncy-castle-java'
+rescue LoadError
+ # runs under restricted mode.
+end
+require 'jopenssl'
+
+if RUBY_VERSION >= '1.9.0'
+ $LOAD_PATH.unshift(File.expand_path('../../1.9', __FILE__))
+ load(File.expand_path('../../1.9/openssl.rb', __FILE__))
+else
+ $LOAD_PATH.unshift(File.expand_path('../../1.8', __FILE__))
+ load(File.expand_path('../../1.8/openssl.rb', __FILE__))
+end
=======================================
***Additional files exist in this changeset.***

Reply all
Reply to author
Forward
0 new messages