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

Utilize SAN extension matching during SSL/TLS peer verification #482

Merged
merged 2 commits into from
Oct 9, 2013
Merged

Utilize SAN extension matching during SSL/TLS peer verification #482

merged 2 commits into from
Oct 9, 2013

Conversation

rdlowrey
Copy link
Contributor

@rdlowrey rdlowrey commented Oct 8, 2013

Even when specifying appropriate CN_match context settings it's not always possible to correctly verify peers
using the existing PHP encryption wrappers. Consider a scenario in which we connect to a party whose
certificate utilizes the Subject Alternative Name (SAN) X.509 extension. A real-world example is
github.com whose common name (CN) is github.com but whose certificate lists SAN entries of both
github.com and github.com. An RFC 2818-compliant implementation will verify either name as correct:

If a subjectAltName extension of type dNSName is present, that MUST be used as the identity.

At this time PHP's encryption wrappers do not verify peer names against a cert's SAN list. As a result
the peer verification routine fails when attempting to verify the provided certificate with a CN_match field equal to "github.com".

Note that this patch has no BC implications and should be safe to merge with 5.4 and 5.5 branches.

@rdlowrey
Copy link
Contributor Author

rdlowrey commented Oct 9, 2013

@m6w6 Ping. I've applied the suggested zend_bool changes. Let me know if you see anything else that should be modified prior to merging.

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

Successfully merging this pull request may close these issues.

2 participants