test/ruby-saml_test.rb in ruby-saml-0.4.0 vs test/ruby-saml_test.rb in ruby-saml-0.4.1
- old
+ new
@@ -36,9 +36,18 @@
response = Onelogin::Saml::Response.new(response_document_2)
assert !response.name_id.nil?
response = Onelogin::Saml::Response.new(response_document_3)
assert !response.name_id.nil?
end
+
+ should "not allow signature wrapping attack" do
+ response = Onelogin::Saml::Response.new(response_document_4)
+ settings = Onelogin::Saml::Settings.new
+ response.settings = settings
+ settings.idp_cert_fingerprint = signature_fingerprint_1
+ assert response.is_valid?
+ assert response.name_id == "test@onelogin.com"
+ end
context "#is_valid?" do
should "return false when response is initialized with blank data" do
response = Onelogin::Saml::Response.new('')
assert !response.is_valid?