Skip to content

Commit

Permalink
Merge pull request SAML-Toolkits#59 from assaydepot/fix_amp_regex
Browse files Browse the repository at this point in the history
Detect already escaped ampersands
  • Loading branch information
stouset committed Apr 3, 2013
2 parents 37547a8 + e605fc7 commit 8a99308
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xml_security.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def validate_doc(base64_cert, soft = true)

hashed_element = document.at_xpath("//*[@ID='#{uri[1..-1]}']")
canon_algorithm = canon_algorithm REXML::XPath.first(ref, '//ds:CanonicalizationMethod', 'ds' => DSIG)
canon_hashed_element = hashed_element.canonicalize(canon_algorithm, inclusive_namespaces).gsub('&','&')
canon_hashed_element = hashed_element.canonicalize(canon_algorithm, inclusive_namespaces).gsub(/&(?!amp;)/,'&')

digest_algorithm = algorithm(REXML::XPath.first(ref, "//ds:DigestMethod"))

Expand Down

0 comments on commit 8a99308

Please sign in to comment.