Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Metadata Multiple Signing Certificate only #428

Closed
pandamouse opened this issue Dec 13, 2017 · 2 comments
Closed

Azure Metadata Multiple Signing Certificate only #428

pandamouse opened this issue Dec 13, 2017 · 2 comments

Comments

@pandamouse
Copy link

https://github.com/onelogin/ruby-saml/blob/b3ac5bd3acb76c31c6bbb24784cc8648244e0e80/lib/onelogin/ruby-saml/idp_metadata_parser.rb#L333

So I updated the ruby-saml to 1.6.0 hoping to sort out the Azure certificate rollover problem with the ipd_cert_multi. Unfortunately for us while it contains 3 signing certificate, it contains no additional encryption certificate. Resulting in certificates.size of 1 when parsing the metadata which in turn result in only the idp_cert and fingerprint being set to the first one. Which is going to cause us the original problem of Mismatch Fingerprint.

Would it be an acceptable solution if we check that if only signing certificates are present and there are more than 1 to set ipd_cert_multi to use the certificates for both signing and encryption?

like below?

if certificates.key?("signing")
  if certificates['signing'].size > 1
    parsed_metadata[:idp_cert_multi] = {signing: certificates['signing'], 
       encryption: certificates['signing']}
 else
    parsed_metadata[:idp_cert] = certificates["signing"][0]
    parsed_metadata[:idp_cert_fingerprint] = fingerprint(
      parsed_metadata[:idp_cert],
      parsed_metadata[:idp_cert_fingerprint_algorithm]
    )
  end
else
   parsed_metadata[:idp_cert] = certificates["encryption"][0]
   parsed_metadata[:idp_cert_fingerprint] = fingerprint(
        parsed_metadata[:idp_cert],
        parsed_metadata[:idp_cert_fingerprint_algorithm]
    )
end
@pitbulk
Copy link
Collaborator

pitbulk commented Dec 13, 2017

I will review soon and fix the bug.

@pandamouse
Copy link
Author

pandamouse commented Dec 14, 2017

Here is something I did to override it. Just had to fix the if statement.

https://gist.github.com/pandamouse/2ccbb0bff8edd723d9ea615213496b78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants