onelogin/ruby-saml — pull request #144 by curious-attempt-bunny (2014-08-07 23:04:31+00:00)
Title: Fix DigestMethod lookup bug.

# Thanks!

Thanks for maintaining the ruby-saml library. This is a great service you're providing. It's been a while since I found a bug in ruby-saml. Here's a fix for this one. I hope you find the tests satisfactory.

# Passes validation

<Signature **xmlns:ds**='http://www.w3.org/2000/09/xmldsig#'>
...
<**ds:DigestMethod** Algorithm='http://www.w3.org/2001/04/xmlenc#sha256'/>

# Fails validation with a Digest Mismatch error

<Signature **xmlns**='http://www.w3.org/2000/09/xmldsig#'>
...
<**DigestMethod** Algorithm='http://www.w3.org/2001/04/xmlenc#sha256'/>

# Details

This bug is masked by sha1 being the default `digest_algorithm` when the lookup of the `DigestMethod` fails.