Commit a7295523 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

crypto/x509: SystemRootsError style tweaks, document in Verify

In retrospect this should've been a variable instead of a type,
but oh well.

LGTM=agl
R=agl
CC=golang-codereviews
https://golang.org/cl/129250044
parent 7eba885b
......@@ -116,10 +116,9 @@ func (e UnknownAuthorityError) Error() string {
}
// SystemRootsError results when we fail to load the system root certificates.
type SystemRootsError struct {
}
type SystemRootsError struct{}
func (e SystemRootsError) Error() string {
func (SystemRootsError) Error() string {
return "x509: failed to load system roots and no roots provided"
}
......@@ -206,6 +205,9 @@ func (c *Certificate) isValid(certType int, currentChain []*Certificate, opts *V
// needed. If successful, it returns one or more chains where the first
// element of the chain is c and the last element is from opts.Roots.
//
// If opts.Roots is nil and system roots are unavailable the returned error
// will be of type SystemRootsError.
//
// WARNING: this doesn't do any revocation checking.
func (c *Certificate) Verify(opts VerifyOptions) (chains [][]*Certificate, err error) {
// Use Windows's own verification and chain building.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment