diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 2bfac9d..068b401 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -32,4 +32,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52.2 + version: v1.53.3 diff --git a/.golangci.yaml b/.golangci.yaml index 12f1c5f..89e014a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -29,7 +29,7 @@ linters-settings: - github.com/spf13/cobra - golang.org/x/crypto/blake2b - golang.org/x/crypto/chacha20poly1305 - - golang.org/x/exp/slog + - log/slog - golang.zx2c4.com/wireguard/wgctrl deny: - pkg: math/rand diff --git a/cmd/main.go b/cmd/main.go index 47704f8..bfc0afc 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,13 +4,13 @@ package main import ( + "log/slog" "os" "os/exec" "strings" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" - "golang.org/x/exp/slog" ) var ( diff --git a/cmd/validate.go b/cmd/validate.go index 46252af..08532e1 100644 --- a/cmd/validate.go +++ b/cmd/validate.go @@ -5,10 +5,10 @@ package main import ( "fmt" + "log/slog" "github.com/spf13/cobra" "github.com/stv0g/go-rosenpass/config" - "golang.org/x/exp/slog" ) func validate(_ *cobra.Command, args []string) error { diff --git a/config.go b/config.go index 6d1c2b7..a63d4ef 100644 --- a/config.go +++ b/config.go @@ -4,9 +4,8 @@ package rosenpass import ( + "log/slog" "net" - - "golang.org/x/exp/slog" ) type Config struct { diff --git a/config/arguments.go b/config/arguments.go index dd0b4ef..a98e852 100644 --- a/config/arguments.go +++ b/config/arguments.go @@ -6,9 +6,9 @@ package config import ( "errors" "fmt" + "log/slog" rp "github.com/stv0g/go-rosenpass" - "golang.org/x/exp/slog" ) var ( diff --git a/config/handler_cmd.go b/config/handler_cmd.go index a442b0b..fa1a077 100644 --- a/config/handler_cmd.go +++ b/config/handler_cmd.go @@ -5,11 +5,11 @@ package config import ( "bytes" + "log/slog" "os/exec" "strings" rp "github.com/stv0g/go-rosenpass" - "golang.org/x/exp/slog" ) type exchangeCommandHandler struct { diff --git a/config/handler_keyout.go b/config/handler_keyout.go index 3532274..f723224 100644 --- a/config/handler_keyout.go +++ b/config/handler_keyout.go @@ -6,11 +6,11 @@ package config import ( "encoding/base64" "fmt" + "log/slog" "os" "path/filepath" rp "github.com/stv0g/go-rosenpass" - "golang.org/x/exp/slog" ) type keyoutFileHandler struct { diff --git a/config/handler_wg_wgctrl.go b/config/handler_wg_wgctrl.go index 0177017..9fb6b4b 100644 --- a/config/handler_wg_wgctrl.go +++ b/config/handler_wg_wgctrl.go @@ -7,9 +7,9 @@ package config import ( "fmt" + "log/slog" rp "github.com/stv0g/go-rosenpass" - "golang.org/x/exp/slog" "golang.zx2c4.com/wireguard/wgctrl" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" ) diff --git a/conn_udp.go b/conn_udp.go index eca613e..e3ac453 100644 --- a/conn_udp.go +++ b/conn_udp.go @@ -6,9 +6,8 @@ package rosenpass import ( "errors" "fmt" + "log/slog" "net" - - "golang.org/x/exp/slog" ) var errInvalidEndpoint = errors.New("invalid endpoint type") diff --git a/go.mod b/go.mod index 9b3259f..8468159 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,13 @@ module github.com/stv0g/go-rosenpass -go 1.20 +go 1.21 require ( github.com/cloudflare/circl v0.0.0-00010101000000-000000000000 - github.com/open-quantum-safe/liboqs-go v0.0.0-20230705192921-cf9c63b76ce6 + github.com/open-quantum-safe/liboqs-go v0.0.0-20230726174627-a49f79a6b626 github.com/pelletier/go-toml/v2 v2.0.9 github.com/spf13/cobra v1.7.0 golang.org/x/crypto v0.12.0 - golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 ) @@ -26,10 +25,10 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.1.0 // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.11.0 // indirect - golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect + golang.zx2c4.com/wireguard v0.0.0-20230704135630-469159ecf7d1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f3bc230..bd85fe5 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,9 @@ github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 h1:RlZweED6sbSArvlE924+mUcZuXKLBHA35U7LN621Bws= -github.com/open-quantum-safe/liboqs-go v0.0.0-20230705192921-cf9c63b76ce6 h1:0seF5SlT4gR+smS+jv9oU3JWtSQEVYwu/jzgbvePidc= -github.com/open-quantum-safe/liboqs-go v0.0.0-20230705192921-cf9c63b76ce6/go.mod h1:7o26+0OF/Oh1Vo1sWUN+2jZavRhXvuLldh++utxFvRI= +github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= +github.com/open-quantum-safe/liboqs-go v0.0.0-20230726174627-a49f79a6b626 h1:aDWl8Y1TZ7SVYBtZYZf+kYiCzztCMV7zdLwJ0xWV1BQ= +github.com/open-quantum-safe/liboqs-go v0.0.0-20230726174627-a49f79a6b626/go.mod h1:7o26+0OF/Oh1Vo1sWUN+2jZavRhXvuLldh++utxFvRI= github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -37,22 +38,16 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stv0g/circl v0.0.0-20230801113412-fec58fc7b5f6 h1:+lCakOkbjp3Qcc73KlV8sHoxTGfBA9VA22J1s3mVwaM= github.com/stv0g/circl v0.0.0-20230801113412-fec58fc7b5f6/go.mod h1:+CauBF6R70Jqcyl8N2hC8pAXYbWkGIezuSbuGLtRhnw= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI= -golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b h1:J1CaxgLerRR5lgx3wnr6L04cJFbWoceSK9JWBdglINo= -golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b/go.mod h1:tqur9LnfstdR9ep2LaJT4lFUl0EjlHtge+gAjmsHUG4= +golang.zx2c4.com/wireguard v0.0.0-20230704135630-469159ecf7d1 h1:EY138uSo1JYlDq+97u1FtcOUwPpIU6WL1Lkt7WpYjPA= +golang.zx2c4.com/wireguard v0.0.0-20230704135630-469159ecf7d1/go.mod h1:tqur9LnfstdR9ep2LaJT4lFUl0EjlHtge+gAjmsHUG4= golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 h1:CawjfCvYQH2OU3/TnxLx97WDSUDRABfT18pCOYwc2GE= golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6/go.mod h1:3rxYc4HtVcSG9gVaTs2GEBdehh+sYPOwKtyUWEOTb80= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/handshake_initiator.go b/handshake_initiator.go index 60f9622..de07615 100644 --- a/handshake_initiator.go +++ b/handshake_initiator.go @@ -7,10 +7,9 @@ import ( "crypto/rand" "encoding/binary" "fmt" + "log/slog" "math" "time" - - "golang.org/x/exp/slog" ) type initiatorHandshake struct { diff --git a/internal/test/server_standalone.go b/internal/test/server_standalone.go index db1e4d8..4d3d9b1 100644 --- a/internal/test/server_standalone.go +++ b/internal/test/server_standalone.go @@ -9,13 +9,13 @@ import ( "flag" "fmt" "io" + "log/slog" "os" "os/exec" "path/filepath" rp "github.com/stv0g/go-rosenpass" "github.com/stv0g/go-rosenpass/config" - "golang.org/x/exp/slog" ) type StandaloneServer struct { diff --git a/main_test.go b/main_test.go index bcd2d34..765a0e7 100644 --- a/main_test.go +++ b/main_test.go @@ -4,12 +4,12 @@ package rosenpass_test import ( + "log/slog" "os" "testing" "time" rp "github.com/stv0g/go-rosenpass" - "golang.org/x/exp/slog" ) func TestMain(m *testing.M) { diff --git a/peer.go b/peer.go index 88cf632..e9cc753 100644 --- a/peer.go +++ b/peer.go @@ -6,10 +6,9 @@ package rosenpass import ( "errors" "fmt" + "log/slog" "net" "time" - - "golang.org/x/exp/slog" ) var ( diff --git a/server.go b/server.go index 67c3435..8e06d39 100644 --- a/server.go +++ b/server.go @@ -6,11 +6,10 @@ package rosenpass import ( "errors" "fmt" + "log/slog" "net" "sync" "time" - - "golang.org/x/exp/slog" ) type Server struct { diff --git a/server_test.go b/server_test.go index a6c9d32..6803c45 100644 --- a/server_test.go +++ b/server_test.go @@ -5,6 +5,7 @@ package rosenpass_test import ( "encoding/base64" + "log/slog" "math" "math/rand" "net" @@ -14,7 +15,6 @@ import ( "github.com/stretchr/testify/require" rp "github.com/stv0g/go-rosenpass" "github.com/stv0g/go-rosenpass/internal/test" - "golang.org/x/exp/slog" ) type handshakeHandler struct {