Re: [Cryptography-dev] Parsing DER from PE File

2018-12-23 Thread Robert Simmons
I've added the use case to the issue as requested. I tried the code snippet, but the contents of signers is missing. What should that be? NameError: name 'signers' is not defined On Fri, Dec 21, 2018 at 11:21 AM Paul Kehrer wrote: > Out of curiosity, does the following code load the cert you ex

Re: [Cryptography-dev] Parsing DER from PE File

2018-12-23 Thread Robert Simmons
import os import pathlib import pefile target = pathlib.Path().home().joinpath('Desktop').joinpath('HWID_4_0_6YMBWX.exe') fname = str(target) totsize = os.path.getsize(target) pe = pefile.PE(fname) pe.parse_data_directories(directories=[pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_SECURITY']]) si

Re: [Cryptography-dev] Parsing DER from PE File

2018-12-23 Thread Paul Kehrer
One day I will learn to run the code I write before I ask people to use it. The missing signers variable should go after the pkcs7 assignment. It looks like this: signers = backend._lib.PKCS7_get0_signers(pkcs7, backend._ffi.NULL, 0) With that in place and using the extracted.der you previously

Re: [Cryptography-dev] Parsing DER from PE File

2018-12-23 Thread Robert Simmons
This works great! Thanks! On Sun, Dec 23, 2018 at 7:05 PM Paul Kehrer wrote: > One day I will learn to run the code I write before I ask people to use > it. The missing signers variable should go after the pkcs7 assignment. It > looks like this: > > signers = backend._lib.PKCS7_get0_signers(pkcs