2 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | Alex A. Skinner
2 | Andrew Tunnell-Jones
3 | Ask Bjørn Hansen
4 | Dave Cheney
5 | Dusty Wilson
6 | Marek Majkowski
7 | Peter van Dijk
8 | Omri Bahumi
9 | Alex Sergeyev
10 | James Hartig
11 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/COPYRIGHT:
--------------------------------------------------------------------------------
1 | Copyright 2009 The Go Authors. All rights reserved. Use of this source code
2 | is governed by a BSD-style license that can be found in the LICENSE file.
3 | Extensions of the original work are copyright (c) 2011 Miek Gieben
4 |
5 | Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is
6 | governed by a BSD-style license that can be found in the LICENSE file.
7 |
8 | Copyright 2014 CloudFlare. All rights reserved. Use of this source code is
9 | governed by a BSD-style license that can be found in the LICENSE file.
10 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/Gopkg.lock:
--------------------------------------------------------------------------------
1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
2 |
3 |
4 | [[projects]]
5 | branch = "master"
6 | name = "golang.org/x/crypto"
7 | packages = ["ed25519","ed25519/internal/edwards25519"]
8 | revision = "b080dc9a8c480b08e698fb1219160d598526310f"
9 |
10 | [[projects]]
11 | branch = "master"
12 | name = "golang.org/x/net"
13 | packages = ["bpf","internal/iana","internal/socket","ipv4","ipv6"]
14 | revision = "894f8ed5849b15b810ae41e9590a0d05395bba27"
15 |
16 | [solve-meta]
17 | analyzer-name = "dep"
18 | analyzer-version = 1
19 | inputs-digest = "c4abc38abaeeeeb9be92455c9c02cae32841122b8982aaa067ef25bb8e86ff9d"
20 | solver-name = "gps-cdcl"
21 | solver-version = 1
22 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/Gopkg.toml:
--------------------------------------------------------------------------------
1 |
2 | # Gopkg.toml example
3 | #
4 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
5 | # for detailed Gopkg.toml documentation.
6 | #
7 | # required = ["github.com/user/thing/cmd/thing"]
8 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
9 | #
10 | # [[constraint]]
11 | # name = "github.com/user/project"
12 | # version = "1.0.0"
13 | #
14 | # [[constraint]]
15 | # name = "github.com/user/project2"
16 | # branch = "dev"
17 | # source = "github.com/myfork/project2"
18 | #
19 | # [[override]]
20 | # name = "github.com/x/y"
21 | # version = "2.4.0"
22 |
23 |
24 | [[constraint]]
25 | branch = "master"
26 | name = "golang.org/x/crypto"
27 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/Makefile.fuzz:
--------------------------------------------------------------------------------
1 | # Makefile for fuzzing
2 | #
3 | # Use go-fuzz and needs the tools installed.
4 | # See https://blog.cloudflare.com/dns-parser-meet-go-fuzzer/
5 | #
6 | # Installing go-fuzz:
7 | # $ make -f Makefile.fuzz get
8 | # Installs:
9 | # * github.com/dvyukov/go-fuzz/go-fuzz
10 | # * get github.com/dvyukov/go-fuzz/go-fuzz-build
11 |
12 | all: build
13 |
14 | .PHONY: build
15 | build:
16 | go-fuzz-build -tags fuzz github.com/miekg/dns
17 |
18 | .PHONY: build-newrr
19 | build-newrr:
20 | go-fuzz-build -func FuzzNewRR -tags fuzz github.com/miekg/dns
21 |
22 | .PHONY: fuzz
23 | fuzz:
24 | go-fuzz -bin=dns-fuzz.zip -workdir=fuzz
25 |
26 | .PHONY: get
27 | get:
28 | go get github.com/dvyukov/go-fuzz/go-fuzz
29 | go get github.com/dvyukov/go-fuzz/go-fuzz-build
30 |
31 | .PHONY: clean
32 | clean:
33 | rm *-fuzz.zip
34 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/dyn_test.go:
--------------------------------------------------------------------------------
1 | package dns
2 |
3 | // Find better solution
4 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/fuzz.go:
--------------------------------------------------------------------------------
1 | // +build fuzz
2 |
3 | package dns
4 |
5 | func Fuzz(data []byte) int {
6 | msg := new(Msg)
7 |
8 | if err := msg.Unpack(data); err != nil {
9 | return 0
10 | }
11 | if _, err := msg.Pack(); err != nil {
12 | return 0
13 | }
14 |
15 | return 1
16 | }
17 |
18 | func FuzzNewRR(data []byte) int {
19 | if _, err := NewRR(string(data)); err != nil {
20 | return 0
21 | }
22 | return 1
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/remote_test.go:
--------------------------------------------------------------------------------
1 | package dns
2 |
3 | import "testing"
4 |
5 | const LinodeAddr = "176.58.119.54:53"
6 |
7 | func TestClientRemote(t *testing.T) {
8 | m := new(Msg)
9 | m.SetQuestion("go.dns.miek.nl.", TypeTXT)
10 |
11 | c := new(Client)
12 | r, _, err := c.Exchange(m, LinodeAddr)
13 | if err != nil {
14 | t.Errorf("failed to exchange: %v", err)
15 | }
16 | if r != nil && r.Rcode != RcodeSuccess {
17 | t.Errorf("failed to get an valid answer\n%v", r)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/reverse.go:
--------------------------------------------------------------------------------
1 | package dns
2 |
3 | // StringToType is the reverse of TypeToString, needed for string parsing.
4 | var StringToType = reverseInt16(TypeToString)
5 |
6 | // StringToClass is the reverse of ClassToString, needed for string parsing.
7 | var StringToClass = reverseInt16(ClassToString)
8 |
9 | // StringToOpcode is a map of opcodes to strings.
10 | var StringToOpcode = reverseInt(OpcodeToString)
11 |
12 | // StringToRcode is a map of rcodes to strings.
13 | var StringToRcode = reverseInt(RcodeToString)
14 |
15 | // Reverse a map
16 | func reverseInt8(m map[uint8]string) map[string]uint8 {
17 | n := make(map[string]uint8, len(m))
18 | for u, s := range m {
19 | n[s] = u
20 | }
21 | return n
22 | }
23 |
24 | func reverseInt16(m map[uint16]string) map[string]uint16 {
25 | n := make(map[string]uint16, len(m))
26 | for u, s := range m {
27 | n[s] = u
28 | }
29 | return n
30 | }
31 |
32 | func reverseInt(m map[int]string) map[string]int {
33 | n := make(map[string]int, len(m))
34 | for u, s := range m {
35 | n[s] = u
36 | }
37 | return n
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/rr_test.go:
--------------------------------------------------------------------------------
1 | package dns
2 |
3 | // testRR returns the RR from string s. The error is thrown away.
4 | func testRR(s string) RR {
5 | r, _ := NewRR(s)
6 | return r
7 | }
8 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/version.go:
--------------------------------------------------------------------------------
1 | package dns
2 |
3 | import "fmt"
4 |
5 | // Version is current version of this library.
6 | var Version = V{1, 0, 0}
7 |
8 | // V holds the version of this library.
9 | type V struct {
10 | Major, Minor, Patch int
11 | }
12 |
13 | func (v V) String() string {
14 | return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/miekg/dns/version_test.go:
--------------------------------------------------------------------------------
1 | package dns
2 |
3 | import "testing"
4 |
5 | func TestVersion(t *testing.T) {
6 | v := V{1, 0, 0}
7 | if x := v.String(); x != "1.0.0" {
8 | t.Fatalf("Failed to convert version %v, got: %s", v, x)
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/.gitattributes:
--------------------------------------------------------------------------------
1 | # Treat all files in this repo as binary, with no git magic updating
2 | # line endings. Windows users contributing to Go will need to use a
3 | # modern version of git and editors capable of LF line endings.
4 | #
5 | # We'll prevent accidental CRLF line endings from entering the repo
6 | # via the git-review gofmt checks.
7 | #
8 | # See golang.org/issue/9281
9 |
10 | * -text
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/.gitignore:
--------------------------------------------------------------------------------
1 | # Add no patterns to .hgignore except for files generated by the build.
2 | last-change
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at https://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at https://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/README.md:
--------------------------------------------------------------------------------
1 | # Go Cryptography
2 |
3 | This repository holds supplementary Go cryptography libraries.
4 |
5 | ## Download/Install
6 |
7 | The easiest way to install is to run `go get -u golang.org/x/crypto/...`. You
8 | can also manually git clone the repository to `$GOPATH/src/golang.org/x/crypto`.
9 |
10 | ## Report Issues / Send Patches
11 |
12 | This repository uses Gerrit for code changes. To learn how to submit changes to
13 | this repository, see https://golang.org/doc/contribute.html.
14 |
15 | The main issue tracker for the crypto repository is located at
16 | https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the
17 | subject line, so it is easy to find.
18 |
19 | Note that contributions to the cryptography package receive additional scrutiny
20 | due to their sensitive nature. Patches may take longer than normal to receive
21 | feedback.
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/acme/autocert/example_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 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 | package autocert_test
6 |
7 | import (
8 | "crypto/tls"
9 | "fmt"
10 | "log"
11 | "net/http"
12 |
13 | "golang.org/x/crypto/acme/autocert"
14 | )
15 |
16 | func ExampleNewListener() {
17 | mux := http.NewServeMux()
18 | mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
19 | fmt.Fprintf(w, "Hello, TLS user! Your config: %+v", r.TLS)
20 | })
21 | log.Fatal(http.Serve(autocert.NewListener("example.com"), mux))
22 | }
23 |
24 | func ExampleManager() {
25 | m := autocert.Manager{
26 | Cache: autocert.DirCache("secret-dir"),
27 | Prompt: autocert.AcceptTOS,
28 | HostPolicy: autocert.HostWhitelist("example.org"),
29 | }
30 | s := &http.Server{
31 | Addr: ":https",
32 | TLSConfig: &tls.Config{GetCertificate: m.GetCertificate},
33 | }
34 | s.ListenAndServeTLS("", "")
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/bcrypt/base64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 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 | package bcrypt
6 |
7 | import "encoding/base64"
8 |
9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
10 |
11 | var bcEncoding = base64.NewEncoding(alphabet)
12 |
13 | func base64Encode(src []byte) []byte {
14 | n := bcEncoding.EncodedLen(len(src))
15 | dst := make([]byte, n)
16 | bcEncoding.Encode(dst, src)
17 | for dst[n-1] == '=' {
18 | n--
19 | }
20 | return dst[:n]
21 | }
22 |
23 | func base64Decode(src []byte) ([]byte, error) {
24 | numOfEquals := 4 - (len(src) % 4)
25 | for i := 0; i < numOfEquals; i++ {
26 | src = append(src, '=')
27 | }
28 |
29 | dst := make([]byte, bcEncoding.DecodedLen(len(src)))
30 | n, err := bcEncoding.Decode(dst, src)
31 | if err != nil {
32 | return nil, err
33 | }
34 | return dst[:n], nil
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 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 !go1.7,amd64,!gccgo,!appengine
6 |
7 | package blake2b
8 |
9 | func init() {
10 | useSSE4 = supportsSSE4()
11 | }
12 |
13 | //go:noescape
14 | func supportsSSE4() bool
15 |
16 | //go:noescape
17 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
18 |
19 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
20 | if useSSE4 {
21 | hashBlocksSSE4(h, c, flag, blocks)
22 | } else {
23 | hashBlocksGeneric(h, c, flag, blocks)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 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 !amd64 appengine gccgo
6 |
7 | package blake2b
8 |
9 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
10 | hashBlocksGeneric(h, c, flag, blocks)
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/blake2b/register.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 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 go1.9
6 |
7 | package blake2b
8 |
9 | import (
10 | "crypto"
11 | "hash"
12 | )
13 |
14 | func init() {
15 | newHash256 := func() hash.Hash {
16 | h, _ := New256(nil)
17 | return h
18 | }
19 | newHash384 := func() hash.Hash {
20 | h, _ := New384(nil)
21 | return h
22 | }
23 |
24 | newHash512 := func() hash.Hash {
25 | h, _ := New512(nil)
26 | return h
27 | }
28 |
29 | crypto.RegisterHash(crypto.BLAKE2b_256, newHash256)
30 | crypto.RegisterHash(crypto.BLAKE2b_384, newHash384)
31 | crypto.RegisterHash(crypto.BLAKE2b_512, newHash512)
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/blake2s/blake2s_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 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 386,!gccgo,!appengine
6 |
7 | package blake2s
8 |
9 | var (
10 | useSSE4 = false
11 | useSSSE3 = supportSSSE3()
12 | useSSE2 = supportSSE2()
13 | )
14 |
15 | //go:noescape
16 | func supportSSE2() bool
17 |
18 | //go:noescape
19 | func supportSSSE3() bool
20 |
21 | //go:noescape
22 | func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
23 |
24 | //go:noescape
25 | func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
26 |
27 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) {
28 | if useSSSE3 {
29 | hashBlocksSSSE3(h, c, flag, blocks)
30 | } else if useSSE2 {
31 | hashBlocksSSE2(h, c, flag, blocks)
32 | } else {
33 | hashBlocksGeneric(h, c, flag, blocks)
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 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 !amd64,!386 gccgo appengine
6 |
7 | package blake2s
8 |
9 | var (
10 | useSSE4 = false
11 | useSSSE3 = false
12 | useSSE2 = false
13 | )
14 |
15 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) {
16 | hashBlocksGeneric(h, c, flag, blocks)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/blake2s/register.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 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 go1.9
6 |
7 | package blake2s
8 |
9 | import (
10 | "crypto"
11 | "hash"
12 | )
13 |
14 | func init() {
15 | newHash256 := func() hash.Hash {
16 | h, _ := New256(nil)
17 | return h
18 | }
19 |
20 | crypto.RegisterHash(crypto.BLAKE2s_256, newHash256)
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 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 !amd64 !go1.7 gccgo appengine
6 |
7 | package chacha20poly1305
8 |
9 | func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte {
10 | return c.sealGeneric(dst, nonce, plaintext, additionalData)
11 | }
12 |
13 | func (c *chacha20poly1305) open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) {
14 | return c.openGeneric(dst, nonce, ciphertext, additionalData)
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/chacha20poly1305/internal/chacha20/chacha_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 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 | package chacha20
6 |
7 | import (
8 | "encoding/hex"
9 | "testing"
10 | )
11 |
12 | func TestCore(t *testing.T) {
13 | // This is just a smoke test that checks the example from
14 | // https://tools.ietf.org/html/rfc7539#section-2.3.2. The
15 | // chacha20poly1305 package contains much more extensive tests of this
16 | // code.
17 | var key [32]byte
18 | for i := range key {
19 | key[i] = byte(i)
20 | }
21 |
22 | var input [16]byte
23 | input[0] = 1
24 | input[7] = 9
25 | input[11] = 0x4a
26 |
27 | var out [64]byte
28 | XORKeyStream(out[:], out[:], &input, &key)
29 | const expected = "10f1e7e4d13b5915500fdd1fa32071c4c7d1f4c733c068030422aa9ac3d46c4ed2826446079faa0914c2d705d98b02a2b5129cd1de164eb9cbd083e8a2503c4e"
30 | if result := hex.EncodeToString(out[:]); result != expected {
31 | t.Errorf("wanted %x but got %x", expected, result)
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/codereview.cfg:
--------------------------------------------------------------------------------
1 | issuerepo: golang/go
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/curve25519/const_amd64.h:
--------------------------------------------------------------------------------
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 | // This code was translated into a form compatible with 6a from the public
6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html
7 |
8 | #define REDMASK51 0x0007FFFFFFFFFFFF
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/curve25519/const_amd64.s:
--------------------------------------------------------------------------------
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 | // This code was translated into a form compatible with 6a from the public
6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html
7 |
8 | // +build amd64,!gccgo,!appengine
9 |
10 | // These constants cannot be encoded in non-MOVQ immediates.
11 | // We access them directly from memory instead.
12 |
13 | DATA ·_121666_213(SB)/8, $996687872
14 | GLOBL ·_121666_213(SB), 8, $8
15 |
16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA
17 | GLOBL ·_2P0(SB), 8, $8
18 |
19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE
20 | GLOBL ·_2P1234(SB), 8, $8
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/curve25519/curve25519_test.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 | package curve25519
6 |
7 | import (
8 | "fmt"
9 | "testing"
10 | )
11 |
12 | const expectedHex = "89161fde887b2b53de549af483940106ecc114d6982daa98256de23bdf77661a"
13 |
14 | func TestBaseScalarMult(t *testing.T) {
15 | var a, b [32]byte
16 | in := &a
17 | out := &b
18 | a[0] = 1
19 |
20 | for i := 0; i < 200; i++ {
21 | ScalarBaseMult(out, in)
22 | in, out = out, in
23 | }
24 |
25 | result := fmt.Sprintf("%x", in[:])
26 | if result != expectedHex {
27 | t.Errorf("incorrect result: got %s, want %s", result, expectedHex)
28 | }
29 | }
30 |
31 | func BenchmarkScalarBaseMult(b *testing.B) {
32 | var in, out [32]byte
33 | in[0] = 1
34 |
35 | b.SetBytes(32)
36 | for i := 0; i < b.N; i++ {
37 | ScalarBaseMult(&out, &in)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fardog/secureoperator/6ee86f0eed1eced2ff942249ec28c3dc47eaa4a5/vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/md4/example_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 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 | package md4_test
6 |
7 | import (
8 | "fmt"
9 | "io"
10 |
11 | "golang.org/x/crypto/md4"
12 | )
13 |
14 | func ExampleNew() {
15 | h := md4.New()
16 | data := "These pretzels are making me thirsty."
17 | io.WriteString(h, data)
18 | fmt.Printf("%x", h.Sum(nil))
19 | // Output: 48c4e365090b30a32f084c4888deceaa
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/openpgp/packet/compressed_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 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 | package packet
6 |
7 | import (
8 | "bytes"
9 | "encoding/hex"
10 | "io"
11 | "io/ioutil"
12 | "testing"
13 | )
14 |
15 | func TestCompressed(t *testing.T) {
16 | packet, err := Read(readerFromHex(compressedHex))
17 | if err != nil {
18 | t.Errorf("failed to read Compressed: %s", err)
19 | return
20 | }
21 |
22 | c, ok := packet.(*Compressed)
23 | if !ok {
24 | t.Error("didn't find Compressed packet")
25 | return
26 | }
27 |
28 | contents, err := ioutil.ReadAll(c.Body)
29 | if err != nil && err != io.EOF {
30 | t.Error(err)
31 | return
32 | }
33 |
34 | expected, _ := hex.DecodeString(compressedExpectedHex)
35 | if !bytes.Equal(expected, contents) {
36 | t.Errorf("got:%x want:%x", contents, expected)
37 | }
38 | }
39 |
40 | const compressedHex = "a3013b2d90c4e02b72e25f727e5e496a5e49b11e1700"
41 | const compressedExpectedHex = "cb1062004d14c8fe636f6e74656e74732e0a"
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/pkcs12/errors.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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 | package pkcs12
6 |
7 | import "errors"
8 |
9 | var (
10 | // ErrDecryption represents a failure to decrypt the input.
11 | ErrDecryption = errors.New("pkcs12: decryption error, incorrect padding")
12 |
13 | // ErrIncorrectPassword is returned when an incorrect password is detected.
14 | // Usually, P12/PFX data is signed to be able to verify the password.
15 | ErrIncorrectPassword = errors.New("pkcs12: decryption password incorrect")
16 | )
17 |
18 | // NotImplementedError indicates that the input is not currently supported.
19 | type NotImplementedError string
20 |
21 | func (e NotImplementedError) Error() string {
22 | return "pkcs12: " + string(e)
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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 | package rc2
6 |
7 | import (
8 | "testing"
9 | )
10 |
11 | func BenchmarkEncrypt(b *testing.B) {
12 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64)
13 | b.ResetTimer()
14 | var src [8]byte
15 | for i := 0; i < b.N; i++ {
16 | r.Encrypt(src[:], src[:])
17 | }
18 | }
19 |
20 | func BenchmarkDecrypt(b *testing.B) {
21 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64)
22 | b.ResetTimer()
23 | var src [8]byte
24 | for i := 0; i < b.N; i++ {
25 | r.Decrypt(src[:], src[:])
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/poly1305/sum_amd64.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 amd64,!gccgo,!appengine
6 |
7 | package poly1305
8 |
9 | // This function is implemented in sum_amd64.s
10 | //go:noescape
11 | func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte)
12 |
13 | // Sum generates an authenticator for m using a one-time key and puts the
14 | // 16-byte result into out. Authenticating two different messages with the same
15 | // key allows an attacker to forge messages at will.
16 | func Sum(out *[16]byte, m []byte, key *[32]byte) {
17 | var mPtr *byte
18 | if len(m) > 0 {
19 | mPtr = &m[0]
20 | }
21 | poly1305(out, mPtr, uint64(len(m)), key)
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/poly1305/sum_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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 arm,!gccgo,!appengine,!nacl
6 |
7 | package poly1305
8 |
9 | // This function is implemented in sum_arm.s
10 | //go:noescape
11 | func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte)
12 |
13 | // Sum generates an authenticator for m using a one-time key and puts the
14 | // 16-byte result into out. Authenticating two different messages with the same
15 | // key allows an attacker to forge messages at will.
16 | func Sum(out *[16]byte, m []byte, key *[32]byte) {
17 | var mPtr *byte
18 | if len(m) > 0 {
19 | mPtr = &m[0]
20 | }
21 | poly1305_auth_armv6(out, mPtr, uint32(len(m)), key)
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.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 amd64,!appengine,!gccgo
6 |
7 | package salsa
8 |
9 | // This function is implemented in salsa2020_amd64.s.
10 |
11 | //go:noescape
12 |
13 | func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte)
14 |
15 | // XORKeyStream crypts bytes from in to out using the given key and counters.
16 | // In and out must overlap entirely or not at all. Counter
17 | // contains the raw salsa20 counter bytes (both nonce and block counter).
18 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) {
19 | if len(in) == 0 {
20 | return
21 | }
22 | _ = out[len(in)-1]
23 | salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0])
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/scrypt/example_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 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 | package scrypt_test
6 |
7 | import (
8 | "encoding/base64"
9 | "fmt"
10 | "log"
11 |
12 | "golang.org/x/crypto/scrypt"
13 | )
14 |
15 | func Example() {
16 | // DO NOT use this salt value; generate your own random salt. 8 bytes is
17 | // a good length.
18 | salt := []byte{0xc8, 0x28, 0xf2, 0x58, 0xa7, 0x6a, 0xad, 0x7b}
19 |
20 | dk, err := scrypt.Key([]byte("some password"), salt, 1<<15, 8, 1, 32)
21 | if err != nil {
22 | log.Fatal(err)
23 | }
24 | fmt.Println(base64.StdEncoding.EncodeToString(dk))
25 | // Output: lGnMz8io0AUkfzn6Pls1qX20Vs7PGN6sbYQ2TQgY12M=
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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 amd64,!appengine,!gccgo
6 |
7 | package sha3
8 |
9 | // This function is implemented in keccakf_amd64.s.
10 |
11 | //go:noescape
12 |
13 | func keccakF1600(a *[25]uint64)
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/sha3/register.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 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 go1.4
6 |
7 | package sha3
8 |
9 | import (
10 | "crypto"
11 | )
12 |
13 | func init() {
14 | crypto.RegisterHash(crypto.SHA3_224, New224)
15 | crypto.RegisterHash(crypto.SHA3_256, New256)
16 | crypto.RegisterHash(crypto.SHA3_384, New384)
17 | crypto.RegisterHash(crypto.SHA3_512, New512)
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fardog/secureoperator/6ee86f0eed1eced2ff942249ec28c3dc47eaa4a5/vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/sha3/xor.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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 !amd64,!386,!ppc64le appengine
6 |
7 | package sha3
8 |
9 | var (
10 | xorIn = xorInGeneric
11 | copyOut = copyOutGeneric
12 | xorInUnaligned = xorInGeneric
13 | copyOutUnaligned = copyOutGeneric
14 | )
15 |
16 | const xorImplementationUnaligned = "generic"
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/sha3/xor_generic.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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 | package sha3
6 |
7 | import "encoding/binary"
8 |
9 | // xorInGeneric xors the bytes in buf into the state; it
10 | // makes no non-portable assumptions about memory layout
11 | // or alignment.
12 | func xorInGeneric(d *state, buf []byte) {
13 | n := len(buf) / 8
14 |
15 | for i := 0; i < n; i++ {
16 | a := binary.LittleEndian.Uint64(buf)
17 | d.a[i] ^= a
18 | buf = buf[8:]
19 | }
20 | }
21 |
22 | // copyOutGeneric copies ulint64s to a byte buffer.
23 | func copyOutGeneric(d *state, b []byte) {
24 | for i := 0; len(b) >= 8; i++ {
25 | binary.LittleEndian.PutUint64(b, d.a[i])
26 | b = b[8:]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ssh/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 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 | /*
6 | Package ssh implements an SSH client and server.
7 |
8 | SSH is a transport security protocol, an authentication protocol and a
9 | family of application protocols. The most typical application level
10 | protocol is a remote shell and this is specifically implemented. However,
11 | the multiplexed nature of SSH is exposed to users that wish to support
12 | others.
13 |
14 | References:
15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD
16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1
17 |
18 | This package does not fall under the stability promise of the Go language itself,
19 | so its API may be changed when pressing needs arise.
20 | */
21 | package ssh // import "golang.org/x/crypto/ssh"
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ssh/tcpip_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 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 | package ssh
6 |
7 | import (
8 | "testing"
9 | )
10 |
11 | func TestAutoPortListenBroken(t *testing.T) {
12 | broken := "SSH-2.0-OpenSSH_5.9hh11"
13 | works := "SSH-2.0-OpenSSH_6.1"
14 | if !isBrokenOpenSSHVersion(broken) {
15 | t.Errorf("version %q not marked as broken", broken)
16 | }
17 | if isBrokenOpenSSHVersion(works) {
18 | t.Errorf("version %q marked as broken", works)
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 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 darwin dragonfly freebsd netbsd openbsd
6 |
7 | package terminal
8 |
9 | import "golang.org/x/sys/unix"
10 |
11 | const ioctlReadTermios = unix.TIOCGETA
12 | const ioctlWriteTermios = unix.TIOCSETA
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 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 | package terminal
6 |
7 | import "golang.org/x/sys/unix"
8 |
9 | const ioctlReadTermios = unix.TCGETS
10 | const ioctlWriteTermios = unix.TCSETS
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ssh/test/banner_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 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 darwin dragonfly freebsd linux netbsd openbsd
6 |
7 | package test
8 |
9 | import (
10 | "testing"
11 | )
12 |
13 | func TestBannerCallbackAgainstOpenSSH(t *testing.T) {
14 | server := newServer(t)
15 | defer server.Shutdown()
16 |
17 | clientConf := clientConfig()
18 |
19 | var receivedBanner string
20 | clientConf.BannerCallback = func(message string) error {
21 | receivedBanner = message
22 | return nil
23 | }
24 |
25 | conn := server.Dial(clientConf)
26 | defer conn.Close()
27 |
28 | expected := "Server Banner"
29 | if receivedBanner != expected {
30 | t.Fatalf("got %v; want %v", receivedBanner, expected)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ssh/test/doc.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 | // Package test contains integration tests for the
6 | // golang.org/x/crypto/ssh package.
7 | package test // import "golang.org/x/crypto/ssh/test"
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/ssh/testdata/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 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 | // This package contains test data shared between the various subpackages of
6 | // the golang.org/x/crypto/ssh package. Under no circumstance should
7 | // this data be used for production code.
8 | package testdata // import "golang.org/x/crypto/ssh/testdata"
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/.gitattributes:
--------------------------------------------------------------------------------
1 | # Treat all files in this repo as binary, with no git magic updating
2 | # line endings. Windows users contributing to Go will need to use a
3 | # modern version of git and editors capable of LF line endings.
4 | #
5 | # We'll prevent accidental CRLF line endings from entering the repo
6 | # via the git-review gofmt checks.
7 | #
8 | # See golang.org/issue/9281
9 |
10 | * -text
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/.gitignore:
--------------------------------------------------------------------------------
1 | # Add no patterns to .hgignore except for files generated by the build.
2 | last-change
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/README.md:
--------------------------------------------------------------------------------
1 | # Go Networking
2 |
3 | This repository holds supplementary Go networking libraries.
4 |
5 | ## Download/Install
6 |
7 | The easiest way to install is to run `go get -u golang.org/x/net`. You can
8 | also manually git clone the repository to `$GOPATH/src/golang.org/x/net`.
9 |
10 | ## Report Issues / Send Patches
11 |
12 | This repository uses Gerrit for code changes. To learn how to submit
13 | changes to this repository, see https://golang.org/doc/contribute.html.
14 | The main issue tracker for the net repository is located at
15 | https://github.com/golang/go/issues. Prefix your issue with "x/net:" in the
16 | subject line, so it is easy to find.
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/bpf/setter.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 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 | package bpf
6 |
7 | // A Setter is a type which can attach a compiled BPF filter to itself.
8 | type Setter interface {
9 | SetBPF(filter []RawInstruction) error
10 | }
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf:
--------------------------------------------------------------------------------
1 | 50,0 0 0 42,1 0 0 42,96 0 0 3,97 0 0 3,48 0 0 42,40 0 0 42,32 0 0 42,80 0 0 42,72 0 0 42,64 0 0 42,177 0 0 42,128 0 0 0,32 0 0 4294963200,32 0 0 4294963204,32 0 0 4294963256,2 0 0 3,3 0 0 3,4 0 0 42,20 0 0 42,36 0 0 42,52 0 0 42,68 0 0 42,84 0 0 42,100 0 0 42,116 0 0 42,148 0 0 42,164 0 0 42,12 0 0 0,28 0 0 0,44 0 0 0,60 0 0 0,76 0 0 0,92 0 0 0,108 0 0 0,124 0 0 0,156 0 0 0,172 0 0 0,132 0 0 0,5 0 0 10,21 8 9 42,21 0 8 42,53 0 7 42,37 0 6 42,37 4 5 42,53 3 4 42,69 2 3 42,7 0 0 0,135 0 0 0,22 0 0 0,6 0 0 0,
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/codereview.cfg:
--------------------------------------------------------------------------------
1 | issuerepo: golang/go
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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,go1.7
6 |
7 | package ctxhttp
8 |
9 | import (
10 | "io"
11 | "net/http"
12 | "net/http/httptest"
13 | "testing"
14 |
15 | "context"
16 | )
17 |
18 | func TestGo17Context(t *testing.T) {
19 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
20 | io.WriteString(w, "ok")
21 | }))
22 | defer ts.Close()
23 | ctx := context.Background()
24 | resp, err := Get(ctx, http.DefaultClient, ts.URL)
25 | if resp == nil || err != nil {
26 | t.Fatalf("error received from client: %v %v", err, resp)
27 | }
28 | resp.Body.Close()
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/context/go19.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 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 go1.9
6 |
7 | package context
8 |
9 | import "context" // standard library's context, as of Go 1.7
10 |
11 | // A Context carries a deadline, a cancelation signal, and other values across
12 | // API boundaries.
13 | //
14 | // Context's methods may be called by multiple goroutines simultaneously.
15 | type Context = context.Context
16 |
17 | // A CancelFunc tells an operation to abandon its work.
18 | // A CancelFunc does not wait for the work to stop.
19 | // After the first call, subsequent calls to a CancelFunc do nothing.
20 | type CancelFunc = context.CancelFunc
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/context/withtimeout_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 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 | package context_test
6 |
7 | import (
8 | "fmt"
9 | "time"
10 |
11 | "golang.org/x/net/context"
12 | )
13 |
14 | // This example passes a context with a timeout to tell a blocking function that
15 | // it should abandon its work after the timeout elapses.
16 | func ExampleWithTimeout() {
17 | // Pass a context with a timeout to tell a blocking function that it
18 | // should abandon its work after the timeout elapses.
19 | ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
20 | defer cancel()
21 |
22 | select {
23 | case <-time.After(1 * time.Second):
24 | fmt.Println("overslept")
25 | case <-ctx.Done():
26 | fmt.Println(ctx.Err()) // prints "context deadline exceeded"
27 | }
28 |
29 | // Output:
30 | // context deadline exceeded
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/charset/testdata/README:
--------------------------------------------------------------------------------
1 | These test cases come from
2 | http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics
3 |
4 | Distributed under both the W3C Test Suite License
5 | (http://www.w3.org/Consortium/Legal/2008/04-testsuite-license)
6 | and the W3C 3-clause BSD License
7 | (http://www.w3.org/Consortium/Legal/2008/03-bsd-license).
8 | To contribute to a W3C Test Suite, see the policies and contribution
9 | forms (http://www.w3.org/2004/10/27-testcases).
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fardog/secureoperator/6ee86f0eed1eced2ff942249ec28c3dc47eaa4a5/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fardog/secureoperator/6ee86f0eed1eced2ff942249ec28c3dc47eaa4a5/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/example_test.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 | // This example demonstrates parsing HTML data and walking the resulting tree.
6 | package html_test
7 |
8 | import (
9 | "fmt"
10 | "log"
11 | "strings"
12 |
13 | "golang.org/x/net/html"
14 | )
15 |
16 | func ExampleParse() {
17 | s := `Links:
`
18 | doc, err := html.Parse(strings.NewReader(s))
19 | if err != nil {
20 | log.Fatal(err)
21 | }
22 | var f func(*html.Node)
23 | f = func(n *html.Node) {
24 | if n.Type == html.ElementNode && n.Data == "a" {
25 | for _, a := range n.Attr {
26 | if a.Key == "href" {
27 | fmt.Println(a.Val)
28 | break
29 | }
30 | }
31 | }
32 | for c := n.FirstChild; c != nil; c = c.NextSibling {
33 | f(c)
34 | }
35 | }
36 | f(doc)
37 | // Output:
38 | // foo
39 | // /bar/baz
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat:
--------------------------------------------------------------------------------
1 | #data
2 | 1234
3 | #errors
4 | #document
5 | |
6 | |
7 | |
8 | |
9 | | "1"
10 | |
11 | | "2"
12 | |
13 | |
14 | |
15 | | "3"
16 | | "4"
17 |
18 | #data
19 |