Skip to content

Commit 2c19321

Browse files
committed
rename x509fork to lax509
1 parent e45de5e commit 2c19321

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

internal/x509fork/README.md renamed to internal/lax509/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# x509fork
1+
# lax509
22

33
This is a minimalist fork of [`crypto/x509`](https://pkg.go.dev/crypto/x509).
44

internal/x509fork/cert_pool.go renamed to internal/lax509/cert_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +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-
package x509fork
5+
package lax509
66

77
import (
88
"bytes"

internal/x509fork/cert_pool_test.go renamed to internal/lax509/cert_pool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +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-
package x509fork
5+
package lax509
66

77
import (
88
"crypto/x509"

internal/x509fork/verify.go renamed to internal/lax509/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +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-
package x509fork
5+
package lax509
66

77
import (
88
"bytes"

internal/x509fork/verify_test.go renamed to internal/lax509/verify_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +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-
package x509fork
5+
package lax509
66

77
import (
88
"crypto"
@@ -1232,7 +1232,7 @@ func TestPathBuilding(t *testing.T) {
12321232
// * Trust Anchor -> A -> B -> EE
12331233
// * Trust Anchor -> C -> A -> B -> EE
12341234
//
1235-
// [x509fork edit]: These paths should also be valid since EKU checks have been disabled.
1235+
// [lax509 edit]: These paths should also be valid since EKU checks have been disabled.
12361236
// * Trust Anchor -> A -> C -> B -> EE
12371237
// * Trust Anchor -> C -> B -> EE
12381238
//
@@ -1315,7 +1315,7 @@ func TestPathBuilding(t *testing.T) {
13151315
// * Trust Anchor -> A -> B -> EE
13161316
// * Trust Anchor -> C -> A -> B -> EE
13171317
//
1318-
// [x509fork edit]: These paths should also be valid since EKU checks have been disabled.
1318+
// [lax509 edit]: These paths should also be valid since EKU checks have been disabled.
13191319
// * Trust Anchor -> C -> B -> EE
13201320
// * Trust Anchor -> A -> C -> B -> EE
13211321
//
@@ -1561,7 +1561,7 @@ func TestPathBuilding(t *testing.T) {
15611561
// Build a basic graph with two paths from leaf to root, but the path passing
15621562
// through C should be ignored, because it has invalid EKU nesting.
15631563
//
1564-
// [x509fork edit]: the second path should not be ignored since EKU checks
1564+
// [lax509 edit]: the second path should not be ignored since EKU checks
15651565
// have been disabled.
15661566
name: "ignore invalid EKU path",
15671567
graph: trustGraphDescription{

internal/x509fork/x509.go renamed to internal/lax509/x509.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package x509fork
1+
package lax509
22

33
var (
44
oidExtensionSubjectAltName = []int{2, 5, 29, 17}

internal/scti/chain_validation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"strings"
2525
"time"
2626

27+
"github.com/transparency-dev/static-ct/internal/lax509"
2728
"github.com/transparency-dev/static-ct/internal/types"
28-
"github.com/transparency-dev/static-ct/internal/x509fork"
2929
"github.com/transparency-dev/static-ct/internal/x509util"
3030
"k8s.io/klog/v2"
3131
)
@@ -236,13 +236,13 @@ func validateChain(rawChain [][]byte, validationOpts ChainValidationOpts) ([]*x5
236236
// - allow pre-certificates and chains with pre-issuers
237237
// - allow certificate without policing them since this is not CT's responsibility
238238
// See /internal/x509fork/README.md for further information.
239-
verifyOpts := x509fork.VerifyOptions{
239+
verifyOpts := lax509.VerifyOptions{
240240
Roots: validationOpts.trustedRoots.CertPool(),
241241
Intermediates: intermediatePool.CertPool(),
242242
KeyUsages: validationOpts.extKeyUsages,
243243
}
244244

245-
verifiedChains, err := x509fork.Verify(cert, verifyOpts)
245+
verifiedChains, err := lax509.Verify(cert, verifyOpts)
246246
if err != nil {
247247
return nil, err
248248
}

internal/x509util/pem_cert_pool.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"fmt"
2323
"os"
2424

25-
"github.com/transparency-dev/static-ct/internal/x509fork"
25+
"github.com/transparency-dev/static-ct/internal/lax509"
2626
"k8s.io/klog/v2"
2727
)
2828

@@ -37,12 +37,12 @@ type PEMCertPool struct {
3737
// maps from sha-256 to certificate, used for dup detection
3838
fingerprintToCertMap map[[sha256.Size]byte]x509.Certificate
3939
rawCerts []*x509.Certificate
40-
certPool *x509fork.CertPool
40+
certPool *lax509.CertPool
4141
}
4242

4343
// NewPEMCertPool creates a new, empty, instance of PEMCertPool.
4444
func NewPEMCertPool() *PEMCertPool {
45-
return &PEMCertPool{fingerprintToCertMap: make(map[[sha256.Size]byte]x509.Certificate), certPool: x509fork.NewCertPool()}
45+
return &PEMCertPool{fingerprintToCertMap: make(map[[sha256.Size]byte]x509.Certificate), certPool: lax509.NewCertPool()}
4646
}
4747

4848
// AddCert adds a certificate to a pool. Uses fingerprint to weed out duplicates.
@@ -111,7 +111,7 @@ func (p *PEMCertPool) Subjects() (res [][]byte) {
111111
}
112112

113113
// CertPool returns the underlying CertPool.
114-
func (p *PEMCertPool) CertPool() *x509fork.CertPool {
114+
func (p *PEMCertPool) CertPool() *lax509.CertPool {
115115
return p.certPool
116116
}
117117

0 commit comments

Comments
 (0)