Skip to content

Commit

Permalink
adjusting error copy
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioCareMonkey committed Sep 19, 2020
1 parent 60aa020 commit 11145ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/xml_security.rb
Expand Up @@ -255,12 +255,12 @@ def validate_document_with_cert(idp_cert, soft = true)
begin
cert = OpenSSL::X509::Certificate.new(cert_text)
rescue OpenSSL::X509::CertificateError => _e
return append_error("Certificate Error", soft)
return append_error("Document certificate error", soft)
end

# check saml response cert matches provided idp cert
if idp_cert.to_pem != cert.to_pem
return append_error("SAML response certificate does not match idp certificate", soft)
return append_error("Document certificate does not match idp certificate", soft)
end
else
base64_cert = Base64.encode64(idp_cert.to_pem)
Expand Down
4 changes: 2 additions & 2 deletions test/xml_security_test.rb
Expand Up @@ -415,7 +415,7 @@ class XmlSecurityTest < Minitest::Test

it 'is not valid' do
assert !document.validate_document_with_cert(idp_cert), 'Document should be valid'
assert_equal(["Certificate Error"], document.errors)
assert_equal(["Document certificate error"], document.errors)
end
end

Expand All @@ -426,7 +426,7 @@ class XmlSecurityTest < Minitest::Test
exception = assert_raises(OneLogin::RubySaml::ValidationError) do
document.validate_document_with_cert(idp_cert, false)
end
assert_equal("SAML response certificate does not match idp certificate", exception.message)
assert_equal("Document certificate does not match idp certificate", exception.message)
end
end
end
Expand Down

0 comments on commit 11145ab

Please sign in to comment.