diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-09-23 14:54:20 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-09-23 15:29:18 +0200 |
commit | f2c1f2a478a36cf94d54c6eee4c9addc34f10457 (patch) | |
tree | 29a07822f3ffea086b03a5bcb0d0c9a6954b7cff /version/official_windows.go | |
parent | updater: use winhttp to reduce filesize (diff) | |
download | wireguard-windows-f2c1f2a478a36cf94d54c6eee4c9addc34f10457.tar.xz wireguard-windows-f2c1f2a478a36cf94d54c6eee4c9addc34f10457.zip |
version: use crypt32 instead of go x509 for cn extraction for file size
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'version/official_windows.go')
-rw-r--r-- | version/official_windows.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/version/official_windows.go b/version/official_windows.go index b0f62250..d9f041f6 100644 --- a/version/official_windows.go +++ b/version/official_windows.go @@ -67,12 +67,12 @@ func IsRunningOfficialVersion() bool { // This below tests is easily circumvented. False certificates can be appended, and just checking the // common name is not very good. But that's okay, as this isn't security related. - certs, err := wintrust.ExtractCertificates(path) + names, err := wintrust.ExtractCertificateNames(path) if err != nil { return false } - for _, cert := range certs { - if cert.Subject.CommonName == officialCommonName { + for _, name := range names { + if name == officialCommonName { return true } } |