mirror of
https://github.com/pbatard/rufus.git
synced 2025-06-01 23:38:30 -04:00
[pki] have GetSignatureName() use the current binary on NULL parameter
This commit is contained in:
parent
92d8ac26b0
commit
54ee68f6fc
3 changed files with 15 additions and 7 deletions
|
@ -61,6 +61,14 @@ char* GetSignatureName(const char* path)
|
|||
SPROG_PUBLISHERINFO ProgPubInfo = { 0 };
|
||||
wchar_t *szFileName = utf8_to_wchar(path);
|
||||
|
||||
// If the path is NULL, get the signature of the current runtime
|
||||
if (path == NULL) {
|
||||
szFileName = calloc(MAX_PATH, sizeof(wchar_t));
|
||||
if (szFileName == NULL)
|
||||
return NULL;
|
||||
GetModuleFileNameW(GetModuleHandle(NULL), szFileName, MAX_PATH);
|
||||
}
|
||||
|
||||
// Get message handle and store handle from the signed file.
|
||||
r = CryptQueryObject(CERT_QUERY_OBJECT_FILE, szFileName,
|
||||
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED, CERT_QUERY_FORMAT_FLAG_BINARY,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue