Skip to content

Commit c70e911

Browse files
authored
Fix fingerprint method
#fingerprint method memoizes its result, and it should not b/c it takes arguments.
1 parent 130b829 commit c70e911

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/onelogin/ruby-saml/idp_metadata_parser.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,12 @@ def certificates
384384
# @return [String|nil] the fingerpint of the X509Certificate if it exists
385385
#
386386
def fingerprint(certificate, fingerprint_algorithm = XMLSecurity::Document::SHA1)
387-
@fingerprint ||= begin
388-
return unless certificate
387+
return unless certificate
389388

390-
cert = OpenSSL::X509::Certificate.new(Base64.decode64(certificate))
389+
cert = OpenSSL::X509::Certificate.new(Base64.decode64(certificate))
391390

392-
fingerprint_alg = XMLSecurity::BaseDocument.new.algorithm(fingerprint_algorithm).new
393-
fingerprint_alg.hexdigest(cert.to_der).upcase.scan(/../).join(":")
394-
end
391+
fingerprint_alg = XMLSecurity::BaseDocument.new.algorithm(fingerprint_algorithm).new
392+
fingerprint_alg.hexdigest(cert.to_der).upcase.scan(/../).join(":")
395393
end
396394

397395
# @return [Array] the names of all SAML attributes if any exist

0 commit comments

Comments
 (0)