Skip to content

Commit 2dde1f2

Browse files
committed
add parseChain again to minimize diff
1 parent 1740ce3 commit 2dde1f2

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
@@ -313,6 +313,26 @@ func TestNewPathHandlers(t *testing.T) {
313313
})
314314
}
315315

316+
// TODO(phboneff): use this in followup PR. Leaving here for now to make
317+
// diffs easier to digst in PRs.
318+
// func parseChain(t *testing.T, isPrecert bool, pemChain []string, root *x509.Certificate) (*ctonly.Entry, []*x509.Certificate) {
319+
// t.Helper()
320+
// pool := loadCertsIntoPoolOrDie(t, pemChain)
321+
// leafChain := pool.RawCertificates()
322+
// if !leafChain[len(leafChain)-1].Equal(root) {
323+
// // The submitted chain may not include a root, but the generated LogLeaf will
324+
// fullChain := make([]*x509.Certificate, len(leafChain)+1)
325+
// copy(fullChain, leafChain)
326+
// fullChain[len(leafChain)] = root
327+
// leafChain = fullChain
328+
// }
329+
// entry, err := entryFromChain(leafChain, isPrecert, fakeTimeMillis)
330+
// if err != nil {
331+
// t.Fatalf("failed to create entry")
332+
// }
333+
// return entry, leafChain
334+
// }
335+
316336
func TestGetRoots(t *testing.T) {
317337
log := setupTestLog(t)
318338
server := setupTestServer(t, log, path.Join(prefix, "ct/v1/get-roots"))

0 commit comments

Comments
 (0)