Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/pkg/cosign/fulcio/fulcioroots/fulcioroots.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ func GetIntermediates() (*x509.CertPool, error) {
return intermediates, singletonRootErr
}

// ReInit reinitializes the global roots and intermediates, overriding the sync.Once lock.
// This is only to be used for tests, where the trust root environment variables may change after the roots are initialized in the module.
func ReInit() error {
roots, intermediates, singletonRootErr = initRoots()
return singletonRootErr
}

func initRoots() (*x509.CertPool, *x509.CertPool, error) {
rootPool := x509.NewCertPool()
// intermediatePool should be nil if no intermediates are found
Expand Down
Loading