Skip to content

Commit 0bf4594

Browse files
committed
fix tests
1 parent 0e94012 commit 0bf4594

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

auth/cert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ type serialNumberSet struct {
158158
}
159159

160160
func cutLeadingZeroes(b []byte) []byte {
161-
for len(b) > 1 && b[0] == 0 {
161+
for len(b) > 0 && b[0] == 0 {
162162
b = b[1:]
163163
}
164164
return b

auth/cert_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,6 @@ func mkbytes(l uint) []byte {
1616
return b
1717
}
1818

19-
var mask *big.Int = big.NewInt(0).Add(big.NewInt(0).Lsh(big.NewInt(1), uint(8*len(serialNumberKey{}))), big.NewInt(-1))
20-
21-
func TestNormalizeSNBytes(t *testing.T) {
22-
for i := uint(0); i <= 32; i++ {
23-
t.Run(fmt.Sprintf("%d-bytes", i), func(t *testing.T) {
24-
s := mkbytes(i)
25-
k := normalizeSNBytes(s)
26-
var a, b big.Int
27-
a.SetBytes(s).And(&a, mask)
28-
b.SetBytes(k[:])
29-
if a.Cmp(&b) != 0 {
30-
t.Fatalf("%d != %d", &a, &b)
31-
}
32-
})
33-
}
34-
}
35-
3619
type parseSerialBytesTestcase struct {
3720
input []byte
3821
output []byte

0 commit comments

Comments
 (0)