Skip to content

Fix for php bug #64802 #410

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

Closed
wants to merge 3 commits into from
Closed

Fix for php bug #64802 #410

wants to merge 3 commits into from

Conversation

mk-j
Copy link
Contributor

@mk-j mk-j commented Aug 14, 2013

I included a test case as well.

Mark Jones and others added 3 commits September 14, 2012 08:59
<?php
$cert = file_get_contents(__DIR__.'/bug64802.pem');
$r = openssl_x509_parse($cert,$use_short_names=true);
var_dump( count($r['subject'])>1 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to have actual list or count to be output. True/false tests are very hard to debug - if you get false, you have no idea what the actual count was. That's why we compare the output instead of making true/false tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had another version of the test that tested for actual keys in the response, like 'CN', 'O', 'L', 'ST' etc, but the return value of openssl_x509_parse states: "The structure of the returned data is (deliberately) not yet documented, as it is still subject to change.", so I submitted it as you saw it above.

But if you think its better, I can test previous for actual keys 'CN', 'O', etc, because the "subject to change" clause, probably has more to do with the X509v3 extensions, than the x509 subject.

@php-pulls
Copy link

Comment on behalf of stas at php.net:

merged

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