aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wintun: increase registry timeoutJason A. Donenfeld2019-06-111-1/+1
|
* wintun: add helper for cleaning upJason A. Donenfeld2019-06-101-9/+82
|
* wintun: simplify error matching and remove dumb commentsJason A. Donenfeld2019-06-101-19/+4
|
* wintun: fix comments and remove hwnd paramJason A. Donenfeld2019-06-102-124/+55
| | | | This now looks more idiomatic.
* setupapi: add SetDeviceRegistryPropertyString descriptionSimon Rozman2019-06-101-1/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: unify ERROR_INSUFFICIENT_BUFFER handlingSimon Rozman2019-06-101-58/+32
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: allow controlling GUIDJason A. Donenfeld2019-06-102-2/+29
|
* setupapi: add DeviceInstanceID()Jason A. Donenfeld2019-06-103-0/+41
|
* global: fixup TODO comment spacingJason A. Donenfeld2019-06-067-11/+11
|
* wintun: guid functions are upstreamJason A. Donenfeld2019-06-067-120/+14
|
* wintun: simplify DeleteInterface method signatureSimon Rozman2019-06-062-58/+79
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: don't run HrRenameConnection in separate threadJason A. Donenfeld2019-06-051-3/+2
| | | | | It's very slow, but unfortunately we haven't a choice. NLA needs this to have completed.
* tun: windows: obsolete 256 packets per exchange buffer limitationSimon Rozman2019-06-051-2/+1
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi, wintun: replace syscall with golang.org/x/sys/windowsSimon Rozman2019-06-044-36/+32
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: set DI_QUIETINSTALL flag for GUI-less device managementSimon Rozman2019-06-041-3/+26
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* setupapi: define PropChangeParams structSimon Rozman2019-06-041-1/+20
| | | | | | | This structure is required for calling DIF_PROPERTYCHANGE installer class. Signed-off-by: Simon Rozman <simon@rozman.si>
* device: remove redundant return statementsMatt Layher2019-06-041-3/+0
| | | | | | | | | | | More staticcheck fixes: $ staticcheck ./... | grep S1023 device/noise-helpers.go:45:2: redundant return statement (S1023) device/noise-helpers.go:54:2: redundant return statement (S1023) device/noise-helpers.go:64:2: redundant return statement (S1023) Signed-off-by: Matt Layher <mdlayher@gmail.com>
* device: use bytes.Equal for equality check, simplify assertEqualMatt Layher2019-06-041-2/+2
| | | | Signed-off-by: Matt Layher <mdlayher@gmail.com>
* device, ratelimiter: replace uses of time.Now().Sub() with time.Since()Matt Layher2019-06-035-11/+11
| | | | | | | | | | | | | | | | | | | | | | | Simplification found by staticcheck: $ staticcheck ./... | grep S1012 device/cookie.go:90:5: should use time.Since instead of time.Now().Sub (S1012) device/cookie.go:127:5: should use time.Since instead of time.Now().Sub (S1012) device/cookie.go:242:5: should use time.Since instead of time.Now().Sub (S1012) device/noise-protocol.go:304:13: should use time.Since instead of time.Now().Sub (S1012) device/receive.go:82:46: should use time.Since instead of time.Now().Sub (S1012) device/send.go:132:5: should use time.Since instead of time.Now().Sub (S1012) device/send.go:139:5: should use time.Since instead of time.Now().Sub (S1012) device/send.go:235:59: should use time.Since instead of time.Now().Sub (S1012) device/send.go:393:9: should use time.Since instead of time.Now().Sub (S1012) ratelimiter/ratelimiter.go:79:10: should use time.Since instead of time.Now().Sub (S1012) ratelimiter/ratelimiter.go:87:10: should use time.Since instead of time.Now().Sub (S1012) Change applied using: $ find . -type f -name "*.go" -exec sed -i "s/Now().Sub(/Since(/g" {} \; Signed-off-by: Matt Layher <mdlayher@gmail.com>
* ipc/winpipe: go fmtMatt Layher2019-06-031-1/+1
| | | | Signed-off-by: Matt Layher <mdlayher@gmail.com>
* tun: windows: mitigate infinite loop in Flush()Jason A. Donenfeld2019-05-311-29/+35
| | | | | It's possible that for whatever reason, we keep returning EOF, resulting in repeated close/open/write operations, except with empty packets.
* device: add SendKeepalivesToPeersWithCurrentKeypair for handoverJason A. Donenfeld2019-05-301-0/+17
|
* tai64n: account for whitening in testJason A. Donenfeld2019-05-291-3/+7
|
* device, tun: rearrange code and fix device testsMatt Layher2019-05-293-103/+86
| | | | Signed-off-by: Matt Layher <mdlayher@gmail.com>
* wintun: remove extra /Jason A. Donenfeld2019-05-261-1/+1
|
* device: darwin actually doesn't need bound interfacesJason A. Donenfeld2019-05-251-44/+0
|
* device: make initiations per second match kernel implementationJason A. Donenfeld2019-05-251-1/+1
|
* device: timers: add jitter on ack failure reinitiationJason A. Donenfeld2019-05-241-1/+1
|
* wintun: revise GetInterface()Simon Rozman2019-05-242-3/+6
| | | | | | | | | | | - Make foreign interface found error numeric to ease condition detection. - Update GetInterface() documentation. - Make tun.CreateTUN() quit when foreign interface found before attempting to create a Wintun interface with a duplicate name. Creation is futile. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: never return nil, nilJason A. Donenfeld2019-05-231-1/+1
|
* ipc: use simplified fork of winioJason A. Donenfeld2019-05-238-20/+1162
|
* setupapi: trim "Get" from gettersSimon Rozman2019-05-225-53/+53
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: don't try to flush interface, but rather deleteJason A. Donenfeld2019-05-172-25/+8
|
* device: fail to give bind if it doesn't existJason A. Donenfeld2019-05-172-2/+13
|
* wintun: make certain methods privateJason A. Donenfeld2019-05-172-33/+41
|
* version: bump snapshot0.0.20190517Jason A. Donenfeld2019-05-171-1/+1
|
* makefile: do not show warning on non-linuxJason A. Donenfeld2019-05-171-1/+1
|
* wintun: change acronyms to uppercaseSimon Rozman2019-05-171-5/+5
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* global: regroup all importsJason A. Donenfeld2019-05-1427-44/+70
|
* wintun: registry: fix nitsJason A. Donenfeld2019-05-111-17/+20
|
* wintun: registry: revise value readingSimon Rozman2019-05-112-67/+82
| | | | | | | | | | | | | | - Make getStringValueRetry() reusable for reading any value type. This merges code from GetIntegerValueWait(). - expandString() >> toString() and extend to support REG_MULTI_SZ (to return first value of REG_MULTI_SZ). Furthermore, doing our own UTF-16 to UTF-8 conversion works around a bug in windows/registry's GetStringValue() non-zero terminated string handling. - Provide toInteger() analogous to toString() - GetStringValueWait() tolerates and reads REG_MULTI_SZ too now. It returns REG_MULTI_SZ[0], making GetFirstStringValueWait() redundant. Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: call HrRenameConnection in another threadJason A. Donenfeld2019-05-101-2/+3
|
* wintun: add LUID accessorJason A. Donenfeld2019-05-101-0/+7
|
* wintun: enumerate faster by using COMPATDRIVER instead of CLASSDRIVERJason A. Donenfeld2019-05-101-1/+1
|
* wintun: destroy devinfolist after usageJason A. Donenfeld2019-05-101-0/+1
|
* wintun: registry: replace REG_NOTIFY with NOTIFYSimon Rozman2019-05-103-13/+9
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* wintun: IpConfig is a MULTI_SZ, and fix errorsJason A. Donenfeld2019-05-102-49/+72
|
* wintun: poll for device keyJason A. Donenfeld2019-05-101-9/+10
| | | | It's actually pretty hard to guess where it is.
* wintun: fix scope of error objectJason A. Donenfeld2019-05-101-5/+6
|
* wintun: wait for interface registry key on device creationSimon Rozman2019-05-107-133/+534
| | | | | | By using RegNotifyChangeKeyValue(). Also disable dead gateway detection. Signed-off-by: Simon Rozman <simon@rozman.si>