redcar 0.3.2dev → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +49 -2
- data/README.md +2 -7
- data/ROADMAP.md +8 -9
- data/Rakefile +29 -44
- data/bin/redcar +11 -2
- data/lib/openssl/History.txt +75 -0
- data/lib/openssl/License.txt +30 -0
- data/lib/openssl/Manifest.txt +99 -0
- data/lib/openssl/README.txt +24 -0
- data/lib/openssl/Rakefile +71 -0
- data/lib/openssl/build.properties.SAMPLE +7 -0
- data/lib/openssl/build.xml +57 -0
- data/lib/openssl/lib/jopenssl/version.rb +5 -0
- data/lib/openssl/lib/openssl.rb +24 -0
- data/lib/openssl/lib/openssl/bn.rb +33 -0
- data/lib/openssl/lib/openssl/buffering.rb +239 -0
- data/lib/openssl/lib/openssl/cipher.rb +56 -0
- data/lib/openssl/lib/openssl/digest.rb +46 -0
- data/lib/openssl/lib/openssl/dummy.rb +34 -0
- data/lib/openssl/lib/openssl/dummyssl.rb +13 -0
- data/lib/openssl/lib/openssl/ssl.rb +135 -0
- data/lib/openssl/lib/openssl/x509.rb +154 -0
- data/lib/openssl/mocha/COPYING +3 -0
- data/lib/openssl/mocha/MIT-LICENSE +7 -0
- data/lib/openssl/mocha/README +35 -0
- data/lib/openssl/mocha/RELEASE +171 -0
- data/lib/openssl/mocha/Rakefile +147 -0
- data/lib/openssl/mocha/TODO +48 -0
- data/lib/openssl/mocha/examples/misc.rb +36 -0
- data/lib/openssl/mocha/examples/mocha.rb +26 -0
- data/lib/openssl/mocha/examples/stubba.rb +65 -0
- data/lib/openssl/mocha/init.rb +3 -0
- data/lib/openssl/mocha/lib/mocha.rb +19 -0
- data/lib/openssl/mocha/lib/mocha/any_instance_method.rb +35 -0
- data/lib/openssl/mocha/lib/mocha/auto_verify.rb +111 -0
- data/lib/openssl/mocha/lib/mocha/central.rb +35 -0
- data/lib/openssl/mocha/lib/mocha/class_method.rb +62 -0
- data/lib/openssl/mocha/lib/mocha/deprecation.rb +22 -0
- data/lib/openssl/mocha/lib/mocha/exception_raiser.rb +17 -0
- data/lib/openssl/mocha/lib/mocha/expectation.rb +382 -0
- data/lib/openssl/mocha/lib/mocha/expectation_error.rb +6 -0
- data/lib/openssl/mocha/lib/mocha/expectation_list.rb +45 -0
- data/lib/openssl/mocha/lib/mocha/infinite_range.rb +25 -0
- data/lib/openssl/mocha/lib/mocha/inspect.rb +39 -0
- data/lib/openssl/mocha/lib/mocha/instance_method.rb +8 -0
- data/lib/openssl/mocha/lib/mocha/is_a.rb +9 -0
- data/lib/openssl/mocha/lib/mocha/metaclass.rb +7 -0
- data/lib/openssl/mocha/lib/mocha/missing_expectation.rb +27 -0
- data/lib/openssl/mocha/lib/mocha/mock.rb +200 -0
- data/lib/openssl/mocha/lib/mocha/multiple_yields.rb +20 -0
- data/lib/openssl/mocha/lib/mocha/no_yields.rb +11 -0
- data/lib/openssl/mocha/lib/mocha/object.rb +110 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers.rb +9 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/all_of.rb +39 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/any_of.rb +44 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/anything.rb +30 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/has_entry.rb +39 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/has_key.rb +39 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/has_value.rb +39 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/includes.rb +37 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/instance_of.rb +39 -0
- data/lib/openssl/mocha/lib/mocha/parameter_matchers/kind_of.rb +39 -0
- data/lib/openssl/mocha/lib/mocha/pretty_parameters.rb +28 -0
- data/lib/openssl/mocha/lib/mocha/return_values.rb +31 -0
- data/lib/openssl/mocha/lib/mocha/setup_and_teardown.rb +23 -0
- data/lib/openssl/mocha/lib/mocha/single_return_value.rb +24 -0
- data/lib/openssl/mocha/lib/mocha/single_yield.rb +18 -0
- data/lib/openssl/mocha/lib/mocha/standalone.rb +32 -0
- data/lib/openssl/mocha/lib/mocha/stub.rb +18 -0
- data/lib/openssl/mocha/lib/mocha/test_case_adapter.rb +49 -0
- data/lib/openssl/mocha/lib/mocha/yield_parameters.rb +31 -0
- data/lib/openssl/mocha/lib/mocha_standalone.rb +2 -0
- data/lib/openssl/mocha/lib/stubba.rb +2 -0
- data/lib/openssl/mocha/templates/html_with_google_analytics.rb +742 -0
- data/lib/openssl/mocha/test/acceptance/expected_invocation_count_acceptance_test.rb +187 -0
- data/lib/openssl/mocha/test/acceptance/mocha_acceptance_test.rb +98 -0
- data/lib/openssl/mocha/test/acceptance/mocked_methods_dispatch_acceptance_test.rb +71 -0
- data/lib/openssl/mocha/test/acceptance/parameter_matcher_acceptance_test.rb +63 -0
- data/lib/openssl/mocha/test/acceptance/standalone_acceptance_test.rb +131 -0
- data/lib/openssl/mocha/test/acceptance/stubba_acceptance_test.rb +102 -0
- data/lib/openssl/mocha/test/active_record_test_case.rb +36 -0
- data/lib/openssl/mocha/test/deprecation_disabler.rb +15 -0
- data/lib/openssl/mocha/test/execution_point.rb +34 -0
- data/lib/openssl/mocha/test/integration/mocha_test_result_integration_test.rb +105 -0
- data/lib/openssl/mocha/test/integration/stubba_integration_test.rb +89 -0
- data/lib/openssl/mocha/test/integration/stubba_test_result_integration_test.rb +85 -0
- data/lib/openssl/mocha/test/method_definer.rb +18 -0
- data/lib/openssl/mocha/test/test_helper.rb +12 -0
- data/lib/openssl/mocha/test/test_runner.rb +31 -0
- data/lib/openssl/mocha/test/unit/any_instance_method_test.rb +124 -0
- data/lib/openssl/mocha/test/unit/array_inspect_test.rb +16 -0
- data/lib/openssl/mocha/test/unit/auto_verify_test.rb +122 -0
- data/lib/openssl/mocha/test/unit/central_test.rb +124 -0
- data/lib/openssl/mocha/test/unit/class_method_test.rb +196 -0
- data/lib/openssl/mocha/test/unit/date_time_inspect_test.rb +21 -0
- data/lib/openssl/mocha/test/unit/expectation_list_test.rb +69 -0
- data/lib/openssl/mocha/test/unit/expectation_raiser_test.rb +28 -0
- data/lib/openssl/mocha/test/unit/expectation_test.rb +399 -0
- data/lib/openssl/mocha/test/unit/hash_inspect_test.rb +16 -0
- data/lib/openssl/mocha/test/unit/infinite_range_test.rb +53 -0
- data/lib/openssl/mocha/test/unit/metaclass_test.rb +22 -0
- data/lib/openssl/mocha/test/unit/missing_expectation_test.rb +45 -0
- data/lib/openssl/mocha/test/unit/mock_test.rb +316 -0
- data/lib/openssl/mocha/test/unit/multiple_yields_test.rb +18 -0
- data/lib/openssl/mocha/test/unit/no_yield_test.rb +18 -0
- data/lib/openssl/mocha/test/unit/object_inspect_test.rb +35 -0
- data/lib/openssl/mocha/test/unit/object_test.rb +165 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/all_of_test.rb +26 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/any_of_test.rb +26 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/anything_test.rb +21 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/has_entry_test.rb +25 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/has_key_test.rb +25 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/has_value_test.rb +25 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/includes_test.rb +25 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/instance_of_test.rb +25 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/kind_of_test.rb +25 -0
- data/lib/openssl/mocha/test/unit/parameter_matchers/stub_matcher.rb +22 -0
- data/lib/openssl/mocha/test/unit/pretty_parameters_test.rb +32 -0
- data/lib/openssl/mocha/test/unit/return_values_test.rb +63 -0
- data/lib/openssl/mocha/test/unit/setup_and_teardown_test.rb +76 -0
- data/lib/openssl/mocha/test/unit/single_return_value_test.rb +33 -0
- data/lib/openssl/mocha/test/unit/single_yield_test.rb +18 -0
- data/lib/openssl/mocha/test/unit/string_inspect_test.rb +11 -0
- data/lib/openssl/mocha/test/unit/stub_test.rb +24 -0
- data/lib/openssl/mocha/test/unit/yield_parameters_test.rb +93 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/FOLDERS +53 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/LICENSE +340 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/README +117 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/bin/coderay +77 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/bin/coderay_stylesheet +4 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay.rb +319 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/duo.rb +29 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoder.rb +173 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/_map.rb +8 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/count.rb +21 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/debug.rb +46 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/div.rb +20 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html.rb +260 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/classes.rb +77 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/css.rb +65 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/numerization.rb +122 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/output.rb +195 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/null.rb +26 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/page.rb +21 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/span.rb +20 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/statistic.rb +81 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/text.rb +33 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/tokens.rb +44 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/xml.rb +71 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/yaml.rb +22 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/file_type.rb +182 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/gzip_simple.rb +122 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/plugin.rb +326 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/word_list.rb +119 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanner.rb +238 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/_map.rb +15 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/c.rb +163 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/debug.rb +60 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/delphi.rb +149 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/html.rb +177 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/nitro_xhtml.rb +133 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/plaintext.rb +16 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/rhtml.rb +73 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/ruby.rb +367 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/ruby/patterns.rb +230 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/xml.rb +18 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/style.rb +20 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/styles/_map.rb +7 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/styles/cycnus.rb +125 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/styles/murphy.rb +119 -0
- data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/tokens.rb +368 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/CHANGES +295 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/MIT-LICENSE +21 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/README +129 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/Rakefile +152 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project.rb +19 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/core_ext/open_uri.rb +22 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/core_ext/pathname.rb +36 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/core_ext/string.rb +5 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/http/multipart.rb +32 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/patois.rb +1 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/patois/parser.rb +99 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project.rb +4 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/base.rb +9 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/codehaus.rb +1 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/codehaus/codehaus_project_svn.rb +31 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/trac.rb +1 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/trac/trac_project.rb +54 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge.rb +5 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/ruby_forge.rb +47 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/session.rb +177 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/source_forge.rb +50 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/xfile.rb +45 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/xforge_base.rb +85 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project_analyzer.rb +36 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/release/freshmeat.rb +267 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/release/raa.rb +572 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/scm_web.rb +2 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/scm_web/browser.rb +112 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/scm_web/pathname.rb +89 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker.rb +6 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/base.rb +24 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb +34 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/issue.rb +57 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/jira.rb +2 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/jira/jira_issues.rb +35 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/jira/jira_tracker.rb +149 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/trac.rb +1 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/trac/trac_tracker.rb +33 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge.rb +3 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge/ruby_forge_tracker.rb +17 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge/source_forge_tracker.rb +17 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge/xforge_tracker.rb +191 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/version_parser.rb +52 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge.rb +3 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge/base.rb +64 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge/news_publisher.rb +97 -0
- data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge/release.rb +134 -0
- data/lib/openssl/nbproject/genfiles.properties +5 -0
- data/lib/openssl/nbproject/jdk.xml +157 -0
- data/lib/openssl/nbproject/nbjdk.properties +1 -0
- data/lib/openssl/nbproject/nbjdk.xml +16 -0
- data/lib/openssl/nbproject/project.xml +117 -0
- data/lib/openssl/src/java/JopensslService.java +41 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/ASN1.java +930 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Attribute.java +132 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/BN.java +769 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/BouncyCastlePEMHandler.java +69 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Callable.java +10 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Cipher.java +661 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/CipherStrings.java +1827 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Config.java +49 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/DefaultPEMHandler.java +44 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Digest.java +207 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/HMAC.java +183 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/NetscapeSPKI.java +212 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/OpenSSLImpl.java +341 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/OpenSSLReal.java +113 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/PEMHandler.java +40 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/PKCS10CertificationRequestExt.java +159 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/PKCS7.java +642 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/PKey.java +154 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/PKeyDH.java +401 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/PKeyDSA.java +419 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/PKeyRSA.java +762 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Random.java +103 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Request.java +336 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/SSL.java +71 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/SSLContext.java +358 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/SSLSocket.java +561 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/SimpleSecretKey.java +53 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/Utils.java +60 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509.java +108 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509CRL.java +446 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509Cert.java +520 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509Extensions.java +751 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509Name.java +405 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509Revoked.java +111 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509Store.java +282 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/X509StoreCtx.java +206 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/ASN1Registry.java +5135 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Attribute.java +79 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/BIO.java +345 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/BIOFilter.java +38 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Base64BIOFilter.java +84 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/CipherBIOFilter.java +157 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Digest.java +126 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/EVP.java +136 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/EncContent.java +178 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Encrypt.java +77 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Envelope.java +169 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/IssuerAndSerial.java +35 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MemBIO.java +117 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MessageDigestBIOFilter.java +76 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Mime.java +245 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MimeHeader.java +103 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MimeParam.java +69 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/NotVerifiedPKCS7Exception.java +38 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/NullSinkBIO.java +52 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7.java +1276 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7Data.java +168 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataData.java +88 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataDigest.java +64 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataEncrypted.java +61 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataEnveloped.java +85 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataSigned.java +127 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataSignedAndEnveloped.java +91 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7Exception.java +68 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/RecipInfo.java +244 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/SMIME.java +281 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/SignEnvelope.java +202 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Signed.java +345 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/SignerInfoWithPkey.java +365 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/TypeDiscriminating.java +34 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/impl/utils/Base64.java +1809 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/util/Base64Coder.java +103 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/CRL.java +59 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Certificate.java +57 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/CertificateFile.java +46 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/CertificateHashDir.java +46 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function0.java +43 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function1.java +43 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function2.java +43 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function3.java +43 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function4.java +43 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function5.java +43 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Lookup.java +560 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/LookupMethod.java +84 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Name.java +85 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/PEMInputOutput.java +1210 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/PKey.java +41 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/PolicyTree.java +36 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Purpose.java +475 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Store.java +377 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/StoreContext.java +1356 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Trust.java +279 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/VerifyParameter.java +324 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Aux.java +43 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509AuxCertificate.java +170 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Error.java +70 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Object.java +88 -0
- data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Utils.java +541 -0
- data/lib/openssl/test/cert_with_ec_pk.cer +27 -0
- data/lib/openssl/test/fixture/ca_path/72fa7371.0 +19 -0
- data/lib/openssl/test/fixture/ca_path/verisign.pem +19 -0
- data/lib/openssl/test/fixture/cacert.pem +23 -0
- data/lib/openssl/test/fixture/cert_localhost.pem +19 -0
- data/lib/openssl/test/fixture/common.pem +48 -0
- data/lib/openssl/test/fixture/localhost_keypair.pem +18 -0
- data/lib/openssl/test/fixture/max.pem +29 -0
- data/lib/openssl/test/fixture/purpose/b70a5bc1.0 +24 -0
- data/lib/openssl/test/fixture/purpose/ca/PASSWD_OF_CA_KEY_IS_1234 +0 -0
- data/lib/openssl/test/fixture/purpose/ca/ca_config.rb +37 -0
- data/lib/openssl/test/fixture/purpose/ca/cacert.pem +24 -0
- data/lib/openssl/test/fixture/purpose/ca/newcerts/2_cert.pem +19 -0
- data/lib/openssl/test/fixture/purpose/ca/newcerts/3_cert.pem +19 -0
- data/lib/openssl/test/fixture/purpose/ca/private/cakeypair.pem +30 -0
- data/lib/openssl/test/fixture/purpose/ca/serial +1 -0
- data/lib/openssl/test/fixture/purpose/cacert.pem +24 -0
- data/lib/openssl/test/fixture/purpose/scripts/gen_cert.rb +127 -0
- data/lib/openssl/test/fixture/purpose/scripts/gen_csr.rb +50 -0
- data/lib/openssl/test/fixture/purpose/scripts/init_ca.rb +66 -0
- data/lib/openssl/test/fixture/purpose/sslclient.pem +19 -0
- data/lib/openssl/test/fixture/purpose/sslclient/csr.pem +10 -0
- data/lib/openssl/test/fixture/purpose/sslclient/keypair.pem +15 -0
- data/lib/openssl/test/fixture/purpose/sslclient/sslclient.pem +19 -0
- data/lib/openssl/test/fixture/purpose/sslserver.pem +19 -0
- data/lib/openssl/test/fixture/purpose/sslserver/csr.pem +10 -0
- data/lib/openssl/test/fixture/purpose/sslserver/keypair.pem +15 -0
- data/lib/openssl/test/fixture/purpose/sslserver/sslserver.pem +19 -0
- data/lib/openssl/test/fixture/verisign.pem +19 -0
- data/lib/openssl/test/fixture/verisign_c3.pem +14 -0
- data/lib/openssl/test/openssl/ssl_server.rb +99 -0
- data/lib/openssl/test/openssl/test_asn1.rb +199 -0
- data/lib/openssl/test/openssl/test_cipher.rb +196 -0
- data/lib/openssl/test/openssl/test_digest.rb +88 -0
- data/lib/openssl/test/openssl/test_hmac.rb +44 -0
- data/lib/openssl/test/openssl/test_ns_spki.rb +69 -0
- data/lib/openssl/test/openssl/test_pair.rb +149 -0
- data/lib/openssl/test/openssl/test_pkcs7.rb +160 -0
- data/lib/openssl/test/openssl/test_pkey_rsa.rb +49 -0
- data/lib/openssl/test/openssl/test_ssl.rb +413 -0
- data/lib/openssl/test/openssl/test_x509cert.rb +236 -0
- data/lib/openssl/test/openssl/test_x509crl.rb +234 -0
- data/lib/openssl/test/openssl/test_x509ext.rb +95 -0
- data/lib/openssl/test/openssl/test_x509name.rb +281 -0
- data/lib/openssl/test/openssl/test_x509req.rb +178 -0
- data/lib/openssl/test/openssl/test_x509store.rb +245 -0
- data/lib/openssl/test/openssl/utils.rb +135 -0
- data/lib/openssl/test/pkcs7_mime_enveloped.message +19 -0
- data/lib/openssl/test/pkcs7_mime_signed.message +30 -0
- data/lib/openssl/test/pkcs7_multipart_signed.message +45 -0
- data/lib/openssl/test/ref/compile.rb +8 -0
- data/lib/openssl/test/ref/pkcs1 +0 -0
- data/lib/openssl/test/ref/pkcs1.c +21 -0
- data/lib/openssl/test/test_cipher.rb +95 -0
- data/lib/openssl/test/test_integration.rb +139 -0
- data/lib/openssl/test/test_java.rb +98 -0
- data/lib/openssl/test/test_java_attribute.rb +25 -0
- data/lib/openssl/test/test_java_bio.rb +42 -0
- data/lib/openssl/test/test_java_mime.rb +173 -0
- data/lib/openssl/test/test_java_pkcs7.rb +769 -0
- data/lib/openssl/test/test_java_smime.rb +177 -0
- data/lib/openssl/test/test_openssl.rb +34 -0
- data/lib/openssl/test/test_openssl_x509.rb +34 -0
- data/lib/openssl/test/test_parse_certificate.rb +20 -0
- data/lib/openssl/test/test_pkey.rb +46 -0
- data/lib/openssl/test/test_x509store.rb +155 -0
- data/lib/openssl/test/ut_eof.rb +128 -0
- data/lib/redcar.rb +134 -8
- data/lib/redcar/installer.rb +46 -11
- data/lib/redcar/runner.rb +2 -1
- data/lib/redcar/usage.rb +12 -5
- data/lib/redcar_quick_start.rb +37 -0
- data/plugins/application/features/support/env.rb +9 -1
- data/plugins/application/icons/redcar_icon_beta.png +0 -0
- data/plugins/application/lib/application.rb +113 -43
- data/plugins/application/lib/application/clipboard.rb +28 -4
- data/plugins/application/lib/application/command.rb +4 -12
- data/plugins/application/lib/application/command/executor.rb +2 -2
- data/plugins/application/lib/application/keymap.rb +39 -0
- data/plugins/application/lib/application/keymap/builder.rb +19 -0
- data/plugins/application/lib/application/speedbar.rb +33 -24
- data/plugins/application/lib/application/tab.rb +15 -0
- data/plugins/application/lib/application/window.rb +28 -5
- data/plugins/application/spec/application/clipboard_spec.rb +20 -1
- data/plugins/application/spec/application/command/executor_spec.rb +7 -2
- data/plugins/application/spec/application/command_spec.rb +0 -5
- data/plugins/application/spec/application/keymap/builder_spec.rb +17 -0
- data/plugins/application/spec/application/menu_spec.rb +30 -0
- data/plugins/application/spec/application/speedbar_spec.rb +30 -6
- data/plugins/application/spec/application/window_spec.rb +2 -2
- data/plugins/application/spec/spec_helper.rb +1 -1
- data/plugins/application_swt/lib/application_swt.rb +3 -0
- data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +10 -1
- data/plugins/application_swt/lib/application_swt/html_tab.rb +1 -0
- data/plugins/application_swt/lib/application_swt/menu.rb +4 -3
- data/plugins/application_swt/lib/application_swt/menu/binding_translator.rb +12 -4
- data/plugins/application_swt/lib/application_swt/speedbar.rb +105 -19
- data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +2 -0
- data/plugins/application_swt/lib/application_swt/window.rb +55 -23
- data/plugins/application_swt/spec/spec_helper.rb +0 -1
- data/plugins/auto_completer/lib/auto_completer.rb +57 -3
- data/plugins/auto_indenter/lib/auto_indenter.rb +1 -1
- data/plugins/core/lib/core.rb +5 -3
- data/plugins/core/lib/core/interface.rb +73 -0
- data/plugins/core/lib/core/model.rb +2 -0
- data/plugins/core/lib/core/observable.rb +12 -1
- data/plugins/core/lib/core/observable_struct.rb +34 -0
- data/plugins/core/lib/core/plugin/storage.rb +16 -3
- data/plugins/core/lib/core/reentry_helpers.rb +13 -0
- data/plugins/core/spec/core/observable_spec.rb +13 -0
- data/plugins/core/spec/core/storage_spec.rb +18 -0
- data/plugins/core/spec/spec_helper.rb +1 -0
- data/plugins/edit_view/features/cut_and_paste.feature +4 -2
- data/plugins/edit_view/features/soft_tabs.feature +243 -0
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +91 -2
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +1 -1
- data/plugins/edit_view/features/tabs.feature +146 -0
- data/plugins/edit_view/lib/edit_view.rb +197 -8
- data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +121 -0
- data/plugins/edit_view/lib/edit_view/actions/deletion.rb +30 -0
- data/plugins/edit_view/lib/edit_view/actions/tab.rb +66 -0
- data/plugins/edit_view/lib/edit_view/command.rb +0 -2
- data/plugins/edit_view/lib/edit_view/document.rb +62 -27
- data/plugins/edit_view/lib/edit_view/document/command.rb +11 -0
- data/plugins/edit_view/lib/edit_view/edit_tab.rb +2 -1
- data/plugins/edit_view/lib/edit_view/info_speedbar.rb +69 -0
- data/plugins/edit_view/lib/edit_view/tab_settings.rb +40 -0
- data/plugins/edit_view/spec/edit_view/document_spec.rb +26 -0
- data/plugins/edit_view/spec/spec_helper.rb +0 -1
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +57 -69
- data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +24 -3
- data/plugins/edit_view_swt/lib/edit_view_swt/edit_tab.rb +23 -6
- data/plugins/edit_view_swt/spec/spec_helper.rb +0 -1
- data/plugins/edit_view_swt/vendor/java-mateview.rb +19 -2
- data/plugins/encryption/encryption.rb +38 -0
- data/plugins/encryption/ezcrypto.rb +652 -0
- data/plugins/encryption/jarmor-1.1.jar +0 -0
- data/plugins/encryption/plugin.rb +9 -0
- data/plugins/execute_current_tab/lib/execute_current_tab.rb +56 -0
- data/plugins/execute_current_tab/plugin.rb +8 -0
- data/plugins/html_view/lib/html_view.rb +16 -11
- data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +2 -1
- data/plugins/plugin_manager_ui/views/index.html.erb +22 -4
- data/plugins/project/lib/project.rb +140 -26
- data/plugins/project/lib/project/drb_service.rb +75 -0
- data/plugins/project/lib/project/file_mirror.rb +5 -5
- data/plugins/project/lib/project/find_file_dialog.rb +123 -32
- data/plugins/project/spec/project/file_mirror_spec.rb +10 -1
- data/plugins/project/spec/spec_helper.rb +0 -1
- data/plugins/redcar/plugin.rb +1 -1
- data/plugins/redcar/redcar.rb +204 -109
- data/plugins/redcar/spec/redcar/redcar_spec.rb +70 -0
- data/plugins/redcar/spec/spec_helper.rb +4 -0
- data/plugins/repl/lib/repl.rb +14 -7
- data/plugins/repl/lib/repl/internal_mirror.rb +43 -22
- data/plugins/repl/spec/repl/internal_mirror_spec.rb +34 -7
- data/plugins/repl/spec/spec_helper.rb +0 -1
- data/plugins/tree/spec/spec_helper.rb +0 -1
- data/plugins/tree_view_swt/lib/tree_view_swt.rb +1 -1
- data/textmate/Bundles/RedcarRepl.tmbundle/Syntaxes/InternalRuby.plist +2 -18
- data/textmate/Bundles/asciidoc.tmbundle/Syntaxes/AsciiDoc.tmLanguage +428 -0
- metadata +790 -371
- data/lib/redcar/boot.rb +0 -108
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/***** BEGIN LICENSE BLOCK *****
|
|
2
|
+
* Version: CPL 1.0/GPL 2.0/LGPL 2.1
|
|
3
|
+
*
|
|
4
|
+
* The contents of this file are subject to the Common Public
|
|
5
|
+
* License Version 1.0 (the "License"); you may not use this file
|
|
6
|
+
* except in compliance with the License. You may obtain a copy of
|
|
7
|
+
* the License at http://www.eclipse.org/legal/cpl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Software distributed under the License is distributed on an "AS
|
|
10
|
+
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
11
|
+
* implied. See the License for the specific language governing
|
|
12
|
+
* rights and limitations under the License.
|
|
13
|
+
*
|
|
14
|
+
* Copyright (C) 2008 Ola Bini <ola.bini@gmail.com>
|
|
15
|
+
*
|
|
16
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
17
|
+
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
18
|
+
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
19
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
20
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
21
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
22
|
+
* use your version of this file under the terms of the CPL, indicate your
|
|
23
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
24
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
25
|
+
* the provisions above, a recipient may use your version of this file under
|
|
26
|
+
* the terms of any one of the CPL, the GPL or the LGPL.
|
|
27
|
+
***** END LICENSE BLOCK *****/
|
|
28
|
+
package org.jruby.ext.openssl.impl;
|
|
29
|
+
|
|
30
|
+
import java.io.IOException;
|
|
31
|
+
import java.io.InputStream;
|
|
32
|
+
import java.io.OutputStream;
|
|
33
|
+
import org.jruby.ext.openssl.impl.utils.Base64;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
|
|
38
|
+
*/
|
|
39
|
+
public class Base64BIOFilter extends BIOFilter {
|
|
40
|
+
private OutputStream nextOutput;
|
|
41
|
+
private InputStream nextInput;
|
|
42
|
+
|
|
43
|
+
@Override
|
|
44
|
+
public int write(byte[] out, int offset, int len) throws IOException {
|
|
45
|
+
this.nextOutput.write(out, offset, len);
|
|
46
|
+
return len;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private static void printBytes(byte[] bs, int offset, int len) {
|
|
50
|
+
System.err.print("[");
|
|
51
|
+
String sep = "";
|
|
52
|
+
for(int i=offset, end=offset+len;i<end;i++) {
|
|
53
|
+
System.err.print(sep);
|
|
54
|
+
System.err.print(((int)bs[i]) & 0xFF);
|
|
55
|
+
sep = ", ";
|
|
56
|
+
}
|
|
57
|
+
System.err.print("]");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Override
|
|
61
|
+
public int read(byte[] into, int offset, int len) throws IOException {
|
|
62
|
+
int read = this.nextInput.read(into, offset, len);
|
|
63
|
+
if(read == -1) {
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
return read;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Override
|
|
70
|
+
public void flush() throws IOException {
|
|
71
|
+
this.nextOutput.flush();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public BIO push(BIO bio) {
|
|
75
|
+
BIO ret = super.push(bio);
|
|
76
|
+
this.nextOutput = new Base64.OutputStream(BIO.asOutputStream(this.nextBio));
|
|
77
|
+
this.nextInput = new Base64.InputStream(BIO.asInputStream(this.nextBio));
|
|
78
|
+
return ret;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public int getType() {
|
|
82
|
+
return TYPE_BASE64;
|
|
83
|
+
}
|
|
84
|
+
}// Base64BIOFilter
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/***** BEGIN LICENSE BLOCK *****
|
|
2
|
+
* Version: CPL 1.0/GPL 2.0/LGPL 2.1
|
|
3
|
+
*
|
|
4
|
+
* The contents of this file are subject to the Common Public
|
|
5
|
+
* License Version 1.0 (the "License"); you may not use this file
|
|
6
|
+
* except in compliance with the License. You may obtain a copy of
|
|
7
|
+
* the License at http://www.eclipse.org/legal/cpl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Software distributed under the License is distributed on an "AS
|
|
10
|
+
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
11
|
+
* implied. See the License for the specific language governing
|
|
12
|
+
* rights and limitations under the License.
|
|
13
|
+
*
|
|
14
|
+
* Copyright (C) 2008 Ola Bini <ola.bini@gmail.com>
|
|
15
|
+
*
|
|
16
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
17
|
+
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
18
|
+
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
19
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
20
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
21
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
22
|
+
* use your version of this file under the terms of the CPL, indicate your
|
|
23
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
24
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
25
|
+
* the provisions above, a recipient may use your version of this file under
|
|
26
|
+
* the terms of any one of the CPL, the GPL or the LGPL.
|
|
27
|
+
***** END LICENSE BLOCK *****/
|
|
28
|
+
package org.jruby.ext.openssl.impl;
|
|
29
|
+
|
|
30
|
+
import java.io.IOException;
|
|
31
|
+
import javax.crypto.BadPaddingException;
|
|
32
|
+
import javax.crypto.Cipher;
|
|
33
|
+
import javax.crypto.IllegalBlockSizeException;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
|
|
38
|
+
*/
|
|
39
|
+
public class CipherBIOFilter extends BIOFilter {
|
|
40
|
+
private Cipher cipher;
|
|
41
|
+
|
|
42
|
+
private byte[] bufRead = new byte[4096];
|
|
43
|
+
private int fillLen = 0;
|
|
44
|
+
private int fillOffset = 0;
|
|
45
|
+
|
|
46
|
+
private byte[] tmpBuf = new byte[1024];
|
|
47
|
+
|
|
48
|
+
private boolean finalized = false;
|
|
49
|
+
|
|
50
|
+
public CipherBIOFilter(Cipher cipher) {
|
|
51
|
+
this.cipher = cipher;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public void flush() throws IOException {
|
|
55
|
+
try {
|
|
56
|
+
byte[] result = cipher.doFinal();
|
|
57
|
+
if(result == null) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
next().write(result, 0, result.length);
|
|
61
|
+
} catch(IllegalBlockSizeException e) {
|
|
62
|
+
throw new PKCS7Exception(-1, -1, e.toString());
|
|
63
|
+
} catch(BadPaddingException e) {
|
|
64
|
+
throw new PKCS7Exception(-1, -1, e.toString());
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public int read(byte[] into, int offset, int len) throws IOException {
|
|
69
|
+
try {
|
|
70
|
+
int read = 0;
|
|
71
|
+
if(fillLen > 0) {
|
|
72
|
+
read = Math.min(fillLen, len);
|
|
73
|
+
System.arraycopy(bufRead, fillOffset, into, offset, read);
|
|
74
|
+
fillOffset += read;
|
|
75
|
+
fillLen -= read;
|
|
76
|
+
if(fillLen == 0) {
|
|
77
|
+
fillOffset = 0;
|
|
78
|
+
}
|
|
79
|
+
if(read == len) {
|
|
80
|
+
return read;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
int req = len - read;
|
|
85
|
+
int off = offset + read;
|
|
86
|
+
|
|
87
|
+
if(finalized) {
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
while(req > 0) {
|
|
92
|
+
int readFromNext = next().read(tmpBuf, 0, 1024);
|
|
93
|
+
if(readFromNext > 0) {
|
|
94
|
+
int required = cipher.getOutputSize(readFromNext);
|
|
95
|
+
if(required > (bufRead.length - (fillOffset + fillLen))) {
|
|
96
|
+
byte[] newBuf = new byte[required + fillOffset + fillLen];
|
|
97
|
+
System.arraycopy(bufRead, fillOffset, newBuf, 0, fillLen);
|
|
98
|
+
fillOffset = 0;
|
|
99
|
+
bufRead = newBuf;
|
|
100
|
+
}
|
|
101
|
+
int outputted = cipher.update(tmpBuf, 0, readFromNext, bufRead, fillOffset + fillLen);
|
|
102
|
+
fillLen += outputted;
|
|
103
|
+
|
|
104
|
+
read = Math.min(fillLen, req);
|
|
105
|
+
System.arraycopy(bufRead, fillOffset, into, off, read);
|
|
106
|
+
fillOffset += read;
|
|
107
|
+
fillLen -= read;
|
|
108
|
+
if(fillLen == 0) {
|
|
109
|
+
fillOffset = 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
req -= read;
|
|
113
|
+
off += read;
|
|
114
|
+
} else {
|
|
115
|
+
int required = cipher.getOutputSize(0);
|
|
116
|
+
if(required > (bufRead.length - (fillOffset + fillLen))) {
|
|
117
|
+
byte[] newBuf = new byte[required + fillOffset + fillLen];
|
|
118
|
+
System.arraycopy(bufRead, fillOffset, newBuf, 0, fillLen);
|
|
119
|
+
fillOffset = 0;
|
|
120
|
+
bufRead = newBuf;
|
|
121
|
+
}
|
|
122
|
+
int outputted = cipher.doFinal(bufRead, fillOffset + fillLen);
|
|
123
|
+
finalized = true;
|
|
124
|
+
fillLen += outputted;
|
|
125
|
+
|
|
126
|
+
read = Math.min(fillLen, req);
|
|
127
|
+
System.arraycopy(bufRead, fillOffset, into, off, read);
|
|
128
|
+
fillOffset += read;
|
|
129
|
+
fillLen -= read;
|
|
130
|
+
if(fillLen == 0) {
|
|
131
|
+
fillOffset = 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
req -= read;
|
|
135
|
+
return len-req;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return len;
|
|
140
|
+
} catch(Exception e) {
|
|
141
|
+
throw new IllegalArgumentException(e);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
public int write(byte[] out, int offset, int len) throws IOException {
|
|
146
|
+
byte[] result = cipher.update(out, offset, len);
|
|
147
|
+
if(result == null) {
|
|
148
|
+
return len;
|
|
149
|
+
}
|
|
150
|
+
next().write(result, 0, result.length);
|
|
151
|
+
return len;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public int getType() {
|
|
155
|
+
return TYPE_CIPHER;
|
|
156
|
+
}
|
|
157
|
+
}// CipherBIOFilter
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/***** BEGIN LICENSE BLOCK *****
|
|
2
|
+
* Version: CPL 1.0/GPL 2.0/LGPL 2.1
|
|
3
|
+
*
|
|
4
|
+
* The contents of this file are subject to the Common Public
|
|
5
|
+
* License Version 1.0 (the "License"); you may not use this file
|
|
6
|
+
* except in compliance with the License. You may obtain a copy of
|
|
7
|
+
* the License at http://www.eclipse.org/legal/cpl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Software distributed under the License is distributed on an "AS
|
|
10
|
+
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
11
|
+
* implied. See the License for the specific language governing
|
|
12
|
+
* rights and limitations under the License.
|
|
13
|
+
*
|
|
14
|
+
* Copyright (C) 2008 Ola Bini <ola.bini@gmail.com>
|
|
15
|
+
*
|
|
16
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
17
|
+
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
18
|
+
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
19
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
20
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
21
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
22
|
+
* use your version of this file under the terms of the CPL, indicate your
|
|
23
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
24
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
25
|
+
* the provisions above, a recipient may use your version of this file under
|
|
26
|
+
* the terms of any one of the CPL, the GPL or the LGPL.
|
|
27
|
+
***** END LICENSE BLOCK *****/
|
|
28
|
+
package org.jruby.ext.openssl.impl;
|
|
29
|
+
|
|
30
|
+
import org.bouncycastle.asn1.ASN1OctetString;
|
|
31
|
+
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
|
|
32
|
+
|
|
33
|
+
/** PKCS7_DIGEST
|
|
34
|
+
*
|
|
35
|
+
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
|
|
36
|
+
*/
|
|
37
|
+
public class Digest {
|
|
38
|
+
/**
|
|
39
|
+
* Describe version here.
|
|
40
|
+
*/
|
|
41
|
+
private int version;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Describe md here.
|
|
45
|
+
*/
|
|
46
|
+
private AlgorithmIdentifier md;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Describe digest here.
|
|
50
|
+
*/
|
|
51
|
+
private ASN1OctetString digest;
|
|
52
|
+
|
|
53
|
+
PKCS7 contents;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get the <code>Version</code> value.
|
|
57
|
+
*
|
|
58
|
+
* @return an <code>int</code> value
|
|
59
|
+
*/
|
|
60
|
+
public final int getVersion() {
|
|
61
|
+
return version;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Set the <code>Version</code> value.
|
|
66
|
+
*
|
|
67
|
+
* @param newVersion The new Version value.
|
|
68
|
+
*/
|
|
69
|
+
public final void setVersion(final int newVersion) {
|
|
70
|
+
this.version = newVersion;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get the <code>Contents</code> value.
|
|
75
|
+
*
|
|
76
|
+
* @return a <code>PKCS7</code> value
|
|
77
|
+
*/
|
|
78
|
+
public final PKCS7 getContents() {
|
|
79
|
+
return contents;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Set the <code>Contents</code> value.
|
|
84
|
+
*
|
|
85
|
+
* @param newContents The new Contents value.
|
|
86
|
+
*/
|
|
87
|
+
public final void setContents(final PKCS7 newContents) {
|
|
88
|
+
this.contents = newContents;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get the <code>Md</code> value.
|
|
93
|
+
*
|
|
94
|
+
* @return an <code>AlgorithmIdentifier</code> value
|
|
95
|
+
*/
|
|
96
|
+
public final AlgorithmIdentifier getMd() {
|
|
97
|
+
return md;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Set the <code>Md</code> value.
|
|
102
|
+
*
|
|
103
|
+
* @param newMd The new Md value.
|
|
104
|
+
*/
|
|
105
|
+
public final void setMd(final AlgorithmIdentifier newMd) {
|
|
106
|
+
this.md = newMd;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get the <code>Digest</code> value.
|
|
111
|
+
*
|
|
112
|
+
* @return an <code>ASN1OctetString</code> value
|
|
113
|
+
*/
|
|
114
|
+
public final ASN1OctetString getDigest() {
|
|
115
|
+
return digest;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Set the <code>Digest</code> value.
|
|
120
|
+
*
|
|
121
|
+
* @param newDigest The new Digest value.
|
|
122
|
+
*/
|
|
123
|
+
public final void setDigest(final ASN1OctetString newDigest) {
|
|
124
|
+
this.digest = newDigest;
|
|
125
|
+
}
|
|
126
|
+
}// Digest
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/***** BEGIN LICENSE BLOCK *****
|
|
2
|
+
* Version: CPL 1.0/GPL 2.0/LGPL 2.1
|
|
3
|
+
*
|
|
4
|
+
* The contents of this file are subject to the Common Public
|
|
5
|
+
* License Version 1.0 (the "License"); you may not use this file
|
|
6
|
+
* except in compliance with the License. You may obtain a copy of
|
|
7
|
+
* the License at http://www.eclipse.org/legal/cpl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Software distributed under the License is distributed on an "AS
|
|
10
|
+
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
11
|
+
* implied. See the License for the specific language governing
|
|
12
|
+
* rights and limitations under the License.
|
|
13
|
+
*
|
|
14
|
+
* Copyright (C) 2008 Ola Bini <ola.bini@gmail.com>
|
|
15
|
+
*
|
|
16
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
17
|
+
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
18
|
+
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
19
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
20
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
21
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
22
|
+
* use your version of this file under the terms of the CPL, indicate your
|
|
23
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
24
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
25
|
+
* the provisions above, a recipient may use your version of this file under
|
|
26
|
+
* the terms of any one of the CPL, the GPL or the LGPL.
|
|
27
|
+
***** END LICENSE BLOCK *****/
|
|
28
|
+
package org.jruby.ext.openssl.impl;
|
|
29
|
+
|
|
30
|
+
import java.security.InvalidKeyException;
|
|
31
|
+
import java.security.Key;
|
|
32
|
+
import java.security.MessageDigest;
|
|
33
|
+
import java.security.NoSuchAlgorithmException;
|
|
34
|
+
import javax.crypto.BadPaddingException;
|
|
35
|
+
import javax.crypto.Cipher;
|
|
36
|
+
import javax.crypto.IllegalBlockSizeException;
|
|
37
|
+
import javax.crypto.NoSuchPaddingException;
|
|
38
|
+
import org.bouncycastle.asn1.DERObjectIdentifier;
|
|
39
|
+
import org.jruby.ext.openssl.OpenSSLReal;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
|
|
44
|
+
*/
|
|
45
|
+
public class EVP {
|
|
46
|
+
// This is a class that will collect mappings from ASN1 stuff to
|
|
47
|
+
// matching Cipher and other algorithms.
|
|
48
|
+
|
|
49
|
+
// Typical examples:
|
|
50
|
+
// EVP_get_cipherbyobj
|
|
51
|
+
// EVP_get_digestbynid
|
|
52
|
+
|
|
53
|
+
/* c: EVP_get_cipherbyobj
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
public static Cipher getCipher(DERObjectIdentifier oid) throws NoSuchAlgorithmException,
|
|
57
|
+
NoSuchPaddingException {
|
|
58
|
+
return Cipher.getInstance(oid.getId(), OpenSSLReal.PROVIDER);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* c: EVP_get_cipherbynid
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
public static Cipher getCipher(int nid) throws NoSuchAlgorithmException,
|
|
65
|
+
NoSuchPaddingException {
|
|
66
|
+
return getCipher(ASN1Registry.nid2obj(nid));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* c: EVP_get_digestbyobj
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
public static MessageDigest getDigest(DERObjectIdentifier oid) throws NoSuchAlgorithmException {
|
|
73
|
+
return MessageDigest.getInstance(oid.getId(), OpenSSLReal.PROVIDER);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* c: EVP_get_digestbynid
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
public static MessageDigest getDigest(int nid) throws NoSuchAlgorithmException {
|
|
80
|
+
return getDigest(ASN1Registry.nid2obj(nid));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* c: EVP_sha1
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
public static MessageDigest sha1() {
|
|
87
|
+
try {
|
|
88
|
+
return MessageDigest.getInstance("SHA1", OpenSSLReal.PROVIDER);
|
|
89
|
+
} catch(Exception e) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public static int type(MessageDigest digest) {
|
|
95
|
+
String name = digest.getAlgorithm();
|
|
96
|
+
DERObjectIdentifier obj = ASN1Registry.sym2oid(name);
|
|
97
|
+
if(obj == null) {
|
|
98
|
+
name = name.toLowerCase().replace("sha-", "sha");
|
|
99
|
+
obj = ASN1Registry.sym2oid(name);
|
|
100
|
+
}
|
|
101
|
+
return ASN1Registry.obj2nid(obj);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public static String signatureAlgorithm(MessageDigest digest, Key key) {
|
|
105
|
+
String sig = digest.getAlgorithm().toLowerCase().replace("sha-", "sha");
|
|
106
|
+
String type = key.getAlgorithm().toLowerCase();
|
|
107
|
+
if(sig == null) {
|
|
108
|
+
sig = "none";
|
|
109
|
+
}
|
|
110
|
+
return sig + "with" + type;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* c: EVP_PKEY_decrypt
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
public static byte[] decrypt(byte[] input, int offset, int len, Key key) throws InvalidKeyException,
|
|
117
|
+
NoSuchAlgorithmException,
|
|
118
|
+
NoSuchPaddingException,
|
|
119
|
+
IllegalBlockSizeException,
|
|
120
|
+
BadPaddingException {
|
|
121
|
+
Cipher cipher = Cipher.getInstance(key.getAlgorithm(), OpenSSLReal.PROVIDER);
|
|
122
|
+
cipher.init(Cipher.DECRYPT_MODE, key);
|
|
123
|
+
return cipher.doFinal(input, offset, len);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* c: EVP_PKEY_decrypt
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
public static byte[] decrypt(byte[] input, Key key) throws InvalidKeyException,
|
|
130
|
+
NoSuchAlgorithmException,
|
|
131
|
+
NoSuchPaddingException,
|
|
132
|
+
IllegalBlockSizeException,
|
|
133
|
+
BadPaddingException {
|
|
134
|
+
return decrypt(input, 0, input.length, key);
|
|
135
|
+
}
|
|
136
|
+
}// EVP
|