Skip to content

Commit

Permalink
Detect already escaped ampersands
Browse files Browse the repository at this point in the history
  • Loading branch information
xrl committed Jan 22, 2013
1 parent 25173fe commit e605fc7
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 @@ -90,7 +90,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 e605fc7

Please sign in to comment.