Skip to content

Commit e84e25e

Browse files
committed
address more comments
1 parent 87a6155 commit e84e25e

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

internal/scti/handlers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (f *fixedTimeSource) Now() time.Time {
7979
return f.fakeTime
8080
}
8181

82-
// setupTestLog creates test TesseraCT log using a POSIX backend.
82+
// setupTestLog creates a test TesseraCT log using a POSIX backend.
8383
func setupTestLog(t *testing.T) *log {
8484
t.Helper()
8585

@@ -90,7 +90,7 @@ func setupTestLog(t *testing.T) *log {
9090

9191
roots := x509util.NewPEMCertPool()
9292
if err := roots.AppendCertsFromPEMFile(testRootPath); err != nil {
93-
t.Fatalf("failed to read trusted roots: %v", err)
93+
t.Fatalf("Failed to read trusted roots: %v", err)
9494
}
9595

9696
cvOpts := ChainValidationOpts{

internal/testonly/storage/posix/issuers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (s IssuersStorage) keyToObjName(key []byte) (string, error) {
5252
if string(key) == "" {
5353
return "", fmt.Errorf("key cannot be empty")
5454
}
55-
if strings.Contains(string(key), "/") {
55+
if strings.Contains(string(key), string(os.PathSeparator)) {
5656
return "", fmt.Errorf("key %q cannot contain '/'", string(key))
5757
}
5858
return path.Join(string(s), string(key)), nil

internal/testonly/storage/posix/issuers_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package posix
1616

1717
import (
1818
"context"
19+
"fmt"
1920
"os"
2021
"path/filepath"
2122
"reflect"
@@ -77,14 +78,14 @@ func TestKeyToObjName(t *testing.T) {
7778
wantErr: true,
7879
},
7980
{
80-
name: "key with slash",
81-
key: []byte("issuer/1"),
81+
name: "key with os.PathSeparator",
82+
key: []byte(fmt.Sprintf("issuer%s1", string(os.PathSeparator))),
8283
want: "",
8384
wantErr: true,
8485
},
8586
{
8687
name: "key with multiple slashes",
87-
key: []byte("issuer/1/2"),
88+
key: []byte(fmt.Sprintf("issuer%s1%s2", string(os.PathSeparator), string(os.PathSeparator))),
8889
want: "",
8990
wantErr: true,
9091
},

0 commit comments

Comments
 (0)