FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev (cc: [email protected], rsc),

I'd like you to review this change to
https://code.google.com/p/go


Description:
crypto/x509: add Plan 9 root certificate location

Please review this at http://codereview.appspot.com/6571056/

Affected files:
A src/pkg/crypto/x509/root_plan9.go
M src/pkg/crypto/x509/root_stub.go


Index: src/pkg/crypto/x509/root_plan9.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/pkg/crypto/x509/root_plan9.go
@@ -0,0 +1,31 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build plan9
+
+package x509
+
+import "io/ioutil"
+
+// Possible certificate files; stop after finding one.
+var certFiles = []string{
+ "/sys/lib/tls/ca.pem",
+}
+
+func (c *Certificate) systemVerify(opts *VerifyOptions) (chains
[][]*Certificate, err error) {
+ return nil, nil
+}
+
+func initSystemRoots() {
+ roots := NewCertPool()
+ for _, file := range certFiles {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
+ break
+ }
+ }
+
+ systemRoots = roots
+}
Index: src/pkg/crypto/x509/root_stub.go
===================================================================
--- a/src/pkg/crypto/x509/root_stub.go
+++ b/src/pkg/crypto/x509/root_stub.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

-// +build plan9 darwin,!cgo
+// +build darwin,!cgo

package x509

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedSep 26, '12 at 12:39p
activeSep 26, '12 at 6:47p
posts3
users2
websitegolang.org

2 users in discussion

Rsc: 2 posts 0intro: 1 post

People

Translate

site design / logo © 2023 Grokbase