This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug with multiple signatures. (VirusTotal#940)
* Fix bug with multiple signatures. * Don't use BIO interface, use d2i instead. Fix some other small bugs and don't recurse forever when parsing nested signatures. * Walk the X509 attributes looking for nested signatures. * Move variable declarations out of loop. * Move nested signature checking out of the loop. Move the nested signature checking out of the main certificate parsing loop. The nested signatures are on the PKCS7 structure, not the certificate. Also, make the loop better by not processing the same attribute over and over. These were suggested by Andrew Williams. * If the nested signature is NULL, break early. If the nested signature is ever NULL, break early because it will always be NULL. Also, tighten up the the checks for MAX_PE_CERTS. We aren't likely to ever see a PE that hits the case where it has multiple certs in a single PKCS7 blob, but it can't hurt to check in the loop too.
- Loading branch information