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

Verify digital signature after we have a signer/counter-signer to fix fileinfo crashes #249

Merged
merged 1 commit into from
Mar 17, 2018

Conversation

s3rvac
Copy link
Member

@s3rvac s3rvac commented Mar 17, 2018

In #87, fileinfo crashes are reported when verifying the digital signature of attached PE files. What all the attached files have in common is that we are unable to find a signer or counter-signer for them and p7->length is 0. As the following comment in pe_format.cpp suggests, there is no point of continuing in such a case:

// If we have no signer and countersigner, there must be something really bad
if(!signerCert && !counterSignerCert)
{
    BIO_free(bio);
    return;
}

Thus, move the signature verification AFTER the check that we have found a signer or a counter-signer. This fixes the signature-verifying crashes for all the files attached to #87.

…igner (#87).

In #87, a fileinfo crash is reported when verifying the digital signature of
attached PE files. What all the attached files have in common is that we are
unable to find a signer or counter-signer for them and p7->length is 0. As the
following comment in pe_format.cpp suggests, there is no point of continuing in
such a case:

    // If we have no signer and countersigner, there must be something really bad
    if(!signerCert && !counterSignerCert)
    {
        BIO_free(bio);
        return;
    }

Thus, move the signature verification AFTER the check that we have found a
signer or a counter-signer. This fixes the signature-verifying crashes for all
the files attached to #87.
@metthal metthal merged commit 00222a5 into master Mar 17, 2018
@s3rvac s3rvac deleted the fix-fileinfo-crashing-when-verifying-signatures branch March 18, 2018 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants