Skip to content

Commit

Permalink
Remove unnecessary string check
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields committed Jan 11, 2025
1 parent e3a81cd commit c5ac21a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ruby_saml/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Utils # rubocop:disable Metrics/ModuleLength
# @param cert [OpenSSL::X509::Certificate|String] The x509 certificate.
# @return [true|false] Whether the certificate is expired.
def is_cert_expired(cert)
cert = build_cert_object(cert) if cert.is_a?(String)
cert = build_cert_object(cert)
cert.not_after < Time.now
end

Expand All @@ -46,7 +46,7 @@ def is_cert_expired(cert)
# @param cert [OpenSSL::X509::Certificate|String] The x509 certificate.
# @return [true|false] Whether the certificate is currently active.
def is_cert_active(cert)
cert = build_cert_object(cert) if cert.is_a?(String)
cert = build_cert_object(cert)
now = Time.now
cert.not_before <= now && cert.not_after >= now
end
Expand Down

0 comments on commit c5ac21a

Please sign in to comment.