@@ -41,11 +41,11 @@ func TestPAE(t *testing.T) {
4141
4242type nilSignerVerifier int
4343
44- func (n nilSignerVerifier ) Sign (ctx context.Context , data []byte ) ([]byte , error ) {
44+ func (n nilSignerVerifier ) Sign (_ context.Context , data []byte ) ([]byte , error ) {
4545 return data , nil
4646}
4747
48- func (n nilSignerVerifier ) Verify (ctx context.Context , data , sig []byte ) error {
48+ func (n nilSignerVerifier ) Verify (_ context.Context , data , sig []byte ) error {
4949 if len (data ) != len (sig ) {
5050 return errLength
5151 }
@@ -69,11 +69,11 @@ func (n nilSignerVerifier) Public() crypto.PublicKey {
6969
7070type nullSignerVerifier int
7171
72- func (n nullSignerVerifier ) Sign (ctx context.Context , data []byte ) ([]byte , error ) {
72+ func (n nullSignerVerifier ) Sign (_ context.Context , data []byte ) ([]byte , error ) {
7373 return data , nil
7474}
7575
76- func (n nullSignerVerifier ) Verify (ctx context.Context , data , sig []byte ) error {
76+ func (n nullSignerVerifier ) Verify (_ context.Context , data , sig []byte ) error {
7777 if len (data ) != len (sig ) {
7878 return errLength
7979 }
@@ -97,11 +97,11 @@ func (n nullSignerVerifier) Public() crypto.PublicKey {
9797
9898type errsigner int
9999
100- func (n errsigner ) Sign (ctx context.Context , data []byte ) ([]byte , error ) {
100+ func (n errsigner ) Sign (_ context.Context , _ []byte ) ([]byte , error ) {
101101 return nil , fmt .Errorf ("signing error" )
102102}
103103
104- func (n errsigner ) Verify (ctx context.Context , data , sig []byte ) error {
104+ func (n errsigner ) Verify (_ context.Context , _ , _ []byte ) error {
105105 return errVerify
106106}
107107
@@ -118,11 +118,11 @@ type errSignerVerifier int
118118var errVerify = fmt .Errorf ("accepted signatures do not match threshold, Found: 0, Expected 1" )
119119var errThreshold = fmt .Errorf ("invalid threshold" )
120120
121- func (n errSignerVerifier ) Sign (ctx context.Context , data []byte ) ([]byte , error ) {
121+ func (n errSignerVerifier ) Sign (_ context.Context , data []byte ) ([]byte , error ) {
122122 return data , nil
123123}
124124
125- func (n errSignerVerifier ) Verify (ctx context.Context , data , sig []byte ) error {
125+ func (n errSignerVerifier ) Verify (_ context.Context , _ , _ []byte ) error {
126126 return errVerify
127127}
128128
@@ -136,12 +136,11 @@ func (n errSignerVerifier) Public() crypto.PublicKey {
136136
137137type badverifier int
138138
139- func (n badverifier ) Sign (ctx context.Context , data []byte ) ([]byte , error ) {
139+ func (n badverifier ) Sign (_ context.Context , data []byte ) ([]byte , error ) {
140140 return append (data , byte (0 )), nil
141141}
142142
143- func (n badverifier ) Verify (ctx context.Context , data , sig []byte ) error {
144-
143+ func (n badverifier ) Verify (_ context.Context , data , sig []byte ) error {
145144 if len (data ) != len (sig ) {
146145 return errLength
147146 }
@@ -186,7 +185,7 @@ func TestNilSign(t *testing.T) {
186185
187186 pae := PAE (payloadType , payload )
188187 want := Envelope {
189- Payload : base64 .StdEncoding .EncodeToString ([] byte ( payload ) ),
188+ Payload : base64 .StdEncoding .EncodeToString (payload ),
190189 PayloadType : payloadType ,
191190 Signatures : []Signature {
192191 {
@@ -200,7 +199,7 @@ func TestNilSign(t *testing.T) {
200199 signer , err := NewEnvelopeSigner (ns )
201200 assert .Nil (t , err , "unexpected error" )
202201
203- got , err := signer .SignPayload (context .TODO (), payloadType , [] byte ( payload ) )
202+ got , err := signer .SignPayload (context .TODO (), payloadType , payload )
204203 assert .Nil (t , err , "sign failed" )
205204 assert .Equal (t , & want , got , "bad signature" )
206205}
@@ -253,7 +252,7 @@ type ecdsaSignerVerifier struct {
253252 verified bool
254253}
255254
256- func (es * ecdsaSignerVerifier ) Sign (ctx context.Context , data []byte ) ([]byte , error ) {
255+ func (es * ecdsaSignerVerifier ) Sign (_ context.Context , data []byte ) ([]byte , error ) {
257256 // Data is complete message, hash it and sign the digest
258257 digest := sha256 .Sum256 (data )
259258 r , s , err := rfc6979 .SignECDSA (es .key , digest [:], sha256 .New )
@@ -264,12 +263,12 @@ func (es *ecdsaSignerVerifier) Sign(ctx context.Context, data []byte) ([]byte, e
264263 rb := r .Bytes ()
265264 sb := s .Bytes ()
266265 es .rLen = len (rb )
267- rawSig := append (rb , sb ... )
266+ rawSig := append (rb , sb ... ) //nolint:gocritic
268267
269268 return rawSig , nil
270269}
271270
272- func (es * ecdsaSignerVerifier ) Verify (ctx context.Context , data , sig []byte ) error {
271+ func (es * ecdsaSignerVerifier ) Verify (_ context.Context , data , sig []byte ) error {
273272 var r big.Int
274273 var s big.Int
275274 digest := sha256 .Sum256 (data )
0 commit comments