-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14229 from star-tek-mb/wincerts
windows root certificate scanning
- Loading branch information
Showing
5 changed files
with
208 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const std = @import("../../std.zig"); | ||
const windows = std.os.windows; | ||
const BOOL = windows.BOOL; | ||
const DWORD = windows.DWORD; | ||
const BYTE = windows.BYTE; | ||
const LPCWSTR = windows.LPCWSTR; | ||
const WINAPI = windows.WINAPI; | ||
|
||
pub const CERT_INFO = *opaque {}; | ||
pub const HCERTSTORE = *opaque {}; | ||
pub const CERT_CONTEXT = extern struct { | ||
dwCertEncodingType: DWORD, | ||
pbCertEncoded: [*]BYTE, | ||
cbCertEncoded: DWORD, | ||
pCertInfo: CERT_INFO, | ||
hCertStore: HCERTSTORE, | ||
}; | ||
|
||
pub extern "crypt32" fn CertOpenSystemStoreW( | ||
_: ?*const anyopaque, | ||
szSubsystemProtocol: LPCWSTR, | ||
) callconv(WINAPI) ?HCERTSTORE; | ||
|
||
pub extern "crypt32" fn CertCloseStore( | ||
hCertStore: HCERTSTORE, | ||
dwFlags: DWORD, | ||
) callconv(WINAPI) BOOL; | ||
|
||
pub extern "crypt32" fn CertEnumCertificatesInStore( | ||
hCertStore: HCERTSTORE, | ||
pPrevCertContext: ?*CERT_CONTEXT, | ||
) callconv(WINAPI) ?*CERT_CONTEXT; |