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

modules/pe/authenticode: Add Wincrypt API support for authenticode on Windows #2053

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lucas-soares-npro
Copy link

Hi,

In the context of a Stormshield internal project, we could not use OpenSSL in libyara. Due to this fact, we developped an alternate version of authenticode parser using only Windows APIs.
We decided to go opensource on it as it could help others in the same situation to go without OpenSSL.

We're opened to do edits on anything if needed,
Best regards.

- Added GOTO_EXIT_ON_NULL maccro to handle cleanup after NULL on allocations
- Added GOTO_EXIT_ON_FAIL maccro to perform post-failure cleanup

Sponsored by Stormshield
- Replace all occurences of malloc/calloc/realloc/free/strdup by their Yara defined counterparts

Sponsored by Stormshield
- Added windows crypto support for Yara, to go without OpenSSL
- Added USE_WINCRYPT_AUTHENTICODE to be defined for Yara to use windows crypto API for authenticode
- Now using USE_WINCRYPT_AUTHENTICODE to exclude code using OpenSSL, where HAVE_WINCRYPT_H have to be defined along it
- Updated visual studio project files to add new files, and use wincrypt API by default

Sponsored by Stormshield
Copy link

google-cla bot commented Mar 14, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sponsored by Stormshield
@plusvic
Copy link
Member

plusvic commented Mar 19, 2024

Notice that the Authenticode parser is an external project (https://github.com/avast/authenticode-parser), and YARA simply has a copy of it. I prefer not deviating too much from their implementation, so that I can merge new updates with ease in the future. So, you should propose this change to the owners of the https://github.com/avast/authenticode-parser repository instead.

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