aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel/firewall/helpers.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-27 17:30:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-27 17:30:24 +0200
commitbba4646b11fa8b18649d04d02e6dae333bd9008d (patch)
tree37e1e6d50e2f247426eda698c5a8359c145c59a7 /tunnel/firewall/helpers.go
parentui: do not pass pointer into closure from loop (diff)
downloadwireguard-windows-bba4646b11fa8b18649d04d02e6dae333bd9008d.tar.xz
wireguard-windows-bba4646b11fa8b18649d04d02e6dae333bd9008d.zip
global: several helpers are now upstream
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tunnel/firewall/helpers.go')
-rw-r--r--tunnel/firewall/helpers.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/tunnel/firewall/helpers.go b/tunnel/firewall/helpers.go
index 6bc71806..ee783c2d 100644
--- a/tunnel/firewall/helpers.go
+++ b/tunnel/firewall/helpers.go
@@ -87,22 +87,12 @@ func getCurrentProcessSecurityDescriptor() (*wtFwpByteBlob, error) {
if g.Attributes != windows.SE_GROUP_ENABLED|windows.SE_GROUP_ENABLED_BY_DEFAULT|windows.SE_GROUP_OWNER {
continue
}
- if *(*byte)(unsafe.Pointer(g.Sid)) != 1 { // The revision.
- continue
- }
- if *getSidIdentifierAuthority(g.Sid) != windows.SECURITY_NT_AUTHORITY {
- continue
- }
// We could be checking != 6, but hopefully Microsoft will update
// RtlCreateServiceSid to use SHA2, which will then likely bump
// this up. So instead just roll with a minimum.
- if *getSidSubAuthorityCount(g.Sid) < 6 {
+ if !g.Sid.IsValid() || g.Sid.IdentifierAuthority() != windows.SECURITY_NT_AUTHORITY || g.Sid.SubAuthorityCount() < 6 || g.Sid.SubAuthority(0) != 80 {
continue
}
- if *getSidSubAuthority(g.Sid, 0) != 80 {
- continue
- }
-
sid = g.Sid
break
}