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

Bug Report #1486

Closed
wants to merge 2 commits into from
Closed

Bug Report #1486

wants to merge 2 commits into from

Conversation

hackimov
Copy link

Valid Base64 valid format did not pass validation in 10 cases out of 131,000. All signatures that did not pass regular expressions were more than 1 megabyte. One to two megabytes
I can provide this data, please contact me by telegram, please @alex_dirty. My name is Alexander Khakimov and I want to help you make your library better
I commented out a regex that did not correctly validate base64
I am passing base64 pkcs7 format to it to allow further decode of ASN1.

Valid Base64 valid format did not pass validation in 10 cases out of 131,000. All signatures that did not pass regular expressions were more than 1 megabyte. One to two megabytes
I can provide this data, please contact me by telegram, please @alex_dirty. My name is Alexander Khakimov and I want to help you make your library better
I commented out a regex that did not correctly validate base64
I am passing base64 pkcs7 format to it to allow further decode of ASN1.
@terrafrost
Copy link
Member

I'm going to need some unit tests for this that show this failing before and passing after. I don't suppose you could email the files to me? terrafrost@php.net .

I did install Telegram (which I've never used before) on my desktop. In order to add a new contact it's wanting me to add in their phone number. idk your phone number and I'm loathe to give out mine...

@hackimov
Copy link
Author

Hello, I sent you an email with examples of files that did not pass validation.

Mail from supermehanikus@gmail.com . Zip archive with b64 format files.

Sorry for the delay, work does not always allow you to respond quickly.

@terrafrost
Copy link
Member

I think I like this better as a fix:

        $temp = preg_match('#^-+BEGIN[^-]+-+[\r\n ]*$#ms', $str) ?
            preg_replace('#.*?^-+BEGIN[^-]+-+[\r\n ]*$#ms', '', $str, 1) :
            $str;

Anyway, now that I have your issues I should be able to create a much simpler unit test without your files.

I'll try to have that done within the next few days (got a busy week ahead of me).

Thanks!

@terrafrost
Copy link
Member

Does d077c7b fix the issue?

@hackimov
Copy link
Author

Perfect

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.

None yet

2 participants