diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc7f8eb..dc2e158 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: test: strategy: matrix: - go-version: [1.19.x, 1.20.x, 1.21.x] + go-version: [1.21.x, 1.22.x, 1.23.x] os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: @@ -21,6 +21,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.55 + version: v1.63 - run: go vet ./... - run: go test -tags skipsecretserviceintegrationtests ./... diff --git a/.golangci.yml b/.golangci.yml index 23aaf43..4eb78ca 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,3 +9,5 @@ linters: - gofmt - gocritic - unconvert + - revive + - govet diff --git a/datetime.go b/datetime.go index 2daca4a..15be2a3 100644 --- a/datetime.go +++ b/datetime.go @@ -34,8 +34,8 @@ func unixToAbsoluteTime(s int64, ns int64) C.CFAbsoluteTime { } func absoluteTimeToUnix(abs C.CFAbsoluteTime) (int64, int64) { - int, frac := math.Modf(float64(abs)) - return int64(int) + absoluteTimeIntervalSince1970(), int64(frac * nsPerSec) + i, frac := math.Modf(float64(abs)) + return int64(i) + absoluteTimeIntervalSince1970(), int64(frac * nsPerSec) } // TimeToCFDate will convert the given time.Time to a CFDateRef, which diff --git a/go.mod b/go.mod index dfd4374..33f95a1 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ module github.com/keybase/go-keychain -go 1.19 +go 1.21 require ( github.com/keybase/dbus v0.0.0-20220506165403-5aa21ea2c23a github.com/pkg/errors v0.9.1 - github.com/stretchr/testify v1.8.4 - golang.org/x/crypto v0.31.0 + github.com/stretchr/testify v1.10.0 + golang.org/x/crypto v0.32.0 ) require ( diff --git a/go.sum b/go.sum index ec23f31..0c6c2f2 100644 --- a/go.sum +++ b/go.sum @@ -6,10 +6,10 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/secretservice/secretservice_test.go b/secretservice/secretservice_test.go index a07e25c..708de18 100644 --- a/secretservice/secretservice_test.go +++ b/secretservice/secretservice_test.go @@ -25,7 +25,7 @@ func TestKeyringDH(t *testing.T) { func testKeyring(t *testing.T, mode AuthenticationMode) { srv, err := NewService() require.NoError(t, err) - session, err := srv.OpenSession(AuthenticationDHAES) + session, err := srv.OpenSession(mode) require.NoError(t, err) defer srv.CloseSession(session)