From 6d443e008a94f842799f30d15aacb754439fe101 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 28 Oct 2014 11:23:55 -0700 Subject: better solution to activesupport dependency problem --- .../certificate_authority/lib/certificate_authority/certificate.rb | 6 ++---- .../certificate_authority/lib/certificate_authority/extensions.rb | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'vendor/certificate_authority/lib') diff --git a/vendor/certificate_authority/lib/certificate_authority/certificate.rb b/vendor/certificate_authority/lib/certificate_authority/certificate.rb index f096c5a..3fcae90 100644 --- a/vendor/certificate_authority/lib/certificate_authority/certificate.rb +++ b/vendor/certificate_authority/lib/certificate_authority/certificate.rb @@ -1,5 +1,3 @@ -require 'active_support/all' - module CertificateAuthority class Certificate include ActiveModel::Validations @@ -34,8 +32,8 @@ module CertificateAuthority self.distinguished_name = DistinguishedName.new self.serial_number = SerialNumber.new self.key_material = MemoryKeyMaterial.new - self.not_before = Time.now.change(:min => 0).utc - self.not_after = Time.now.change(:min => 0).utc + 1.year + self.not_before = Time.now + self.not_after = Time.now + 60 * 60 * 24 * 365 # One year self.parent = self self.extensions = load_extensions() diff --git a/vendor/certificate_authority/lib/certificate_authority/extensions.rb b/vendor/certificate_authority/lib/certificate_authority/extensions.rb index 89de032..7bc4fab 100644 --- a/vendor/certificate_authority/lib/certificate_authority/extensions.rb +++ b/vendor/certificate_authority/lib/certificate_authority/extensions.rb @@ -282,11 +282,11 @@ module CertificateAuthority return obj if value.nil? obj.critical = critical value.split("\n").each do |v| - if v.starts_with?("OCSP") + if v =~ /^OCSP/ obj.ocsp << v.split.last end - if v.starts_with?("CA Issuers") + if v =~ /^CA Issuers/ obj.ca_issuers << v.split.last end end -- cgit v1.2.3