onelogin/ruby-saml — pull request #34 by lawrencepit (2012-04-20 03:41:07+00:00)
Title: Should decode the DigestValue instead of comparing with the encoded hash.

An encoded hash may have newline characters, whereas the DigestValue may not, or may have several more, or have them at a different line length. So instead, the calculated digest hash should be compared with the decoded DigestValue.

Added tests for SHA384 and SHA512 algorithms, which shows the issue (note that the DigestValue has no newlines in the input, whereas an encoded hash has newlines, i.e. they wouldn't compare).

Also simplified the algorithm method; always use OpenSSL::Digest