1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:14:43 -07:00

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
This commit is contained in:
Brad Fitzpatrick 2014-08-15 17:47:02 -07:00
parent 7eba885ba5
commit a729552333

View File

@ -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.