rubygems-update 2.0.17 → 2.1.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -0
- data/.autotest +1 -1
- data/History.txt +82 -153
- data/Manifest.txt +35 -9
- data/Rakefile +35 -36
- data/lib/rubygems.rb +106 -18
- data/lib/rubygems/available_set.rb +68 -0
- data/lib/rubygems/basic_specification.rb +139 -0
- data/lib/rubygems/command_manager.rb +37 -40
- data/lib/rubygems/commands/cert_command.rb +78 -29
- data/lib/rubygems/commands/cleanup_command.rb +2 -2
- data/lib/rubygems/commands/contents_command.rb +101 -58
- data/lib/rubygems/commands/dependency_command.rb +94 -53
- data/lib/rubygems/commands/environment_command.rb +70 -53
- data/lib/rubygems/commands/fetch_command.rb +1 -2
- data/lib/rubygems/commands/help_command.rb +85 -55
- data/lib/rubygems/commands/install_command.rb +84 -42
- data/lib/rubygems/commands/outdated_command.rb +2 -12
- data/lib/rubygems/commands/owner_command.rb +6 -0
- data/lib/rubygems/commands/pristine_command.rb +26 -16
- data/lib/rubygems/commands/sources_command.rb +85 -70
- data/lib/rubygems/commands/uninstall_command.rb +32 -2
- data/lib/rubygems/commands/update_command.rb +111 -75
- data/lib/rubygems/config_file.rb +15 -3
- data/lib/rubygems/core_ext/kernel_require.rb +9 -31
- data/lib/rubygems/defaults.rb +8 -0
- data/lib/rubygems/dependency.rb +4 -2
- data/lib/rubygems/dependency_installer.rb +180 -170
- data/lib/rubygems/dependency_resolver.rb +191 -526
- data/lib/rubygems/dependency_resolver/activation_request.rb +109 -0
- data/lib/rubygems/dependency_resolver/api_set.rb +65 -0
- data/lib/rubygems/dependency_resolver/api_specification.rb +36 -0
- data/lib/rubygems/dependency_resolver/composed_set.rb +18 -0
- data/lib/rubygems/dependency_resolver/current_set.rb +16 -0
- data/lib/rubygems/dependency_resolver/dependency_conflict.rb +85 -0
- data/lib/rubygems/dependency_resolver/dependency_request.rb +51 -0
- data/lib/rubygems/dependency_resolver/index_set.rb +59 -0
- data/lib/rubygems/dependency_resolver/index_specification.rb +53 -0
- data/lib/rubygems/dependency_resolver/installed_specification.rb +38 -0
- data/lib/rubygems/dependency_resolver/installer_set.rb +130 -0
- data/lib/rubygems/exceptions.rb +88 -1
- data/lib/rubygems/ext/builder.rb +1 -1
- data/lib/rubygems/gem_runner.rb +17 -9
- data/lib/rubygems/gemcutter_utilities.rb +72 -42
- data/lib/rubygems/install_default_message.rb +12 -0
- data/lib/rubygems/install_update_options.rb +3 -0
- data/lib/rubygems/installer.rb +55 -30
- data/lib/rubygems/name_tuple.rb +18 -7
- data/lib/rubygems/package.rb +50 -25
- data/lib/rubygems/package/tar_test_case.rb +9 -9
- data/lib/rubygems/package/tar_writer.rb +35 -12
- data/lib/rubygems/package_task.rb +2 -5
- data/lib/rubygems/path_support.rb +10 -0
- data/lib/rubygems/platform.rb +9 -3
- data/lib/rubygems/psych_additions.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +9 -276
- data/lib/rubygems/request.rb +267 -0
- data/lib/rubygems/request_set.rb +123 -125
- data/lib/rubygems/request_set/gem_dependency_api.rb +39 -0
- data/lib/rubygems/security.rb +32 -23
- data/lib/rubygems/security/policy.rb +35 -9
- data/lib/rubygems/security/signer.rb +2 -2
- data/lib/rubygems/server.rb +8 -16
- data/lib/rubygems/source.rb +25 -14
- data/lib/rubygems/source/installed.rb +28 -0
- data/lib/rubygems/source/local.rb +122 -0
- data/lib/rubygems/source/specific_file.rb +28 -0
- data/lib/rubygems/source_local.rb +2 -89
- data/lib/rubygems/source_specific_file.rb +2 -26
- data/lib/rubygems/spec_fetcher.rb +11 -11
- data/lib/rubygems/specification.rb +186 -198
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +88 -30
- data/lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem +90 -0
- data/lib/rubygems/ssl_certs/{GeoTrustGlobalCA.pem → GeoTrust_Global_CA.pem} +20 -20
- data/lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem +57 -0
- data/lib/rubygems/stub_specification.rb +119 -0
- data/lib/rubygems/test_case.rb +117 -49
- data/lib/rubygems/uninstaller.rb +14 -9
- data/lib/rubygems/uri_formatter.rb +39 -0
- data/lib/rubygems/util/list.rb +44 -0
- data/lib/rubygems/version.rb +15 -5
- data/lib/rubygems/version_option.rb +8 -2
- data/test/rubygems/ca_cert.pem +23 -0
- data/test/rubygems/client.pem +49 -0
- data/test/rubygems/encrypted_private_key.pem +30 -0
- data/test/rubygems/invalid_client.pem +49 -0
- data/test/rubygems/specifications/bar-0.0.2.gemspec +9 -0
- data/test/rubygems/specifications/foo-0.0.1.gemspec +0 -0
- data/test/rubygems/test_gem.rb +76 -454
- data/test/rubygems/test_gem_command_manager.rb +23 -21
- data/test/rubygems/test_gem_commands_cert_command.rb +154 -14
- data/test/rubygems/test_gem_commands_cleanup_command.rb +15 -0
- data/test/rubygems/test_gem_commands_contents_command.rb +32 -4
- data/test/rubygems/test_gem_commands_environment_command.rb +9 -1
- data/test/rubygems/test_gem_commands_fetch_command.rb +2 -28
- data/test/rubygems/test_gem_commands_help_command.rb +6 -3
- data/test/rubygems/test_gem_commands_install_command.rb +2 -65
- data/test/rubygems/test_gem_commands_owner_command.rb +49 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +30 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +1 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +33 -0
- data/test/rubygems/test_gem_commands_update_command.rb +2 -1
- data/test/rubygems/test_gem_config_file.rb +12 -0
- data/test/rubygems/test_gem_dependency_installer.rb +58 -65
- data/test/rubygems/test_gem_dependency_resolver.rb +6 -3
- data/test/rubygems/test_gem_dependency_resolver_dependency_conflict.rb +36 -0
- data/test/rubygems/test_gem_ext_builder.rb +2 -4
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +7 -2
- data/test/rubygems/test_gem_gem_runner.rb +17 -13
- data/test/rubygems/test_gem_gemcutter_utilities.rb +6 -19
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +41 -0
- data/test/rubygems/test_gem_install_update_options.rb +4 -1
- data/test/rubygems/test_gem_installer.rb +31 -2
- data/test/rubygems/test_gem_name_tuple.rb +22 -0
- data/test/rubygems/test_gem_package.rb +122 -11
- data/test/rubygems/test_gem_package_old.rb +8 -0
- data/test/rubygems/test_gem_package_tar_reader.rb +9 -8
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +1 -1
- data/test/rubygems/test_gem_package_tar_writer.rb +78 -56
- data/test/rubygems/test_gem_package_task.rb +2 -23
- data/test/rubygems/test_gem_path_support.rb +17 -0
- data/test/rubygems/test_gem_platform.rb +18 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +106 -385
- data/test/rubygems/test_gem_request.rb +239 -0
- data/test/rubygems/test_gem_requirement.rb +9 -11
- data/test/rubygems/test_gem_security.rb +58 -2
- data/test/rubygems/test_gem_security_policy.rb +42 -1
- data/test/rubygems/test_gem_security_signer.rb +13 -1
- data/test/rubygems/test_gem_security_trust_dir.rb +5 -1
- data/test/rubygems/test_gem_server.rb +1 -105
- data/test/rubygems/test_gem_source.rb +4 -14
- data/test/rubygems/test_gem_source_local.rb +4 -4
- data/test/rubygems/test_gem_source_specific_file.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -12
- data/test/rubygems/test_gem_specification.rb +452 -28
- data/test/rubygems/test_gem_stub_specification.rb +30 -0
- data/test/rubygems/test_gem_uninstaller.rb +14 -0
- data/test/rubygems/test_gem_uri_formatter.rb +20 -0
- data/test/rubygems/test_gem_version.rb +23 -13
- data/test/rubygems/test_gem_version_option.rb +63 -1
- data/test/rubygems/test_require.rb +0 -12
- data/util/create_encrypted_key.rb +16 -0
- metadata +161 -23
- metadata.gz.sig +0 -0
- data/CVE-2013-4287.txt +0 -36
- data/CVE-2013-4363.txt +0 -45
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/test/rubygems/test_bundled_ca.rb +0 -59
- data/util/update_bundled_ca_certificates.rb +0 -103
metadata.gz.sig
ADDED
Binary file
|
data/CVE-2013-4287.txt
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
= Algorithmic complexity vulnerability in RubyGems 2.0.7 and older
|
2
|
-
|
3
|
-
RubyGems validates versions with a regular expression that is vulnerable to
|
4
|
-
denial of service due to a backtracking regular expression. For specially
|
5
|
-
crafted RubyGems versions attackers can cause denial of service through CPU
|
6
|
-
consumption.
|
7
|
-
|
8
|
-
RubyGems versions 2.0.7 and older, 2.1.0.rc.1 and 2.1.0.rc.2 are vulnerable.
|
9
|
-
|
10
|
-
Ruby versions 1.9.0 through 2.0.0p247 are vulnerable as they contain embedded
|
11
|
-
versions of RubyGems.
|
12
|
-
|
13
|
-
It does not appear to be possible to exploit this vulnerability by installing a
|
14
|
-
gem for RubyGems 1.8.x or 2.0.x. Vulnerable uses of RubyGems API include
|
15
|
-
packaging a gem (through `gem build`, Gem::Package or Gem::PackageTask),
|
16
|
-
sending user input to Gem::Version.new, Gem::Version.correct? or use of the
|
17
|
-
Gem::Version::VERSION_PATTERN or Gem::Version::ANCHORED_VERSION_PATTERN
|
18
|
-
constants.
|
19
|
-
|
20
|
-
Notably, users of bundler that install gems from git are vulnerable if a
|
21
|
-
malicious author changes the gemspec to an invalid version.
|
22
|
-
|
23
|
-
The vulnerability can be fixed by changing the first grouping to an atomic
|
24
|
-
grouping in Gem::Version::VERSION_PATTERN in lib/rubygems/version.rb. For
|
25
|
-
RubyGems 2.0.x:
|
26
|
-
|
27
|
-
- VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
|
28
|
-
+ VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
|
29
|
-
|
30
|
-
For RubyGems 1.8.x:
|
31
|
-
|
32
|
-
- VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*' # :nodoc:
|
33
|
-
+ VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' # :nodoc:
|
34
|
-
|
35
|
-
This vulnerability was discovered by Damir Sharipov <dammer2k@gmail.com>
|
36
|
-
|
data/CVE-2013-4363.txt
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
= Algorithmic complexity vulnerability in RubyGems 2.1.4 and older
|
2
|
-
|
3
|
-
The patch for CVE-2013-4287 was insufficiently verified so the combined
|
4
|
-
regular expression for verifying gem version remains vulnerable following
|
5
|
-
CVE-2013-4287.
|
6
|
-
|
7
|
-
RubyGems validates versions with a regular expression that is vulnerable to
|
8
|
-
denial of service due to backtracking. For specially crafted RubyGems
|
9
|
-
versions attackers can cause denial of service through CPU consumption.
|
10
|
-
|
11
|
-
RubyGems versions 2.1.4 and older are vulnerable.
|
12
|
-
|
13
|
-
Ruby versions 1.9.0 through 2.0.0p247 are vulnerable as they contain embedded
|
14
|
-
versions of RubyGems.
|
15
|
-
|
16
|
-
It does not appear to be possible to exploit this vulnerability by installing a
|
17
|
-
gem for RubyGems 1.8.x or newer. Vulnerable uses of RubyGems API include
|
18
|
-
packaging a gem (through `gem build`, Gem::Package or Gem::PackageTask),
|
19
|
-
sending user input to Gem::Version.new, Gem::Version.correct? or use of the
|
20
|
-
Gem::Version::VERSION_PATTERN or Gem::Version::ANCHORED_VERSION_PATTERN
|
21
|
-
constants.
|
22
|
-
|
23
|
-
Notably, users of bundler that install gems from git are vulnerable if a
|
24
|
-
malicious author changes the gemspec to an invalid version.
|
25
|
-
|
26
|
-
The vulnerability can be fixed by changing the "*" repetition to a "?"
|
27
|
-
repetition in Gem::Version::ANCHORED_VERSION_PATTERN in
|
28
|
-
lib/rubygems/version.rb. For RubyGems 2.1.x:
|
29
|
-
|
30
|
-
- ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
|
31
|
-
+ ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
|
32
|
-
|
33
|
-
For RubyGems 2.0.x:
|
34
|
-
|
35
|
-
- ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
|
36
|
-
+ ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
|
37
|
-
|
38
|
-
For RubyGems 1.8.x:
|
39
|
-
|
40
|
-
- ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
|
41
|
-
+ ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
|
42
|
-
|
43
|
-
|
44
|
-
This vulnerability was discovered by Alexander Cherepanov <cherepan@mccme.ru>
|
45
|
-
|
@@ -1,25 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
|
3
|
-
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
|
4
|
-
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
|
5
|
-
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
|
6
|
-
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBF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MDk0
|
22
|
-
MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
|
23
|
-
E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
|
24
|
-
MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
|
25
|
-
hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
|
26
|
-
95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
|
27
|
-
2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
|
28
|
-
-----END CERTIFICATE-----
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'rubygems/test_case'
|
2
|
-
require 'net/https'
|
3
|
-
|
4
|
-
# = Testing Bundled CA
|
5
|
-
#
|
6
|
-
# The tested hosts are explained in detail here: https://github.com/rubygems/rubygems/commit/5e16a5428f973667cabfa07e94ff939e7a83ebd9
|
7
|
-
#
|
8
|
-
class TestBundledCA < Gem::TestCase
|
9
|
-
|
10
|
-
THIS_FILE = File.expand_path __FILE__
|
11
|
-
|
12
|
-
def bundled_certificate_store
|
13
|
-
store = OpenSSL::X509::Store.new
|
14
|
-
|
15
|
-
ssl_cert_glob =
|
16
|
-
File.expand_path '../../../lib/rubygems/ssl_certs/*.pem', THIS_FILE
|
17
|
-
|
18
|
-
Dir[ssl_cert_glob].each do |ssl_cert|
|
19
|
-
store.add_file ssl_cert
|
20
|
-
end
|
21
|
-
|
22
|
-
store
|
23
|
-
end
|
24
|
-
|
25
|
-
def assert_https(host)
|
26
|
-
if self.respond_to? :_assertions # minitest <= 4
|
27
|
-
self._assertions += 1
|
28
|
-
else # minitest >= 5
|
29
|
-
self.assertions += 1
|
30
|
-
end
|
31
|
-
http = Net::HTTP.new(host, 443)
|
32
|
-
http.use_ssl = true
|
33
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
34
|
-
http.cert_store = bundled_certificate_store
|
35
|
-
http.get('/')
|
36
|
-
rescue Errno::ENOENT
|
37
|
-
skip "#{host} seems offline, I can't tell whether ssl would work."
|
38
|
-
rescue OpenSSL::SSL::SSLError => e
|
39
|
-
# Only fail for certificate verification errors
|
40
|
-
if e.message =~ /certificate verify failed/
|
41
|
-
flunk "#{host} is not verifiable using the included certificates. Error was: #{e.message}"
|
42
|
-
end
|
43
|
-
raise
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_accessing_rubygems
|
47
|
-
assert_https('rubygems.org')
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_accessing_cloudfront
|
51
|
-
assert_https('d2chzxaqi4y7f8.cloudfront.net')
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_accessing_s3
|
55
|
-
assert_https('s3.amazonaws.com')
|
56
|
-
end
|
57
|
-
|
58
|
-
end if ENV['TRAVIS']
|
59
|
-
|
@@ -1,103 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
require 'openssl'
|
3
|
-
|
4
|
-
URIS = [
|
5
|
-
URI('https://rubygems.org'),
|
6
|
-
URI('https://s3.amazonaws.com'),
|
7
|
-
URI('https://d2chzxaqi4y7f8.cloudfront.net'),
|
8
|
-
URI('https://rubygems.global.ssl.fastly.net'),
|
9
|
-
]
|
10
|
-
|
11
|
-
def connect_to uri, store
|
12
|
-
http = Net::HTTP.new uri.hostname, uri.port
|
13
|
-
|
14
|
-
http.use_ssl = uri.scheme.downcase == 'https'
|
15
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
16
|
-
http.cert_store = store
|
17
|
-
|
18
|
-
http.get '/'
|
19
|
-
|
20
|
-
true
|
21
|
-
rescue OpenSSL::SSL::SSLError
|
22
|
-
false
|
23
|
-
end
|
24
|
-
|
25
|
-
def load_certificates io
|
26
|
-
cert_texts =
|
27
|
-
io.read.scan(/^-{5}BEGIN CERTIFICATE-{5}.*?^-{5}END CERTIFICATE-{5}/m)
|
28
|
-
|
29
|
-
cert_texts.map do |cert_text|
|
30
|
-
OpenSSL::X509::Certificate.new cert_text
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def show_certificates certificates
|
35
|
-
certificates.each do |certificate|
|
36
|
-
p certificate.subject.to_a
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def store_for certificates
|
41
|
-
store = OpenSSL::X509::Store.new
|
42
|
-
certificates.each do |certificate|
|
43
|
-
store.add_cert certificate
|
44
|
-
end
|
45
|
-
|
46
|
-
store
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_certificates certificates, uri
|
50
|
-
1.upto certificates.length do |n|
|
51
|
-
puts "combinations of #{n} certificates"
|
52
|
-
certificates.combination(n).each do |combination|
|
53
|
-
match = test_uri uri, combination
|
54
|
-
|
55
|
-
if match then
|
56
|
-
$needed_combinations << match
|
57
|
-
puts
|
58
|
-
return
|
59
|
-
else
|
60
|
-
print '.'
|
61
|
-
end
|
62
|
-
end
|
63
|
-
puts
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_uri uri, certificates
|
68
|
-
store = store_for certificates
|
69
|
-
|
70
|
-
verified = connect_to uri, store
|
71
|
-
|
72
|
-
return certificates if verified
|
73
|
-
|
74
|
-
nil
|
75
|
-
end
|
76
|
-
|
77
|
-
def write_certificates certificates
|
78
|
-
certificates.each do |certificate|
|
79
|
-
subject = certificate.subject.to_a
|
80
|
-
name = (subject.assoc('CN') || subject.assoc('OU'))[1]
|
81
|
-
name = name.delete ' .-'
|
82
|
-
|
83
|
-
open "lib/rubygems/ssl_certs/#{name}.pem", 'w' do |io|
|
84
|
-
io.write certificate.to_pem
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
certificates = load_certificates ARGF
|
90
|
-
puts "loaded #{certificates.length} certificates"
|
91
|
-
|
92
|
-
$needed_combinations = []
|
93
|
-
|
94
|
-
URIS.each do |uri|
|
95
|
-
puts uri
|
96
|
-
|
97
|
-
test_certificates certificates, uri
|
98
|
-
end
|
99
|
-
|
100
|
-
needed = $needed_combinations.flatten.uniq
|
101
|
-
|
102
|
-
write_certificates needed
|
103
|
-
|