X7ROOT File Manager
Current Path:
/opt/golang/1.17.2/src/crypto/x509
opt
/
golang
/
1.17.2
/
src
/
crypto
/
x509
/
📁
..
📄
cert_pool.go
(7.09 KB)
📄
example_test.go
(5.32 KB)
📁
internal
📄
name_constraints_test.go
(44.53 KB)
📄
parser.go
(30.43 KB)
📄
pem_decrypt.go
(7.23 KB)
📄
pem_decrypt_test.go
(8.92 KB)
📄
pkcs1.go
(4.65 KB)
📄
pkcs8.go
(4.36 KB)
📄
pkcs8_test.go
(8.05 KB)
📁
pkix
📄
root.go
(793 B)
📄
root_aix.go
(463 B)
📄
root_bsd.go
(844 B)
📄
root_darwin.go
(9.11 KB)
📄
root_darwin_test.go
(1017 B)
📄
root_ios.go
(281.3 KB)
📄
root_ios_gen.go
(4.31 KB)
📄
root_js.go
(450 B)
📄
root_linux.go
(1012 B)
📄
root_omit.go
(1 KB)
📄
root_omit_test.go
(669 B)
📄
root_plan9.go
(844 B)
📄
root_solaris.go
(591 B)
📄
root_unix.go
(2.73 KB)
📄
root_unix_test.go
(6.13 KB)
📄
root_windows.go
(10.18 KB)
📄
sec1.go
(4.14 KB)
📄
sec1_test.go
(5.36 KB)
📄
test-file.crt
(1.9 KB)
📁
testdata
📄
verify.go
(33.09 KB)
📄
verify_test.go
(89.1 KB)
📄
x509.go
(69.55 KB)
📄
x509_test.go
(129.06 KB)
📄
x509_test_import.go
(1.72 KB)
Editing: root_unix.go
// Copyright 2011 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. //go:build aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris // +build aix dragonfly freebsd js,wasm linux netbsd openbsd solaris package x509 import ( "io/fs" "os" "path/filepath" "strings" ) const ( // certFileEnv is the environment variable which identifies where to locate // the SSL certificate file. If set this overrides the system default. certFileEnv = "SSL_CERT_FILE" // certDirEnv is the environment variable which identifies which directory // to check for SSL certificate files. If set this overrides the system default. // It is a colon separated list of directories. // See https://www.openssl.org/docs/man1.0.2/man1/c_rehash.html. certDirEnv = "SSL_CERT_DIR" ) func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { return nil, nil } func loadSystemRoots() (*CertPool, error) { roots := NewCertPool() files := certFiles if f := os.Getenv(certFileEnv); f != "" { files = []string{f} } var firstErr error for _, file := range files { data, err := os.ReadFile(file) if err == nil { roots.AppendCertsFromPEM(data) break } if firstErr == nil && !os.IsNotExist(err) { firstErr = err } } dirs := certDirectories if d := os.Getenv(certDirEnv); d != "" { // OpenSSL and BoringSSL both use ":" as the SSL_CERT_DIR separator. // See: // * https://golang.org/issue/35325 // * https://www.openssl.org/docs/man1.0.2/man1/c_rehash.html dirs = strings.Split(d, ":") } for _, directory := range dirs { fis, err := readUniqueDirectoryEntries(directory) if err != nil { if firstErr == nil && !os.IsNotExist(err) { firstErr = err } continue } for _, fi := range fis { data, err := os.ReadFile(directory + "/" + fi.Name()) if err == nil { roots.AppendCertsFromPEM(data) } } } if roots.len() > 0 || firstErr == nil { return roots, nil } return nil, firstErr } // readUniqueDirectoryEntries is like os.ReadDir but omits // symlinks that point within the directory. func readUniqueDirectoryEntries(dir string) ([]fs.DirEntry, error) { files, err := os.ReadDir(dir) if err != nil { return nil, err } uniq := files[:0] for _, f := range files { if !isSameDirSymlink(f, dir) { uniq = append(uniq, f) } } return uniq, nil } // isSameDirSymlink reports whether fi in dir is a symlink with a // target not containing a slash. func isSameDirSymlink(f fs.DirEntry, dir string) bool { if f.Type()&fs.ModeSymlink == 0 { return false } target, err := os.Readlink(filepath.Join(dir, f.Name())) return err == nil && !strings.Contains(target, "/") }
Upload File
Create Folder