Skip to content

Commit

Permalink
Fix remaining linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Vogel <[email protected]>
  • Loading branch information
stv0g committed Nov 28, 2023
1 parent 4a84bd8 commit e5d12d8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
if: matrix.os != 'windows-latest'
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.0
version: v1.55.2

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
Expand Down
10 changes: 4 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@

module cunicu.li/go-openpgp-card

go 1.21.0
go 1.21.3

require (
cunicu.li/go-iso7816 v0.3.0
github.com/davecgh/go-spew v1.1.1
)
require cunicu.li/go-iso7816 v0.3.0

require (
github.com/davecgh/go-spew v1.1.1 // test-only
github.com/stretchr/testify v1.8.4 // test-only
gopkg.in/yaml.v3 v3.0.1 // indirect; test-only
)

require (
github.com/ebfe/scard v0.0.0-20230420082256-7db3f9b7c8a7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.1 // indirect
)
8 changes: 5 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cunicu.li/go-iso7816 v0.2.2 h1:/LN6D3ZA+h3xiI4a6ln52CroByBGoiBTy4hxukxxXMk=
cunicu.li/go-iso7816 v0.2.2/go.mod h1:jL3bciDEU4prkEtONmCzVAz542Vb7SLJBnLV3o4o8qo=
cunicu.li/go-iso7816 v0.3.0 h1:KSt0D7TBh0ghWnpDSjNJDehFmXwM67Q8I3Qg0fvZlgw=
cunicu.li/go-iso7816 v0.3.0/go.mod h1:jL3bciDEU4prkEtONmCzVAz542Vb7SLJBnLV3o4o8qo=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -9,10 +9,12 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0=
github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
6 changes: 3 additions & 3 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"math/big"
"math/bits"

"cunicu.li/go-iso7816"
iso "cunicu.li/go-iso7816"
"cunicu.li/go-iso7816/encoding/tlv"
)

Expand Down Expand Up @@ -134,7 +134,7 @@ func (c *Card) EncryptAES(pt []byte) (ct []byte, err error) {
return nil, fmt.Errorf("%w: plaintext length must be multiple of AES block size (16 bytes)", ErrInvalidLength)
}

return send(c.tx, iso7816.InsPerformSecurityOperation, 0x86, 0x80, pt)
return send(c.tx, iso.InsPerformSecurityOperation, 0x86, 0x80, pt)
}

// DecryptAES encrypts a plain text with an AES-key stored in a special DO (D5).
Expand All @@ -149,7 +149,7 @@ func (c *Card) DecryptAES(pt []byte) (ct []byte, err error) {
return nil, fmt.Errorf("%w: plaintext length must be multiple of AES block size (16 bytes)", ErrInvalidLength)
}

return send(c.tx, iso7816.InsPerformSecurityOperation, 0x86, 0x80, pt)
return send(c.tx, iso.InsPerformSecurityOperation, 0x86, 0x80, pt)
}

func (c *Card) changeAlgAttrs(slot Slot, attrs AlgorithmAttributes) error {
Expand Down
1 change: 1 addition & 0 deletions objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ type ApplicationRelated struct {
Keys [4]KeyInfo
}

//nolint:gocognit
func (ar *ApplicationRelated) Decode(b []byte) (err error) {
tvs, err := tlv.DecodeBER(b)
if err != nil {
Expand Down

0 comments on commit e5d12d8

Please sign in to comment.