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
Error loading a wrong certificate with PHP 7.4 #1456
Comments
Can you provide a copy of the certificate that's causing the issue? This will enable me to implement a fix and to then include a unit test for it. Thanks! |
The problem occurs when it's not a certificate that is provided, but a "random" string instead. For instance I'd rather have a real "business" exception thrown than this PHP error. Or maybe there is way to validate that a string is a certificate before calling |
As an update to this... I'm able to reproduce the issue. I'll try to have a fix in place this weekend. Thanks! |
Thank you very much @terrafrost ! |
fc0832a should fix this. The commit immediately before that one has a unit test for this. Thanks! |
Thank you very much! |
Hello @terrafrost Will this bug fix be available with the next 2.0.26? And if yes, do you have an ETA for it? |
Yes.
I'll try to do it this week. Thanks! |
Perfect, thank you very much 🥇 |
2.0.26 has been released - thanks! |
With PHP 7.4 and phpseclib 2.0.24, we encounter the following problem:
This error comes from one of our test (
it_adds_a_violation_if_the_certificate_is_wrongly_formatted
) that triggers underneath this code:The method
ASN1::asn1map
receivesfalse
as value for$decoded
. Which then makes the method crash on line 534.This comes from
X509::loadX509
where the methoddecodeBER
returns[0 => false]
. See here.Sadly, I can't propose a fix as I don't really get what's going on here.
The text was updated successfully, but these errors were encountered: