Skip to content

Commit d206580

Browse files
committed
only verify the signature if it isn't missing and location is called
1 parent 191f293 commit d206580

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/samlr/assertion.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,16 @@ def verify!
1616
end
1717

1818
def location
19-
@location ||= begin
19+
@location ||= if !signature.missing?
2020
verify_signature!
2121

22-
if !signature.missing?
23-
if signature.references.any?
24-
"//saml:Assertion[@ID='#{signature.references.first.uri}']"
25-
else
26-
raise SignatureError.new("Missing references inside checked signature")
27-
end
22+
if signature.references.any?
23+
"//saml:Assertion[@ID='#{signature.references.first.uri}']"
2824
else
29-
DEFAULT_LOCATION
25+
raise SignatureError.new("Missing references inside checked signature")
3026
end
27+
else
28+
DEFAULT_LOCATION
3129
end
3230
end
3331

0 commit comments

Comments
 (0)