Skip to content

Fixed BearSSL bug: EXC_BAD_ACCESS on incomplete CA cert#8476

Closed
jan2000 wants to merge 2 commits into
curl:masterfrom
jan2000:bearssl-fix-incomplete-cacert
Closed

Fixed BearSSL bug: EXC_BAD_ACCESS on incomplete CA cert#8476
jan2000 wants to merge 2 commits into
curl:masterfrom
jan2000:bearssl-fix-incomplete-cacert

Conversation

@jan2000

@jan2000 jan2000 commented Feb 19, 2022

Copy link
Copy Markdown
Contributor

Separated from: #8106

When having a incomplete CA cert (for example missing a newline at the end) in the function load_cafile the code after case BR_PEM_END_OBJ: will not be executed. This will result in an extra ta (ca.anchors) that does not have its data set. Because ta->dn.len is not set (thus a random value) this will result in EXC_BAD_ACCESS in BearSSL because it expects correct values. The fix is to only add the new ta after case BR_PEM_END_OBJ:.

@michaelforney

Copy link
Copy Markdown
Contributor

Looks good to me.

@jay jay closed this in f36e32b Feb 20, 2022
@jay

jay commented Feb 20, 2022

Copy link
Copy Markdown
Member

Thanks

@jan2000 jan2000 deleted the bearssl-fix-incomplete-cacert branch April 22, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants