-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Windows \r\n causes PEM object to fail parsing #5591
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
Comments
Hello. |
It seems like the issue is with line endings in the certificate: incorrect parsing occurs when lines end with CR/LF pairs (Windows line endings). Single LF (Unix) line ends are parsed OK. |
@sergeyegerev Thanks for the report. I'm able to reproduce using the validation example by changing to Windows EOL markers in a cert. This looks like it's a bug inside the semi-Forth text parser used to decode PEMs inside the BearSSL library itself. I've updated the bug title accordingly. |
There is a bug in the BearSSL PEM decoder when Windows EOLs (\r\n) are passed in. Avoid the issue by silenly discarding \rs as they are read from the PEM source in the C code, to keep my sanity by avoiding reworking the pseudo-Forth parser code. Fixes esp8266#5591
There is a bug in the BearSSL PEM decoder when Windows EOLs (\r\n) are passed in. Avoid the issue by silenly discarding \rs as they are read from the PEM source in the C code, to keep my sanity by avoiding reworking the pseudo-Forth parser code. Fixes #5591
Arduino/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp
Line 359 in 7c2e071
The text was updated successfully, but these errors were encountered: