redcar 0.3.2dev → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- 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,43 @@
|
|
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) 2006 Ola Bini <ola@ologix.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.x509store;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Three arity function call.
|
32
|
+
*
|
33
|
+
* @author <a href="mailto:ola.bini@ki.se">Ola Bini</a>
|
34
|
+
*/
|
35
|
+
public interface Function3 {
|
36
|
+
public static class Empty implements Function3 {
|
37
|
+
public int call(Object arg0,Object arg1,Object arg2) {
|
38
|
+
return -1;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
public static final Function3.Empty EMPTY = new Empty();
|
42
|
+
int call(Object arg0,Object arg1,Object arg2) throws Exception;
|
43
|
+
}// Function3
|
@@ -0,0 +1,43 @@
|
|
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) 2006 Ola Bini <ola@ologix.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.x509store;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Four arity function call.
|
32
|
+
*
|
33
|
+
* @author <a href="mailto:ola.bini@ki.se">Ola Bini</a>
|
34
|
+
*/
|
35
|
+
public interface Function4 {
|
36
|
+
public static class Empty implements Function4 {
|
37
|
+
public int call(Object arg0,Object arg1,Object arg2,Object arg3) {
|
38
|
+
return -1;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
public static final Function4.Empty EMPTY = new Empty();
|
42
|
+
int call(Object arg0,Object arg1,Object arg2,Object arg3) throws Exception;
|
43
|
+
}// Function4
|
@@ -0,0 +1,43 @@
|
|
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) 2006 Ola Bini <ola@ologix.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.x509store;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Five arity function call.
|
32
|
+
*
|
33
|
+
* @author <a href="mailto:ola.bini@ki.se">Ola Bini</a>
|
34
|
+
*/
|
35
|
+
public interface Function5 {
|
36
|
+
public static class Empty implements Function5 {
|
37
|
+
public int call(Object arg0,Object arg1,Object arg2,Object arg3,Object arg4) {
|
38
|
+
return -1;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
public static final Function5.Empty EMPTY = new Empty();
|
42
|
+
int call(Object arg0,Object arg1,Object arg2,Object arg3,Object arg4) throws Exception;
|
43
|
+
}// Function5
|
@@ -0,0 +1,560 @@
|
|
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) 2006 Ola Bini <ola@ologix.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.x509store;
|
29
|
+
|
30
|
+
import java.io.File;
|
31
|
+
import java.io.FileReader;
|
32
|
+
import java.io.Reader;
|
33
|
+
import java.io.InputStream;
|
34
|
+
import java.io.BufferedInputStream;
|
35
|
+
import java.io.BufferedReader;
|
36
|
+
import java.io.FileInputStream;
|
37
|
+
import java.io.InputStreamReader;
|
38
|
+
|
39
|
+
import java.math.BigInteger;
|
40
|
+
|
41
|
+
import java.security.cert.CertificateFactory;
|
42
|
+
import java.security.cert.X509Certificate;
|
43
|
+
import java.security.cert.CRL;
|
44
|
+
|
45
|
+
import java.util.ArrayList;
|
46
|
+
import java.util.Iterator;
|
47
|
+
import java.util.List;
|
48
|
+
|
49
|
+
import org.jruby.ext.openssl.OpenSSLReal;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* X509_LOOKUP
|
53
|
+
*
|
54
|
+
* @author <a href="mailto:ola.bini@ki.se">Ola Bini</a>
|
55
|
+
*/
|
56
|
+
public class Lookup {
|
57
|
+
public boolean init;
|
58
|
+
public boolean skip;
|
59
|
+
public LookupMethod method;
|
60
|
+
public Object methodData;
|
61
|
+
public Store store;
|
62
|
+
|
63
|
+
public final static int FILE_LOAD = 1;
|
64
|
+
public final static int ADD_DIR = 2;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* c: X509_LOOKUP_new
|
68
|
+
*/
|
69
|
+
public Lookup(LookupMethod method) throws Exception {
|
70
|
+
init=false;
|
71
|
+
skip=false;
|
72
|
+
this.method=method;
|
73
|
+
methodData=null;
|
74
|
+
store=null;
|
75
|
+
if(method.newItem != null && method.newItem != Function1.EMPTY && method.newItem.call(this) == 0) {
|
76
|
+
throw new Exception();
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* c: X509_LOOKUP_load_file
|
82
|
+
*/
|
83
|
+
public int loadFile(CertificateFile.Path file) throws Exception {
|
84
|
+
return control(FILE_LOAD,file.name,file.type,null);
|
85
|
+
}
|
86
|
+
|
87
|
+
/**
|
88
|
+
* c: X509_LOOKUP_add_dir
|
89
|
+
*/
|
90
|
+
public int addDir(CertificateHashDir.Dir dir) throws Exception {
|
91
|
+
return control(ADD_DIR,dir.name,dir.type,null);
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* c: X509_LOOKUP_hash_dir
|
96
|
+
*/
|
97
|
+
public static LookupMethod hashDirLookup() {
|
98
|
+
return x509DirectoryLookup;
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* c: X509_LOOKUP_file
|
103
|
+
*/
|
104
|
+
public static LookupMethod fileLookup() {
|
105
|
+
return x509FileLookup;
|
106
|
+
}
|
107
|
+
|
108
|
+
/**
|
109
|
+
* c: X509_LOOKUP_ctrl
|
110
|
+
*/
|
111
|
+
public int control(int cmd, String argc, long argl, String[] ret) throws Exception {
|
112
|
+
if(method == null) {
|
113
|
+
return -1;
|
114
|
+
}
|
115
|
+
if(method.control != null && method.control != Function5.EMPTY) {
|
116
|
+
return method.control.call(this,new Integer(cmd),argc,new Long(argl),ret);
|
117
|
+
} else {
|
118
|
+
return 1;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* c: X509_LOOKUP_load_cert_file
|
124
|
+
*/
|
125
|
+
public int loadCertificateFile(String file, int type) throws Exception {
|
126
|
+
if(file == null) {
|
127
|
+
return 1;
|
128
|
+
}
|
129
|
+
int count = 0;
|
130
|
+
int ret = 0;
|
131
|
+
InputStream in = new BufferedInputStream(new FileInputStream(file));
|
132
|
+
X509AuxCertificate x = null;
|
133
|
+
|
134
|
+
if(type == X509Utils.X509_FILETYPE_PEM) {
|
135
|
+
Reader r = new InputStreamReader(in);
|
136
|
+
for(;;) {
|
137
|
+
x = PEMInputOutput.readX509Aux(r,null);
|
138
|
+
if(null == x) {
|
139
|
+
break;
|
140
|
+
}
|
141
|
+
int i = store.addCertificate(x);
|
142
|
+
if(i == 0) {
|
143
|
+
return ret;
|
144
|
+
}
|
145
|
+
count++;
|
146
|
+
x = null;
|
147
|
+
}
|
148
|
+
ret = count;
|
149
|
+
} else if(type == X509Utils.X509_FILETYPE_ASN1) {
|
150
|
+
CertificateFactory cf = CertificateFactory.getInstance("X.509",OpenSSLReal.PROVIDER);
|
151
|
+
x = StoreContext.ensureAux((X509Certificate)cf.generateCertificate(in));
|
152
|
+
if(x == null) {
|
153
|
+
X509Error.addError(13);
|
154
|
+
return ret;
|
155
|
+
}
|
156
|
+
int i = store.addCertificate(x);
|
157
|
+
if(i == 0) {
|
158
|
+
return ret;
|
159
|
+
}
|
160
|
+
ret = i;
|
161
|
+
} else {
|
162
|
+
X509Error.addError(X509Utils.X509_R_BAD_X509_FILETYPE);
|
163
|
+
}
|
164
|
+
|
165
|
+
return ret;
|
166
|
+
}
|
167
|
+
|
168
|
+
/**
|
169
|
+
* c: X509_LOOKUP_load_crl_file
|
170
|
+
*/
|
171
|
+
public int loadCRLFile(String file, int type) throws Exception {
|
172
|
+
if(file == null) {
|
173
|
+
return 1;
|
174
|
+
}
|
175
|
+
int count = 0;
|
176
|
+
int ret = 0;
|
177
|
+
InputStream in = new BufferedInputStream(new FileInputStream(file));
|
178
|
+
CRL x = null;
|
179
|
+
|
180
|
+
if(type == X509Utils.X509_FILETYPE_PEM) {
|
181
|
+
Reader r = new InputStreamReader(in);
|
182
|
+
for(;;) {
|
183
|
+
x = PEMInputOutput.readX509CRL(r,null);;
|
184
|
+
if(null == x) {
|
185
|
+
break;
|
186
|
+
}
|
187
|
+
int i = store.addCRL(x);
|
188
|
+
if(i == 0) {
|
189
|
+
return ret;
|
190
|
+
}
|
191
|
+
count++;
|
192
|
+
x = null;
|
193
|
+
}
|
194
|
+
ret = count;
|
195
|
+
} else if(type == X509Utils.X509_FILETYPE_ASN1) {
|
196
|
+
CertificateFactory cf = CertificateFactory.getInstance("X.509",OpenSSLReal.PROVIDER);
|
197
|
+
x = cf.generateCRL(in);
|
198
|
+
if(x == null) {
|
199
|
+
X509Error.addError(13);
|
200
|
+
return ret;
|
201
|
+
}
|
202
|
+
int i = store.addCRL(x);
|
203
|
+
if(i == 0) {
|
204
|
+
return ret;
|
205
|
+
}
|
206
|
+
ret = i;
|
207
|
+
} else {
|
208
|
+
X509Error.addError(X509Utils.X509_R_BAD_X509_FILETYPE);
|
209
|
+
}
|
210
|
+
|
211
|
+
return ret;
|
212
|
+
}
|
213
|
+
|
214
|
+
/**
|
215
|
+
* c: X509_LOOKUP_load_cert_crl_file
|
216
|
+
*/
|
217
|
+
public int loadCertificateOrCRLFile(String file, int type) throws Exception {
|
218
|
+
if(type != X509Utils.X509_FILETYPE_PEM) {
|
219
|
+
return loadCertificateFile(file,type);
|
220
|
+
}
|
221
|
+
int count = 0;
|
222
|
+
Reader in = null;
|
223
|
+
try {
|
224
|
+
in = new FileReader(file);
|
225
|
+
Reader r = new BufferedReader(in);
|
226
|
+
for (;;) {
|
227
|
+
Object v = PEMInputOutput.readPEM(r, null);
|
228
|
+
if (null == v) {
|
229
|
+
break;
|
230
|
+
}
|
231
|
+
if (v instanceof X509Certificate) {
|
232
|
+
store.addCertificate(StoreContext.ensureAux((X509Certificate) v));
|
233
|
+
count++;
|
234
|
+
} else if (v instanceof CRL) {
|
235
|
+
store.addCRL((CRL) v);
|
236
|
+
count++;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
} finally {
|
240
|
+
if (in != null) {
|
241
|
+
try { in.close(); } catch(Exception e) {}
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
245
|
+
return count;
|
246
|
+
}
|
247
|
+
|
248
|
+
/**
|
249
|
+
* c: X509_LOOKUP_free
|
250
|
+
*/
|
251
|
+
public void free() throws Exception {
|
252
|
+
if(method != null && method.free != null && method.free != Function1.EMPTY) {
|
253
|
+
method.free.call(this);
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
/**
|
258
|
+
* c: X509_LOOKUP_init
|
259
|
+
*/
|
260
|
+
public int init() throws Exception {
|
261
|
+
if(method == null) {
|
262
|
+
return 0;
|
263
|
+
}
|
264
|
+
if(method.init != null && method.init != Function1.EMPTY) {
|
265
|
+
return method.init.call(this);
|
266
|
+
}
|
267
|
+
return 1;
|
268
|
+
}
|
269
|
+
|
270
|
+
/**
|
271
|
+
* c: X509_LOOKUP_by_subject
|
272
|
+
*/
|
273
|
+
public int bySubject(int type, Name name,X509Object[] ret) throws Exception {
|
274
|
+
if(method == null || method.getBySubject == null || method.getBySubject == Function4.EMPTY) {
|
275
|
+
return X509Utils.X509_LU_FAIL;
|
276
|
+
}
|
277
|
+
if(skip) {
|
278
|
+
return 0;
|
279
|
+
}
|
280
|
+
return method.getBySubject.call(this,new Integer(type),name,ret);
|
281
|
+
}
|
282
|
+
|
283
|
+
/**
|
284
|
+
* c: X509_LOOKUP_by_issuer_serial
|
285
|
+
*/
|
286
|
+
public int byIssuerSerialNumber(int type, Name name,BigInteger serial, X509Object[] ret) throws Exception {
|
287
|
+
if(method == null || method.getByIssuerSerialNumber == null || method.getByIssuerSerialNumber == Function5.EMPTY) {
|
288
|
+
return X509Utils.X509_LU_FAIL;
|
289
|
+
}
|
290
|
+
return method.getByIssuerSerialNumber.call(this,new Integer(type),name,serial,ret);
|
291
|
+
}
|
292
|
+
|
293
|
+
/**
|
294
|
+
* c: X509_LOOKUP_by_fingerprint
|
295
|
+
*/
|
296
|
+
public int byFingerprint(int type,String bytes, X509Object[] ret) throws Exception {
|
297
|
+
if(method == null || method.getByFingerprint == null || method.getByFingerprint == Function4.EMPTY) {
|
298
|
+
return X509Utils.X509_LU_FAIL;
|
299
|
+
}
|
300
|
+
return method.getByFingerprint.call(this,new Integer(type),bytes,ret);
|
301
|
+
}
|
302
|
+
|
303
|
+
/**
|
304
|
+
* c: X509_LOOKUP_by_alias
|
305
|
+
*/
|
306
|
+
public int byAlias(int type, String str, X509Object[] ret) throws Exception {
|
307
|
+
if(method == null || method.getByAlias == null || method.getByAlias == Function4.EMPTY) {
|
308
|
+
return X509Utils.X509_LU_FAIL;
|
309
|
+
}
|
310
|
+
return method.getByAlias.call(this,new Integer(type),str,ret);
|
311
|
+
}
|
312
|
+
|
313
|
+
/**
|
314
|
+
* c: X509_LOOKUP_shutdown
|
315
|
+
*/
|
316
|
+
public int shutdown() throws Exception {
|
317
|
+
if(method == null) {
|
318
|
+
return 0;
|
319
|
+
}
|
320
|
+
if(method.shutdown != null && method.shutdown != Function1.EMPTY) {
|
321
|
+
return method.shutdown.call(this);
|
322
|
+
}
|
323
|
+
return 1;
|
324
|
+
}
|
325
|
+
|
326
|
+
/**
|
327
|
+
* c: x509_file_lookup
|
328
|
+
*/
|
329
|
+
private final static LookupMethod x509FileLookup = new LookupMethod();
|
330
|
+
|
331
|
+
/**
|
332
|
+
* c: x509_dir_lookup
|
333
|
+
*/
|
334
|
+
private final static LookupMethod x509DirectoryLookup = new LookupMethod();
|
335
|
+
|
336
|
+
static {
|
337
|
+
x509FileLookup.name = "Load file into cache";
|
338
|
+
x509FileLookup.control = new ByFile();
|
339
|
+
|
340
|
+
x509DirectoryLookup.name = "Load certs from files in a directory";
|
341
|
+
x509DirectoryLookup.newItem = new NewLookupDir();
|
342
|
+
x509DirectoryLookup.free = new FreeLookupDir();
|
343
|
+
x509DirectoryLookup.control = new LookupDirControl();
|
344
|
+
x509DirectoryLookup.getBySubject = new GetCertificateBySubject();
|
345
|
+
}
|
346
|
+
|
347
|
+
/**
|
348
|
+
* c: by_file_ctrl
|
349
|
+
*/
|
350
|
+
private static class ByFile implements LookupMethod.ControlFunction {
|
351
|
+
public int call(Object _ctx, Object _cmd, Object _argp, Object _argl, Object _ret) throws Exception {
|
352
|
+
Lookup ctx = (Lookup)_ctx;
|
353
|
+
int cmd = ((Integer)_cmd).intValue();
|
354
|
+
String argp = (String)_argp;
|
355
|
+
long argl = ((Long)_argl).longValue();
|
356
|
+
|
357
|
+
int ok = 0;
|
358
|
+
String file = null;
|
359
|
+
|
360
|
+
switch(cmd) {
|
361
|
+
case X509Utils.X509_L_FILE_LOAD:
|
362
|
+
if (argl == X509Utils.X509_FILETYPE_DEFAULT) {
|
363
|
+
try {
|
364
|
+
file = System.getenv(X509Utils.getDefaultCertificateFileEnvironment());
|
365
|
+
} catch (Error error) {
|
366
|
+
}
|
367
|
+
if (file != null) {
|
368
|
+
ok = ctx.loadCertificateOrCRLFile(file, X509Utils.X509_FILETYPE_PEM) != 0 ? 1 : 0;
|
369
|
+
} else {
|
370
|
+
ok = (ctx.loadCertificateOrCRLFile(X509Utils.getDefaultCertificateFile(), X509Utils.X509_FILETYPE_PEM) != 0) ? 1 : 0;
|
371
|
+
}
|
372
|
+
if (ok == 0) {
|
373
|
+
X509Error.addError(X509Utils.X509_R_LOADING_DEFAULTS);
|
374
|
+
}
|
375
|
+
} else {
|
376
|
+
if (argl == X509Utils.X509_FILETYPE_PEM) {
|
377
|
+
ok = (ctx.loadCertificateOrCRLFile(argp, X509Utils.X509_FILETYPE_PEM) != 0) ? 1 : 0;
|
378
|
+
} else {
|
379
|
+
ok = (ctx.loadCertificateFile(argp, (int) argl) != 0) ? 1 : 0;
|
380
|
+
}
|
381
|
+
}
|
382
|
+
break;
|
383
|
+
}
|
384
|
+
|
385
|
+
return ok;
|
386
|
+
}
|
387
|
+
}
|
388
|
+
|
389
|
+
/**
|
390
|
+
* c: BY_DIR, lookup_dir_st
|
391
|
+
*/
|
392
|
+
private static class LookupDir {
|
393
|
+
StringBuffer buffer;
|
394
|
+
List<String> dirs;
|
395
|
+
List<Integer> dirsType;
|
396
|
+
}
|
397
|
+
|
398
|
+
/**
|
399
|
+
* c: new_dir
|
400
|
+
*/
|
401
|
+
private static class NewLookupDir implements LookupMethod.NewItemFunction {
|
402
|
+
public int call(Object _lu) {
|
403
|
+
Lookup lu = (Lookup)_lu;
|
404
|
+
LookupDir a = new LookupDir();
|
405
|
+
a.buffer = new StringBuffer();
|
406
|
+
a.dirs = new ArrayList<String>();
|
407
|
+
a.dirsType = new ArrayList<Integer>();
|
408
|
+
lu.methodData = a;
|
409
|
+
return 1;
|
410
|
+
}
|
411
|
+
}
|
412
|
+
|
413
|
+
/**
|
414
|
+
* c: free_dir
|
415
|
+
*/
|
416
|
+
private static class FreeLookupDir implements LookupMethod.FreeFunction {
|
417
|
+
public int call(Object _lu) {
|
418
|
+
Lookup lu = (Lookup)_lu;
|
419
|
+
LookupDir a = (LookupDir)lu.methodData;
|
420
|
+
a.dirs = null;
|
421
|
+
a.dirsType = null;
|
422
|
+
a.buffer = null;
|
423
|
+
lu.methodData = null;
|
424
|
+
return -1;
|
425
|
+
}
|
426
|
+
}
|
427
|
+
|
428
|
+
/**
|
429
|
+
* c: dir_ctrl
|
430
|
+
*/
|
431
|
+
private static class LookupDirControl implements LookupMethod.ControlFunction {
|
432
|
+
public int call(Object _ctx, Object _cmd, Object _argp, Object _argl, Object _retp) {
|
433
|
+
Lookup ctx = (Lookup)_ctx;
|
434
|
+
int cmd = ((Integer)_cmd).intValue();
|
435
|
+
String argp = (String)_argp;
|
436
|
+
long argl = ((Long)_argl).longValue();
|
437
|
+
int ret = 0;
|
438
|
+
LookupDir ld = (LookupDir)ctx.methodData;
|
439
|
+
String dir = null;
|
440
|
+
switch(cmd) {
|
441
|
+
case X509Utils.X509_L_ADD_DIR:
|
442
|
+
if(argl == X509Utils.X509_FILETYPE_DEFAULT) {
|
443
|
+
try {
|
444
|
+
dir = System.getenv(X509Utils.getDefaultCertificateDirectoryEnvironment());
|
445
|
+
} catch (Error error) {
|
446
|
+
}
|
447
|
+
if(null != dir) {
|
448
|
+
ret = addCertificateDirectory(ld,dir,X509Utils.X509_FILETYPE_PEM);
|
449
|
+
} else {
|
450
|
+
ret = addCertificateDirectory(ld,X509Utils.getDefaultCertificateDirectory(),X509Utils.X509_FILETYPE_PEM);
|
451
|
+
}
|
452
|
+
if(ret == 0) {
|
453
|
+
X509Error.addError(X509Utils.X509_R_LOADING_CERT_DIR);
|
454
|
+
}
|
455
|
+
} else {
|
456
|
+
ret = addCertificateDirectory(ld,argp,(int)argl);
|
457
|
+
}
|
458
|
+
break;
|
459
|
+
}
|
460
|
+
return ret;
|
461
|
+
}
|
462
|
+
|
463
|
+
/**
|
464
|
+
* c: add_cert_dir
|
465
|
+
*/
|
466
|
+
private int addCertificateDirectory(LookupDir ctx,String dir,int type) {
|
467
|
+
if(dir == null || "".equals(dir)) {
|
468
|
+
X509Error.addError(X509Utils.X509_R_INVALID_DIRECTORY);
|
469
|
+
return 0;
|
470
|
+
}
|
471
|
+
|
472
|
+
String[] dirs = dir.split(System.getProperty("path.separator"));
|
473
|
+
|
474
|
+
for(int i=0;i<dirs.length;i++) {
|
475
|
+
if(dirs[i].length() == 0) {
|
476
|
+
continue;
|
477
|
+
}
|
478
|
+
if(ctx.dirs.contains(dirs[i])) {
|
479
|
+
continue;
|
480
|
+
}
|
481
|
+
ctx.dirsType.add(type);
|
482
|
+
ctx.dirs.add(dirs[i]);
|
483
|
+
}
|
484
|
+
|
485
|
+
return 1;
|
486
|
+
}
|
487
|
+
}
|
488
|
+
|
489
|
+
/**
|
490
|
+
* c: get_cert_by_subject
|
491
|
+
*/
|
492
|
+
private static class GetCertificateBySubject implements LookupMethod.BySubjectFunction {
|
493
|
+
public int call(Object _xl, Object _type, Object _name, Object _ret) throws Exception {
|
494
|
+
Lookup x1 = (Lookup)_xl;
|
495
|
+
int type = ((Integer)_type).intValue();
|
496
|
+
Name name = (Name)_name;
|
497
|
+
X509Object[] ret = (X509Object[])_ret;
|
498
|
+
|
499
|
+
X509Object tmp = null;
|
500
|
+
|
501
|
+
int ok = 0;
|
502
|
+
StringBuffer b = new StringBuffer();
|
503
|
+
|
504
|
+
if(null == name) {
|
505
|
+
return 0;
|
506
|
+
}
|
507
|
+
|
508
|
+
String postfix = "";
|
509
|
+
if(type == X509Utils.X509_LU_X509) {
|
510
|
+
} else if(type == X509Utils.X509_LU_CRL) {
|
511
|
+
postfix = "r";
|
512
|
+
} else {
|
513
|
+
X509Error.addError(X509Utils.X509_R_WRONG_LOOKUP_TYPE);
|
514
|
+
return ok;
|
515
|
+
}
|
516
|
+
|
517
|
+
LookupDir ctx = (LookupDir)x1.methodData;
|
518
|
+
|
519
|
+
long h = name.hash();
|
520
|
+
|
521
|
+
Iterator<Integer> iter = ctx.dirsType.iterator();
|
522
|
+
for(String cdir : ctx.dirs) {
|
523
|
+
int tp = iter.next();
|
524
|
+
int k = 0;
|
525
|
+
for(;;) {
|
526
|
+
b.append(String.format("%s/%08x.%s%d",new Object[]{cdir,new Long(h),postfix,new Integer(k)}));
|
527
|
+
k++;
|
528
|
+
if(!(new File(b.toString()).exists())) {
|
529
|
+
break;
|
530
|
+
}
|
531
|
+
if(type == X509Utils.X509_LU_X509) {
|
532
|
+
if((x1.loadCertificateFile(b.toString(),tp)) == 0) {
|
533
|
+
break;
|
534
|
+
}
|
535
|
+
} else if(type == X509Utils.X509_LU_CRL) {
|
536
|
+
if((x1.loadCRLFile(b.toString(),tp)) == 0) {
|
537
|
+
break;
|
538
|
+
}
|
539
|
+
}
|
540
|
+
}
|
541
|
+
synchronized(X509Utils.CRYPTO_LOCK_X509_STORE) {
|
542
|
+
tmp = null;
|
543
|
+
for(X509Object o : x1.store.objs) {
|
544
|
+
if(o.type() == type && o.isName(name)) {
|
545
|
+
tmp = o;
|
546
|
+
break;
|
547
|
+
}
|
548
|
+
}
|
549
|
+
}
|
550
|
+
if(tmp != null) {
|
551
|
+
ok = 1;
|
552
|
+
ret[0] = tmp;
|
553
|
+
break;
|
554
|
+
}
|
555
|
+
}
|
556
|
+
|
557
|
+
return ok;
|
558
|
+
}
|
559
|
+
}
|
560
|
+
}// X509_LOOKUP
|