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

IPv6 support for X509v3 SubjectAltNames #936

Merged
merged 2 commits into from
Feb 7, 2016
Merged

IPv6 support for X509v3 SubjectAltNames #936

merged 2 commits into from
Feb 7, 2016

Conversation

metaclassing
Copy link
Contributor

Switched out pack/unpack and ip2long/long2ip with inet_pton/ntop for ipv6 encoding support in x509v3 subject alternative names. The functions should be in PHP5.1 (or 5.3 for Windows) or later.

I am attaching my before and after certificates generated with this patch for comparison.
ipv6.before.crt.txt
ipv6.after.crt.txt

Please let me know if this is acceptable, or if there are changes / alternative approaches you would prefer. Thanks.

…ipv6 encoding support in x509v3 subject alternative names
@bantu
Copy link
Member

bantu commented Jan 27, 2016

Unit tests for the existing IPv4 behaviour and the newly added IPv6 functionality would be nice. Or is that already covered somewhere?

@metaclassing
Copy link
Contributor Author

I added a quick unit test to decode both IPv4 and IPv6 elements in subject alt names.

Other than the x509v3 subjectaltname I don't know of another location where IP address information must be encoded as binary "in network byte order", other locations like subject encode them as text.

@terrafrost terrafrost merged commit 88a0486 into phpseclib:2.0 Feb 7, 2016
@terrafrost
Copy link
Member

I apologize for the delay! This has been merged - thanks!!

@metaclassing metaclassing deleted the x509-subjectaltnames-ipv6 branch June 3, 2016 01:11
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.

3 participants