aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/version/official_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-10-01 13:03:36 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-10-01 13:14:23 +0200
commit3932f8ac9fcedc41b478414ea78bbd3bf50364ee (patch)
tree52318575b200e084b2c7c1fc94c20bba7e782582 /version/official_windows.go
parentbuild: bump and loosen go version (diff)
downloadwireguard-windows-3932f8ac9fcedc41b478414ea78bbd3bf50364ee.tar.xz
wireguard-windows-3932f8ac9fcedc41b478414ea78bbd3bf50364ee.zip
Revert "version: use crypt32 instead of go x509 for cn extraction for file size"
This reverts commit 4cdc8fef9973a8d82593bff4e7cb350a20e0fa78. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'version/official_windows.go')
-rw-r--r--version/official_windows.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/version/official_windows.go b/version/official_windows.go
index d9f041f6..b0f62250 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.
- names, err := wintrust.ExtractCertificateNames(path)
+ certs, err := wintrust.ExtractCertificates(path)
if err != nil {
return false
}
- for _, name := range names {
- if name == officialCommonName {
+ for _, cert := range certs {
+ if cert.Subject.CommonName == officialCommonName {
return true
}
}