Skip to content

Commit 031df30

Browse files
committed
add parseChain again to minimize diff
1 parent 1740ce3 commit 031df30

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

internal/scti/handlers_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,26 @@ func TestGetRoots(t *testing.T) {
349349
})
350350
}
351351

352+
// TODO(phboneff): use this in followup PR. Leaving here for now to make
353+
// diffs easier to digst in PRs.
354+
// func parseChain(t *testing.T, isPrecert bool, pemChain []string, root *x509.Certificate) (*ctonly.Entry, []*x509.Certificate) {
355+
// t.Helper()
356+
// pool := loadCertsIntoPoolOrDie(t, pemChain)
357+
// leafChain := pool.RawCertificates()
358+
// if !leafChain[len(leafChain)-1].Equal(root) {
359+
// // The submitted chain may not include a root, but the generated LogLeaf will
360+
// fullChain := make([]*x509.Certificate, len(leafChain)+1)
361+
// copy(fullChain, leafChain)
362+
// fullChain[len(leafChain)] = root
363+
// leafChain = fullChain
364+
// }
365+
// entry, err := entryFromChain(leafChain, isPrecert, fakeTimeMillis)
366+
// if err != nil {
367+
// t.Fatalf("failed to create entry")
368+
// }
369+
// return entry, leafChain
370+
// }
371+
352372
// TODO(phboneff): this could just be a parseBodyJSONChain test
353373
func TestAddChainWhitespace(t *testing.T) {
354374
// Throughout we use variants of a hard-coded POST body derived from a chain of:

0 commit comments

Comments
 (0)