Skip to content

Commit bd49471

Browse files
committed
Fix and/or silence linter issues
1 parent 4545659 commit bd49471

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

test/integration/scep/common_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,12 @@ func (c *client) requestCertificate(t *testing.T, commonName string, sans []stri
335335
}
336336

337337
var (
338-
oidExtensionAuthorityKeyId = asn1.ObjectIdentifier{2, 5, 29, 35}
339-
oidExtensionSubjectKeyId = asn1.ObjectIdentifier{2, 5, 29, 14}
338+
oidExtensionAuthorityKeyID = asn1.ObjectIdentifier{2, 5, 29, 35}
339+
oidExtensionSubjectKeyID = asn1.ObjectIdentifier{2, 5, 29, 14}
340340
)
341341

342-
type authorityKeyId struct {
343-
Id []byte `asn1:"optional,tag:0"`
342+
type authorityKeyID struct {
343+
ID []byte `asn1:"optional,tag:0"`
344344
}
345345

346346
type pkcs1PublicKey struct {
@@ -367,12 +367,12 @@ func (c *client) requestCertificateEmulatingWindowsClient(t *testing.T, commonNa
367367

368368
// on Windows the self-signed certificate contains an authority key identifier
369369
// extension that is marked critical
370-
value, err := asn1.Marshal(authorityKeyId{[]byte("bla")}) // fake value
370+
value, err := asn1.Marshal(authorityKeyID{[]byte("bla")}) // fake value
371371
if err != nil {
372372
return nil, fmt.Errorf("failed marshaling authority key ID")
373373
}
374374
authorityKeyIDExtension := pkix.Extension{
375-
Id: oidExtensionAuthorityKeyId,
375+
Id: oidExtensionAuthorityKeyID,
376376
Critical: true,
377377
Value: value,
378378
}
@@ -387,15 +387,15 @@ func (c *client) requestCertificateEmulatingWindowsClient(t *testing.T, commonNa
387387
}
388388

389389
h := sha1.Sum(publicKeyBytes)
390-
subjectKeyId := h[:]
390+
subjectKeyID := h[:]
391391

392392
// create subject key ID extension
393-
value, err = asn1.Marshal(subjectKeyId)
393+
value, err = asn1.Marshal(subjectKeyID)
394394
if err != nil {
395395
return nil, fmt.Errorf("failed marshaling subject key ID: %w", err)
396396
}
397397
subjectKeyIDExtension := pkix.Extension{
398-
Id: oidExtensionSubjectKeyId,
398+
Id: oidExtensionSubjectKeyID,
399399
Value: value,
400400
}
401401

test/integration/scep/internal/x509/doc.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ It is based on Go 1.23, and has just the parts copied over required for
44
parsing X509 certificates.
55
66
The copy in this repository is intended to be used for preparing a SCEP request
7-
emulating a Windows SCEP client. The Windows SCEP client markes the authority
7+
emulating a Windows SCEP client. The Windows SCEP client marks the authority
88
key identifier as critical in the self-signed SCEP enrolment certificate, which
99
fails to parse using the standard X509 parser in Go 1.23 and later.
1010
1111
This is itself a copy from the copy in our PKCS7 package. We currently don't
1212
intend to maintain that in an importable package, since we only need these copies
1313
for testing purposes, hence needing another copy of the code.
1414
*/
15-
1615
package legacyx509

test/integration/scep/internal/x509/oid.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//nolint:stylecheck,revive,gocritic // code copied from crypto/x509
56
package legacyx509
67

78
import (

test/integration/scep/internal/x509/parser.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//nolint:revive,gocritic,errorlint,unconvert // code copied from crypto/x509
56
package legacyx509
67

78
import (

test/integration/scep/internal/x509/verify.go

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2011 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//nolint:gocritic // code copied from crypto/x509
16
package legacyx509
27

38
import (

test/integration/scep/internal/x509/x509.go

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// On macOS and Windows, certificate verification is handled by system APIs, but
1919
// the package aims to apply consistent validation rules across operating
2020
// systems.
21+
22+
//nolint:gosec,unused // code copied from crypto/x509
2123
package legacyx509
2224

2325
import (

0 commit comments

Comments
 (0)