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

&lt;Signature **xmlns:ds**='http://www.w3.org/2000/09/xmldsig#'&gt;
...
&lt;**ds:DigestMethod** Algorithm='http://www.w3.org/2001/04/xmlenc#sha256'/&gt;

# Fails validation with a Digest Mismatch error

&lt;Signature **xmlns**='http://www.w3.org/2000/09/xmldsig#'&gt;
...
&lt;**DigestMethod** Algorithm='http://www.w3.org/2001/04/xmlenc#sha256'/&gt;

# Details

This bug is masked by sha1 being the default `digest_algorithm` when the lookup of the `DigestMethod` fails.

Sure thing. What about it do you want to see changed?

> Am Sep 9, 2014 um 11:44 AM schrieb Ben <notifications@github.com>:
> 
> In test/xml_security_test.rb:
> 
> > @@ -52,6 +52,12 @@ class XmlSecurityTest < Test::Unit::TestCase
> >        assert_equal("Key validation error", exception.message)
> >      end
> >  
> > +    should "correctly obtain the digest method with alternate namespace declaration" do
> > +      document = XMLSecurity::SignedDocument.new(fixture(:adfs_response_xmlns, false))
> > +      base64cert = document.elements["//X509Certificate"].text
> > +      document.validate_signature(base64cert, false)
> can you please improve this test, @curious-attempt-bunny
> 
> —
> Reply to this email directly or view it on GitHub.