]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgo/go/crypto/x509/root_plan9.go
libgo: Update to current sources.
[thirdparty/gcc.git] / libgo / go / crypto / x509 / root_plan9.go
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build plan9
6
7 package x509
8
9 import "io/ioutil"
10
11 // Possible certificate files; stop after finding one.
12 var certFiles = []string{
13 "/sys/lib/tls/ca.pem",
14 }
15
16 func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
17 return nil, nil
18 }
19
20 func initSystemRoots() {
21 roots := NewCertPool()
22 for _, file := range certFiles {
23 data, err := ioutil.ReadFile(file)
24 if err == nil {
25 roots.AppendCertsFromPEM(data)
26 break
27 }
28 }
29
30 systemRoots = roots
31 }