From 331f9ea96cfe1fbcc11446e6311d3b38ed1ea6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Thu, 9 Aug 2018 15:07:53 +0200 Subject: [PATCH] check hosts in ssl certificates --- .gitignore | 1 + go.mod | 39 +- go.sum | 42 + secrets.go | 27 + .../cavaliercoder/go-cpio/example_test.go | 77 - .../cavaliercoder/go-cpio/svr4_test.go | 121 - .../cavaliercoder/go-cpio/testdata/Makefile | 26 - .../go-cpio/testdata/checklist.txt | 1 - .../cavaliercoder/go-cpio/testdata/etc/hosts | 2 - .../go-cpio/testdata/gophers.txt | 4 - .../cavaliercoder/go-cpio/testdata/readme.txt | 1 - .../go-cpio/testdata/test_odc.cpio | Bin 1024 -> 0 bytes .../go-cpio/testdata/test_svr4.cpio | Bin 1024 -> 0 bytes .../go-cpio/testdata/test_svr4_crc.cpio | Bin 1024 -> 0 bytes .../cavaliercoder/go-cpio/testdata/todo.txt | 1 - .../cavaliercoder/go-cpio/writer_test.go | 53 - vendor/github.com/cloudflare/cfssl/LICENSE | 24 + .../cloudflare/cfssl/auth/auth_test.go | 159 - .../cfssl/auth/testdata/authrequest.json | 1 - .../cfssl/auth/testdata/request.json | 30 - .../cloudflare/cfssl/config/config_test.go | 537 -- .../cfssl/config/testdata/invalid_auth.json | 27 - .../config/testdata/invalid_auth_bad_key.json | 27 - .../cfssl/config/testdata/invalid_config.json | 17 - .../config/testdata/invalid_default.json | 18 - .../config/testdata/invalid_no_auth_keys.json | 23 - .../config/testdata/invalid_no_remotes.json | 24 - .../config/testdata/invalid_profile.json | 18 - .../config/testdata/invalid_remotes.json | 27 - .../cfssl/config/testdata/invalid_usage.json | 18 - .../cfssl/config/testdata/valid_config.json | 24 - .../config/testdata/valid_config_auth.json | 29 - .../valid_config_auth_no_default.json | 19 - .../testdata/valid_config_no_default.json | 14 - .../cloudflare/cfssl/csr/csr_test.go | 744 --- .../cfssl/csr/testdata/test-ecdsa-ca.pem | 15 - .../cloudflare/cfssl/errors/error_test.go | 338 -- .../cloudflare/cfssl/helpers/helpers_test.go | 629 -- .../cfssl/helpers/testdata/bundle.pem | 53 - .../cfssl/helpers/testdata/bundle_pkcs7.pem | 52 - .../testdata/bundle_with_whitespace.pem | 56 - .../cloudflare/cfssl/helpers/testdata/ca.pem | 27 - .../cfssl/helpers/testdata/ca_key.pem | 28 - .../cfssl/helpers/testdata/cert.der | Bin 496 -> 0 bytes .../cfssl/helpers/testdata/cert.pem | 13 - .../cfssl/helpers/testdata/cert_pkcs7.pem | 14 - .../helpers/testdata/cert_with_whitespace.pem | 15 - .../cfssl/helpers/testdata/ecdsa256.csr | 11 - .../cfssl/helpers/testdata/empty.pem | 1 - .../cfssl/helpers/testdata/empty_pkcs7.der | Bin 41 -> 0 bytes .../cfssl/helpers/testdata/empty_pkcs7.pem | 3 - .../cfssl/helpers/testdata/emptycert.pem | 2 - .../helpers/testdata/emptypasswordpkcs12.p12 | Bin 2557 -> 0 bytes .../cfssl/helpers/testdata/enc_priv_key.pem | 30 - .../helpers/testdata/messed_up_bundle.pem | 48 - .../helpers/testdata/messed_up_priv_key.pem | 20 - .../cfssl/helpers/testdata/messedupcert.pem | 11 - .../cfssl/helpers/testdata/multiplecerts.p12 | Bin 3101 -> 0 bytes .../cfssl/helpers/testdata/noheadercert.pem | 9 - .../cfssl/helpers/testdata/passwordpkcs12.p12 | Bin 2557 -> 0 bytes .../cfssl/helpers/testdata/priv_rsa_key.pem | 28 - .../helpers/testdata/private_ecdsa_key.pem | 5 - .../cfssl/helpers/testdata/rsa-old.csr | 19 - .../cfssl/helpers/testdata/secp256k1-key.pem | 5 - .../cfssl/helpers/testdata/test.bad.csr.pem | 15 - .../cfssl/helpers/testdata/test.csr.pem | 18 - .../cloudflare/cfssl/initca/initca_test.go | 385 -- .../cfssl/initca/testdata/5min-ecdsa-key.pem | 5 - .../cfssl/initca/testdata/5min-ecdsa.pem | 15 - .../cfssl/initca/testdata/5min-rsa-key.pem | 27 - .../cfssl/initca/testdata/5min-rsa.pem | 23 - .../cfssl/initca/testdata/README.md | 11 - .../cfssl/initca/testdata/ca_csr_ecdsa.json | 18 - .../cfssl/initca/testdata/ca_csr_rsa.json | 18 - .../cfssl/initca/testdata/ecdsa256.csr | 11 - .../cfssl/initca/testdata/ecdsa384.csr | 12 - .../cfssl/initca/testdata/ecdsa521.csr | 13 - .../cfssl/initca/testdata/rsa2048.csr | 19 - .../cfssl/initca/testdata/rsa3072.csr | 24 - .../cfssl/initca/testdata/rsa4096.csr | 29 - .../cloudflare/cfssl/log/log_test.go | 186 - .../cloudflare/cfssl/ocsp/testdata/ca-key.pem | 27 - .../cloudflare/cfssl/ocsp/testdata/ca.pem | 23 - .../cloudflare/cfssl/ocsp/testdata/cert.pem | 23 - .../cfssl/ocsp/testdata/db-config.json | 1 - .../cloudflare/cfssl/ocsp/testdata/resp64.pem | 2 - .../cfssl/ocsp/testdata/response.der | Bin 540 -> 0 bytes .../cfssl/ocsp/testdata/response_broken.pem | 1 - .../cfssl/ocsp/testdata/response_mix.pem | Bin 1260 -> 0 bytes .../cloudflare/cfssl/ocsp/testdata/server.crt | 13 - .../cloudflare/cfssl/ocsp/testdata/server.key | 15 - .../cfssl/ocsp/testdata/server_broken.crt | 9 - .../cfssl/ocsp/testdata/server_broken.key | 8 - .../cfssl/ocsp/testdata/sqlite_ca.pem | 22 - .../cfssl/ocsp/testdata/sqlite_test.db | Bin 28672 -> 0 bytes .../cfssl/signer/local/local_test.go | 1423 ----- .../testdata/build_inter_pathlen_csrs.sh | 3 - .../cfssl/signer/local/testdata/ca.pem | 27 - .../cfssl/signer/local/testdata/ca_key.pem | 28 - .../signer/local/testdata/ecdsa256-inter.csr | 10 - .../signer/local/testdata/ecdsa256-inter.key | 5 - .../cfssl/signer/local/testdata/ecdsa256.csr | 11 - .../signer/local/testdata/ecdsa256_ca.pem | 20 - .../signer/local/testdata/ecdsa256_ca_key.pem | 5 - .../cfssl/signer/local/testdata/ecdsa384.csr | 12 - .../cfssl/signer/local/testdata/ecdsa521.csr | 13 - .../cfssl/signer/local/testdata/ex.csr | 11 - .../signer/local/testdata/inter_pathlen_0.csr | 8 - .../signer/local/testdata/inter_pathlen_1.csr | 8 - .../testdata/inter_pathlen_unspecified.csr | 8 - .../cfssl/signer/local/testdata/ip.csr | 11 - .../cfssl/signer/local/testdata/key.pem | 15 - .../cfssl/signer/local/testdata/rsa-old.csr | 19 - .../signer/local/testdata/rsa2048-inter.csr | 19 - .../signer/local/testdata/rsa2048-inter.key | 27 - .../cfssl/signer/local/testdata/rsa2048.csr | 19 - .../cfssl/signer/local/testdata/rsa3072.csr | 24 - .../cfssl/signer/local/testdata/rsa4096.csr | 29 - .../signer/local/testdata/san_domain.csr | 19 - .../cfssl/signer/local/testdata/test.csr | 18 - .../cloudflare/cfssl/signer/signer_test.go | 150 - .../cloudflare/cfssl/testdata/csr.json | 19 - .../cloudflare/cfssl/testdata/garbage.crt | 13 - .../cloudflare/cfssl/testdata/garbage.key | 15 - .../cloudflare/cfssl/testdata/gd_bundle.crt | 76 - .../cfssl/testdata/good_config.json | 17 - .../cfssl/testdata/roots/httplib2_cacerts.txt | 738 --- .../cloudflare/cfssl/testdata/server.crt | 13 - .../cloudflare/cfssl/testdata/server.csr | 11 - .../cloudflare/cfssl/testdata/server.key | 15 - .../cloudflare/cfssl/testdata/ssl-verifier.sh | 47 - .../cloudflare/cfssl/testdata/temp.crt | 19 - .../cloudflare/cfssl/testdata/test.py | 12 - vendor/github.com/golang/protobuf/AUTHORS | 3 + .../github.com/golang/protobuf/CONTRIBUTORS | 3 + vendor/github.com/golang/protobuf/LICENSE | 31 + .../golang/protobuf/proto/all_test.go | 2410 -------- .../golang/protobuf/proto/any_test.go | 300 - .../golang/protobuf/proto/clone_test.go | 390 -- .../golang/protobuf/proto/decode_test.go | 255 - .../golang/protobuf/proto/discard_test.go | 170 - .../golang/protobuf/proto/encode_test.go | 85 - .../golang/protobuf/proto/equal_test.go | 244 - .../golang/protobuf/proto/extensions_test.go | 688 --- .../golang/protobuf/proto/map_test.go | 70 - .../golang/protobuf/proto/message_set_test.go | 77 - .../protobuf/proto/proto3_proto/proto3.pb.go | 461 -- .../protobuf/proto/proto3_proto/proto3.proto | 89 - .../golang/protobuf/proto/proto3_test.go | 151 - .../golang/protobuf/proto/size2_test.go | 63 - .../golang/protobuf/proto/size_test.go | 191 - .../protobuf/proto/test_proto/test.pb.go | 5118 ----------------- .../protobuf/proto/test_proto/test.proto | 562 -- .../golang/protobuf/proto/text_parser_test.go | 706 --- .../golang/protobuf/proto/text_test.go | 518 -- .../protoc-gen-go/descriptor/descriptor.pb.go | 2812 --------- .../protoc-gen-go/descriptor/descriptor.proto | 872 --- .../testdata/deprecated/deprecated.pb.go | 232 - .../testdata/deprecated/deprecated.proto | 69 - .../extension_base/extension_base.pb.go | 139 - .../extension_base/extension_base.proto | 48 - .../extension_extra/extension_extra.pb.go | 78 - .../extension_extra/extension_extra.proto | 40 - .../protoc-gen-go/testdata/extension_test.go | 206 - .../extension_user/extension_user.pb.go | 401 -- .../extension_user/extension_user.proto | 102 - .../protoc-gen-go/testdata/grpc/grpc.pb.go | 444 -- .../protoc-gen-go/testdata/grpc/grpc.proto | 61 - .../testdata/import_public/a.pb.go | 110 - .../testdata/import_public/a.proto | 45 - .../testdata/import_public/b.pb.go | 87 - .../testdata/import_public/b.proto | 43 - .../testdata/import_public/sub/a.pb.go | 100 - .../testdata/import_public/sub/a.proto | 47 - .../testdata/import_public/sub/b.pb.go | 67 - .../testdata/import_public/sub/b.proto | 39 - .../testdata/import_public_test.go | 66 - .../testdata/imports/fmt/m.pb.go | 66 - .../testdata/imports/fmt/m.proto | 35 - .../testdata/imports/test_a_1/m1.pb.go | 130 - .../testdata/imports/test_a_1/m1.proto | 44 - .../testdata/imports/test_a_1/m2.pb.go | 67 - .../testdata/imports/test_a_1/m2.proto | 35 - .../testdata/imports/test_a_2/m3.pb.go | 67 - .../testdata/imports/test_a_2/m3.proto | 35 - .../testdata/imports/test_a_2/m4.pb.go | 67 - .../testdata/imports/test_a_2/m4.proto | 35 - .../testdata/imports/test_b_1/m1.pb.go | 67 - .../testdata/imports/test_b_1/m1.proto | 35 - .../testdata/imports/test_b_1/m2.pb.go | 67 - .../testdata/imports/test_b_1/m2.proto | 35 - .../testdata/imports/test_import_a1m1.pb.go | 80 - .../testdata/imports/test_import_a1m1.proto | 42 - .../testdata/imports/test_import_a1m2.pb.go | 80 - .../testdata/imports/test_import_a1m2.proto | 42 - .../testdata/imports/test_import_all.pb.go | 138 - .../testdata/imports/test_import_all.proto | 58 - .../protoc-gen-go/testdata/main_test.go | 48 - .../protoc-gen-go/testdata/multi/multi1.pb.go | 96 - .../protoc-gen-go/testdata/multi/multi1.proto | 46 - .../protoc-gen-go/testdata/multi/multi2.pb.go | 128 - .../protoc-gen-go/testdata/multi/multi2.proto | 48 - .../protoc-gen-go/testdata/multi/multi3.pb.go | 115 - .../protoc-gen-go/testdata/multi/multi3.proto | 45 - .../protoc-gen-go/testdata/my_test/test.pb.go | 1174 ---- .../protoc-gen-go/testdata/my_test/test.proto | 158 - .../testdata/proto3/proto3.pb.go | 196 - .../testdata/proto3/proto3.proto | 55 - .../golang/protobuf/ptypes/any_test.go | 113 - .../golang/protobuf/ptypes/duration_test.go | 121 - .../golang/protobuf/ptypes/timestamp_test.go | 153 - .../asn1/asn1_test.go | 1173 ---- .../asn1/marshal_test.go | 263 - .../client/logclient_test.go | 789 --- .../client/multilog_test.go | 482 -- .../gossip/minimal/testdata/Makefile | 37 - .../minimal/testdata/dup-source-name.cfg | 32 - .../gossip/minimal/testdata/goshawk.cfg | 17 - .../minimal/testdata/gossiper.privkey.pem | 8 - .../minimal/testdata/hawk-dup-source-name.cfg | 27 - .../minimal/testdata/hawk-no-dest-name.cfg | 13 - .../minimal/testdata/hawk-no-source-log.cfg | 7 - .../minimal/testdata/hawk-no-source-name.cfg | 13 - .../minimal/testdata/invalid-private-key.cfg | 19 - .../minimal/testdata/invalid-root-cert.cfg | 19 - .../testdata/invalid-source-duration.cfg | 20 - .../testdata/invalid-source-pubkey.cfg | 22 - .../gossip/minimal/testdata/no-dest-log.cfg | 15 - .../gossip/minimal/testdata/no-dest-name.cfg | 18 - .../minimal/testdata/no-private-key.cfg | 15 - .../gossip/minimal/testdata/no-root-cert.cfg | 18 - .../gossip/minimal/testdata/no-source-log.cfg | 12 - .../minimal/testdata/no-source-name.cfg | 18 - .../gossip/minimal/testdata/root-ca.cert | 15 - .../gossip/minimal/testdata/root-ca.cfg | 28 - .../gossip/minimal/testdata/test.cfg | 22 - .../testdata/wrong-password-private-key.cfg | 19 - .../gossip/minimal/x509ext/x509ext.go | 91 - .../gossip/minimal/x509ext/x509ext_test.go | 150 - .../jsonclient/backoff_test.go | 117 - .../jsonclient/client_test.go | 446 -- .../serialization_test.go | 513 -- .../signatures_test.go | 493 -- .../testdata/argon.cfg | 30 - .../testdata/certs.go | 409 -- .../testdata/gossip-root.cert | 15 - .../testdata/gossiper.privkey.pem | 8 - .../testdata/keys.go | 221 - .../testdata/test-cert.pem | 60 - .../testdata/test-cert.proof | Bin 118 -> 0 bytes .../tls/hash_test.go | 65 - .../tls/signature_test.go | 160 - .../tls/tls_test.go | 355 -- .../tls/types_test.go | 100 - .../certificate-transparency-go/types_test.go | 131 - .../x509/error_test.go | 192 - .../x509/errors_test.go | 13 - .../x509/example_test.go | 135 - .../x509/name_constraints_test.go | 2126 ------- .../x509/names_test.go | 267 - .../x509/pem_decrypt_test.go | 247 - .../x509/pkcs8_test.go | 109 - .../x509/revoked_test.go | 2123 ------- .../x509/root_darwin_test.go | 80 - .../x509/root_unix_test.go | 127 - .../x509/sec1_test.go | 44 - .../x509/sha2_windows_test.go | 19 - .../x509/testdata/test-dir.crt | 31 - .../x509/verify_test.go | 1793 ------ .../x509/x509_test.go | 2429 -------- .../x509util/files.go | 115 - .../x509util/fuzz.go | 26 - .../x509util/revoked.go | 169 - .../x509util/x509util.go | 773 --- vendor/github.com/kr/pretty/.gitignore | 4 - vendor/github.com/kr/pretty/License | 21 - vendor/github.com/kr/pretty/Readme | 9 - vendor/github.com/kr/pretty/diff.go | 265 - vendor/github.com/kr/pretty/diff_test.go | 213 - vendor/github.com/kr/pretty/example_test.go | 20 - vendor/github.com/kr/pretty/formatter.go | 328 -- vendor/github.com/kr/pretty/formatter_test.go | 288 - vendor/github.com/kr/pretty/go.mod | 3 - vendor/github.com/kr/pretty/pretty.go | 108 - vendor/github.com/kr/pretty/zero.go | 41 - vendor/github.com/kr/text/License | 19 - vendor/github.com/kr/text/Readme | 3 - vendor/github.com/kr/text/doc.go | 3 - vendor/github.com/kr/text/go.mod | 3 - vendor/github.com/kr/text/indent.go | 74 - vendor/github.com/kr/text/indent_test.go | 119 - vendor/github.com/kr/text/wrap.go | 86 - vendor/github.com/kr/text/wrap_test.go | 62 - vendor/golang.org/x/crypto/AUTHORS | 3 + vendor/golang.org/x/crypto/CONTRIBUTORS | 3 + vendor/golang.org/x/crypto/LICENSE | 27 + vendor/golang.org/x/crypto/PATENTS | 22 + .../x/crypto/cryptobyte/asn1_test.go | 333 -- .../x/crypto/cryptobyte/cryptobyte_test.go | 428 -- .../x/crypto/cryptobyte/example_test.go | 154 - vendor/golang.org/x/crypto/ocsp/ocsp_test.go | 875 --- .../x/crypto/pkcs12/bmp-string_test.go | 63 - .../golang.org/x/crypto/pkcs12/crypto_test.go | 125 - .../crypto/pkcs12/internal/rc2/bench_test.go | 27 - .../x/crypto/pkcs12/internal/rc2/rc2_test.go | 92 - vendor/golang.org/x/crypto/pkcs12/mac_test.go | 42 - .../golang.org/x/crypto/pkcs12/pbkdf_test.go | 34 - .../golang.org/x/crypto/pkcs12/pkcs12_test.go | 138 - vendor/golang.org/x/net/AUTHORS | 3 + vendor/golang.org/x/net/CONTRIBUTORS | 3 + vendor/golang.org/x/net/LICENSE | 27 + vendor/golang.org/x/net/PATENTS | 22 + .../golang.org/x/net/context/context_test.go | 583 -- .../x/net/context/ctxhttp/ctxhttp_17_test.go | 29 - .../net/context/ctxhttp/ctxhttp_pre17_test.go | 79 - .../x/net/context/ctxhttp/ctxhttp_test.go | 105 - .../x/net/context/withtimeout_test.go | 31 - vendor/golang.org/x/sync/errgroup/errgroup.go | 67 - .../errgroup/errgroup_example_md5all_test.go | 101 - .../x/sync/errgroup/errgroup_test.go | 176 - vendor/gopkg.in/check.v1/.gitignore | 4 - vendor/gopkg.in/check.v1/.travis.yml | 3 - vendor/gopkg.in/check.v1/LICENSE | 25 - vendor/gopkg.in/check.v1/README.md | 20 - vendor/gopkg.in/check.v1/TODO | 2 - vendor/gopkg.in/check.v1/benchmark.go | 187 - vendor/gopkg.in/check.v1/benchmark_test.go | 91 - vendor/gopkg.in/check.v1/bootstrap_test.go | 82 - vendor/gopkg.in/check.v1/check.go | 882 --- vendor/gopkg.in/check.v1/check_test.go | 207 - vendor/gopkg.in/check.v1/checkers.go | 524 -- vendor/gopkg.in/check.v1/checkers_test.go | 287 - vendor/gopkg.in/check.v1/export_test.go | 19 - vendor/gopkg.in/check.v1/fixture_test.go | 484 -- vendor/gopkg.in/check.v1/foundation_test.go | 335 -- vendor/gopkg.in/check.v1/helpers.go | 231 - vendor/gopkg.in/check.v1/helpers_test.go | 519 -- vendor/gopkg.in/check.v1/integration_test.go | 94 - vendor/gopkg.in/check.v1/printer.go | 168 - vendor/gopkg.in/check.v1/printer_test.go | 104 - vendor/gopkg.in/check.v1/reporter.go | 88 - vendor/gopkg.in/check.v1/reporter_test.go | 159 - vendor/gopkg.in/check.v1/run.go | 175 - vendor/gopkg.in/check.v1/run_test.go | 419 -- vendor/gopkg.in/yaml.v2/decode_test.go | 1326 ----- vendor/gopkg.in/yaml.v2/encode_test.go | 595 -- .../gopkg.in/yaml.v2/example_embedded_test.go | 41 - vendor/gopkg.in/yaml.v2/suite_test.go | 12 - vendor/k8s.io/apimachinery/LICENSE | 202 + .../apimachinery/pkg/util/errors/doc.go | 18 + .../apimachinery/pkg/util/errors/errors.go | 201 + .../k8s.io/apimachinery/pkg/util/sets/byte.go | 203 + .../k8s.io/apimachinery/pkg/util/sets/doc.go | 20 + .../apimachinery/pkg/util/sets/empty.go | 23 + .../k8s.io/apimachinery/pkg/util/sets/int.go | 203 + .../apimachinery/pkg/util/sets/int64.go | 203 + .../apimachinery/pkg/util/sets/string.go | 203 + .../pkg/util/validation/field/errors.go | 259 + .../pkg/util/validation/field/path.go | 91 + .../pkg/util/validation/validation.go | 391 ++ vendor/{vgo.list => modules.txt} | 47 +- vendor/novit.nc/direktil/pkg/LICENSE | 201 + 362 files changed, 2499 insertions(+), 59344 deletions(-) create mode 100644 .gitignore create mode 100644 go.sum delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/example_test.go delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/svr4_test.go delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/Makefile delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/checklist.txt delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/etc/hosts delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/gophers.txt delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/readme.txt delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/test_odc.cpio delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/test_svr4.cpio delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/test_svr4_crc.cpio delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/testdata/todo.txt delete mode 100644 vendor/github.com/cavaliercoder/go-cpio/writer_test.go create mode 100644 vendor/github.com/cloudflare/cfssl/LICENSE delete mode 100644 vendor/github.com/cloudflare/cfssl/auth/auth_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/auth/testdata/authrequest.json delete mode 100644 vendor/github.com/cloudflare/cfssl/auth/testdata/request.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/config_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth_bad_key.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_config.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_default.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_auth_keys.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_remotes.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_profile.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_remotes.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/invalid_usage.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/valid_config.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth_no_default.json delete mode 100644 vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_no_default.json delete mode 100644 vendor/github.com/cloudflare/cfssl/csr/csr_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/csr/testdata/test-ecdsa-ca.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/errors/error_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/helpers_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_pkcs7.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_with_whitespace.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/ca.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/ca_key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/cert.der delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/cert.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_pkcs7.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_with_whitespace.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/ecdsa256.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/empty.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/empty_pkcs7.der delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/empty_pkcs7.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/emptycert.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/emptypasswordpkcs12.p12 delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/enc_priv_key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_bundle.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_priv_key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/messedupcert.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/multiplecerts.p12 delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/noheadercert.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/passwordpkcs12.p12 delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/priv_rsa_key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/private_ecdsa_key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/rsa-old.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/secp256k1-key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/test.bad.csr.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/helpers/testdata/test.csr.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/initca_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa-key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa-key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/README.md delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_ecdsa.json delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_rsa.json delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa256.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa384.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa521.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/rsa2048.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/rsa3072.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/initca/testdata/rsa4096.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/log/log_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca-key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/cert.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/db-config.json delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/resp64.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/response.der delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/response_broken.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/response_mix.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.crt delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.key delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.crt delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.key delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/sqlite_ca.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/ocsp/testdata/sqlite_test.db delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/local_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/build_inter_pathlen_csrs.sh delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca_key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.key delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca_key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa384.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa521.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ex.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_0.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_1.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_unspecified.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/ip.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/key.pem delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa-old.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.key delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa3072.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa4096.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/san_domain.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/local/testdata/test.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/signer/signer_test.go delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/csr.json delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/garbage.crt delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/garbage.key delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/gd_bundle.crt delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/good_config.json delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/roots/httplib2_cacerts.txt delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/server.crt delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/server.csr delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/server.key delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/ssl-verifier.sh delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/temp.crt delete mode 100644 vendor/github.com/cloudflare/cfssl/testdata/test.py create mode 100644 vendor/github.com/golang/protobuf/AUTHORS create mode 100644 vendor/github.com/golang/protobuf/CONTRIBUTORS create mode 100644 vendor/github.com/golang/protobuf/LICENSE delete mode 100644 vendor/github.com/golang/protobuf/proto/all_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/any_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/clone_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/decode_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/discard_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/encode_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/equal_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/extensions_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/map_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/message_set_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go delete mode 100644 vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto delete mode 100644 vendor/github.com/golang/protobuf/proto/proto3_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/size2_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/size_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/test_proto/test.pb.go delete mode 100644 vendor/github.com/golang/protobuf/proto/test_proto/test.proto delete mode 100644 vendor/github.com/golang/protobuf/proto/text_parser_test.go delete mode 100644 vendor/github.com/golang/protobuf/proto/text_test.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public_test.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.proto delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any_test.go delete mode 100644 vendor/github.com/golang/protobuf/ptypes/duration_test.go delete mode 100644 vendor/github.com/golang/protobuf/ptypes/timestamp_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/asn1/asn1_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/asn1/marshal_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/client/logclient_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/client/multilog_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/Makefile delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/dup-source-name.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/goshawk.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/gossiper.privkey.pem delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-dup-source-name.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-dest-name.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-log.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-name.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-private-key.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-root-cert.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-duration.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-pubkey.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-log.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-name.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-private-key.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-root-cert.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-log.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-name.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cert delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/test.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/wrong-password-private-key.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/jsonclient/backoff_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/jsonclient/client_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/serialization_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/signatures_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/testdata/argon.cfg delete mode 100644 vendor/github.com/google/certificate-transparency-go/testdata/certs.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/testdata/gossip-root.cert delete mode 100644 vendor/github.com/google/certificate-transparency-go/testdata/gossiper.privkey.pem delete mode 100644 vendor/github.com/google/certificate-transparency-go/testdata/keys.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/testdata/test-cert.pem delete mode 100644 vendor/github.com/google/certificate-transparency-go/testdata/test-cert.proof delete mode 100644 vendor/github.com/google/certificate-transparency-go/tls/hash_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/tls/signature_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/tls/tls_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/tls/types_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/types_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/error_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/errors_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/example_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/name_constraints_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/names_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/pem_decrypt_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/pkcs8_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/revoked_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/root_darwin_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/root_unix_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/sec1_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/sha2_windows_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/testdata/test-dir.crt delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/verify_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509/x509_test.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509util/files.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509util/fuzz.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509util/revoked.go delete mode 100644 vendor/github.com/google/certificate-transparency-go/x509util/x509util.go delete mode 100644 vendor/github.com/kr/pretty/.gitignore delete mode 100644 vendor/github.com/kr/pretty/License delete mode 100644 vendor/github.com/kr/pretty/Readme delete mode 100644 vendor/github.com/kr/pretty/diff.go delete mode 100644 vendor/github.com/kr/pretty/diff_test.go delete mode 100644 vendor/github.com/kr/pretty/example_test.go delete mode 100644 vendor/github.com/kr/pretty/formatter.go delete mode 100644 vendor/github.com/kr/pretty/formatter_test.go delete mode 100644 vendor/github.com/kr/pretty/go.mod delete mode 100644 vendor/github.com/kr/pretty/pretty.go delete mode 100644 vendor/github.com/kr/pretty/zero.go delete mode 100644 vendor/github.com/kr/text/License delete mode 100644 vendor/github.com/kr/text/Readme delete mode 100644 vendor/github.com/kr/text/doc.go delete mode 100644 vendor/github.com/kr/text/go.mod delete mode 100644 vendor/github.com/kr/text/indent.go delete mode 100644 vendor/github.com/kr/text/indent_test.go delete mode 100644 vendor/github.com/kr/text/wrap.go delete mode 100644 vendor/github.com/kr/text/wrap_test.go create mode 100644 vendor/golang.org/x/crypto/AUTHORS create mode 100644 vendor/golang.org/x/crypto/CONTRIBUTORS create mode 100644 vendor/golang.org/x/crypto/LICENSE create mode 100644 vendor/golang.org/x/crypto/PATENTS delete mode 100644 vendor/golang.org/x/crypto/cryptobyte/asn1_test.go delete mode 100644 vendor/golang.org/x/crypto/cryptobyte/cryptobyte_test.go delete mode 100644 vendor/golang.org/x/crypto/cryptobyte/example_test.go delete mode 100644 vendor/golang.org/x/crypto/ocsp/ocsp_test.go delete mode 100644 vendor/golang.org/x/crypto/pkcs12/bmp-string_test.go delete mode 100644 vendor/golang.org/x/crypto/pkcs12/crypto_test.go delete mode 100644 vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go delete mode 100644 vendor/golang.org/x/crypto/pkcs12/internal/rc2/rc2_test.go delete mode 100644 vendor/golang.org/x/crypto/pkcs12/mac_test.go delete mode 100644 vendor/golang.org/x/crypto/pkcs12/pbkdf_test.go delete mode 100644 vendor/golang.org/x/crypto/pkcs12/pkcs12_test.go create mode 100644 vendor/golang.org/x/net/AUTHORS create mode 100644 vendor/golang.org/x/net/CONTRIBUTORS create mode 100644 vendor/golang.org/x/net/LICENSE create mode 100644 vendor/golang.org/x/net/PATENTS delete mode 100644 vendor/golang.org/x/net/context/context_test.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17_test.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go delete mode 100644 vendor/golang.org/x/net/context/withtimeout_test.go delete mode 100644 vendor/golang.org/x/sync/errgroup/errgroup.go delete mode 100644 vendor/golang.org/x/sync/errgroup/errgroup_example_md5all_test.go delete mode 100644 vendor/golang.org/x/sync/errgroup/errgroup_test.go delete mode 100644 vendor/gopkg.in/check.v1/.gitignore delete mode 100644 vendor/gopkg.in/check.v1/.travis.yml delete mode 100644 vendor/gopkg.in/check.v1/LICENSE delete mode 100644 vendor/gopkg.in/check.v1/README.md delete mode 100644 vendor/gopkg.in/check.v1/TODO delete mode 100644 vendor/gopkg.in/check.v1/benchmark.go delete mode 100644 vendor/gopkg.in/check.v1/benchmark_test.go delete mode 100644 vendor/gopkg.in/check.v1/bootstrap_test.go delete mode 100644 vendor/gopkg.in/check.v1/check.go delete mode 100644 vendor/gopkg.in/check.v1/check_test.go delete mode 100644 vendor/gopkg.in/check.v1/checkers.go delete mode 100644 vendor/gopkg.in/check.v1/checkers_test.go delete mode 100644 vendor/gopkg.in/check.v1/export_test.go delete mode 100644 vendor/gopkg.in/check.v1/fixture_test.go delete mode 100644 vendor/gopkg.in/check.v1/foundation_test.go delete mode 100644 vendor/gopkg.in/check.v1/helpers.go delete mode 100644 vendor/gopkg.in/check.v1/helpers_test.go delete mode 100644 vendor/gopkg.in/check.v1/integration_test.go delete mode 100644 vendor/gopkg.in/check.v1/printer.go delete mode 100644 vendor/gopkg.in/check.v1/printer_test.go delete mode 100644 vendor/gopkg.in/check.v1/reporter.go delete mode 100644 vendor/gopkg.in/check.v1/reporter_test.go delete mode 100644 vendor/gopkg.in/check.v1/run.go delete mode 100644 vendor/gopkg.in/check.v1/run_test.go delete mode 100644 vendor/gopkg.in/yaml.v2/decode_test.go delete mode 100644 vendor/gopkg.in/yaml.v2/encode_test.go delete mode 100644 vendor/gopkg.in/yaml.v2/example_embedded_test.go delete mode 100644 vendor/gopkg.in/yaml.v2/suite_test.go create mode 100644 vendor/k8s.io/apimachinery/LICENSE create mode 100644 vendor/k8s.io/apimachinery/pkg/util/errors/doc.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/errors/errors.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/byte.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/doc.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/empty.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/int.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/int64.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/string.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/field/path.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/validation.go rename vendor/{vgo.list => modules.txt} (76%) create mode 100644 vendor/novit.nc/direktil/pkg/LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c933b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.sw[po] diff --git a/go.mod b/go.mod index bc93648..7a44e9d 100644 --- a/go.mod +++ b/go.mod @@ -1,25 +1,28 @@ module novit.nc/direktil/local-server require ( - cloud.google.com/go v0.24.0 + cloud.google.com/go v0.24.0 // indirect github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e github.com/cloudflare/cfssl v0.0.0-20180705210102-ff56ab5eb62a - github.com/go-sql-driver/mysql v1.4.0 - github.com/golang/protobuf v1.1.0 - github.com/google/certificate-transparency-go v1.0.20 - github.com/googleapis/gax-go v1.0.0 - github.com/kr/pretty v0.1.0 - github.com/mattn/go-sqlite3 v1.9.0 - golang.org/x/build v0.0.0-20180706045728-5a0b491d3d31 - golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 - golang.org/x/net v0.0.0-20180706051357-32a936f46389 - golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd - golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f - golang.org/x/tools v0.0.0-20180706162124-435878328fa3 - google.golang.org/api v0.0.0-20180706000841-61180b1196c9 - google.golang.org/appengine v1.1.0 - google.golang.org/grpc v1.13.0 - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 - honnef.co/go/tools v0.0.0-20180628101929-85dde8b51d3a + github.com/go-sql-driver/mysql v1.4.0 // indirect + github.com/golang/protobuf v1.1.0 // indirect + github.com/google/certificate-transparency-go v1.0.20 // indirect + github.com/googleapis/gax-go v1.0.0 // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/mattn/go-sqlite3 v1.9.0 // indirect + golang.org/x/build v0.0.0-20180706045728-5a0b491d3d31 // indirect + golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 // indirect + golang.org/x/net v0.0.0-20180706051357-32a936f46389 // indirect + golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd // indirect + golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect + golang.org/x/tools v0.0.0-20180706162124-435878328fa3 // indirect + google.golang.org/api v0.0.0-20180706000841-61180b1196c9 // indirect + google.golang.org/appengine v1.1.0 // indirect + google.golang.org/grpc v1.13.0 // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + gopkg.in/yaml.v2 v2.2.1 + honnef.co/go/tools v0.0.0-20180628101929-85dde8b51d3a // indirect + k8s.io/apimachinery v0.0.0-20180808233214-a7b7e4de06b2 + k8s.io/kubernetes v1.11.2 // indirect novit.nc/direktil/pkg v0.0.0-20180707011528-e82b59c0324d ) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..0dae2c8 --- /dev/null +++ b/go.sum @@ -0,0 +1,42 @@ +cloud.google.com/go v0.24.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e h1:mep9E//vzfjmtYUVBAvRMIW5BKTL88nidNZc8RF2lhA= +github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A= +github.com/cloudflare/cfssl v0.0.0-20180705210102-ff56ab5eb62a h1:wbCZ8e4WG5hcfVKSyaqobgvEe/uZeVvkbUBX1zgr9kw= +github.com/cloudflare/cfssl v0.0.0-20180705210102-ff56ab5eb62a/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/golang/protobuf v1.1.0 h1:0iH4Ffd/meGoXqF2lSAhZHt8X+cPgkfn/cb6Cce5Vpc= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/certificate-transparency-go v1.0.20 h1:azETE79toaBOyp+StoEBy8atzQujL0PyBPEmsEeDCXI= +github.com/google/certificate-transparency-go v1.0.20/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= +github.com/googleapis/gax-go v1.0.0/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/ulikunitz/xz v0.5.4/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +golang.org/x/build v0.0.0-20180706045728-5a0b491d3d31/go.mod h1:xwoxzDSBtVMfGm9EGvIEcwZxBYS/6ALXnEvsP1TooIk= +golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 h1:h7zdf0RiEvWbYBKIx4b+q41xoUVnMmvsGZnIVE5syG8= +golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20180706051357-32a936f46389 h1:U+zCn5sqaq+q4hrnMrz9sgrW1yatwEOUgYkGt3u9ZOU= +golang.org/x/net v0.0.0-20180706051357-32a936f46389/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/tools v0.0.0-20180706162124-435878328fa3/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/api v0.0.0-20180706000841-61180b1196c9/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180628101929-85dde8b51d3a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/apimachinery v0.0.0-20180808233214-a7b7e4de06b2 h1:w/5Dvht2Wf4vRaXFDb4cWInymI8NkaMJtrs8UsJyZLI= +k8s.io/apimachinery v0.0.0-20180808233214-a7b7e4de06b2/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/kubernetes v1.11.2 h1:2/lmzYbN17Mr23mX/p4ODMm/MBWTeu2Q1Bvsw82YC40= +k8s.io/kubernetes v1.11.2/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +novit.nc/direktil/pkg v0.0.0-20180707011528-e82b59c0324d h1:DMk2j7F+mXAQdZD5ouIxWVosY55RmpRevgCWSikRRzU= +novit.nc/direktil/pkg v0.0.0-20180707011528-e82b59c0324d/go.mod h1:rbcL+fuxazzipTdJV8t9MW39YsdaK3pSvvhTdI9SXsc= diff --git a/secrets.go b/secrets.go index c8eb7a4..3a1c5b7 100644 --- a/secrets.go +++ b/secrets.go @@ -5,7 +5,9 @@ import ( "encoding/base32" "encoding/json" "errors" + "fmt" "io/ioutil" + "net" "os" "path/filepath" @@ -15,6 +17,8 @@ import ( "github.com/cloudflare/cfssl/initca" "github.com/cloudflare/cfssl/signer" "github.com/cloudflare/cfssl/signer/local" + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" ) type SecretData struct { @@ -152,6 +156,29 @@ func (sd *SecretData) CA(cluster, name string) (ca *CA, err error) { } func (sd *SecretData) KeyCert(cluster, caName, name, profile, label string, req *csr.CertificateRequest) (kc *KeyCert, err error) { + for idx, host := range req.Hosts { + if ip := net.ParseIP(host); ip != nil { + // valid IP (v4 or v6) + continue + } + + if host == "*" { + continue + } + + //for _, part := range strings.Split(host, ".") { + if errs := validation.IsDNS1123Subdomain(host); len(errs) == 0 { + continue + } + if errs := validation.IsWildcardDNS1123Subdomain(host); len(errs) == 0 { + continue + } + + path := field.NewPath(cluster, name, "hosts").Index(idx) + return nil, fmt.Errorf("%v: %q is not an IP or FQDN", path, host) + //} + } + if req.CA != nil { err = errors.New("no CA section allowed here") return diff --git a/vendor/github.com/cavaliercoder/go-cpio/example_test.go b/vendor/github.com/cavaliercoder/go-cpio/example_test.go deleted file mode 100644 index b7ed518..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/example_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package cpio_test - -import ( - "bytes" - "fmt" - "io" - "log" - "os" - - "github.com/cavaliercoder/go-cpio" -) - -func Example() { - // Create a buffer to write our archive to. - buf := new(bytes.Buffer) - - // Create a new cpio archive. - w := cpio.NewWriter(buf) - - // Add some files to the archive. - var files = []struct { - Name, Body string - }{ - {"readme.txt", "This archive contains some text files."}, - {"gopher.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"}, - {"todo.txt", "Get animal handling license."}, - } - for _, file := range files { - hdr := &cpio.Header{ - Name: file.Name, - Mode: 0600, - Size: int64(len(file.Body)), - } - if err := w.WriteHeader(hdr); err != nil { - log.Fatalln(err) - } - if _, err := w.Write([]byte(file.Body)); err != nil { - log.Fatalln(err) - } - } - // Make sure to check the error on Close. - if err := w.Close(); err != nil { - log.Fatalln(err) - } - - // Open the cpio archive for reading. - b := bytes.NewReader(buf.Bytes()) - r := cpio.NewReader(b) - - // Iterate through the files in the archive. - for { - hdr, err := r.Next() - if err == io.EOF { - // end of cpio archive - break - } - if err != nil { - log.Fatalln(err) - } - fmt.Printf("Contents of %s:\n", hdr.Name) - if _, err := io.Copy(os.Stdout, r); err != nil { - log.Fatalln(err) - } - fmt.Println() - } - - // Output: - // Contents of readme.txt: - // This archive contains some text files. - // Contents of gopher.txt: - // Gopher names: - // George - // Geoffrey - // Gonzo - // Contents of todo.txt: - // Get animal handling license. -} diff --git a/vendor/github.com/cavaliercoder/go-cpio/svr4_test.go b/vendor/github.com/cavaliercoder/go-cpio/svr4_test.go deleted file mode 100644 index 4dafcec..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/svr4_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package cpio - -import ( - "fmt" - "io" - "log" - "os" - "testing" -) - -var files = []struct { - Name, Body string -}{ - {"./gophers.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"}, - {"./readme.txt", "This archive contains some text files."}, - {"./todo.txt", "Get animal handling license."}, -} - -func TestRead(t *testing.T) { - f, err := os.Open("testdata/test_svr4_crc.cpio") - if err != nil { - t.Fatalf("error opening test file: %v", err) - } - defer f.Close() - - r := NewReader(f) - for { - _, err := r.Next() - if err == io.EOF { - return - } - if err != nil { - t.Errorf("error moving to next header: %v", err) - return - } - // TODO: validate header fields - } -} - -func TestSVR4CRC(t *testing.T) { - f, err := os.Open("testdata/test_svr4_crc.cpio") - if err != nil { - t.Fatalf("error opening test file: %v", err) - } - defer f.Close() - - w := NewHash() - r := NewReader(f) - for { - hdr, err := r.Next() - if err != nil { - if err != io.EOF { - t.Errorf("error moving to next header: %v", err) - } - return - } - - if hdr.Mode.IsRegular() { - w.Reset() - _, err = io.CopyN(w, r, hdr.Size) - if err != nil { - t.Fatalf("error writing to checksum hash: %v", err) - } - - sum := Checksum(w.Sum32()) - if sum != hdr.Checksum { - t.Errorf("expected checksum %v, got %v for %v", hdr.Checksum, sum, hdr.Name) - } - } - } -} - -func ExampleNewHash() { - // Open the cpio archive for reading. - f, err := os.Open("testdata/test_svr4_crc.cpio") - if err != nil { - log.Fatal(err) - } - defer f.Close() - r := NewReader(f) - - // create a Hash - h := NewHash() - - // Iterate through the files in the archive. - for { - hdr, err := r.Next() - if err == io.EOF { - // end of cpio archive - return - } - if err != nil { - log.Fatal(err) - } - - // skip symlinks, directories, etc. - if !hdr.Mode.IsRegular() { - continue - } - - // read file into hash - h.Reset() - _, err = io.CopyN(h, r, hdr.Size) - if err != nil { - log.Fatal(err) - } - - // check hash matches header checksum - sum := Checksum(h.Sum32()) - if sum == hdr.Checksum { - fmt.Printf("Checksum OK: %v (%v)\n", hdr.Name, hdr.Checksum) - } else { - fmt.Printf("Checksum FAIL: %v - expected %v, got %v\n", hdr.Name, hdr.Checksum, sum) - } - } - - // Output: - // Checksum OK: gophers.txt (00000C98) - // Checksum OK: readme.txt (00000E3D) - // Checksum OK: todo.txt (00000A52) -} diff --git a/vendor/github.com/cavaliercoder/go-cpio/testdata/Makefile b/vendor/github.com/cavaliercoder/go-cpio/testdata/Makefile deleted file mode 100644 index c8f06ca..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/testdata/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -SOURCES = \ - gophers.txt \ - readme.txt \ - todo.txt \ - checklist.txt - -ARCHIVES = \ - test_odc.cpio \ - test_svr4.cpio \ - test_svr4_crc.cpio - -all: $(ARCHIVES) - -test_odc.cpio: $(SOURCES) - echo $(SOURCES) | tr " " "\n" | cpio -o --owner=0:0 --format=odc > $@ - -test_svr4.cpio: $(SOURCES) - echo $(SOURCES) | tr " " "\n" | cpio -o --owner=0:0 --format=newc > $@ - -test_svr4_crc.cpio: $(SOURCES) - echo $(SOURCES) | tr " " "\n" | cpio -o --owner=0:0 --format=crc > $@ - -clean: - rm -f $(ARCHIVES) version.txt - -.PHONY: all clean diff --git a/vendor/github.com/cavaliercoder/go-cpio/testdata/checklist.txt b/vendor/github.com/cavaliercoder/go-cpio/testdata/checklist.txt deleted file mode 100644 index 072c47b..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/testdata/checklist.txt +++ /dev/null @@ -1 +0,0 @@ -todo.txt \ No newline at end of file diff --git a/vendor/github.com/cavaliercoder/go-cpio/testdata/etc/hosts b/vendor/github.com/cavaliercoder/go-cpio/testdata/etc/hosts deleted file mode 100644 index 77c24a1..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/testdata/etc/hosts +++ /dev/null @@ -1,2 +0,0 @@ -127.0.0.1 localhost -::1 localhost diff --git a/vendor/github.com/cavaliercoder/go-cpio/testdata/gophers.txt b/vendor/github.com/cavaliercoder/go-cpio/testdata/gophers.txt deleted file mode 100644 index f578d5b..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/testdata/gophers.txt +++ /dev/null @@ -1,4 +0,0 @@ -Gopher names: -George -Geoffrey -Gonzo diff --git a/vendor/github.com/cavaliercoder/go-cpio/testdata/readme.txt b/vendor/github.com/cavaliercoder/go-cpio/testdata/readme.txt deleted file mode 100644 index ddd60e9..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/testdata/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This archive contains some text files. diff --git a/vendor/github.com/cavaliercoder/go-cpio/testdata/test_odc.cpio b/vendor/github.com/cavaliercoder/go-cpio/testdata/test_odc.cpio deleted file mode 100644 index f67cbe0102090983a60f78289e860d2be61fc8b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmeH@&1%Ci499!UQ#dbB{29Y;JB%>csq_Vmqr_&3J!~_&J^gH_Bk5q!^Vr`YSwiS1 z2}@jFmf%=W!6?DFqHH=Le3}uW+234x}-y2|H!EY;zQGe4-*tO zjsZTJ-n&oVRPx5AoZQDIdDJ>eu~l3KP{RTheKs~C6|}MMfV6i>Sr<|C3!ns-gho3< zJpQCJitnRSyl#FyNaiz<{NUHMAtB}LqGn{28)oY!G+PZW!Yz>zPK6{COHtch7g^oz z*0N(A7G24cYHJ0-+JJtYZA=yW&EGD%Hu}|W!|zK7+ePQoEVOv$!9$oJ2ic1j#u)dhEA>YMI(f=!NY>J zpkAB|WLH6dlw}83CzIk+I)={jZK&aVhHpE)=ZC%i+ZOqDR?`71TA1+Aspbl^F0c6+ za4v;rTqvw$3s}QNIUZ09j;=twhU0j)WO#%mi;)gKH*= zhKmX}JO`n`P@$PCjpK->eLeM(oA+#2Vs;y*>%E^$k!a2gmqjkCCwUF|d&89;;4Gz` g&F^jt-mu?=++X2&f2SjTeM^q6>zeQX+Y=M`0%jYl-z(6!eCK65EPCpVpwpC^A0p^#)_TSDg zHV$!!J&dy`2m*pfi(InT=M8g%_;B<|8caFwO6MgvYIJCdCvnt>w-yGuQx|1fR$)BE zX%F(rESp)(4l{=rYW=ru@*RyP^V0!n)x(Tuom(am z9mp*t0%-%2!`x52Y>q^0##}bJ7CkOoC|^4! nm4RC*m)ZR8w&9umZsh(7Px~7c=M#B;$xe>rjNkva2PW_Zu34vo diff --git a/vendor/github.com/cavaliercoder/go-cpio/testdata/todo.txt b/vendor/github.com/cavaliercoder/go-cpio/testdata/todo.txt deleted file mode 100644 index 487ea9e..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/testdata/todo.txt +++ /dev/null @@ -1 +0,0 @@ -Get animal handling license. diff --git a/vendor/github.com/cavaliercoder/go-cpio/writer_test.go b/vendor/github.com/cavaliercoder/go-cpio/writer_test.go deleted file mode 100644 index 2a935b1..0000000 --- a/vendor/github.com/cavaliercoder/go-cpio/writer_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package cpio_test - -import ( - "bytes" - "io" - "os" - "testing" - - cpio "github.com/cavaliercoder/go-cpio" -) - -func store(w *cpio.Writer, fn string) error { - f, err := os.Open(fn) - if err != nil { - return err - } - defer f.Close() - fi, err := f.Stat() - if err != nil { - return err - } - hdr, err := cpio.FileInfoHeader(fi, "") - if err != nil { - return err - } - if err := w.WriteHeader(hdr); err != nil { - return err - } - if !fi.IsDir() { - if _, err := io.Copy(w, f); err != nil { - return err - } - } - - return err -} - -func TestWriter(t *testing.T) { - var buf bytes.Buffer - w := cpio.NewWriter(&buf) - - if err := store(w, "testdata/etc"); err != nil { - t.Fatalf("store: %v", err) - } - - if err := store(w, "testdata/etc/hosts"); err != nil { - t.Fatalf("store: %v", err) - } - - if err := w.Close(); err != nil { - t.Fatalf("Close: %v", err) - } -} diff --git a/vendor/github.com/cloudflare/cfssl/LICENSE b/vendor/github.com/cloudflare/cfssl/LICENSE new file mode 100644 index 0000000..bc5841f --- /dev/null +++ b/vendor/github.com/cloudflare/cfssl/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2014 CloudFlare Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/cloudflare/cfssl/auth/auth_test.go b/vendor/github.com/cloudflare/cfssl/auth/auth_test.go deleted file mode 100644 index 6e4c6af..0000000 --- a/vendor/github.com/cloudflare/cfssl/auth/auth_test.go +++ /dev/null @@ -1,159 +0,0 @@ -package auth - -import ( - "encoding/json" - "io/ioutil" - "testing" -) - -var ( - testProvider Provider - testProviderAD Provider - testKey = "0123456789ABCDEF0123456789ABCDEF" - testAD = []byte{1, 2, 3, 4} // IP address 1.2.3.4 -) - -func TestNew(t *testing.T) { - _, err := New("ABC", nil) - if err == nil { - t.Fatal("expected failure with improperly-hex-encoded key") - } - - testProvider, err = New(testKey, nil) - if err != nil { - t.Fatalf("%v", err) - } - - testProviderAD, err = New(testKey, testAD) - if err != nil { - t.Fatalf("%v", err) - } - -} - -var ( - testRequest1A = &AuthenticatedRequest{ - Request: []byte(`testing 1 2 3`), - } - testRequest1B = &AuthenticatedRequest{ - Request: []byte(`testing 1 2 3`), - } - testRequest2 = &AuthenticatedRequest{ - Request: []byte(`testing 3 2 1`), - } -) - -// Sanity check: can a newly-generated token be verified? -func TestVerifyTrue(t *testing.T) { - var err error - - testRequest1A.Token, err = testProvider.Token(testRequest1A.Request) - if err != nil { - t.Fatalf("%v", err) - } - - testRequest1B.Token, err = testProviderAD.Token(testRequest1B.Request) - if err != nil { - t.Fatalf("%v", err) - } - - if !testProvider.Verify(testRequest1A) { - t.Fatal("failed to verify request 1A") - } - - if !testProviderAD.Verify(testRequest1B) { - t.Fatal("failed to verify request 1B") - } -} - -// Sanity check: ensure that additional data is actually used in -// verification. -func TestVerifyAD(t *testing.T) { - if testProvider.Verify(testRequest1B) { - t.Fatal("no-AD provider verifies request with AD") - } - - if testProviderAD.Verify(testRequest1A) { - t.Fatal("AD provider verifies request without AD") - } -} - -// Sanity check: verification fails if tokens are not the same length. -func TestTokenLength(t *testing.T) { - token := testRequest1A.Token[:] - testRequest1A.Token = testRequest1A.Token[1:] - - if testProvider.Verify(testRequest1A) { - t.Fatal("invalid token should not be verified") - } - - testRequest1A.Token = token -} - -// Sanity check: token fails validation if the request is changed. -func TestBadRequest(t *testing.T) { - testRequest2.Token = testRequest1A.Token - if testProvider.Verify(testRequest2) { - t.Fatal("bad request should fail verification") - } -} - -// Sanity check: a null request should fail to verify. -func TestNullRequest(t *testing.T) { - if testProvider.Verify(nil) { - t.Fatal("null request should fail verification") - } -} - -// Sanity check: verify a pre-generated authenticated request. -func TestPreGenerated(t *testing.T) { - in, err := ioutil.ReadFile("testdata/authrequest.json") - if err != nil { - t.Fatalf("%v", err) - } - - var req AuthenticatedRequest - err = json.Unmarshal(in, &req) - if err != nil { - t.Fatalf("%v", err) - } - - if !testProvider.Verify(&req) { - t.Fatal("failed to verify pre-generated request") - } -} - -var bmRequest []byte - -func TestLoadBenchmarkRequest(t *testing.T) { - in, err := ioutil.ReadFile("testdata/request.json") - if err != nil { - t.Fatalf("%v", err) - } - - bmRequest = in -} - -func BenchmarkToken(b *testing.B) { - for i := 0; i < b.N; i++ { - _, err := testProvider.Token(bmRequest) - if err != nil { - b.Fatalf("%v", err) - } - } -} - -func BenchmarkVerify(b *testing.B) { - token, _ := testProvider.Token(bmRequest) - req := &AuthenticatedRequest{ - Token: token, - Request: bmRequest, - } - b.ResetTimer() - - for i := 0; i < b.N; i++ { - if !testProvider.Verify(req) { - b.Fatal("failed to verify request") - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/auth/testdata/authrequest.json b/vendor/github.com/cloudflare/cfssl/auth/testdata/authrequest.json deleted file mode 100644 index 30fa039..0000000 --- a/vendor/github.com/cloudflare/cfssl/auth/testdata/authrequest.json +++ /dev/null @@ -1 +0,0 @@ -{"token": "tSU1WTE/322iXrOBfJSQ9/u1dleqpwUmCj1LXYHw07Y=", "request": "ewoJImhvc3RuYW1lIjogImt5bGVpc29tLm5ldCIsCgkicmVxdWVzdCI6ICItLS0tLUJFR0lOIENFUlRJRklDQVRFIFJFUVVFU1QtLS0tLQoJICAgIE1JSUQwVENDQWpzQ0FRQXdZREVMTUFrR0ExVUVCaE1DVlZNeEVqQVFCZ05WQkFvVENXUnliM0J6YjI1a1pURVEKCSAgICB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0FZRUFoTUFxQmlySStrMWFVM2xmQUdRaVNtOHl0T3paaWozODloSXIKCSAgICBuVXA4K1duVHVWVGI4WFozL1YrTDlFblRJbUY2dTF3ZWFqWGQzU3VlNDk1NzBMYlltSXV4QmtHcDUwL0JkVUR6CgkgICAgdUI2eHNoaEpXczEySnhVYjkxSW1tMGJUUncyek1xZXdnYTZmdHpaL0FLNG1zeFFBMlVJYmNXWmRzS2J1TTdzbwoJICAgIEpUZlZXOWlPd3FIdC82NFpqNHRCWmY5THpPRHI3a051S0tMbndqaXpIMTg3eGZJSWhkcmpGOFdTN0g5QVBCMU8KCSAgICBTdUVVRGZxaDBTV1IzbHRXdUF1VVdlbzZTS2NIVnVzeS9HNFlFK1BCeXcxZVY3RzRTYmVHNVowbytHT1VVSy9GCgkgICAgYjU1R21XMXhhNExBcnMxQSt6ZUZidkovQkFwc2JVMmI2V1ZtTmE3V3BIejdXWElGT0p1WUpnRWtWS1BKbkt1cwoJICAgIHFxczNGZ1VxejBadjdUSzhtTWlFVEpvWFpzNnpDdk15c1FldTNKL29qZ3RBanZNaHpRYzZQUy9udk90SmRJZysKCSAgICBIMHFYNDlmaHAxQnJZeXNsYWx6UUlGMCtIMHFTVWV5b1V5VjJ3YkxCQUxhcHhNZnZUVmxoTnduYWN0Y0tReHE0CgkgICAgK3dUKzJQVEowYk0vNUFWMFRPMVNQVDBBVmlKaAoJICAgIC0tLS0tRU5EIENFUlRJRklDQVRFIFJFUVVFU1QtLS0tLSIsCgkicHJvZmlsZSI6ICIiLAoJInJlbW90ZSI6ICIiLAoJImxhYmVsIjogInByaW1hcnkiCn0KCg=="} \ No newline at end of file diff --git a/vendor/github.com/cloudflare/cfssl/auth/testdata/request.json b/vendor/github.com/cloudflare/cfssl/auth/testdata/request.json deleted file mode 100644 index 20984b8..0000000 --- a/vendor/github.com/cloudflare/cfssl/auth/testdata/request.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "hostname": "kyleisom.net", - "request": "-----BEGIN CERTIFICATE REQUEST----- - MIID0TCCAjsCAQAwYDELMAkGA1UEBhMCVVMxEjAQBgNVBAoTCWRyb3Bzb25kZTEQ - MA4GA1UECxMHQ0YtQ2hhdDEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzETMBEGA1UE - CBMKQ2FsaWZvcm5pYTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAMcC - GBl5LTrekGFWhotkdbZ+R1MloarWxQv9jP4Aekt8UOicypHvFO6xOtSwHo+r32iE - qnS5yv/01P2MJuyqndncTSMsOlT/7n67TM00u01K/9c/sogKEKjlyplTP7yFdG/c - Ou/9qKb/Jald2wELFYE6xq2RDFyxyiZOB3g7Z7Fxa5d6adfGRwZzNtUL4/8s+Lyi - qdw9I1fkQd604poZFN0wrQs4lfhWTUfg0rHuh5wgGKP3VzZpbt8Fb1vNjfbHtohx - G2PCU6Jy+Dc1bSfUzWcQnenp858W4F8z7pF5ybdnFR313HjosqXnG28zITrOadMT - HaJ6zOhgEafUOWXOzjNofFBFa2IuCAT+ITRY1tC/gqpxGwH/yuVN19BG8Upn0+HA - ie2mKCHfSBAKT/Xe4umPeaxSbIqWsW8ck+d3b4or9RZv5cZRcT3oikJt+SQG69pW - 4OAbb+ABss/NIuri6z0e7DEeIL5zmySJqdtYHdNYN7++v9xBNsL4IsU6IEy3+QID - AQABoC4wLAYJKoZIhvcNAQkOMR8wHTAbBgNVHREEFDASghBjZi5kcm9wc29uZGUu - bmV0MAsGCSqGSIb3DQEBDAOCAYEAhMAqBirI+k1aU3lfAGQiSm8ytOzZij389hIr - nUp8+WnTuVTb8XZ3/V+L9EnTImF6u1weajXd3Sue49570LbYmIuxBkGp50/BdUDz - uB6xshhJWs12JxUb91Imm0bTRw2zMqewga6ftzZ/AK4msxQA2UIbcWZdsKbuM7so - JTfVW9iOwqHt/64Zj4tBZf9LzODr7kNuKKLnwjizH187xfIIhdrjF8WS7H9APB1O - SuEUDfqh0SWR3ltWuAuUWeo6SKcHVusy/G4YE+PByw1eV7G4SbeG5Z0o+GOUUK/F - b55GmW1xa4LArs1A+zeFbvJ/BApsbU2b6WVmNa7WpHz7WXIFOJuYJgEkVKPJnKus - qqs3FgUqz0Zv7TK8mMiETJoXZs6zCvMysQeu3J/ojgtAjvMhzQc6PS/nvOtJdIg+ - H0qX49fhp1BrYyslalzQIF0+H0qSUeyoUyV2wbLBALapxMfvTVlhNwnactcKQxq4 - +wT+2PTJ0bM/5AV0TO1SPT0AViJh - -----END CERTIFICATE REQUEST-----", - "profile": "", - "remote": "", - "label": "primary" -} - diff --git a/vendor/github.com/cloudflare/cfssl/config/config_test.go b/vendor/github.com/cloudflare/cfssl/config/config_test.go deleted file mode 100644 index 1d12664..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/config_test.go +++ /dev/null @@ -1,537 +0,0 @@ -package config - -import ( - "encoding/json" - "fmt" - "testing" - "time" -) - -var expiry = 1 * time.Minute - -var invalidProfileConfig = &Config{ - Signing: &Signing{ - Profiles: map[string]*SigningProfile{ - "invalid": { - Usage: []string{"wiretapping"}, - Expiry: expiry, - }, - "empty": {}, - }, - Default: &SigningProfile{ - Usage: []string{"digital signature"}, - Expiry: expiry, - }, - }, -} - -var invalidDefaultConfig = &Config{ - Signing: &Signing{ - Profiles: map[string]*SigningProfile{ - "key usage": { - Usage: []string{"digital signature"}, - }, - }, - Default: &SigningProfile{ - Usage: []string{"s/mime"}, - }, - }, -} - -var validConfig = &Config{ - Signing: &Signing{ - Profiles: map[string]*SigningProfile{ - "valid": { - Usage: []string{"digital signature"}, - Expiry: expiry, - }, - }, - Default: &SigningProfile{ - Usage: []string{"digital signature"}, - Expiry: expiry, - }, - }, -} - -var validMixedConfig = ` -{ - "signing": { - "profiles": { - "CA": { - "auth_key": "sample", - "remote": "localhost" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_keys": { - "sample": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -}` - -var validMinimalRemoteConfig = ` -{ - "signing": { - "default": { - "auth_key": "sample", - "remote": "localhost" - } - }, - "auth_keys": { - "sample": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -}` - -var validMinimalRemoteConfig2 = ` -{ - "signing": { - "default": { - "auth_remote":{ - "auth_key": "sample", - "remote": "localhost" - } - } - }, - "auth_keys": { - "sample": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -}` - -var invalidConflictRemoteConfig = ` -{ - "signing": { - "default": { - "auth_remote":{ - "auth_key": "sample", - "remote": "localhost" - }, - "remote": "localhost" - } - }, - "auth_keys": { - "sample": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -}` - -var invalidRemoteConfig = ` -{ - "signing": { - "default": { - "auth_remotes_typos":{ - "auth_key": "sample", - "remote": "localhost" - } - } - }, - "auth_keys": { - "sample": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -}` - -var invalidAuthRemoteConfigMissingRemote = ` -{ - "signing": { - "default": { - "auth_remote":{ - "auth_key": "sample" - } - } - }, - "auth_keys": { - "sample": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -}` - -var invalidAuthRemoteConfigMissingKey = ` -{ - "signing": { - "default": { - "auth_remote":{ - "remote": "localhost" - } - } - }, - "auth_keys": { - "sample": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -}` - -var validMinimalLocalConfig = ` -{ - "signing": { - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - } -}` - -var validLocalConfigsWithCAConstraint = []string{ - `{ - "signing": { - "default": { - "usages": ["digital signature", "email protection"], - "ca_constraint": { "is_ca": true }, - "expiry": "8000h" - } - } - }`, - `{ - "signing": { - "default": { - "usages": ["digital signature", "email protection"], - "ca_constraint": { "is_ca": true, "max_path_len": 1 }, - "expiry": "8000h" - } - } - }`, - `{ - "signing": { - "default": { - "usages": ["digital signature", "email protection"], - "ca_constraint": { "is_ca": true, "max_path_len_zero": true }, - "expiry": "8000h" - } - } - }`, -} - -func TestInvalidProfile(t *testing.T) { - if invalidProfileConfig.Signing.Profiles["invalid"].validProfile(false) { - t.Fatal("invalid profile accepted as valid") - } - - if invalidProfileConfig.Signing.Profiles["empty"].validProfile(false) { - t.Fatal("invalid profile accepted as valid") - } - - if invalidProfileConfig.Valid() { - t.Fatal("invalid config accepted as valid") - } - - if !invalidProfileConfig.Signing.Profiles["invalid"].validProfile(true) { - t.Fatal("invalid profile should be a valid default profile") - } -} - -func TestRemoteProfiles(t *testing.T) { - var validRemoteProfile = &SigningProfile{ - RemoteName: "localhost", - RemoteServer: "localhost:8080", - } - - var invalidRemoteProfile = &SigningProfile{ - RemoteName: "localhost", - } - - var invalidRemoteAuthProfile = &SigningProfile{ - RemoteName: "localhost", - RemoteServer: "localhost:8080", - AuthKeyName: "blahblah", - } - - if !validRemoteProfile.validProfile(true) || - !validRemoteProfile.validProfile(false) { - t.Fatal("valid remote profile is rejected.") - } - - if invalidRemoteProfile.validProfile(true) || - invalidRemoteProfile.validProfile(false) { - t.Fatal("invalid remote profile is accepted.") - } - - if invalidRemoteAuthProfile.validProfile(true) || - invalidRemoteAuthProfile.validProfile(false) { - t.Fatal("invalid remote profile is accepted.") - } -} - -func TestInvalidDefault(t *testing.T) { - if invalidDefaultConfig.Signing.Default.validProfile(true) { - t.Fatal("invalid default accepted as valid") - } - - if invalidDefaultConfig.Valid() { - t.Fatal("invalid config accepted as valid") - } - - if !invalidDefaultConfig.Signing.Default.validProfile(false) { - t.Fatal("invalid default profile should be a valid profile") - } -} - -func TestValidConfig(t *testing.T) { - if !validConfig.Valid() { - t.Fatal("Valid config is not valid") - } - bytes, _ := json.Marshal(validConfig) - fmt.Printf("%v", string(bytes)) -} - -func TestDefaultConfig(t *testing.T) { - if !DefaultConfig().validProfile(false) { - t.Fatal("global default signing profile should be a valid profile.") - } - - if !DefaultConfig().validProfile(true) { - t.Fatal("global default signing profile should be a valid default profile") - } -} - -func TestParse(t *testing.T) { - var validProfiles = []*SigningProfile{ - { - ExpiryString: "8760h", - }, - { - ExpiryString: "168h", - }, - { - ExpiryString: "300s", - }, - } - - var invalidProfiles = []*SigningProfile{ - nil, - {}, - { - ExpiryString: "", - }, - { - ExpiryString: "365d", - }, - { - ExpiryString: "1y", - }, - { - ExpiryString: "one year", - }, - } - - for _, p := range validProfiles { - if p.populate(nil) != nil { - t.Fatalf("Failed to parse ExpiryString=%s", p.ExpiryString) - } - } - - for _, p := range invalidProfiles { - if p.populate(nil) == nil { - if p != nil { - t.Fatalf("ExpiryString=%s should not be parseable", p.ExpiryString) - } - t.Fatalf("Nil profile should not be parseable") - } - } - -} - -func TestLoadFile(t *testing.T) { - validConfigFiles := []string{ - "testdata/valid_config.json", - "testdata/valid_config_auth.json", - "testdata/valid_config_no_default.json", - "testdata/valid_config_auth_no_default.json", - } - - for _, configFile := range validConfigFiles { - _, err := LoadFile(configFile) - if err != nil { - t.Fatal("Load valid config file failed.", configFile, "error is ", err) - } - } -} - -func TestLoadInvalidConfigFile(t *testing.T) { - invalidConfigFiles := []string{"", "testdata/no_such_file", - "testdata/invalid_default.json", - "testdata/invalid_profiles.json", - "testdata/invalid_usage.json", - "testdata/invalid_config.json", - "testdata/invalid_auth.json", - "testdata/invalid_auth_bad_key.json", - "testdata/invalid_no_auth_keys.json", - "testdata/invalid_remote.json", - "testdata/invalid_no_remotes.json", - } - for _, configFile := range invalidConfigFiles { - _, err := LoadFile(configFile) - if err == nil { - t.Fatal("Invalid config is loaded.", configFile) - } - } -} - -func TestNeedLocalSigner(t *testing.T) { - - c, err := LoadConfig([]byte(validMixedConfig)) - if err != nil { - t.Fatal("load valid config failed:", err) - } - - // This signing config needs both local signer and remote signer. - if c.Signing.NeedsLocalSigner() != true { - t.Fatal("incorrect NeedsLocalSigner().") - } - - if c.Signing.NeedsRemoteSigner() != true { - t.Fatal("incorrect NeedsRemoteSigner()") - } - - remoteConfig, err := LoadConfig([]byte(validMinimalRemoteConfig)) - if err != nil { - t.Fatal("Load valid config failed:", err) - } - - if remoteConfig.Signing.NeedsLocalSigner() != false { - t.Fatal("incorrect NeedsLocalSigner().") - } - - if remoteConfig.Signing.NeedsRemoteSigner() != true { - t.Fatal("incorrect NeedsRemoteSigner().") - } - - localConfig, err := LoadConfig([]byte(validMinimalLocalConfig)) - if localConfig.Signing.NeedsLocalSigner() != true { - t.Fatal("incorrect NeedsLocalSigner().") - } - - if localConfig.Signing.NeedsRemoteSigner() != false { - t.Fatal("incorrect NeedsRemoteSigner().") - } - - if err != nil { - t.Fatal(err) - } -} - -func TestOverrideRemotes(t *testing.T) { - c, err := LoadConfig([]byte(validMixedConfig)) - if err != nil { - t.Fatal("load valid config failed:", err) - } - - host := "localhost:8888" - c.Signing.OverrideRemotes(host) - - if c.Signing.Default.RemoteServer != host { - t.Fatal("should override default profile's RemoteServer") - } - - for _, p := range c.Signing.Profiles { - if p.RemoteServer != host { - t.Fatal("failed to override profile's RemoteServer") - } - } - -} - -func TestAuthRemoteConfig(t *testing.T) { - c, err := LoadConfig([]byte(validMinimalRemoteConfig2)) - if err != nil { - t.Fatal("load valid config failed:", err) - } - - if c.Signing.Default.RemoteServer != "127.0.0.1:8888" { - t.Fatal("load valid config failed: incorrect remote server") - } - - host := "localhost:8888" - c.Signing.OverrideRemotes(host) - - if c.Signing.Default.RemoteServer != host { - t.Fatal("should override default profile's RemoteServer") - } - - for _, p := range c.Signing.Profiles { - if p.RemoteServer != host { - t.Fatal("failed to override profile's RemoteServer") - } - } -} - -func TestDuplicateRemoteConfig(t *testing.T) { - _, err := LoadConfig([]byte(invalidConflictRemoteConfig)) - if err == nil { - t.Fatal("fail to reject invalid config") - } -} - -func TestBadAuthRemoteConfig(t *testing.T) { - _, err := LoadConfig([]byte(invalidRemoteConfig)) - if err == nil { - t.Fatal("load invalid config should failed") - } - - _, err = LoadConfig([]byte(invalidAuthRemoteConfigMissingRemote)) - if err == nil { - t.Fatal("load invalid config should failed") - } - - _, err = LoadConfig([]byte(invalidAuthRemoteConfigMissingKey)) - if err == nil { - t.Fatal("load invalid config should failed") - } - - var p *Signing - if p.Valid() { - t.Fatal("nil Signing config should be invalid") - } -} - -func TestValidCAConstraint(t *testing.T) { - for _, config := range validLocalConfigsWithCAConstraint { - _, err := LoadConfig([]byte(config)) - if err != nil { - t.Fatal("can't parse valid ca constraint") - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth.json deleted file mode 100644 index 621f7bd..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "remote": "localhost", - "auth_key": "garbage" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_keys": { - "garbage": { - "type":"stadardo", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth_bad_key.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth_bad_key.json deleted file mode 100644 index 77773af..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_auth_bad_key.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "remote": "localhost", - "auth_key": "garbage" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_keys": { - "garbage": { - "type":"standard", - "key":"BAD_KEY" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_config.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_config.json deleted file mode 100644 index edc1804..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_config.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "usages": ["cert sign"], - "expiry": "720h" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_default.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_default.json deleted file mode 100644 index 0c8d3a4..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_default.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "usages": ["cert sign"], - "expiry": "720h" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "invalid_expiry" - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_auth_keys.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_auth_keys.json deleted file mode 100644 index b7d8670..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_auth_keys.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "remote": "localhost", - "auth_key": "garbage" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_keys": { - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_remotes.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_remotes.json deleted file mode 100644 index aa63006..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_no_remotes.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "auth_key": "garbage", - "remote": "localhoster" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_keys": { - "garbage": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_profile.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_profile.json deleted file mode 100644 index aedc7ff..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_profile.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "usages": ["cert sign"], - "expiry": "720h" - }, - "email": { - "usages": ["s/mime"], - "expiry": "invalid_expiry" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_remotes.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_remotes.json deleted file mode 100644 index f7cc0d9..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_remotes.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "auth_key": "garbage", - "remote": "localhoster" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_keys": { - "garbage": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_usage.json b/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_usage.json deleted file mode 100644 index b1dc6dc..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/invalid_usage.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "usages": ["cert sign"], - "expiry": "720h" - }, - "email": { - "usages": ["BAD_USAGE"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config.json b/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config.json deleted file mode 100644 index 64e0948..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "usages": ["cert sign"], - "expiry": "720h" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_key": { - "garbage": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth.json b/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth.json deleted file mode 100644 index b768306..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "usages": ["cert sign"], - "expiry": "720h", - "auth_key": "garbage", - "remote": "localhost" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - }, - "default": { - "usages": ["digital signature", "email protection"], - "expiry": "8000h" - } - }, - "auth_keys": { - "garbage": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth_no_default.json b/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth_no_default.json deleted file mode 100644 index 6e87185..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_auth_no_default.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "auth_key": "garbage", - "remote": "localhost" - } - } - }, - "auth_keys": { - "garbage": { - "type":"standard", - "key":"0123456789ABCDEF0123456789ABCDEF" - } - }, - "remotes": { - "localhost": "127.0.0.1:8888" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_no_default.json b/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_no_default.json deleted file mode 100644 index aec240a..0000000 --- a/vendor/github.com/cloudflare/cfssl/config/testdata/valid_config_no_default.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "signing": { - "profiles": { - "CA": { - "usages": ["cert sign"], - "expiry": "720h" - }, - "email": { - "usages": ["s/mime"], - "expiry": "720h" - } - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/csr/csr_test.go b/vendor/github.com/cloudflare/cfssl/csr/csr_test.go deleted file mode 100644 index b420fa4..0000000 --- a/vendor/github.com/cloudflare/cfssl/csr/csr_test.go +++ /dev/null @@ -1,744 +0,0 @@ -package csr - -import ( - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rsa" - "crypto/x509" - "encoding/asn1" - "encoding/pem" - "io/ioutil" - "testing" - - "github.com/cloudflare/cfssl/errors" - "github.com/cloudflare/cfssl/helpers" -) - -//TestNew validate the CertificateRequest created to return with a BasicKeyRequest -//in KeyRequest field - -func TestNew(t *testing.T) { - - if cr := New(); cr.KeyRequest == nil { - t.Fatalf("Should create a new, empty certificate request with BasicKeyRequest") - } -} - -// TestBasicKeyRequest ensures that key generation returns the same type of -// key specified in the BasicKeyRequest. -func TestBasicKeyRequest(t *testing.T) { - kr := NewBasicKeyRequest() - priv, err := kr.Generate() - if err != nil { - t.Fatalf("%v", err) - } - - switch priv.(type) { - case *rsa.PrivateKey: - if kr.Algo() != "rsa" { - t.Fatal("RSA key generated, but expected", kr.Algo()) - } - case *ecdsa.PrivateKey: - if kr.Algo() != "ecdsa" { - t.Fatal("ECDSA key generated, but expected", kr.Algo()) - } - } -} - -// TestPKIXName validates building a pkix.Name structure from a -// CertificateRequest. -func TestPKIXName(t *testing.T) { - var cr = &CertificateRequest{ - CN: "Test Common Name", - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare, Inc.", - OU: "Systems Engineering", - }, - { - C: "GB", - ST: "London", - L: "London", - O: "CloudFlare, Inc", - OU: "Systems Engineering", - }, - }, - Hosts: []string{"cloudflare.com", "www.cloudflare.com"}, - KeyRequest: NewBasicKeyRequest(), - } - - name := cr.Name() - if len(name.Country) != 2 { - t.Fatal("Expected two countries in SubjInfo.") - } else if len(name.Province) != 2 { - t.Fatal("Expected two states in SubjInfo.") - } else if len(name.Locality) != 2 { - t.Fatal("Expected two localities in SubjInfo.") - } else if len(name.Country) != 2 { - t.Fatal("Expected two countries in SubjInfo.") - } else if len(name.Organization) != 2 { - t.Fatal("Expected two organization in SubjInfo.") - } else if len(name.OrganizationalUnit) != 2 { - t.Fatal("Expected two organizational units in SubjInfo.") - } -} - -// TestParseRequest ensures that a valid certificate request does not -// error. -func TestParseRequest(t *testing.T) { - var cr = &CertificateRequest{ - CN: "Test Common Name", - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare, Inc.", - OU: "Systems Engineering", - }, - { - C: "GB", - ST: "London", - L: "London", - O: "CloudFlare, Inc", - OU: "Systems Engineering", - }, - }, - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "192.168.0.1", "jdoe@example.com"}, - KeyRequest: NewBasicKeyRequest(), - } - - _, _, err := ParseRequest(cr) - if err != nil { - t.Fatalf("%v", err) - } -} - -// TestParseRequestCA ensures that a valid CA certificate request does not -// error and the resulting CSR includes the BasicConstraint extension -func TestParseRequestCA(t *testing.T) { - var cr = &CertificateRequest{ - CN: "Test Common Name", - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare, Inc.", - OU: "Systems Engineering", - }, - { - C: "GB", - ST: "London", - L: "London", - O: "CloudFlare, Inc", - OU: "Systems Engineering", - }, - }, - CA: &CAConfig{ - PathLength: 0, - PathLenZero: true, - }, - KeyRequest: NewBasicKeyRequest(), - } - - csrBytes, _, err := ParseRequest(cr) - if err != nil { - t.Fatalf("%v", err) - } - - block, _ := pem.Decode(csrBytes) - if block == nil { - t.Fatalf("%v", err) - } - - if block.Type != "CERTIFICATE REQUEST" { - t.Fatalf("Incorrect block type: %s", block.Type) - } - - csr, err := x509.ParseCertificateRequest(block.Bytes) - if err != nil { - t.Fatalf("%v", err) - } - - found := false - for _, ext := range csr.Extensions { - if ext.Id.Equal(asn1.ObjectIdentifier{2, 5, 29, 19}) { - found = true - break - } - } - - if !found { - t.Fatalf("CSR did not include BasicConstraint Extension") - } -} - -// TestParseRequestCANoPathlen ensures that a valid CA certificate request -// with an unspecified pathlen does not error and the resulting CSR includes -// the BasicConstraint extension -func TestParseRequestCANoPathlen(t *testing.T) { - var cr = &CertificateRequest{ - CN: "Test Common Name", - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare, Inc.", - OU: "Systems Engineering", - }, - { - C: "GB", - ST: "London", - L: "London", - O: "CloudFlare, Inc", - OU: "Systems Engineering", - }, - }, - CA: &CAConfig{ - PathLength: 0, - PathLenZero: false, - }, - KeyRequest: NewBasicKeyRequest(), - } - - csrBytes, _, err := ParseRequest(cr) - if err != nil { - t.Fatalf("%v", err) - } - - block, _ := pem.Decode(csrBytes) - if block == nil { - t.Fatalf("%v", err) - } - - if block.Type != "CERTIFICATE REQUEST" { - t.Fatalf("Incorrect block type: %s", block.Type) - } - - csr, err := x509.ParseCertificateRequest(block.Bytes) - if err != nil { - t.Fatalf("%v", err) - } - - found := false - for _, ext := range csr.Extensions { - if ext.Id.Equal(asn1.ObjectIdentifier{2, 5, 29, 19}) { - bc := &BasicConstraints{} - asn1.Unmarshal(ext.Value, bc) - if bc.IsCA == true && bc.MaxPathLen == -1 { - found = true - break - } - } - } - - if !found { - t.Fatalf("CSR did not include BasicConstraint Extension") - } -} - -func whichCurve(sz int) elliptic.Curve { - switch sz { - case 256: - return elliptic.P256() - case 384: - return elliptic.P384() - case 521: - return elliptic.P521() - } - return nil -} - -// TestECGeneration ensures that the proper curve is used depending on -// the bit size specified in a key request and that an appropriate -// signature algorithm is returned. -func TestECGeneration(t *testing.T) { - var eckey *ecdsa.PrivateKey - - for _, sz := range []int{256, 384, 521} { - kr := &BasicKeyRequest{"ecdsa", sz} - priv, err := kr.Generate() - if err != nil { - t.Fatalf("%v", err) - } - eckey = priv.(*ecdsa.PrivateKey) - if eckey.Curve != whichCurve(sz) { - t.Fatal("Generated key has wrong curve.") - } - if sa := kr.SigAlgo(); sa == x509.UnknownSignatureAlgorithm { - t.Fatal("Invalid signature algorithm!") - } - } -} - -func TestRSAKeyGeneration(t *testing.T) { - var rsakey *rsa.PrivateKey - - for _, sz := range []int{2048, 3072, 4096} { - kr := &BasicKeyRequest{"rsa", sz} - priv, err := kr.Generate() - if err != nil { - t.Fatalf("%v", err) - } - rsakey = priv.(*rsa.PrivateKey) - if rsakey.PublicKey.N.BitLen() != kr.Size() { - t.Fatal("Generated key has wrong size.") - } - if sa := kr.SigAlgo(); sa == x509.UnknownSignatureAlgorithm { - t.Fatal("Invalid signature algorithm!") - } - } -} - -// TestBadBasicKeyRequest ensures that generating a key from a BasicKeyRequest -// fails with an invalid algorithm, or an invalid RSA or ECDSA key -// size. An invalid ECDSA key size is any size other than 256, 384, or -// 521; an invalid RSA key size is any size less than 2048 bits. -func TestBadBasicKeyRequest(t *testing.T) { - kr := &BasicKeyRequest{"yolocrypto", 1024} - - if _, err := kr.Generate(); err == nil { - t.Fatal("Key generation should fail with invalid algorithm") - } else if sa := kr.SigAlgo(); sa != x509.UnknownSignatureAlgorithm { - t.Fatal("The wrong signature algorithm was returned from SigAlgo!") - } - - kr.A = "ecdsa" - if _, err := kr.Generate(); err == nil { - t.Fatal("Key generation should fail with invalid key size") - } else if sa := kr.SigAlgo(); sa != x509.ECDSAWithSHA1 { - t.Fatal("The wrong signature algorithm was returned from SigAlgo!") - } - - kr.A = "rsa" - if _, err := kr.Generate(); err == nil { - t.Fatal("Key generation should fail with invalid key size") - } else if sa := kr.SigAlgo(); sa != x509.SHA1WithRSA { - t.Fatal("The wrong signature algorithm was returned from SigAlgo!") - } - - kr = &BasicKeyRequest{"tobig", 9216} - - kr.A = "rsa" - if _, err := kr.Generate(); err == nil { - t.Fatal("Key generation should fail with invalid key size") - } else if sa := kr.SigAlgo(); sa != x509.SHA512WithRSA { - t.Fatal("The wrong signature algorithm was returned from SigAlgo!") - } -} - -// TestDefaultBasicKeyRequest makes sure that certificate requests without -// explicit key requests fall back to the default key request. -func TestDefaultBasicKeyRequest(t *testing.T) { - var req = &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "jdoe@example.com"}, - } - _, priv, err := ParseRequest(req) - if err != nil { - t.Fatalf("%v", err) - } - - // If the default key type changes, this will need to be changed. - block, _ := pem.Decode(priv) - if block == nil { - t.Fatal("Bad private key was generated!") - } - - DefaultKeyRequest := NewBasicKeyRequest() - switch block.Type { - case "RSA PRIVATE KEY": - if DefaultKeyRequest.Algo() != "rsa" { - t.Fatal("Invalid default key request.") - } - case "EC PRIVATE KEY": - if DefaultKeyRequest.Algo() != "ecdsa" { - t.Fatal("Invalid default key request.") - } - } -} - -// TestRSACertRequest validates parsing a certificate request with an -// RSA key. -func TestRSACertRequest(t *testing.T) { - var req = &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "jdoe@example.com"}, - KeyRequest: &BasicKeyRequest{"rsa", 2048}, - } - _, _, err := ParseRequest(req) - if err != nil { - t.Fatalf("%v", err) - } -} - -// TestBadCertRequest checks for failure conditions of ParseRequest. -func TestBadCertRequest(t *testing.T) { - var req = &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com"}, - KeyRequest: &BasicKeyRequest{"yolo-crypto", 2048}, - } - _, _, err := ParseRequest(req) - if err == nil { - t.Fatal("ParseRequest should fail with a bad key algorithm.") - } -} - -// testValidator is a stripped-down validator that checks to make sure -// the request has a common name. It should mimic some of the -// functionality expected in an actual validator. -func testValidator(req *CertificateRequest) error { - if req.CN == "" { - return errors.NewBadRequestMissingParameter("CN") - } - - return nil -} - -// TestGenerator ensures that a valid request is processed properly -// and returns a certificate request and key. -func TestGenerator(t *testing.T) { - g := &Generator{testValidator} - var req = &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "192.168.0.1", "jdoe@example.com"}, - KeyRequest: &BasicKeyRequest{"rsa", 2048}, - } - - csrBytes, _, err := g.ProcessRequest(req) - if err != nil { - t.Fatal(err) - } - - block, _ := pem.Decode([]byte(csrBytes)) - if block == nil { - t.Fatalf("bad CSR in PEM") - } - - if block.Type != "CERTIFICATE REQUEST" { - t.Fatalf("bad CSR in PEM") - } - - csr, err := x509.ParseCertificateRequest(block.Bytes) - if err != nil { - t.Fatal(err) - } - - if len(csr.DNSNames) != 2 { - t.Fatal("SAN parsing error") - } - - if len(csr.IPAddresses) != 1 { - t.Fatal("SAN parsing error") - } - - if len(csr.EmailAddresses) != 1 { - t.Fatal("SAN parsing error") - } - -} - -// TestBadGenerator ensures that a request that fails the validator is -// not processed. -func TestBadGenerator(t *testing.T) { - g := &Generator{testValidator} - missingCN := &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - // Missing CN - Hosts: []string{"cloudflare.com", "www.cloudflare.com"}, - KeyRequest: &BasicKeyRequest{"rsa", 2048}, - } - - _, _, err := g.ProcessRequest(missingCN) - if err == nil { - t.Fatalf("Request should have failed.") - } -} - -func TestWeakCSR(t *testing.T) { - weakKey := &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "jdoe@example.com"}, - KeyRequest: &BasicKeyRequest{"rsa", 1024}, - } - g := &Generator{testValidator} - - _, _, err := g.ProcessRequest(weakKey) - if err == nil { - t.Fatalf("Request should have failed.") - } -} - -var testEmpty = []struct { - name Name - ok bool -}{ - { - Name{}, - true, - }, - { - Name{C: "OK"}, - false, - }, - { - Name{ST: "OK"}, - false, - }, - { - Name{L: "OK"}, - false, - }, - { - Name{O: "OK"}, - false, - }, - { - Name{OU: "OK"}, - false, - }, -} - -func TestIsNameEmpty(t *testing.T) { - for i, c := range testEmpty { - if IsNameEmpty(c.name) != c.ok { - t.Fatalf("%d: expected IsNameEmpty to return %v, but have %v", i, c.ok, !c.ok) - } - } -} - -func TestGenerate(t *testing.T) { - var req = &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "192.168.0.1", "jdoe@example.com"}, - KeyRequest: &BasicKeyRequest{"ecdsa", 256}, - } - - key, err := req.KeyRequest.Generate() - if err != nil { - t.Fatalf("%v", err) - } - - priv, ok := key.(crypto.Signer) - if !ok { - t.Fatal("Private key is not a signer.") - } - - csrPEM, err := Generate(priv, req) - if err != nil { - t.Fatalf("%v", err) - } - - csr, _, err := helpers.ParseCSR(csrPEM) - if err != nil { - t.Fatalf("%v", err) - } - - if len(csr.DNSNames) != 2 { - t.Fatal("SAN parsing error") - } - - if len(csr.IPAddresses) != 1 { - t.Fatal("SAN parsing error") - } - - if len(csr.EmailAddresses) != 1 { - t.Fatal("SAN parsing error") - } -} - -// TestReGenerate ensures Regenerate() is abel to use the provided CSR as a template for signing a new -// CSR using priv. -func TestReGenerate(t *testing.T) { - var req = &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "192.168.0.1"}, - KeyRequest: &BasicKeyRequest{"ecdsa", 256}, - } - - _, key, err := ParseRequest(req) - if err != nil { - t.Fatalf("%v", err) - } - - priv, err := helpers.ParsePrivateKeyPEM(key) - if err != nil { - t.Fatalf("%v", err) - } - - csr, err := Generate(priv, req) - if err != nil { - t.Fatalf("%v", err) - } - - if _, _, err = helpers.ParseCSR(csr); err != nil { - t.Fatalf("%v", err) - } - - _, err = Regenerate(priv, csr) - if err != nil { - t.Fatalf("%v", err) - } -} - -// TestBadReGenerator ensures that a request that fails the ParseCSR is -// not processed. -func TestBadReGenerate(t *testing.T) { - var req = &CertificateRequest{ - Names: []Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: "cloudflare.com", - Hosts: []string{"cloudflare.com", "www.cloudflare.com", "192.168.0.1"}, - KeyRequest: &BasicKeyRequest{"ecdsa", 256}, - } - - _, key, err := ParseRequest(req) - if err != nil { - t.Fatalf("%v", err) - } - - priv, err := helpers.ParsePrivateKeyPEM(key) - if err != nil { - t.Fatalf("%v", err) - } - - csr, err := Generate(priv, req) - if err != nil { - t.Fatalf("%v", err) - } - - block := pem.Block{ - Type: "CERTIFICATE REQUEST", - Headers: map[string]string{ - "Location": "UCSD", - }, - Bytes: csr, - } - - csr = pem.EncodeToMemory(&block) - - _, err = Regenerate(priv, csr) - if err == nil { - t.Fatalf("%v", err) - } -} - -var testECDSACertificateFile = "testdata/test-ecdsa-ca.pem" - -func TestExtractCertificateRequest(t *testing.T) { - certPEM, err := ioutil.ReadFile(testECDSACertificateFile) - if err != nil { - t.Fatal(err) - } - - // must parse ok - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatal(err) - } - - req := ExtractCertificateRequest(cert) - - if req.CN != "" { - t.Fatal("Bad Certificate Request!") - } - - if len(req.Names) != 1 { - t.Fatal("Bad Certificate Request!") - } - - name := req.Names[0] - if name.C != "US" || name.ST != "California" || name.O != "CloudFlare, Inc." || - name.OU != "Test Certificate Authority" || name.L != "San Francisco" { - t.Fatal("Bad Certificate Request!") - } - - if req.CA == nil || req.CA.PathLength != 2 { - t.Fatal("Bad Certificate Request!") - } -} diff --git a/vendor/github.com/cloudflare/cfssl/csr/testdata/test-ecdsa-ca.pem b/vendor/github.com/cloudflare/cfssl/csr/testdata/test-ecdsa-ca.pem deleted file mode 100644 index cc9f998..0000000 --- a/vendor/github.com/cloudflare/cfssl/csr/testdata/test-ecdsa-ca.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICUDCCAfagAwIBAgIIec5PjdpJcNYwCgYIKoZIzj0EAwIwejELMAkGA1UEBhMC -VVMxGTAXBgNVBAoTEENsb3VkRmxhcmUsIEluYy4xIzAhBgNVBAsTGlRlc3QgQ2Vy -dGlmaWNhdGUgQXV0aG9yaXR5MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYD -VQQIEwpDYWxpZm9ybmlhMB4XDTE1MTAwODIzMDEwMFoXDTE1MTAwODIzMDYwMFow -ejELMAkGA1UEBhMCVVMxGTAXBgNVBAoTEENsb3VkRmxhcmUsIEluYy4xIzAhBgNV -BAsTGlRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMFkwEwYHKoZIzj0CAQYIKoZIzj0D -AQcDQgAEoCV+bVOLTJMy38j50sc3vE5k41GMRgriFJt0g0OVX8yaOZ93CZTI7Lzf -GbMU+KqWTgOwGhrPvpusep3fjw+dAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIGA1Ud -EwEB/wQIMAYBAf8CAQIwHQYDVR0OBBYEFDpLhSKBN3njfb6cXQCdRLzCZt0ZMB8G -A1UdIwQYMBaAFDpLhSKBN3njfb6cXQCdRLzCZt0ZMAoGCCqGSM49BAMCA0gAMEUC -IFU3BmzntGGeXZu2qWZx249nYn37S0AkCnQ3rUtI31bdAiEAsPICnZ+GB8yCN26N -OL+N8dHvXiOvZ9/Vl488pyWOccY= ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/errors/error_test.go b/vendor/github.com/cloudflare/cfssl/errors/error_test.go deleted file mode 100644 index 7b04b1d..0000000 --- a/vendor/github.com/cloudflare/cfssl/errors/error_test.go +++ /dev/null @@ -1,338 +0,0 @@ -package errors - -import ( - "crypto/x509" - "encoding/json" - "errors" - "testing" -) - -func TestNew(t *testing.T) { - err := New(CertificateError, Unknown) - if err == nil { - t.Fatal("Error creation failed.") - } - if err.ErrorCode != int(CertificateError)+int(Unknown) { - t.Fatal("Error code construction failed.") - } - if err.Message != "Unknown certificate error" { - t.Fatal("Error message construction failed.") - } - - code := New(OCSPError, ReadFailed).ErrorCode - if code != 8001 { - t.Fatal("Improper error code") - } - - code = New(OCSPError, IssuerMismatch).ErrorCode - if code != 8100 { - t.Fatal("Improper error code") - } - - code = New(OCSPError, InvalidStatus).ErrorCode - if code != 8200 { - t.Fatal("Improper error code") - } - - code = New(CertificateError, Unknown).ErrorCode - if code != 1000 { - t.Fatal("Improper error code") - } - code = New(CertificateError, ReadFailed).ErrorCode - if code != 1001 { - t.Fatal("Improper error code") - } - code = New(CertificateError, DecodeFailed).ErrorCode - if code != 1002 { - t.Fatal("Improper error code") - } - code = New(CertificateError, ParseFailed).ErrorCode - if code != 1003 { - t.Fatal("Improper error code") - } - code = New(CertificateError, SelfSigned).ErrorCode - if code != 1100 { - t.Fatal("Improper error code") - } - code = New(CertificateError, VerifyFailed).ErrorCode - if code != 1200 { - t.Fatal("Improper error code") - } - code = New(CertificateError, BadRequest).ErrorCode - if code != 1300 { - t.Fatal("Improper error code") - } - code = New(CertificateError, MissingSerial).ErrorCode - if code != 1400 { - t.Fatal("Improper error code") - } - - code = New(PrivateKeyError, Unknown).ErrorCode - if code != 2000 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, ReadFailed).ErrorCode - if code != 2001 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, DecodeFailed).ErrorCode - if code != 2002 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, ParseFailed).ErrorCode - if code != 2003 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, Encrypted).ErrorCode - if code != 2100 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, NotRSAOrECC).ErrorCode - if code != 2200 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, KeyMismatch).ErrorCode - if code != 2300 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, GenerationFailed).ErrorCode - if code != 2400 { - t.Fatal("Improper error code") - } - code = New(PrivateKeyError, Unavailable).ErrorCode - if code != 2500 { - t.Fatal("Improper error code") - } - - code = New(IntermediatesError, Unknown).ErrorCode - if code != 3000 { - t.Fatal("Improper error code") - } - code = New(IntermediatesError, ReadFailed).ErrorCode - if code != 3001 { - t.Fatal("Improper error code") - } - code = New(IntermediatesError, DecodeFailed).ErrorCode - if code != 3002 { - t.Fatal("Improper error code") - } - code = New(IntermediatesError, ParseFailed).ErrorCode - if code != 3003 { - t.Fatal("Improper error code") - } - - code = New(RootError, Unknown).ErrorCode - if code != 4000 { - t.Fatal("Improper error code") - } - code = New(RootError, ReadFailed).ErrorCode - if code != 4001 { - t.Fatal("Improper error code") - } - code = New(RootError, DecodeFailed).ErrorCode - if code != 4002 { - t.Fatal("Improper error code") - } - code = New(RootError, ParseFailed).ErrorCode - if code != 4003 { - t.Fatal("Improper error code") - } - - code = New(PolicyError, Unknown).ErrorCode - if code != 5000 { - t.Fatal("Improper error code") - } - code = New(PolicyError, NoKeyUsages).ErrorCode - if code != 5100 { - t.Fatal("Improper error code") - } - code = New(PolicyError, InvalidPolicy).ErrorCode - if code != 5200 { - t.Fatal("Improper error code") - } - code = New(PolicyError, InvalidRequest).ErrorCode - if code != 5300 { - t.Fatal("Improper error code") - } - code = New(PolicyError, UnknownProfile).ErrorCode - if code != 5400 { - t.Fatal("Improper error code") - } - - code = New(DialError, Unknown).ErrorCode - if code != 6000 { - t.Fatal("Improper error code") - } - - code = New(APIClientError, AuthenticationFailure).ErrorCode - if code != 7100 { - t.Fatal("Improper error code") - } - code = New(APIClientError, JSONError).ErrorCode - if code != 7200 { - t.Fatal("Improper error code") - } - code = New(APIClientError, ClientHTTPError).ErrorCode - if code != 7400 { - t.Fatal("Improper error code") - } - code = New(APIClientError, IOError).ErrorCode - if code != 7300 { - t.Fatal("Improper error code") - } - code = New(APIClientError, ServerRequestFailed).ErrorCode - if code != 7500 { - t.Fatal("Improper error code") - } - - code = New(CSRError, Unknown).ErrorCode - if code != 9000 { - t.Fatal("Improper error code") - } - code = New(CSRError, ReadFailed).ErrorCode - if code != 9001 { - t.Fatal("Improper error code") - } - code = New(CSRError, DecodeFailed).ErrorCode - if code != 9002 { - t.Fatal("Improper error code") - } - code = New(CSRError, ParseFailed).ErrorCode - if code != 9003 { - t.Fatal("Improper error code") - } - code = New(CSRError, KeyMismatch).ErrorCode - if code != 9300 { - t.Fatal("Improper error code") - } - code = New(CSRError, BadRequest).ErrorCode - if code != 9300 { - t.Fatal("Improper error code") - } - - code = New(CTError, Unknown).ErrorCode - if code != 10000 { - t.Fatal("Improper error code") - } - code = New(CTError, PrecertSubmissionFailed).ErrorCode - if code != 10100 { - t.Fatal("Improper error code") - } -} - -func TestWrap(t *testing.T) { - msg := "Arbitrary error message" - err := Wrap(CertificateError, Unknown, errors.New(msg)) - if err == nil { - t.Fatal("Error creation failed.") - } - if err.ErrorCode != int(CertificateError)+int(Unknown) { - t.Fatal("Error code construction failed.") - } - if err.Message != msg { - t.Fatal("Error message construction failed.") - } - - err = Wrap(CertificateError, VerifyFailed, x509.CertificateInvalidError{Reason: x509.Expired}) - if err == nil { - t.Fatal("Error creation failed.") - } - if err.ErrorCode != int(CertificateError)+int(VerifyFailed)+certificateInvalid+int(x509.Expired) { - t.Fatal("Error code construction failed.") - } - if err.Message != "x509: certificate has expired or is not yet valid" { - t.Fatal("Error message construction failed.") - } - - err = Wrap(CertificateError, VerifyFailed, x509.UnknownAuthorityError{}) - if err == nil { - t.Fatal("Error creation failed.") - } - - err = Wrap(RootError, Unknown, errors.New(msg)) - if err == nil { - t.Fatal("Error creation failed.") - } - if err.ErrorCode != int(RootError)+int(Unknown) { - t.Fatal("Error code construction failed.") - } - if err.Message != msg { - t.Fatal("Error message construction failed.") - } -} - -func TestMarshal(t *testing.T) { - msg := "Arbitrary error message" - err := Wrap(CertificateError, Unknown, errors.New(msg)) - bytes, _ := json.Marshal(err) - var received Error - json.Unmarshal(bytes, &received) - if received.ErrorCode != int(CertificateError)+int(Unknown) { - t.Fatal("Error code construction failed.") - } - if received.Message != msg { - t.Fatal("Error message construction failed.") - } -} - -func TestErrorString(t *testing.T) { - msg := "Arbitrary error message" - err := Wrap(CertificateError, Unknown, errors.New(msg)) - str := err.Error() - if str != `{"code":1000,"message":"`+msg+`"}` { - t.Fatal("Incorrect Error():", str) - } -} - -func TestHTTP(t *testing.T) { - err := NewMethodNotAllowed("GET") - if err == nil { - t.Fatal("New Mathod Check failed") - } - - err = NewBadRequest(errors.New("Bad Request")) - if err == nil { - t.Fatal("New Bad Request Check failed") - } - - if err.StatusCode != 400 { - t.Fatal("New Bad Request error code construction failed") - } - - err = NewBadRequestString("Bad Request String") - if err == nil { - t.Fatal("New Bad Request String Check failed") - } - - if err.StatusCode != 400 { - t.Fatal("New Bad Request String error code construction failed") - } - - err = NewBadRequestMissingParameter("Request Missing Parameter") - if err == nil { - t.Fatal("New Bad Request Missing Parameter Check failed") - } - - if err.StatusCode != 400 { - t.Fatal("New Bad Request Missing Parameter error code construction failed") - } - - err = NewBadRequestUnwantedParameter("Unwanted Parameter Present In Request") - if err == nil { - t.Fatal("New Bad Request Unwanted Parameter Check failed") - } - - if err.StatusCode != 400 { - t.Fatal("New Bad Request Unwanted Parameter error code construction failed") - } - -} - -func TestHTTPErrorString(t *testing.T) { - method := "GET" - err := NewMethodNotAllowed(method) - str := err.Error() - if str != `Method is not allowed:"`+method+`"` { - t.Fatal("Incorrect Error():", str) - } -} diff --git a/vendor/github.com/cloudflare/cfssl/helpers/helpers_test.go b/vendor/github.com/cloudflare/cfssl/helpers/helpers_test.go deleted file mode 100644 index c099828..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/helpers_test.go +++ /dev/null @@ -1,629 +0,0 @@ -package helpers - -import ( - "bytes" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - "crypto/x509" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/pem" - "io/ioutil" - "math" - "testing" - "time" - - "golang.org/x/crypto/ocsp" - - "github.com/google/certificate-transparency-go" -) - -const ( - testCertFile = "testdata/cert.pem" - testCertDERFile = "testdata/cert.der" - testBundleFile = "testdata/bundle.pem" - testExtraWSCertFile = "testdata/cert_with_whitespace.pem" - testExtraWSBundleFile = "testdata/bundle_with_whitespace.pem" - testMessedUpBundleFile = "testdata/messed_up_bundle.pem" - testMessedUpCertFile = "testdata/messedupcert.pem" - testEmptyCertFile = "testdata/emptycert.pem" - testPrivateRSAKey = "testdata/priv_rsa_key.pem" - testPrivateECDSAKey = "testdata/private_ecdsa_key.pem" - testUnsupportedECDSAKey = "testdata/secp256k1-key.pem" - testMessedUpPrivateKey = "testdata/messed_up_priv_key.pem" - testEncryptedPrivateKey = "testdata/enc_priv_key.pem" - testEmptyPem = "testdata/empty.pem" - testNoHeaderCert = "testdata/noheadercert.pem" - testSinglePKCS7 = "testdata/cert_pkcs7.pem" // openssl crl2pkcs7 -nocrl -out cert_pkcs7.pem -in cert.pem - testEmptyPKCS7DER = "testdata/empty_pkcs7.der" // openssl crl2pkcs7 -nocrl -out empty_pkcs7.der -outform der - testEmptyPKCS7PEM = "testdata/empty_pkcs7.pem" // openssl crl2pkcs7 -nocrl -out empty_pkcs7.pem -outform pem - testMultiplePKCS7 = "testdata/bundle_pkcs7.pem" - testPKCS12EmptyPswd = "testdata/emptypasswordpkcs12.p12" - testPKCS12Passwordispassword = "testdata/passwordpkcs12.p12" - testPKCS12MultipleCerts = "testdata/multiplecerts.p12" - testCSRPEM = "testdata/test.csr.pem" - testCSRPEMBad = "testdata/test.bad.csr.pem" -) - -func TestParseCertificatesDER(t *testing.T) { - var password = []string{"password", "", ""} - for i, testFile := range []string{testPKCS12Passwordispassword, testPKCS12EmptyPswd, testCertDERFile} { - testDER, err := ioutil.ReadFile(testFile) - if err != nil { - t.Fatal(err) - } - if _, _, err := ParseCertificatesDER(testDER, password[i]); err != nil { - t.Fatal(err) - } - // Incorrect Password for PKCS12 formatted files - if _, _, err := ParseCertificatesDER(testDER, "incorrectpassword"); err == nil && i != 2 { - t.Fatal(err) - } - } - - testDER, err := ioutil.ReadFile(testEmptyPKCS7DER) - if err != nil { - t.Fatal(err) - } - // PKCS7 with no certificates - if _, _, err := ParseCertificatesDER(testDER, ""); err == nil { - t.Fatal(err) - } -} - -func TestKeyLength(t *testing.T) { - expNil := 0 - recNil := KeyLength(nil) - if expNil != recNil { - t.Fatal("KeyLength on nil did not return 0") - } - - expNonsense := 0 - inNonsense := "string?" - outNonsense := KeyLength(inNonsense) - if expNonsense != outNonsense { - t.Fatal("KeyLength malfunctioning on nonsense input") - } - - //test the ecdsa branch - ecdsaPriv, _ := ecdsa.GenerateKey(elliptic.P224(), rand.Reader) - ecdsaIn, _ := ecdsaPriv.Public().(*ecdsa.PublicKey) - expEcdsa := ecdsaIn.Curve.Params().BitSize - outEcdsa := KeyLength(ecdsaIn) - if expEcdsa != outEcdsa { - t.Fatal("KeyLength malfunctioning on ecdsa input") - } - - //test the rsa branch - rsaPriv, _ := rsa.GenerateKey(rand.Reader, 256) - rsaIn, _ := rsaPriv.Public().(*rsa.PublicKey) - expRsa := rsaIn.N.BitLen() - outRsa := KeyLength(rsaIn) - - if expRsa != outRsa { - t.Fatal("KeyLength malfunctioning on rsa input") - } -} - -func TestExpiryTime(t *testing.T) { - // nil case - var expNil time.Time - inNil := []*x509.Certificate{} - outNil := ExpiryTime(inNil) - if expNil != outNil { - t.Fatal("Expiry time is malfunctioning on empty input") - } - - //read a pem file and use that expiry date - bytes, _ := ioutil.ReadFile(testBundleFile) - certs, err := ParseCertificatesPEM(bytes) - if err != nil { - t.Fatalf("%v", err) - } - expected := time.Date(2014, time.April, 15, 0, 0, 0, 0, time.UTC) - out := ExpiryTime(certs) - if out != expected { - t.Fatalf("Expected %v, got %v", expected, out) - } -} - -func TestMonthsValid(t *testing.T) { - var cert = &x509.Certificate{ - NotBefore: time.Date(2015, time.April, 01, 0, 0, 0, 0, time.UTC), - NotAfter: time.Date(2015, time.April, 01, 0, 0, 0, 0, time.UTC), - } - - if MonthsValid(cert) != 0 { - t.Fail() - } - - cert.NotAfter = time.Date(2016, time.April, 01, 0, 0, 0, 0, time.UTC) - if MonthsValid(cert) != 12 { - t.Fail() - } - - // extra days should be rounded up to 1 month - cert.NotAfter = time.Date(2016, time.April, 02, 0, 0, 0, 0, time.UTC) - if MonthsValid(cert) != 13 { - t.Fail() - } -} - -func TestHasValidExpiry(t *testing.T) { - // Issue period > April 1, 2015 - var cert = &x509.Certificate{ - NotBefore: time.Date(2015, time.April, 01, 0, 0, 0, 0, time.UTC), - NotAfter: time.Date(2016, time.April, 01, 0, 0, 0, 0, time.UTC), - } - - if !ValidExpiry(cert) { - t.Fail() - } - - cert.NotAfter = time.Date(2019, time.April, 01, 01, 0, 0, 0, time.UTC) - if ValidExpiry(cert) { - t.Fail() - } - - // Issue period < July 1, 2012 - cert.NotBefore = time.Date(2009, time.March, 01, 0, 0, 0, 0, time.UTC) - if ValidExpiry(cert) { - t.Fail() - } - - // Issue period July 1, 2012 - April 1, 2015 - cert.NotBefore = time.Date(2012, time.July, 01, 0, 0, 0, 0, time.UTC) - cert.NotAfter = time.Date(2017, time.July, 01, 0, 0, 0, 0, time.UTC) - if !ValidExpiry(cert) { - t.Fail() - } -} - -func TestHashAlgoString(t *testing.T) { - if HashAlgoString(x509.MD2WithRSA) != "MD2" { - t.Fatal("standin") - } - if HashAlgoString(x509.MD5WithRSA) != "MD5" { - t.Fatal("standin") - } - if HashAlgoString(x509.SHA1WithRSA) != "SHA1" { - t.Fatal("standin") - } - if HashAlgoString(x509.SHA256WithRSA) != "SHA256" { - t.Fatal("standin") - } - if HashAlgoString(x509.SHA384WithRSA) != "SHA384" { - t.Fatal("standin") - } - if HashAlgoString(x509.SHA512WithRSA) != "SHA512" { - t.Fatal("standin") - } - if HashAlgoString(x509.DSAWithSHA1) != "SHA1" { - t.Fatal("standin") - } - if HashAlgoString(x509.DSAWithSHA256) != "SHA256" { - t.Fatal("standin") - } - if HashAlgoString(x509.ECDSAWithSHA1) != "SHA1" { - t.Fatal("standin") - } - if HashAlgoString(x509.ECDSAWithSHA256) != "SHA256" { - t.Fatal("standin") - } - if HashAlgoString(x509.ECDSAWithSHA384) != "SHA384" { - t.Fatal("standin") - } - if HashAlgoString(x509.ECDSAWithSHA512) != "SHA512" { - t.Fatal("standin") - } - if HashAlgoString(math.MaxInt32) != "Unknown Hash Algorithm" { - t.Fatal("standin") - } -} - -func TestSignatureString(t *testing.T) { - if SignatureString(x509.MD2WithRSA) != "MD2WithRSA" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.MD5WithRSA) != "MD5WithRSA" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.SHA1WithRSA) != "SHA1WithRSA" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.SHA256WithRSA) != "SHA256WithRSA" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.SHA384WithRSA) != "SHA384WithRSA" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.SHA512WithRSA) != "SHA512WithRSA" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.DSAWithSHA1) != "DSAWithSHA1" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.DSAWithSHA256) != "DSAWithSHA256" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.ECDSAWithSHA1) != "ECDSAWithSHA1" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.ECDSAWithSHA256) != "ECDSAWithSHA256" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.ECDSAWithSHA384) != "ECDSAWithSHA384" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(x509.ECDSAWithSHA512) != "ECDSAWithSHA512" { - t.Fatal("Signature String functioning improperly") - } - if SignatureString(math.MaxInt32) != "Unknown Signature" { - t.Fatal("Signature String functioning improperly") - } -} - -func TestParseCertificatePEM(t *testing.T) { - for _, testFile := range []string{testCertFile, testExtraWSCertFile, testSinglePKCS7} { - certPEM, err := ioutil.ReadFile(testFile) - if err != nil { - t.Fatal(err) - } - - if _, err := ParseCertificatePEM(certPEM); err != nil { - t.Log(testFile) - t.Fatal(err) - } - } - for _, testFile := range []string{testBundleFile, testMessedUpCertFile, testEmptyPKCS7PEM, testEmptyCertFile, testMultiplePKCS7} { - certPEM, err := ioutil.ReadFile(testFile) - if err != nil { - t.Fatal(err) - } - - if _, err := ParseCertificatePEM(certPEM); err == nil { - t.Fatal("Incorrect cert failed to raise error") - } - } -} - -func TestParseCertificatesPEM(t *testing.T) { - // expected cases - for _, testFile := range []string{testBundleFile, testExtraWSBundleFile, testSinglePKCS7, testMultiplePKCS7} { - bundlePEM, err := ioutil.ReadFile(testFile) - if err != nil { - t.Fatal(err) - } - - if _, err := ParseCertificatesPEM(bundlePEM); err != nil { - t.Log(testFile) - t.Fatal(err) - } - } - - // test failure cases - // few lines deleted, then headers removed - for _, testFile := range []string{testMessedUpBundleFile, testEmptyPKCS7PEM, testNoHeaderCert} { - bundlePEM, err := ioutil.ReadFile(testFile) - if err != nil { - t.Fatal(err) - } - - if _, err := ParseCertificatesPEM(bundlePEM); err == nil { - t.Fatal("Incorrectly-formatted file failed to produce an error") - } - } -} - -func TestSelfSignedCertificatePEM(t *testing.T) { - testPEM, _ := ioutil.ReadFile(testCertFile) - _, err := ParseSelfSignedCertificatePEM(testPEM) - if err != nil { - t.Fatalf("%v", err) - } - - // a few lines deleted from the pem file - wrongPEM, _ := ioutil.ReadFile(testMessedUpCertFile) - _, err2 := ParseSelfSignedCertificatePEM(wrongPEM) - if err2 == nil { - t.Fatal("Improper pem file failed to raise an error") - } - - // alter the signature of a valid certificate - blk, _ := pem.Decode(testPEM) - blk.Bytes[len(blk.Bytes)-10]++ // some hacking to get to the sig - alteredBytes := pem.EncodeToMemory(blk) - _, err = ParseSelfSignedCertificatePEM(alteredBytes) - if err == nil { - t.Fatal("Incorrect cert failed to produce an error") - } - -} - -func TestParsePrivateKeyPEM(t *testing.T) { - - // expected cases - testRSAPEM, _ := ioutil.ReadFile(testPrivateRSAKey) - _, err := ParsePrivateKeyPEM(testRSAPEM) - if err != nil { - t.Fatal(err) - } - - testECDSAPEM, _ := ioutil.ReadFile(testPrivateECDSAKey) - _, err = ParsePrivateKeyPEM(testECDSAPEM) - if err != nil { - t.Fatal(err) - } - - // error cases - errCases := []string{ - testMessedUpPrivateKey, // a few lines deleted - testEmptyPem, // empty file - testEncryptedPrivateKey, // encrypted key - testUnsupportedECDSAKey, // ECDSA curve not currently supported by Go standard library - } - - for _, fname := range errCases { - testPEM, _ := ioutil.ReadFile(fname) - _, err = ParsePrivateKeyPEM(testPEM) - if err == nil { - t.Fatal("Incorrect private key failed to produce an error") - } - } - -} - -// Imported from signers/local/testdata/ -const ecdsaTestCSR = "testdata/ecdsa256.csr" - -func TestParseCSRPEM(t *testing.T) { - in, err := ioutil.ReadFile(ecdsaTestCSR) - if err != nil { - t.Fatalf("%v", err) - } - - _, _, err = ParseCSR(in) - if err != nil { - t.Fatalf("%v", err) - } - - in[12]++ - _, _, err = ParseCSR(in) - if err == nil { - t.Fatalf("Expected an invalid CSR.") - } - in[12]-- -} - -func TestParseCSRPEMMore(t *testing.T) { - csrPEM, err := ioutil.ReadFile(testCSRPEM) - if err != nil { - t.Fatal(err) - } - - if _, err := ParseCSRPEM(csrPEM); err != nil { - t.Fatal(err) - } - - csrPEM, err = ioutil.ReadFile(testCSRPEMBad) - if err != nil { - t.Fatal(err) - } - - if _, err := ParseCSRPEM(csrPEM); err == nil { - t.Fatal(err) - } - - if _, err := ParseCSRPEM([]byte("not even pem")); err == nil { - t.Fatal("Expected an invalid CSR.") - } -} - -// Imported from signers/local/testdata/ -const rsaOldTestCSR = "testdata/rsa-old.csr" - -func TestParseOldCSR(t *testing.T) { - in, err := ioutil.ReadFile(rsaOldTestCSR) - if err != nil { - t.Fatalf("%v", err) - } - - _, _, err = ParseCSR(in) - if err != nil { - t.Fatalf("%v", err) - } -} - -// Imported from signers/local/testdata/ -const clientCertFile = "testdata/ca.pem" -const clientKeyFile = "testdata/ca_key.pem" - -func TestClientCertParams(t *testing.T) { - _, err := LoadClientCertificate(testCertFile, testPrivateRSAKey) - if err == nil { - t.Fatal("Unmatched cert/key should generate error") - } - - cert, err := LoadClientCertificate("", "") - if err != nil || cert != nil { - t.Fatal("Certificate atempted to loaded with missing key and cert") - } - cert, err = LoadClientCertificate(clientCertFile, "") - if err != nil || cert != nil { - t.Fatal("Certificate atempted to loaded with missing key") - } - cert, err = LoadClientCertificate("", clientKeyFile) - if err != nil || cert != nil { - t.Fatal("Certificate atempted to loaded with missing cert") - } - - cert, err = LoadClientCertificate(clientCertFile, clientKeyFile) - if err != nil { - t.Fatal(err) - } - if cert == nil { - t.Fatal("cert not created") - } -} - -func TestLoadPEMCertPool(t *testing.T) { - certPool, err := PEMToCertPool([]byte{}) - if certPool != nil || err != nil { - t.Fatal("Empty file name should not generate error or a cert pool") - } - - in, err := ioutil.ReadFile(testEmptyPem) - if err != nil { - t.Fatalf("%v", err) - } - certPool, err = PEMToCertPool(in) - if certPool != nil { - t.Fatal("Empty file should not generate a cert pool") - } else if err == nil { - t.Fatal("Expected error for empty file") - } - - in, err = ioutil.ReadFile(testEmptyCertFile) - if err != nil { - t.Fatalf("%v", err) - } - certPool, err = PEMToCertPool(in) - if certPool != nil { - t.Fatal("Empty cert should not generate a cert pool") - } else if err == nil { - t.Fatal("Expected error for empty cert") - } - - in, err = ioutil.ReadFile(clientCertFile) - if err != nil { - t.Fatalf("%v", err) - } - certPool, err = PEMToCertPool(in) - if err != nil { - t.Fatalf("%v", err) - } else if certPool == nil { - t.Fatal("cert pool not created") - } -} - -// sctEquals returns true if all fields of both SCTs are equivalent. -func sctEquals(sctA, sctB ct.SignedCertificateTimestamp) bool { - if sctA.SCTVersion == sctB.SCTVersion && - sctA.LogID == sctB.LogID && - sctA.Timestamp == sctB.Timestamp && - bytes.Equal(sctA.Extensions, sctB.Extensions) && - sctA.Signature.Algorithm == sctB.Signature.Algorithm && - bytes.Equal(sctA.Signature.Signature, sctA.Signature.Signature) { - return true - } - return false -} - -// NOTE: TestDeserializeSCTList tests both DeserializeSCTList and -// SerializeSCTList. -func TestDeserializeSCTList(t *testing.T) { - // Here we make sure that empty SCT lists return an error - emptyLists := [][]byte{nil, {}} - for _, emptyList := range emptyLists { - _, err := DeserializeSCTList(emptyList) - if err == nil { - t.Fatalf("DeserializeSCTList(%v) should raise an error\n", emptyList) - } - } - - // Here we make sure that an SCT list with a zero SCT is deserialized - // correctly - var zeroSCT ct.SignedCertificateTimestamp - serializedSCT, err := SerializeSCTList([]ct.SignedCertificateTimestamp{zeroSCT}) - if err != nil { - t.Fatal(err) - } - deserializedSCTList, err := DeserializeSCTList(serializedSCT) - if err != nil { - t.Fatal(err) - } - if !sctEquals(zeroSCT, (deserializedSCTList)[0]) { - t.Fatal("SCTs don't match") - } - - // Here we verify that an error is raised when the SCT list length - // field is greater than its actual length - serializedSCT, err = SerializeSCTList([]ct.SignedCertificateTimestamp{zeroSCT}) - if err != nil { - t.Fatal(err) - } - serializedSCT[0] = 15 - _, err = DeserializeSCTList(serializedSCT) - if err == nil { - t.Fatalf("DeserializeSCTList should raise an error when " + - "the SCT list length field and the list length don't match\n") - } - - // Here we verify that an error is raised when the SCT list length - // field is less than its actual length - serializedSCT[0] = 0 - serializedSCT[1] = 0 - _, err = DeserializeSCTList(serializedSCT) - if err == nil { - t.Fatalf("DeserializeSCTList should raise an error when " + - "the SCT list length field and the list length don't match\n") - } - - // Here we verify that an error is raised when the SCT length field is - // greater than its actual length - serializedSCT[0] = 0 - serializedSCT[1] = 49 - serializedSCT[2] = 1 - _, err = DeserializeSCTList(serializedSCT) - if err == nil { - t.Fatalf("DeserializeSCTList should raise an error when " + - "the SCT length field and the SCT length don't match\n") - } - - // Here we verify that an error is raised when the SCT length field is - // less than its actual length - serializedSCT[2] = 0 - serializedSCT[3] = 0 - _, err = DeserializeSCTList(serializedSCT) - if err == nil { - t.Fatalf("DeserializeSCTList should raise an error when " + - "the SCT length field and the SCT length don't match\n") - } -} - -func TestSCTListFromOCSPResponse(t *testing.T) { - var response ocsp.Response - lst, err := SCTListFromOCSPResponse(&response) - if err != nil { - t.Fatal(err) - } - if len(lst) != 0 { - t.Fatal("SCTListFromOCSPResponse should return an empty SCT list for an empty extension") - } - - var zeroSCT ct.SignedCertificateTimestamp - serializedSCTList, err := SerializeSCTList([]ct.SignedCertificateTimestamp{zeroSCT}) - if err != nil { - t.Fatal("failed to serialize SCT list") - } - serializedSCTList, err = asn1.Marshal(serializedSCTList) - if err != nil { - t.Fatal("failed to serialize SCT list") - } - // The value of Id below is the object identifier of the OCSP Stapling - // SCT extension (see section 3.3. of RFC 6962). - response.Extensions = []pkix.Extension{{ - Id: asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 5}, - Critical: false, - Value: serializedSCTList, - }} - lst, err = SCTListFromOCSPResponse(&response) - if err != nil { - t.Fatal(err) - } - if !sctEquals(zeroSCT, lst[0]) { - t.Fatal("SCTs don't match") - } -} diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle.pem deleted file mode 100644 index 2f4ca68..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle.pem +++ /dev/null @@ -1,53 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEczCCAl2gAwIBAgIIDARj8BWNsscwCwYJKoZIhvcNAQELMIGMMQswCQYDVQQG -EwJVUzETMBEGA1UEChMKQ2xvdWRGbGFyZTEcMBoGA1UECxMTU3lzdGVtcyBFbmdp -bmVlcmluZzEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzETMBEGA1UECBMKQ2FsaWZv -cm5pYTEdMBsGA1UEAxMUY2xvdWRmbGFyZS1pbnRlci5jb20wHhcNMTQwMzAyMDAw -MDAwWhcNMTkwNDAxMDAwMDAwWjCBjDELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkNs -b3VkRmxhcmUxHDAaBgNVBAsTE1N5c3RlbXMgRW5naW5lZXJpbmcxFjAUBgNVBAcT -DVNhbiBGcmFuY2lzY28xEzARBgNVBAgTCkNhbGlmb3JuaWExHTAbBgNVBAMTFGNs -b3VkZmxhcmUtaW50ZXIuY29tMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEIVkjNJGw -f3F0XWJH7yQSVtxuoBidi5JNsQ7FhxEQcZEl3b+/1iF60TBY2Yi6KwJuA6nIE73P -IXGyfNhThw4D8CiZbackQ/ufgz2DyvxyWFDPzLr7TXeM/0wSp/imoxWeo4GIMIGF -MA4GA1UdDwEB/wQEAwIApDASBgNVHRMBAf8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f8ECDAGAQH/AgEBMB0GA1UdDgQWBBTXXUgpaSwO9HOrQBxGqOOSFHsH -EDAfBgNVHSMEGDAWgBS4Xu+uZ1C31vMH5Wq+VbNnOg2SPjAfBgNVHREEGDAWghRj -bG91ZGZsYXJlLWludGVyLmNvbTALBgkqhkiG9w0BAQsDgYEAfPLKCAHnPzgMYLX/ -fWznVvOEFAAYZByPFx4QdMBbDZUtxHyvJIBs6PdxrdSuDwSiMqE7qQIi+jzzwGl9 -fC7vf45B2zCX0OW51QL2oWNBdKlGgB+b2pwyME82lX/Pr7V1GY10u+ep1xdZDnch -DaMsXjQQTJu0iuG3qKEuCmUwOmc= ------END CERTIFICATE----- \ No newline at end of file diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_pkcs7.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_pkcs7.pem deleted file mode 100644 index 85a4160..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_pkcs7.pem +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PKCS7----- -MIIJOAYJKoZIhvcNAQcCoIIJKTCCCSUCAQExADALBgkqhkiG9w0BBwGgggkLMIIE -czCCAl2gAwIBAgIIDARj8BWNsscwCwYJKoZIhvcNAQELMIGMMQswCQYDVQQGEwJV -UzETMBEGA1UEChMKQ2xvdWRGbGFyZTEcMBoGA1UECxMTU3lzdGVtcyBFbmdpbmVl -cmluZzEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzETMBEGA1UECBMKQ2FsaWZvcm5p -YTEdMBsGA1UEAxMUY2xvdWRmbGFyZS1pbnRlci5jb20wHhcNMTQwMzAyMDAwMDAw -WhcNMTkwNDAxMDAwMDAwWjCBjDELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkNsb3Vk -RmxhcmUxHDAaBgNVBAsTE1N5c3RlbXMgRW5naW5lZXJpbmcxFjAUBgNVBAcTDVNh -biBGcmFuY2lzY28xEzARBgNVBAgTCkNhbGlmb3JuaW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+RGebDI+TR3QG6Yod06l9oEYZxWXBY7STOs8wuTu3huSnan -/IpWnV017Vsc61D5G+QrqcxZdXckt3anZKCF75JpUnJ7vuowTmmHlb8KIMa9mOvc -uGX4P6mz8gTi2arl/aL27kj9Q0Jgv/y1ebe2Bx2P9TF6+VNDDL3J/vSVlFeqLt2r -eAIBKnytLwIDAQABo4GIMIGFMA4GA1UdDwEB/wQEAwIApDASBgNVHRMBAf8ECDAG -AQH/AgEBMB0GA1UdDgQWBBTXXUgpaSwO9HOrQBxGqOOSFHsHEDAfBgNVHSMEGDAW -gBS4Xu+uZ1C31vMH5Wq+VbNnOg2SPjAfBgNVHREEGDAWghRjbG91ZGZsYXJlLWlu -dGVyLmNvbTALBgkqhkiG9w0BAQsDgYEAfPLKCAHnPzgMYLX/fWznVvOEFAAYZByP -Fx4QdMBbDZUtxHyvJIBs6PdxrdSuDwSiMqE7qQIi+jzzwGl9fC7vf45B2zCX0OW5 -1QL2oWNBdKlGgB+b2pwyME82lX/Pr7V1GY10u+ep1xdZDnchDaMsXjQQTJu0iuG3 -qKEuCmUwOmehADEA ------END PKCS7----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_with_whitespace.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_with_whitespace.pem deleted file mode 100644 index dce0d8f..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/bundle_with_whitespace.pem +++ /dev/null @@ -1,56 +0,0 @@ - ------BEGIN CERTIFICATE----- -MIIEczCCAl2gAwIBAgIIDARj8BWNsscwCwYJKoZIhvcNAQELMIGMMQswCQYDVQQG -EwJVUzETMBEGA1UEChMKQ2xvdWRGbGFyZTEcMBoGA1UECxMTU3lzdGVtcyBFbmdp -bmVlcmluZzEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzETMBEGA1UECBMKQ2FsaWZv -cm5pYTEdMBsGA1UEAxMUY2xvdWRmbGFyZS1pbnRlci5jb20wHhcNMTQwMzAyMDAw -MDA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k8wCR1/CW/ii9v1BKOVjXwCfEtIXjg0 -APJx1VNSSH6XoDpUETL+eQ4J0FL9XNbsDuYar7+zD0N1/5vSo3HLNRQR9f0lbsys -sWBEN+CxK19xyPumr21Z0bU0f1B5H52VSF0q3I1Ju9wRo994a7YipdGcmZ2lChmT -7r3mzlBTYl3poU26q34v8wG9U7Jv4fsZJ+RGebDI+TR3QG6Yod06l9oEYZxWXBY7 -STOs8wuTu3huSnan/IpWnV017Vsc61D5G+QrqcxZdXckt3anZKCF75JpUnJ7vuow -TmmHlb8KIMa9mOvcuGX4P6mz8gTi2arl/aL27kj9Q0Jgv/y1ebe2Bx2P9TF6+VND -DL3J/vSVlFeqLt2reAIBKnytLwIDAQABo4GIMIGFMA4GA1UdDwEB/wQEAwIApDAS -BgNVHRMBAf8ECDAGAQH/AgEBMB0GA1UdDgQWBBTXXUgpaSwO9HOrQBxGqOOSFHsH -EDAfBgNVHSMEGDAWgBS4Xu+uZ1C31vMH5Wq+VbNnOg2SPjAfBgNVHREEGDAWghRj -bG91ZGZsYXJlLWludGVyLmNvbTALBgkqhkiG9w0BAQsDgYEAfPLKCAHnPzgMYLX/ -fWznVvOEFAAYZByPFx4QdMBbDZUtxHyvJIBs6PdxrdSuDwSiMqE7qQIi+jzzwGl9 -fC7vf45B2zCX0OW51QL2oWNBdKlGgB+b2pwyME82lX/Pr7V1GY10u+ep1xdZDnch -DaMsXjQQTJu0iuG3qKEuCmUwOmc= ------END CERTIFICATE----- - diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/ca.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/ca.pem deleted file mode 100644 index 1a1f5a9..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/ca.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEmzCCA4OgAwIBAgIMAMSvNBgypwaaSQ5iMA0GCSqGSIb3DQEBBQUAMIGMMQsw -CQYDVQQGEwJVUzETMBEGA1UECBM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QTEeMBwGCSqGSIb3DQEJARYPdGVz -dEB0ZXN0LmxvY2FsggwAxK80GDKnBppJDmIwDwYDVR0TBAgwBgEB/wIBADANBgkq -hkiG9w0BAQUFAAOCAQEAJ7r1EZYDwed6rS0+YKHdkRGRQ5Rz6A9DIVBPXrSMAGj3 -F5EF2m/GJbhpVbnNJTVlgP9DDyabOZNxzdrCr4cHMkYYnocDdgAodnkw6GZ/GJTc -depbVTR4TpihFNzeDEGJePrEwM1DouGswpu97jyuCYZ3z1a60+a+3C1GwWaJ7Aet -Uqm+yLTUrMISsfnDPqJdM1NeqW3jiZ4IgcqJkieCCSpag9Xuzrp9q6rjmePvlQkv -qz020JGg6VijJ+c6Tf5y0XqbAhkBTqYtVamu9gEth9utn12EhdNjTZMPKMjjgFUd -H0N6yOEuQMl4ky7RxZBM0iPyeob6i4z2LEQilgv9MQ== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/ca_key.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/ca_key.pem deleted file mode 100644 index d2de6bf..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/ca_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCxGnXFJ8gOgP/j -QGjgeWzewWfh1q/k2DFtkalXIYXt0kj27R4ScvgFQayw9pQUtYLzcJnG6NQSIR8T -Sgpf646GEa/f6PnFJM0zvribZ5KI3ndx1m0rTl2HCr25Lwu2Mo5B43WZDmqaKrEE -x2OQqAyxXDmUwKChgqjnuRooXJfN2k1UPOrD6m0daa420NCMrepPkxrTqZg+YgZi -EhlgtjugkaD1kRo1HQYjDjMhPklGw2JpJvnBMvBprSf/i8snJWMslxiYkG9laPyD -61or4Lgg27+Ma7H5uawL2GrXi1s5pM0Cf80TSo3ygfBxEESp850Rh1mTEjk1Y+Io -1b9D4B5dAgMBAAECggEAKHh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QZQmsFhAMhkN4hsj6dJfAGn2gRLRiVRAika+8QF65xMZiVQWUVSUZADWERi -0SXGjzN1wYxO3Qzy3LYwws6fxFAq5lo79eb38yFT2lHdqK3x/QgiDSRVl+R6cExV -xQB518/lp2eIeMpglWByDwJX ------END PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert.der b/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert.der deleted file mode 100644 index 3d35085ed1e366f2bc2fc4c7cc5dca8a5b4c2d69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 496 zcmXqLVtixJ#5idIGZP~d6Nm5@FhL)y=CMHo}u7#1YfuX4xkV|FTA`OJu*ug$wVuX5$nUS5@ ziGjs+kN8XbtlxLp@=v*)Zk}sazWixk=xr^Y_*winPb5BGczm|<^L<7wPLftLq=imw zXZtndbBN=>MorY{A$K-qSH5*Ns-~juakeaZ$0#4a)ri{ Z>>CWJDgB+DKiGaJHJ!eheq)cDDgcR4l!*WU diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert.pem deleted file mode 100644 index 081b872..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert.pem +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB7DCCAZKgAwIBAgIIE/Qz49ebG7kwCgYIKoZIzj0EAwIwTDELMAkGA1UEBhMC -VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x -EDAOBgNVBAoTB2FjbWUuY28wHhcNMTcwNTIzMTk1MTQ0WhcNMTcwODIzMDE1NjQ0 -WjBMMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN -U2FuIEZyYW5jaXNjbzEQMA4GA1UEChMHYWNtZS5jbzBZMBMGByqGSM49AgEGCCqG -SM49AwEHA0IABEW8F+k/avvdBm/KRsuDnTZ3p+VuVdsqDF+aD9nIYeOhx5sj574y -hEIZOpgbEsi3BvqY63y2jYyPFodf25+CA9GjXjBcMA4GA1UdDwEB/wQEAwIFoDAd -BgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNV -HQ4EFgQUzDpu+HN89EC1M8aNl7f0Ln5JnnIwCgYIKoZIzj0EAwIDSAAwRQIgC4/r -urbw/pzE3LDA6GpIts6TVyzgftLLEfU2BzQsjp0CIQDo+sn8t7XC6JN4KKRr2ABl -ZI+JifgG+2KCy9ln2LxGJQ== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_pkcs7.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_pkcs7.pem deleted file mode 100644 index 6daf376..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_pkcs7.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PKCS7----- -MIICHQYJKoZIhvcNAQcCoIICDjCCAgoCAQExADALBgkqhkiG9w0BBwGgggHwMIIB -7DCCAZKgAwIBAgIIE/Qz49ebG7kwCgYIKoZIzj0EAwIwTDELMAkGA1UEBhMCVVMx -EzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xEDAO -BgNVBAoTB2FjbWUuY28wHhcNMTcwNTIzMTk1MTQ0WhcNMTcwODIzMDE1NjQ0WjBM -MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2Fu -IEZyYW5jaXNjbzEQMA4GA1UEChMHYWNtZS5jbzBZMBMGByqGSM49AgEGCCqGSM49 -AwEHA0IABEW8F+k/avvdBm/KRsuDnTZ3p+VuVdsqDF+aD9nIYeOhx5sj574yhEIZ -OpgbEsi3BvqY63y2jYyPFodf25+CA9GjXjBcMA4GA1UdDwEB/wQEAwIFoDAdBgNV -HSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4E -FgQUzDpu+HN89EC1M8aNl7f0Ln5JnnIwCgYIKoZIzj0EAwIDSAAwRQIgC4/rurbw -/pzE3LDA6GpIts6TVyzgftLLEfU2BzQsjp0CIQDo+sn8t7XC6JN4KKRr2ABlZI+J -ifgG+2KCy9ln2LxGJaEAMQA= ------END PKCS7----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_with_whitespace.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_with_whitespace.pem deleted file mode 100644 index a233037..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/cert_with_whitespace.pem +++ /dev/null @@ -1,15 +0,0 @@ - ------BEGIN CERTIFICATE----- -MIIB7DCCAZKgAwIBAgIIE/Qz49ebG7kwCgYIKoZIzj0EAwIwTDELMAkGA1UEBhMC -VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x -EDAOBgNVBAoTB2FjbWUuY28wHhcNMTcwNTIzMTk1MTQ0WhcNMTcwODIzMDE1NjQ0 -WjBMMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN -U2FuIEZyYW5jaXNjbzEQMA4GA1UEChMHYWNtZS5jbzBZMBMGByqGSM49AgEGCCqG -SM49AwEHA0IABEW8F+k/avvdBm/KRsuDnTZ3p+VuVdsqDF+aD9nIYeOhx5sj574y -hEIZOpgbEsi3BvqY63y2jYyPFodf25+CA9GjXjBcMA4GA1UdDwEB/wQEAwIFoDAd -BgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNV -HQ4EFgQUzDpu+HN89EC1M8aNl7f0Ln5JnnIwCgYIKoZIzj0EAwIDSAAwRQIgC4/r -urbw/pzE3LDA6GpIts6TVyzgftLLEfU2BzQsjp0CIQDo+sn8t7XC6JN4KKRr2ABl -ZI+JifgG+2KCy9ln2LxGJQ== ------END CERTIFICATE----- - diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/ecdsa256.csr b/vendor/github.com/cloudflare/cfssl/helpers/testdata/ecdsa256.csr deleted file mode 100644 index a699254..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/ecdsa256.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgTCCASgCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABBn9Ldie6BOcMHezn2dPuYqW -z/NoLYMLGNBqhOxUyEidYClI0JW2pWyUgT3A2UazFp1WgE94y7Z+2YlfRz+vcrKg -PzA9BgkqhkiG9w0BCQ4xMDAuMCwGA1UdEQQlMCOCDmNsb3VkZmxhcmUuY29tghF3 -d3djbG91ZGZsYXJlLmNvbTAKBggqhkjOPQQDAgNHADBEAiBM+QRxe8u6rkdr10Jy -cxbR6NxrGrNeg5QqiOqF96JEmgIgDbtjd5e3y3I8W/+ih2us3WtMxgnTXfqPd48i -VLcv28Q= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty.pem deleted file mode 100644 index 8b13789..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty.pem +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty_pkcs7.der b/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty_pkcs7.der deleted file mode 100644 index a8f43e1ebf2630de99560dd3cb08d189bddf416c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41 ocmXp|XXDgr^Jx3d%gD~OK*~UZiILHe!GIef%D8}GA%h_U0J2O7aR2}S diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty_pkcs7.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty_pkcs7.pem deleted file mode 100644 index 0ef5355..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/empty_pkcs7.pem +++ /dev/null @@ -1,3 +0,0 @@ ------BEGIN PKCS7----- -MCcGCSqGSIb3DQEHAqAaMBgCAQExADALBgkqhkiG9w0BBwGgAKEAMQA= ------END PKCS7----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/emptycert.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/emptycert.pem deleted file mode 100644 index 9be19b3..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/emptycert.pem +++ /dev/null @@ -1,2 +0,0 @@ ------BEGIN CERTIFICATE----- ------END CERTIFICATE-----LSKFSKLF diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/emptypasswordpkcs12.p12 b/vendor/github.com/cloudflare/cfssl/helpers/testdata/emptypasswordpkcs12.p12 deleted file mode 100644 index 335991ba44a984da2d7f613f68946fbe711ee169..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2557 zcmVs6j>&0MURbgiDdKsSsT>j`3LRn{KQMyT@ zzBl^dVKC?M2l?3haOOO~Ov`F*et5Qu_$va3aV}{#H823A^go6B!m{TqRhHWLxvw@yn^9 z=1rId1Sil-^l444D3i}4b#&zB%^z%8Q6F1CdZeU9<)Ik+6F8rC0i3f>p?fDj;14Qp zM{eL(LQg>KV{=qpFYIl8fBVlkxWi@=+MGCWt|b1MxjO4=U5Egd`faWM9$D-IQFxaA zByi%g;b=YFmJL=kBkDWd&@KgLBDDuS&K3~4bR#nc&Ws9lgc$&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diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/enc_priv_key.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/enc_priv_key.pem deleted file mode 100644 index ac61047..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/enc_priv_key.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-128-CBC,90B8A5792FA2FE75B2053582F3DF394F - -yVY2xuth5fdJBg9gg+6eP3qTsr0CJ2mGEDW6rvYmYuATSRF1hVERrsznxJYjYLaw -JHec8FVr78y4aXxI/aFzlxLkS8f12WjTtIhzHwhzgSJDwVOXSRphnLAeHWnhEKLe -7kO+vzoTPIc3ECwdvtr6//z2tP1/sac+yIhL6C+x2rS5hFHhmDUXtILPxxfHJCiM -qtKiiOZz3W6008CeJMC9ZPlKHDvpq7aIL4rfVP/GkZ+/teQkgWNpMxac7+gWLKuK -109v6pu+8KT49D6SMsaZPvAb5PXcIB79ZCPI1JX0V26CKcswba4RHG/h1xifwyAF -OIvmK29mmFqbx5GPlUefRUuPwRJKCXFiK6LTdhCwLYodtXde4ibvOFYy4onGoVax -I5WVaOhQMqp+mxA6z7odrIvuFcQGixIA+peaaSbpNZSZGuxRvVefcdxPbJ+26Ijs -wq8uyalbwhKtjPTPNkMaaYzJdWS7wd2DS4RM9JT8Y1h6NTftCY3c+/txOlt5pQzW -T8n+NTd4o+PFOHzMnmEnrtf9Y/SSzXDB2OPCD95YdIXItQDdKcjK0NmnY8GNfkWL -G30NJNy3/DR7Sa5u4xuqNgcgTFhgZaOQ1IVB3p5VjknqAX3gWFu2DrqzbH45071A -He7VbdbzBpMHI2EdiCVOuK9fD/5sv25u9vVC2NHtG/YcoEQv+RB52TNHn9kdiMj1 -gLaywPqGjFmaPxI0xX07BrL+D9RruUT1GAEyw4JAHuJZIyq3+V98wmV/pEqwc7hp -8WuSi6YddetfF4NPA5cGWt8qZ1it+wD/1ydQEAQsxdANqi0XVudYpYox02EoRS02 -up0sd9zqz83pN9RyOOKtGcHdt85gb9DYRVeff1UszMaoVULxqxYetwtzpiHn6grL -DmnSk+DYgvXKOVt8tmSJysDTumhK1VN3xb34TYYJxeBOQJLzWFjGSELEpphZAQSj -rS4OM1FwoP48wvASGiWD4VUJ6v+6F+NDvJr01S+zWGLg1EeUZJmXGHW5GrGd4Kgx -3rdeOsrED9oXKp2cpgx9avXJ9upixja9MbAPp7RkSyeHMPvsuaI44xvOP3f0crmG -d/5CdBKVT7nFaeTGSx/78kHb3VJyopAMm9k0V3CheKwBXXSbXmV1+0muBxMHsEI3 -aEKaI0y5cDfTewzo/U0l0kGtxF6kUPN1pdjFpAvssRlkGttFOC2nWxHwaNHpn7Kq -gFAlN6P4cyB6kb+LvckIYTZ/tV39dx7PfL0KG5TWjJ4a9GSoL1IrAhQq+Qv6oUEt -1vlejZoKyZ/35fni0fmeYNho+pCPimm6l+sHTuXkrWgGLr0S9O00HFLz11D7R4o9 -7mF4JkMNztT+ENOdT4xQBi3OGjRGMwtE6PsQPfDeu13Vq6eDtdEGUdhW1kAsGnBi -eJRuysnGpnoWofJ7yS0+DhnS4GAVi907TMrQWwmez9V4CXl4NBc8X9T69TFL2LsW -2KU9NUXdiCRZqZHD41gd3+RuRA/oXh50V9oaow+uepwYKTFyzde5IH1/DgBd7tOd -Fa2fM5/zSA0uFPRb3yCVhRg5d6J9t5yaPAz7Jp0D1mDDGsMBD1O/FYJvWoANEwUX ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_bundle.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_bundle.pem deleted file mode 100644 index f18ee97..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_bundle.pem +++ /dev/null @@ -1,48 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEczCCAl2gAwIBAgIIDARj8BWNsscwCwYJKoZIhvcNAQELMIGMMQswCQYD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fsZJ+RGebDI+TR3QG6Yod06l9oEYZxWXBY7 -STOs8wuTu3huSnan/IpWnV017Vsc61D5G+QrqcxZdXckt3anZKCF75JpUnJ7vuow -TmmHlb8KIMa9mOvcuGX4P6mz8gTi2arl/aL27kj9Q0Jgv/y1ebe2Bx2P9TF6+VND -DL3J/vSVlFeqLt2reAIBKnytLwIDAQABo4GIMIGFMA4GA1UdDwEB/wQEAwIApDAS -BgNVHRMBAf8ECDAGAQH/AgEBMB0GA1UdDgQWBBTXXUgpaSwO9HOrQBxGqOOSFHsH -EDAfBgNVHSMEGDAWgBS4Xu+uZ1C31vMH5Wq+VbNnOg2SPjAfBgNVHREEGDAWghRj -bG91ZGZsYXJlLWludGVyLmNvbTALBgkqhkiG9w0BAQsDgYEAfPLKCAHnPzgMYLX/ -fWznVvOEFAAYZByPFx4QdMBbDZUtxHyvJIBs6PdxrdSuDwSiMqE7qQIi+jzzwGl9 -fC7vf45B2zCX0OW51QL2oWNBdKlGgB+b2pwyME82lX/Pr7V1GY10u+ep1xdZDnch -DaMsXjQQTJu0iuG3qKEuCmUwOmc= ------END CERTIFICATE----- -SDFSDKjkfdlsdfj diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_priv_key.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_priv_key.pem deleted file mode 100644 index 778273c..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/messed_up_priv_key.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAvGKyz9ZzIXI/BFrtqbVQMmKQkPZGndyfV3AzeSb2ulbS/s5k -yNJMH/jKZiSCvZiJNnW+JNlJrgLxORMmPStPz/N/0L0vCTotQKZUiaBttFgHgobQ -LFsbMnumt9It5W/uOwgWI9binuzvqyPXywLlYwOq3jkOmA22ymhflzRrl6a3jzcY -hT9evxHl0gV4bN7KZ5p4wK/UUuG1uMEQLw87lUwRRHeW3ZG52VL38+redka+f5pa -SGKyG5j0oe1NPLqAjckNgqvDdPMY2gicmCq0VSLzTNpHRsURTUSJvC/iv34vVfba -gIYgTvm8BvGbJSlZqP4kEVlOfd3vmB0ttUeoDwIDAQABAoIBAHZdpXCFlA1d1U6N -O2s4a01dNOyAcVpa9xtfelgTLU9jomtLj3PG/uHP1oxbQHKUVxKK5JAOnwbg/mQY -LhydDCbjHlovpFAt56UJXXCkBoocDYvr3P0huXL80oIJY6EXtR4ONKsMJ5Qn12c2 -vC3ogey2rzO1sf/EDigbcIR3AWtk1Tx8ZDUooktOFypIsDQgjjxXiURGssAlMPSh -6GVgO4JRRG6oRxEna7yDe7izmh/hC5sxSYLsEikCgYEAsBHhb/Qef5obRCSrfFuQ -41P7MCtGrXVxKD3iCDGQCzVbEbYGpmZnGsXSaHljp2FtnamaGGEudYziozGKPHjs -pbTbsLIDbmNwxz1WcaZ1iyIjtOxcAEqDod8hY4hL6SaxypwTHn4Ydbw2NGzp11Eg -Di4SVL82utjycATdKFvBzdsCgYB/3M+GMrt0Sh87rKcQLdL709Kzjcfhvm4HjIbJ -GSXGPCZaYMKaXRTdNAjtRKxMawc9qcf0xSBEHL0GkB158TzusDQtjP1anTcYOnl6 -GsO4bRivp314iNlP4r3S3bIXqBxCGH3HbrvpdPFAN//qjYmAki2lFQZywfvbQOE8 -oFQHwQKBgHqJkTck2DGlXQIwA7jirLggISXjSPlsG4w4LuhY9ivyNKLUi4x5k1cE -bX7SrRtJErQ1WaDN4TFG25xnysi5h+aPinuySatd0XmA5+dE1YjTqqShMO+lUpzi -PrOQl6Eva/uw5BDAcUH4AaXTNRvvtXQptUil9qXyOh6fszikA9Mm ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/messedupcert.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/messedupcert.pem deleted file mode 100644 index 577c375..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/messedupcert.pem +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB7jCCAVmgAwIBAgIBADALBgkqhkiG9w0BAQUwJjEQMA4GA1UEChMHQWNtZSBD -bzESMBAGA1UEAxMJMTI3LjAuMC4xMB4XDTEyMDkwNzIyMDAwNFoXDTEzMDkwNzIy -MDUwNFowJjEQMA4GA1UEChMHQWNtZSBDbzESMBAGA1UEAxMJMTI3LjAuMC4xMIGd -MAsGCSqGSIb3DQEBAQOBjQAwgYkCgYEAm6f+jkP2t5q/vM0YAUZZkhq/EAYD+L1C -cqhEvLFbu3MCAwEAAaMyMDAwDgYDVR0PAQH/BAQDAgCgMA0GA1UdDgQGBAQBAgME -MA8GA1UdIwQIMAaABAECAwQwCwYJKoZIhvcNAQEFA4GBABndWRIcfi+QB9Sakr+m -dYnXTgYCnFio53L2Z+6EHTGG+rEhWtUEGhL4p4pzXX4siAnjWvwcgXTo92cafcfi -uB7wRfK+NL9CTJdpN6cdL+fiNHzH8hsl3bj1nL0CSmdn2hkUWVLbLhSgWlib/I8O -aq+K7aVrgHkPnWeRiG6tl+ZA ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/multiplecerts.p12 b/vendor/github.com/cloudflare/cfssl/helpers/testdata/multiplecerts.p12 deleted file mode 100644 index bef8ca44f08b3fd5e660f103f2a90756f10ab288..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3101 zcmV+&4C3=Jf(#h~0Ru3C3*QC_Duzgg_YDCD0ic2l&;)`D%rJrr$S{Hie+CIEhDe6@ z4FLxRpn?W)FoFhb0s#Opf(B&<2`Yw2hW8Bt2LUh~1_~;MNQU1l>fmyj!T|H9mK+$4Chuc5Jnc06cp&)jPUi zh$Z=wBlM;xmW(S!eaYjM@n=YDWfJ`~?LfcZmO)WiF(hxYY~Lns|4_F{mwA=L}`BEbsB z-JkAK%rB;pmja_NYqN1yVVui(jq`+_uExgXR{+)$54kMuiT~Tgm9A@OUugep}}5-r6@*f~9)t)q6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#xyYwnUcS8V9ei?&Bh&+L=(x&>_>9>W zbof7iSU8*iEPE=NzRM9U4p{m1{k0k#*FCRMZ)@Q~43fEs5c#i;FisgRFh|vSKy|D6 z_UTv7U$^ba%F;JF87K%Dgb)G-p}oQk0{%ry1LokG+K!U49|xeC+L#{0WxuKT7@!Tvf+j diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/priv_rsa_key.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/priv_rsa_key.pem deleted file mode 100644 index e67f2f7..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/priv_rsa_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAvGKyz9ZzIXI/BFrtqbVQMmKQkPZGndyfV3AzeSb2ulbS/s5k -yNJMH/jKZiSCvZiJNnW+JNlJrgLxORMmPStPz/N/0L0vCTotQKZUiaBttFgHgobQ -LFsbMnumt9It5W/uOwgWI9binuzvqyPXywLlYwOq3jkOmA22ymhflzRrl6a3jzcY -hT9evxHl0gV4bN7KZ5p4wK/UUuG1uMEQLw87lUwRRHeW3ZG52VL38+redka+f5pa -SGKyG5j0oe1NPLqAjckNgqvDdPMY2gicmCq0VSLzTNpHRsURTUSJvC/iv34vVfba -gIYgTvm8BvGbJSlZqP4kEVlOfd3vmB0ttUeoDwIDAQABAoIBAHZdpXCFlA1d1U6N -O2s4a01dNOyAcVpa9xtfelgTLU9jomtLj3PG/uHP1oxbQHKUVxKK5JAOnwbg/mQY -LhydDCbjHlovpFAt56UJXXCkBoocDYvr3P0huXL80oIJY6EXtR4ONKsMJ5Qn12c2 -vC3ogey2rzO1sf/EDigbcIR3AWtk1Tx8ZDUooktOFypIsDQgjjxXiURGssAlMPSh -1BFz4StRUK4bESaja0GiHwbuxHa+XYEBlK5OqMo/fpWqpgHhV/42+7wdcBMJsMr8 -rFBe6m+r6TTbLSGJNowyd05XrjoAI35qduckpJ3Voun90i4ynTudjdJ/vHpIqB74 -qQLFW2ECgYEA+GSRVqobaKKakNUFGmK0I5T5Tikz5f137YXXER6aLtDQNiSrlXNi -0aphkC/EfRO3oNvamq5+55bmmgDVoNNPDfpajKz+LZyG8GC2EXlTKO0hZS64KRRl -C+bd+ZsYiUDImNVRbIHN82f+BQgsgXlTaWpBOrEqmoePO/J44O4eX3cCgYEAwieq -amY4UaY+MhWPJFRK1y9M3hM8+N9N/35CFewQUdFJosC6vVQ4t8jNkSOxVQdgbNwE -i/bTBgIwg82JJYbBUPuCVeTT3i6zxymf/FLumrI73URD81IN6FiH1skg0hSFrvs0 -6GVgO4JRRG6oRxEna7yDe7izmh/hC5sxSYLsEikCgYEAsBHhb/Qef5obRCSrfFuQ -41P7MCtGrXVxKD3iCDGQCzVbEbYGpmZnGsXSaHljp2FtnamaGGEudYziozGKPHjs -pbTbsLIDbmNwxz1WcaZ1iyIjtOxcAEqDod8hY4hL6SaxypwTHn4Ydbw2NGzp11Eg -Di4SVL82utjycATdKFvBzdsCgYB/3M+GMrt0Sh87rKcQLdL709Kzjcfhvm4HjIbJ -GSXGPCZaYMKaXRTdNAjtRKxMawc9qcf0xSBEHL0GkB158TzusDQtjP1anTcYOnl6 -GsO4bRivp314iNlP4r3S3bIXqBxCGH3HbrvpdPFAN//qjYmAki2lFQZywfvbQOE8 -oFQHwQKBgHqJkTck2DGlXQIwA7jirLggISXjSPlsG4w4LuhY9ivyNKLUi4x5k1cE -bX7SrRtJErQ1WaDN4TFG25xnysi5h+aPinuySatd0XmA5+dE1YjTqqShMO+lUpzi -PrOQl6Eva/uw5BDAcUH4AaXTNRvvtXQptUil9qXyOh6fszikA9Mm ------END RSA PRIVATE KEY----- - diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/private_ecdsa_key.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/private_ecdsa_key.pem deleted file mode 100644 index 46a8602..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/private_ecdsa_key.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MGgCAQEEHCGXsrNo2xfy8+zd4Pzj8rcQ5KqQO43au1t/7nugBwYFK4EEACGhPAM6 -AASJodCTtj5aYXnWxMiYhwjEgNQJJbNzJFEbsGJX9pCWZC673ammTWFHMjnMPkS/ -9eU5YeW40BHqfw== ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/rsa-old.csr b/vendor/github.com/cloudflare/cfssl/helpers/testdata/rsa-old.csr deleted file mode 100644 index 80d67c2..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/rsa-old.csr +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN NEW CERTIFICATE REQUEST----- -MIIDCTCCAfMCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTWdoYxX4KN51fP -WxQAyGH++VsPbfpAoXIbCPXSmU04BvIxyjzpHQ0ChMKkT/2VNcUeFJwk2fCf+ZwU -f0raTQTplofwkckE0gEYA3WcEfJp+hbvbTb/2recsf+JE6JACYJe2Uu5wsjtrE5j -A+7aT2BEU9RWzBdSy/5281ZfW3PArqcWaf8+RUyA3WRxVWmjmhFsVB+mdNLhCpW0 -C0QNMYR1ppEZiKVnEdao8gcI5sOvSd+35t8g82aPXcNSPU6jKcx1YNUPX5wgPEmu -+anfc9RliQbYqqJYVODgBmV8IR5grw93yTsODoWKtFQ4PKVlnt9CD8AS/iSMQYm3 -OUogqgMCAwEAAaA/MD0GCSqGSIb3DQEJDjEwMC4wLAYDVR0RBCUwI4IOY2xvdWRm -bGFyZS5jb22CEXd3d2Nsb3VkZmxhcmUuY29tMAsGCSqGSIb3DQEBCwOCAQEAl809 -gk9uZkRK+MJVYDSLjgGR2xqk5qOwnhovnispA7N3Z1GshodJRQa6ngNCKuXIm2/6 -AxB9kDGK14n186Qq4odXqHSHs8FG9i0zUcBXeLv1rPAKtwKTas/SLmsOpPgWPZFa -iYiHHeu4HjOQoF987d7uGRYwc3xfstKwJsEXc12eCw2NH8TM1tJgSc/o6CzIpA91 -QnZKhx6uGM4xI2gnOaJA1YikNhyFGBuOGMZgd0k2+/IcR2pg0z4pc5oQw1bXLANx -anqlA/MDrCM9v9019bRJ73zK8LQ3k/FW61PA9nL7RZ8ku65R+uYcVEdLa8pUeqnH -cJZNboDRsItpccZuRQ== ------END NEW CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/secp256k1-key.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/secp256k1-key.pem deleted file mode 100644 index e1cfce9..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/secp256k1-key.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHQCAQEEIJLKycmoCAk4HqlJGdsuFyHsxfIheKsLH91tS/TNP5OOoAcGBSuBBAAK -oUQDQgAEBkmL7cvC2cgchzfSuUZPGnzH0FqBtf3kGhSllQiIzGDn4envPXNqp+93 -V2NZ8VT+Aba4ln2Vbp9gYrKquut5Zg== ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/test.bad.csr.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/test.bad.csr.pem deleted file mode 100644 index c58a581..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/test.bad.csr.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICzDCCAbQCAQAwgYYxCzAJBgNVBAYTAkVOMQ0wCwYDVQQIDARub25lMQ0wCwYD -VQQHDARub25lMRIwEAYDVQQKDAlXaWtpcGVkaWExDTALBgNVBAsMBG5vbmUxGDAW -BgNVBAMMDyoud2lraXBlZGlhLm9yZzEcMBoGCSqGSIb3DQEJARYNbm9uZUBub25l -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMP/U8RlcCD6E8AL -PT8LLUR9ygyygPCaSmIEC8zXGJung3ykElXFRz/Jc/bu0hxCxi2YDz5IjxBBOpB/ -kieG83HsSmZZtR+drZIQ6vOsr/ucvpnB9z4XzKuabNGZ5ZiTSQ9L7Mx8FzvUTq5y -57HhA7ECAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4IBAQBn8OCVOIx+n0AS6WbEmYDR -SspR9xOCoOwYfamB+2Bpmt82R01zJ/kaqzUtZUjaGvQvAaz5lUwoMdaO0X7I5Xfl -sllMFDaYoGD4Rru4s8gz2qG/QHWA8uPXzJVAj6X0olbIdLTEqTKsnBj4Zr1AJCNy -/YcG4ouLJr140o26MhwBpoCRpPjAgdYMH60BYfnc4/DILxMVqR9xqK1s98d6Ob/+ -3wHFK+S7BRWrJQXcM8veAexXuk9lHQ+FgGfD0eSYGz0kyP26Qa2pLTwumjt+nBPl -rfJxaLHwTQ/1988G0H35ED0f9Md5fzoKi5evU1wG5WRxdEUPyt3QUXxdQ69i0C+7 ------END CERTIFICATE REQUEST----- - diff --git a/vendor/github.com/cloudflare/cfssl/helpers/testdata/test.csr.pem b/vendor/github.com/cloudflare/cfssl/helpers/testdata/test.csr.pem deleted file mode 100644 index 3cb6797..0000000 --- a/vendor/github.com/cloudflare/cfssl/helpers/testdata/test.csr.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICzDCCAbQCAQAwgYYxCzAJBgNVBAYTAkVOMQ0wCwYDVQQIDARub25lMQ0wCwYD -VQQHDARub25lMRIwEAYDVQQKDAlXaWtpcGVkaWExDTALBgNVBAsMBG5vbmUxGDAW -BgNVBAMMDyoud2lraXBlZGlhLm9yZzEcMBoGCSqGSIb3DQEJARYNbm9uZUBub25l -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMP/U8RlcCD6E8AL -PT8LLUR9ygyygPCaSmIEC8zXGJung3ykElXFRz/Jc/bu0hxCxi2YDz5IjxBBOpB/ -kieG83HsSmZZtR+drZIQ6vOsr/ucvpnB9z4XzKuabNGZ5ZiTSQ9L7Mx8FzvUTq5y -/ArIuM+FBeuno/IV8zvwAe/VRa8i0QjFXT9vBBp35aeatdnJ2ds50yKCsHHcjvtr -9/8zPVqqmhl2XFS3Qdqlsprzbgksom67OobJGjaV+fNHNQ0o/rzP//Pl3i7vvaEG -7Ff8tQhEwR9nJUR1T6Z7ln7S6cOr23YozgWVkEJ/dSr6LAopb+cZ88FzW5NszU6i -57HhA7ECAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4IBAQBn8OCVOIx+n0AS6WbEmYDR -SspR9xOCoOwYfamB+2Bpmt82R01zJ/kaqzUtZUjaGvQvAaz5lUwoMdaO0X7I5Xfl -sllMFDaYoGD4Rru4s8gz2qG/QHWA8uPXzJVAj6X0olbIdLTEqTKsnBj4Zr1AJCNy -/YcG4ouLJr140o26MhwBpoCRpPjAgdYMH60BYfnc4/DILxMVqR9xqK1s98d6Ob/+ -3wHFK+S7BRWrJQXcM8veAexXuk9lHQ+FgGfD0eSYGz0kyP26Qa2pLTwumjt+nBPl -rfJxaLHwTQ/1988G0H35ED0f9Md5fzoKi5evU1wG5WRxdEUPyt3QUXxdQ69i0C+7 ------END CERTIFICATE REQUEST----- - diff --git a/vendor/github.com/cloudflare/cfssl/initca/initca_test.go b/vendor/github.com/cloudflare/cfssl/initca/initca_test.go deleted file mode 100644 index d0c8b01..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/initca_test.go +++ /dev/null @@ -1,385 +0,0 @@ -package initca - -import ( - "bytes" - "crypto/ecdsa" - "crypto/rsa" - "io/ioutil" - "strings" - "testing" - "time" - - "github.com/cloudflare/cfssl/config" - "github.com/cloudflare/cfssl/csr" - "github.com/cloudflare/cfssl/helpers" - "github.com/cloudflare/cfssl/signer" - "github.com/cloudflare/cfssl/signer/local" -) - -var validKeyParams = []csr.BasicKeyRequest{ - {A: "rsa", S: 2048}, - {A: "rsa", S: 3072}, - {A: "rsa", S: 4096}, - {A: "ecdsa", S: 256}, - {A: "ecdsa", S: 384}, - {A: "ecdsa", S: 521}, -} - -var validCAConfigs = []csr.CAConfig{ - {PathLength: 0, PathLenZero: true}, - {PathLength: 0, PathLenZero: false}, - {PathLength: 2}, - {PathLength: 2, Expiry: "1h"}, - // invalid PathLenZero value will be ignored - {PathLength: 2, PathLenZero: true}, -} - -var invalidCAConfig = csr.CAConfig{ - PathLength: 2, - // Expiry must be a duration string - Expiry: "2116/12/31", -} -var csrFiles = []string{ - "testdata/rsa2048.csr", - "testdata/rsa3072.csr", - "testdata/rsa4096.csr", - "testdata/ecdsa256.csr", - "testdata/ecdsa384.csr", - "testdata/ecdsa521.csr", -} - -var testRSACAFile = "testdata/5min-rsa.pem" -var testRSACAKeyFile = "testdata/5min-rsa-key.pem" -var testECDSACAFile = "testdata/5min-ecdsa.pem" -var testECDSACAKeyFile = "testdata/5min-ecdsa-key.pem" - -var invalidCryptoParams = []csr.BasicKeyRequest{ - // Weak Key - {A: "rsa", S: 1024}, - // Bad param - {A: "rsaCrypto", S: 2048}, - {A: "ecdsa", S: 2000}, -} - -func TestInitCA(t *testing.T) { - var req *csr.CertificateRequest - hostname := "cloudflare.com" - for _, param := range validKeyParams { - for _, caconfig := range validCAConfigs { - req = &csr.CertificateRequest{ - Names: []csr.Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: hostname, - Hosts: []string{hostname, "www." + hostname}, - KeyRequest: ¶m, - CA: &caconfig, - } - certBytes, _, keyBytes, err := New(req) - if err != nil { - t.Fatal("InitCA failed:", err) - } - key, err := helpers.ParsePrivateKeyPEM(keyBytes) - if err != nil { - t.Fatal("InitCA private key parsing failed:", err) - } - cert, err := helpers.ParseCertificatePEM(certBytes) - if err != nil { - t.Fatal("InitCA cert parsing failed:", err) - } - - // Verify key parameters. - switch req.KeyRequest.Algo() { - case "rsa": - if cert.PublicKey.(*rsa.PublicKey).N.BitLen() != param.Size() { - t.Fatal("Cert key length mismatch.") - } - if key.(*rsa.PrivateKey).N.BitLen() != param.Size() { - t.Fatal("Private key length mismatch.") - } - case "ecdsa": - if cert.PublicKey.(*ecdsa.PublicKey).Curve.Params().BitSize != param.Size() { - t.Fatal("Cert key length mismatch.") - } - if key.(*ecdsa.PrivateKey).Curve.Params().BitSize != param.Size() { - t.Fatal("Private key length mismatch.") - } - } - - // Verify CA MaxPathLen - if caconfig.PathLength == 0 && cert.MaxPathLenZero != caconfig.PathLenZero { - t.Fatalf("fail to init a CA cert with specified CA pathlen zero: expect %v, got %v", caconfig.PathLenZero, cert.MaxPathLenZero) - } - - if caconfig.PathLength != 0 { - if cert.MaxPathLen != caconfig.PathLength { - t.Fatalf("fail to init a CA cert with specified CA pathlen: expect %d, got %d", caconfig.PathLength, cert.MaxPathLen) - } - if cert.MaxPathLenZero != false { - t.Fatalf("fail to init a CA cert with specified CA pathlen zero: expect false, got %t", cert.MaxPathLenZero) - } - } - - // Replace the default CAPolicy with a test (short expiry) version. - CAPolicy = func() *config.Signing { - return &config.Signing{ - Default: &config.SigningProfile{ - Usage: []string{"cert sign", "crl sign"}, - ExpiryString: "300s", - Expiry: 300 * time.Second, - CAConstraint: config.CAConstraint{IsCA: true}, - }, - } - } - - // Start a signer - s, err := local.NewSigner(key, cert, signer.DefaultSigAlgo(key), nil) - if err != nil { - t.Fatal("Signer Creation error:", err) - } - s.SetPolicy(CAPolicy()) - - // Sign RSA and ECDSA customer CSRs. - for _, csrFile := range csrFiles { - csrBytes, err := ioutil.ReadFile(csrFile) - if err != nil { - t.Fatal("CSR loading error:", err) - } - req := signer.SignRequest{ - Request: string(csrBytes), - Hosts: signer.SplitHosts(hostname), - Profile: "", - Label: "", - } - - bytes, err := s.Sign(req) - if err != nil { - t.Fatal(err) - } - customerCert, _ := helpers.ParseCertificatePEM(bytes) - if customerCert.SignatureAlgorithm != s.SigAlgo() { - t.Fatal("Signature Algorithm mismatch") - } - err = customerCert.CheckSignatureFrom(cert) - if err != nil { - t.Fatal("Signing CSR failed.", err) - } - } - } - } -} -func TestInvalidCAConfig(t *testing.T) { - hostname := "example.com" - req := &csr.CertificateRequest{ - Names: []csr.Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: hostname, - Hosts: []string{hostname, "www." + hostname}, - KeyRequest: &validKeyParams[0], - CA: &invalidCAConfig, - } - - _, _, _, err := New(req) - if err == nil { - t.Fatal("InitCA with bad CAConfig should fail:", err) - } -} -func TestInvalidCryptoParams(t *testing.T) { - var req *csr.CertificateRequest - hostname := "cloudflare.com" - for _, invalidParam := range invalidCryptoParams { - req = &csr.CertificateRequest{ - Names: []csr.Name{ - { - C: "US", - ST: "California", - L: "San Francisco", - O: "CloudFlare", - OU: "Systems Engineering", - }, - }, - CN: hostname, - Hosts: []string{hostname, "www." + hostname}, - KeyRequest: &invalidParam, - } - _, _, _, err := New(req) - if err == nil { - t.Fatal("InitCA with bad params should fail:", err) - } - - if !strings.Contains(err.Error(), `"code":2400`) { - t.Fatal(err) - } - } -} - -type validation struct { - r *csr.CertificateRequest - v bool -} - -var testValidations = []validation{ - {&csr.CertificateRequest{}, false}, - {&csr.CertificateRequest{ - CN: "test CA", - }, true}, - {&csr.CertificateRequest{ - Names: []csr.Name{{}}, - }, false}, - {&csr.CertificateRequest{ - Names: []csr.Name{ - {O: "Example CA"}, - }, - }, true}, -} - -func TestValidations(t *testing.T) { - for i, tv := range testValidations { - err := validator(tv.r) - if tv.v && err != nil { - t.Fatalf("%v", err) - } - - if !tv.v && err == nil { - t.Fatalf("%d: expected error, but no error was reported", i) - } - } -} - -func TestRenewRSA(t *testing.T) { - certPEM, err := RenewFromPEM(testRSACAFile, testRSACAKeyFile) - if err != nil { - t.Fatal(err) - } - - // must parse ok - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatal(err) - } - - if !cert.IsCA { - t.Fatal("renewed CA certificate is not CA") - } - - // cert expiry must be 5 minutes - expiry := cert.NotAfter.Sub(cert.NotBefore).Seconds() - if expiry >= 301 || expiry <= 299 { - t.Fatal("expiry is not correct:", expiry) - } - - // check subject - - if cert.Subject.CommonName != "" { - t.Fatal("Bad CommonName") - } - - if len(cert.Subject.Country) != 1 || cert.Subject.Country[0] != "US" { - t.Fatal("Bad Subject") - } - - if len(cert.Subject.Organization) != 1 || cert.Subject.Organization[0] != "CloudFlare, Inc." { - t.Fatal("Bad Subject") - } -} - -func TestRenewECDSA(t *testing.T) { - certPEM, err := RenewFromPEM(testECDSACAFile, testECDSACAKeyFile) - if err != nil { - t.Fatal(err) - } - - // must parse ok - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatal(err) - } - - if !cert.IsCA { - t.Fatal("renewed CA certificate is not CA") - } - - // cert expiry must be 5 minutes - expiry := cert.NotAfter.Sub(cert.NotBefore).Seconds() - if expiry >= 301 || expiry <= 299 { - t.Fatal("expiry is not correct:", expiry) - } - - // check subject - - if cert.Subject.CommonName != "" { - t.Fatal("Bad CommonName") - } - - if len(cert.Subject.Country) != 1 || cert.Subject.Country[0] != "US" { - t.Fatal("Bad Subject") - } - - if len(cert.Subject.Organization) != 1 || cert.Subject.Organization[0] != "CloudFlare, Inc." { - t.Fatal("Bad Subject") - } -} - -func TestRenewMismatch(t *testing.T) { - _, err := RenewFromPEM(testECDSACAFile, testRSACAKeyFile) - if err == nil { - t.Fatal("Fail to detect cert/key mismatch") - } -} - -func TestRenew(t *testing.T) { - in, err := ioutil.ReadFile(testECDSACAFile) - if err != nil { - t.Fatal(err) - } - - cert, err := helpers.ParseCertificatePEM(in) - if err != nil { - t.Fatal(err) - } - - in, err = ioutil.ReadFile(testECDSACAKeyFile) - if err != nil { - t.Fatal(err) - } - - priv, err := helpers.ParsePrivateKeyPEM(in) - if err != nil { - t.Fatal(err) - } - - renewed, err := Update(cert, priv) - if err != nil { - t.Fatal(err) - } - - newCert, err := helpers.ParseCertificatePEM(renewed) - if err != nil { - t.Fatal(err) - } - - if !bytes.Equal(newCert.RawSubjectPublicKeyInfo, cert.RawSubjectPublicKeyInfo) { - t.Fatal("Update returned a certificate with different subject public key info") - } - - if !bytes.Equal(newCert.RawSubject, cert.RawSubject) { - t.Fatal("Update returned a certificate with different subject info") - } - - if !bytes.Equal(newCert.RawIssuer, cert.RawIssuer) { - t.Fatal("Update returned a certificate with different issuer info") - } -} diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa-key.pem b/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa-key.pem deleted file mode 100644 index 2837c21..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa-key.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHcCAQEEIA8OzPeVZT0cXTAPdcXYefLRIqyUXa0f0SgYMJ2J1AVcoAoGCCqGSM49 -AwEHoUQDQgAEoCV+bVOLTJMy38j50sc3vE5k41GMRgriFJt0g0OVX8yaOZ93CZTI -7LzfGbMU+KqWTgOwGhrPvpusep3fjw+dAQ== ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa.pem b/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa.pem deleted file mode 100644 index cc9f998..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-ecdsa.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICUDCCAfagAwIBAgIIec5PjdpJcNYwCgYIKoZIzj0EAwIwejELMAkGA1UEBhMC -VVMxGTAXBgNVBAoTEENsb3VkRmxhcmUsIEluYy4xIzAhBgNVBAsTGlRlc3QgQ2Vy -dGlmaWNhdGUgQXV0aG9yaXR5MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYD -VQQIEwpDYWxpZm9ybmlhMB4XDTE1MTAwODIzMDEwMFoXDTE1MTAwODIzMDYwMFow -ejELMAkGA1UEBhMCVVMxGTAXBgNVBAoTEENsb3VkRmxhcmUsIEluYy4xIzAhBgNV -BAsTGlRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMFkwEwYHKoZIzj0CAQYIKoZIzj0D -AQcDQgAEoCV+bVOLTJMy38j50sc3vE5k41GMRgriFJt0g0OVX8yaOZ93CZTI7Lzf -GbMU+KqWTgOwGhrPvpusep3fjw+dAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIGA1Ud -EwEB/wQIMAYBAf8CAQIwHQYDVR0OBBYEFDpLhSKBN3njfb6cXQCdRLzCZt0ZMB8G -A1UdIwQYMBaAFDpLhSKBN3njfb6cXQCdRLzCZt0ZMAoGCCqGSM49BAMCA0gAMEUC -IFU3BmzntGGeXZu2qWZx249nYn37S0AkCnQ3rUtI31bdAiEAsPICnZ+GB8yCN26N -OL+N8dHvXiOvZ9/Vl488pyWOccY= ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa-key.pem b/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa-key.pem deleted file mode 100644 index 1b4c4c9..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEAtrYWs9ao2CpLWWLMyJJr3Bw7eJu3vSImzoqsBuhAREMaeuHm -vAwqbByVpdxu1o+t0u6cMp/1M4YwDSxD4Ny3zEUUGse6yZpyph0+whdHSn1LOCxY -KVwMtcYaEswenm0a+s/b9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RoN9mtC -vrc2uCkkB0sG8V/+MRaPgwKBgBiML2oQkn1mLBbcbssyZjz9hHkmqA1LKn0zmu8G -NkKLezcaQgSMy5s2QsPe2C9OJexeGek/T/V+iRYqqdyHzJpJ0QIh3+1fuGPpqNUj -mTvNCN/fR/ejgH/bgxNt/gPO/Ds+TdU7Vz7RIggRtH2RwYqGvctpo4bVDBqjGR3b -7yahAoGAAgH97uN2FU1ffK0OAfMA1N58ikq/bg07KnJxO2CP5hrgsWK2ZVfeHUmU -3k+xqQHCIuew55yO0tARTrFAh3Rj+zarA+PrtnzqW82wCIn8Fym3PFzbK2qrIMie -yp0p4nBXsRmzinrPWKUYlFyRNY3Tcbstm5gUw2S4czSwwQeM/No= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa.pem b/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa.pem deleted file mode 100644 index c1ecec0..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/5min-rsa.pem +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID3DCCAsSgAwIBAgIIfbm2I1hwBa8wDQYJKoZIhvcNAQELBQAwejELMAkGA1UE -BhMCVVMxGTAXBgNVBAoTEENsb3VkRmxhcmUsIEluYy4xIzAhBgNVBAsTGlRlc3Qg -Q2VydGlmaWNhdGUgQXV0aG9yaXR5MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMw -EQYDVQQIEwpDYWxpZm9ybmlhMB4XDTE1MTAwODIwMjEwMFoXDTE1MTAwODIwMjYw -MFowejELMAkGA1UEBhMCVVMxGTAXBgNVBAoTEENsb3VkRmxhcmUsIEluYy4xIzAh -BgNVBAsTGlRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRYwFAYDVQQHEw1TYW4g -RnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAtrYWs9ao2CpLWWLMyJJr3Bw7eJu3vSImzoqsBuhAREMa -euHmvAwqbByVpdxu1o+t0u6cMp/1M4YwDSxD4Ny3zEUUGse6yZpyph0+whdHSn1L -OCxYKVwMtcYaEswenm0a+s/b9BYpbLv6lPoJ8+6bQNDuyyracDzlvGgk/HabemqD -ly4+W64tlrMUDHBuHHIm5EMF1sqVcinLCS8KsVDVfg4qKfzsZbTw0dDo5GZh1lPs -lkk9y8NzRltZjfJ3y5acv7SvIlETpy41VxScplR+Ot/6sXNJY3aEBT10smPXPABD -eWjxFbnU5xacL/pC7pnKy734sL4lkvzKPDWZPsNMEwIDAQABo2YwZDAOBgNVHQ8B -Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBAjAdBgNVHQ4EFgQUCHoGEI1RZ8JN -7UZ4zcTRll8nnnAwHwYDVR0jBBgwFoAUCHoGEI1RZ8JN7UZ4zcTRll8nnnAwDQYJ -KoZIhvcNAQELBQADggEBAHRcbd6cSXV6IuT4jLV8k6OUUlxzobbiRnXJrLjy9Anx -tyIUWv2XSh/4IEJa+/MLNIb28gU9Sa2y4GV1qAgOM5qUM2iQJyLem0pTg0WTVKlj -ytEK1kUwQCNkc/xpDrPo5CbN3aDuW/VPntOJL1GSQzS7jzK3NeQ9sah9YYhk4Wsk -jzHVI1sX+qzcuUqCIPhqmGR0JE8ZI5YzbMTZ4/B+oWxZ7EyzB8O+v6HVD4eQFBSq -tyGhGbh7mUvuMpVJ8FIX4BA7QL+RwqNNtAMZKcxPjhy5I23nVclbTCz/NC2Dgp8H -13uQsEpUZ65clgiTo4LuPzPiIouZh5cBWP4gGqbyyS4= ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/README.md b/vendor/github.com/cloudflare/cfssl/initca/testdata/README.md deleted file mode 100644 index 64942a8..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/README.md +++ /dev/null @@ -1,11 +0,0 @@ -1. To generate 5min-rsa.pem and 5min-rsa-key.pem -``` -$ GOPATH/bin/cfssl gencert -initca ca_csr_rsa.json | GOPATH/bin/cfssljson -bare 5min-rsa -``` -2. To generate 5min-ecdsa.pem and 5min-ecdsa-key.pem -``` -$ GOPATH/bin/cfssl gencert -initca ca_csr_ecdsa.json | GOPATH/bin/cfssljson -bare 5min-ecdsa -``` - -The above commands will generate 5min-rsa.csr and 5min-ecdsa.csr as well, but those -files can be ignored. diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_ecdsa.json b/vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_ecdsa.json deleted file mode 100644 index 01b4d9d..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_ecdsa.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "key": { - "algo": "ecdsa", - "size": 256 - }, - "names": [ - { - "C": "US", - "L": "San Francisco", - "ST": "California", - "O": "CloudFlare, Inc.", - "OU": "Test Certificate Authority" - } - ], - "ca": { - "expiry": "5m" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_rsa.json b/vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_rsa.json deleted file mode 100644 index d7bc11b..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/ca_csr_rsa.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "US", - "L": "San Francisco", - "ST": "California", - "O": "CloudFlare, Inc.", - "OU": "Test Certificate Authority" - } - ], - "ca": { - "expiry": "5m" - } -} diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa256.csr b/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa256.csr deleted file mode 100644 index a699254..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa256.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgTCCASgCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABBn9Ldie6BOcMHezn2dPuYqW -z/NoLYMLGNBqhOxUyEidYClI0JW2pWyUgT3A2UazFp1WgE94y7Z+2YlfRz+vcrKg -PzA9BgkqhkiG9w0BCQ4xMDAuMCwGA1UdEQQlMCOCDmNsb3VkZmxhcmUuY29tghF3 -d3djbG91ZGZsYXJlLmNvbTAKBggqhkjOPQQDAgNHADBEAiBM+QRxe8u6rkdr10Jy -cxbR6NxrGrNeg5QqiOqF96JEmgIgDbtjd5e3y3I8W/+ih2us3WtMxgnTXfqPd48i -VLcv28Q= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa384.csr b/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa384.csr deleted file mode 100644 index 4afd1d0..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa384.csr +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBvzCCAUUCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTB2MBAGByqGSM49AgEGBSuBBAAiA2IABBk/Q+zMsZOJGkufRzGCWtSUtRjq -0QqChDGWbHLaa0h6ODVeEoKYOMvFJTg4V186tuuBe97KEey0OPDegzCBp5kBIiwg -HB/0xWoKdnfdRk6VyjmubPx399cGoZn8aCqgC6A/MD0GCSqGSIb3DQEJDjEwMC4w -LAYDVR0RBCUwI4IOY2xvdWRmbGFyZS5jb22CEXd3d2Nsb3VkZmxhcmUuY29tMAoG -CCqGSM49BAMDA2gAMGUCMQC57VfwMXDyL5kM7vmO2ynbpgSAuFZT6Yd3C3NnV2jz -Biozw3eqIDXqCb2LI09stZMCMGIwCuVARr2IRctxf7AmX7/O2SIaIhCpMFKRedQ7 -RiWGZIucp5r6AfT9381PB29bHA== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa521.csr b/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa521.csr deleted file mode 100644 index c8c312f..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/ecdsa521.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICCjCCAWsCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCBmzAQBgcqhkjOPQIBBgUrgQQAIwOBhgAEAHt/s9KTZETzu94JIAjZ3BaS -toSG65hGIc1e0Gt7PhdQxPp5FP2D8rQ1wc+pcZhD2O8525kPxopaqTd+fWKBuD3O -AULzoH2OX+atIuumTQzLNbTsIbP0tY3dh7d8LItuERkZn1NfsNl3z6bnNAaR137m -f4aWv49ImbA/Tkv8VmoKX279oD8wPQYJKoZIhvcNAQkOMTAwLjAsBgNVHREEJTAj -gg5jbG91ZGZsYXJlLmNvbYIRd3d3Y2xvdWRmbGFyZS5jb20wCgYIKoZIzj0EAwQD -gYwAMIGIAkIA8OX9LxWOVnyfB25DFBz6JkjhyDpBM/PXlgLnWb/n2mEuMMB44DOG -pljDV768PSW11AC3DtULoIyR92z0TyLEKYoCQgHdGd6PwUtDW5mrAMJQDgebjsxu -MwfcdthzKlFlSmRpHMBnRMOJjlg5f9CTBg9d6wEdv7ZIrQSO6eqQHDQRM0VMnw== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa2048.csr b/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa2048.csr deleted file mode 100644 index 6bbca71..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa2048.csr +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIDCTCCAfMCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTWdoYxX4KN51fP -WxQAyGH++VsPbfpAoXIbCPXSmU04BvIxyjzpHQ0ChMKkT/2VNcUeFJwk2fCf+ZwU -f0raTQTplofwkckE0gEYA3WcEfJp+hbvbTb/2recsf+JE6JACYJe2Uu5wsjtrE5j -A+7aT2BEU9RWzBdSy/5281ZfW3PArqcWaf8+RUyA3WRxVWmjmhFsVB+mdNLhCpW0 -C0QNMYR1ppEZiKVnEdao8gcI5sOvSd+35t8g82aPXcNSPU6jKcx1YNUPX5wgPEmu -+anfc9RliQbYqqJYVODgBmV8IR5grw93yTsODoWKtFQ4PKVlnt9CD8AS/iSMQYm3 -OUogqgMCAwEAAaA/MD0GCSqGSIb3DQEJDjEwMC4wLAYDVR0RBCUwI4IOY2xvdWRm -bGFyZS5jb22CEXd3d2Nsb3VkZmxhcmUuY29tMAsGCSqGSIb3DQEBCwOCAQEAl809 -gk9uZkRK+MJVYDSLjgGR2xqk5qOwnhovnispA7N3Z1GshodJRQa6ngNCKuXIm2/6 -AxB9kDGK14n186Qq4odXqHSHs8FG9i0zUcBXeLv1rPAKtwKTas/SLmsOpPgWPZFa -iYiHHeu4HjOQoF987d7uGRYwc3xfstKwJsEXc12eCw2NH8TM1tJgSc/o6CzIpA91 -QnZKhx6uGM4xI2gnOaJA1YikNhyFGBuOGMZgd0k2+/IcR2pg0z4pc5oQw1bXLANx -anqlA/MDrCM9v9019bRJ73zK8LQ3k/FW61PA9nL7RZ8ku65R+uYcVEdLa8pUeqnH -cJZNboDRsItpccZuRQ== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa3072.csr b/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa3072.csr deleted file mode 100644 index e0b4219..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa3072.csr +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIECTCCAnMCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAL0zzgBv+VTwZOPy -LtuLFweQrj5Lfrje2hnNB7Y3TD4+yCM/cA4yTILixCe/B+N7LQysJgVDbW8u6BZQ -8ZqeDKOP6KCt37WhmcbT45tLpHmH+Z/uAnCz0hVc/7AyJ3CJXo6PaDCcJjgLuUun -W47iy4h79AxyuzELmUeZZGYcO8nqClqcnAzQ6sClGZvJwSbYg2QAFGoA2lHqZ9uN -ygAxNLd+rX9cP+yFwAeKzuKtOnVPiJD5lT3wufSkAbd6M7lOoqmTYnbv0A1WfA/e -upXno9lbgB6iwF5U0V7OtxdA1bTbvgJgNLlxFF1do0sB28CWmqCFNwLfzcPzt5A4 -gLnOyLhNZOmUMXn35KOtp1Zv/yethlgZHxUYGcl6OYwMEFye3Du6dgnTwONzaLhA -7hMI8R60p2YrTLkgSKdFohAY/mKuxHyXxugOHHthlRCOn9m49edcdZ1HrkJXm9jd -P9katjCXgTwSdTQlvaMJkfH7wF3ZMjAxPcDf4RKFEpF2wABeNQIDAQABoD8wPQYJ -KoZIhvcNAQkOMTAwLjAsBgNVHREEJTAjgg5jbG91ZGZsYXJlLmNvbYIRd3d3Y2xv -dWRmbGFyZS5jb20wCwYJKoZIhvcNAQEMA4IBgQBF/RCHNAAOAaRI4VyO0tRPA5Dw -0/1/pgmBm/VejHIwDJnMFCl9njh0RSo1RgsVLhw6ovYbk3ORb4OD4UczPTq3GrFp -KP9uPR+2pR4FWJpCVfCl76YabQv6fUDdiT7ojzyRhsAmkd5rOdiMvWV3Rp+YmBuU -KH/dwkukfn+OeJIbERS5unzOBtQL+g5dU4CHWAqJQIqHr373w38OlYN+JY9QLrYy -sWU9Ye6RjdySXPJ5UzyfOEfc9Ji89RJsVeceB1+As5u5vBvtzGgIMSFUzN947RZo -DZ48JiB71VpmKXbn9LIRn25dlbVMzxRdSeZ194L3JFVAf9OxJTsc1QNFhOacoFgy -hqvtN2iKntEyPo2nacYhpz/FAdJ2JThNH+4WtpPWAqx8Lw/e1OttiDt+6M0FEuVz -svkSHnK206yo+a9Md37nUDDYxtlJEB+9F2qUZNQ7Hv+dxjmJOIgHOXxy1pLEdpVU -rGdGLVXeJNPCh9x+GK21QjdxZABmYAaF8k36Pv4= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa4096.csr b/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa4096.csr deleted file mode 100644 index 603d179..0000000 --- a/vendor/github.com/cloudflare/cfssl/initca/testdata/rsa4096.csr +++ /dev/null @@ -1,29 +0,0 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ALBgkq -hkiG9w0BAQ0DggIBAAgz3NuN43+F+8+WhQ9hb7DOp6Amut7XubOkEBtBVgP3R8U1 -uSsgocR1rvnZ1/bhkeGyTly0eQPhcSEdMo/GgIrcn+co0KLcDyV6Rf3Cgksx9dUZ -TzHSkxmFkxlxYfIGes6abH+2OPiacwK2gLvvmXFYIxEhv+LKzzteQi0xlinewv7R -FnSykZ4QialsFyCgOjOxa11aEdRv6T8qKwhjUOk0VedtzOkt/k95aydTNLjXl2OV -jloeTsbB00yWIqdyhG12+TgcJOa0pNP1zTjgFPodMuRUuiAcbT7Mt7sLCefKNzvZ -Ln6b4y7e6N3YLOHALTIP+LI4y8ar47WlXCNw/zeOM2sW8udjYrukN6WOV3X68oMf -Zsv6jqyGSaCDwdImR4VECUVvkabg9Sq4pz+ijTT+9cNA66omYL+/QAh0GahlROgW -kDGI8zeEUoAC8RkAbFGMJA8jEbAfbT000ZwnLX2SZ8YRQX4Jd1FTmAH99FkvvT8N -ovaGRSQQI5rWQGQYqF67So7PywEaEXeUHTBrv41Msva6CdaWHn7bh/fj4B21ETS7 -VJvrk5DLJTyruqon7EVJU1pn38ppaXF4Z6a9n3C8TqudT/gdJUYn/SBo5jx20uGJ -d9k6vDqixntvk/TRZ848k1AXiv5uUJTdnoPPhzSGjxEaeKuB0R1ZHomVdjU4 ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/log/log_test.go b/vendor/github.com/cloudflare/cfssl/log/log_test.go deleted file mode 100644 index 2a08694..0000000 --- a/vendor/github.com/cloudflare/cfssl/log/log_test.go +++ /dev/null @@ -1,186 +0,0 @@ -package log - -import ( - "bytes" - "log" - "strings" - "testing" -) - -const teststring = "asdf123" - -func TestOutputf(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Level = LevelDebug - outputf(LevelDebug, teststring, nil) - - // outputf correctly prints string - if !strings.Contains(buf.String(), teststring) { - t.Fail() - } - return -} - -func TestOutput(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Level = LevelDebug - output(LevelDebug, nil) - - // outputf correctly prints string with proper Debug prefix - if !strings.Contains(buf.String(), levelPrefix[LevelDebug]) { - t.Fail() - } - return -} - -func TestCriticalf(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Criticalf(teststring, nil) - - // outputf correctly prints string - // should never fail because critical > debug - if !strings.Contains(buf.String(), teststring) { - t.Fail() - } - return -} - -func TestCritical(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Critical(nil) - - // outputf correctly prints string - if !strings.Contains(buf.String(), levelPrefix[LevelCritical]) { - t.Fail() - } - return -} - -func TestWarningf(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Warningf(teststring, nil) - - // outputf correctly prints string - // should never fail because fatal critical > debug - if !strings.Contains(buf.String(), teststring) { - t.Fail() - } - return -} - -func TestWarning(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Warning(nil) - - // outputf correctly prints string - if !strings.Contains(buf.String(), levelPrefix[LevelWarning]) { - t.Fail() - } - return -} - -func TestInfof(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Infof(teststring, nil) - - // outputf correctly prints string - // should never fail because fatal info > debug - if !strings.Contains(buf.String(), teststring) { - t.Fail() - } - return -} - -func TestInfo(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Info(nil) - - // outputf correctly prints string - if !strings.Contains(buf.String(), levelPrefix[LevelInfo]) { - t.Fail() - } - return -} - -func TestDebugf(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Level = LevelDebug - Debugf(teststring, nil) - - // outputf correctly prints string - // should never fail because fatal debug >= debug - if !strings.Contains(buf.String(), teststring) { - t.Fail() - } - return -} - -func TestDebug(t *testing.T) { - buf := new(bytes.Buffer) - log.SetOutput(buf) - Level = LevelDebug - Debug(nil) - - // outputf correctly prints string - if !strings.Contains(buf.String(), levelPrefix[LevelDebug]) { - t.Fail() - } - return -} - -type testSyslogger struct { - *bytes.Buffer -} - -func (l testSyslogger) Debug(s string) { - l.WriteString("[DEBUG] ") - _, _ = l.WriteString(s) -} - -func (l testSyslogger) Info(s string) { - l.WriteString("[INFO] ") - _, _ = l.WriteString(s) -} - -func (l testSyslogger) Warning(s string) { - l.WriteString("[WARN] ") - _, _ = l.WriteString(s) -} - -func (l testSyslogger) Err(s string) { - l.WriteString("[ERROR] ") - _, _ = l.WriteString(s) -} - -func (l testSyslogger) Crit(s string) { - l.WriteString("[CRIT] ") - _, _ = l.WriteString(s) -} - -func (l testSyslogger) Emerg(s string) { - l.WriteString("[FATAL] ") - _, _ = l.WriteString(s) -} - -func TestSetLogger(t *testing.T) { - buf := new(bytes.Buffer) - SetLogger(testSyslogger{buf}) - Level = LevelDebug - outputf(LevelDebug, teststring, nil) - - // outputf correctly prints string - if !strings.Contains(buf.String(), teststring) { - t.Fail() - } - SetLogger(nil) - return -} diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca-key.pem b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca-key.pem deleted file mode 100644 index 5d4f8b5..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAvKOCXwP8Y6x1YkjcimQafnP1bRCF/iWY+z4ffuTWA150RRpA -GnhwOen8muU5wxOEm1A2IkWhNfXQ9GYVdOnzXumTx9Go4Gm8/1nRCYG69GZbQAEr -pNGx/l4wReLVj2iizCf/xkcch5ZM/5zplXWZXCQiavmKz6M+1aSYdsGP0mrLu31c -yod2iJmlISt+nuP5yXkgoKxzGrKjP5qrs6XniVXrKMt+5g1Ta5blWUoft2pwM6yp -8+IAtxh+iYTIJc8dDHbVl9AjVfsfaYeS8SkHcIRyIuD8/3HgLmP/gMLDzuLXvH+W -slOEYqLGMkSo2JPOwLguggDyjt1rI2cEcFkgJwIDAQ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QC8sjlF/8e03m3AfLs2ZW/w0Rsggz52TgBdH24BMUmvd5McVZlH8uZq -zwx5ht3ppVjObG28JPEj8c/FtAmsUjURDD7EVdjb5bDxrMtH++8sHrXUuMMBeUxl -DN2IU+xL9MwMh5H0cyJbXnE+LWGpSefCccDnH5qlEjwNXE5/RggOrw== ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca.pem b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca.pem deleted file mode 100644 index 9775b85..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/ca.pem +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDvjCCAqigAwIBAgIIWhorb65IXvUwCwYJKoZIhvcNAQELMG0xCzAJBgNVBAYT -AlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJlMRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2lu -ZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9y -bmlhMB4XDTE1MDQxOTE2MTAwMFoXDTIwMDQxNzE2MTAwMFowbTELMAkGA1UEBhMC -VVMxEzARBgNVBAoTCkNsb3VkRmxhcmUxHDAaBgNVBAsTE1N5c3RlbXMgRW5naW5l -ZXJpbmcxFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xEzARBgNVBAgTCkNhbGlmb3Ju -aWEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8o4JfA/xjrHViSNyK -ZBp+c/VtEIX+JZj7Ph9+5NYDXnRFGkAaeHA56fya5TnDE4SbUDYiRaE19dD0ZhV0 -6fNe6ZPH0ajgabz/WdEJgbr0ZltAASuk0bH+XjBF4tWPaKLMJ//GRxyHlkz/nOmV -dZlcJCJq+YrPoz7VpJh2wY/Sasu7fVzKh3aImaUhK36e4/nJeSCgrHMasqM/mquz -peeJVesoy37mDVNrluVZSh+3anAzrKnz4gC3GH6JhMglzx0MdtWX0CNV+x9ph5Lx -KQdwhHIi4Pz/ceAuY/+AwsPO4te8f5ayU4RiosYyRKjYk87AuC6CAPKO3WsjZwRw -WSAnAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIABjASBgNVHRMBAf8ECDAGAQH/AgEC -MB0GA1UdDgQWBBSrzjPP4Y5PLsqeyp6iddofBjoRmTAfBgNVHSMEGDAWgBSrzjPP -4Y5PLsqeyp6iddofBjoRmTALBgkqhkiG9w0BAQsDggEBAH7McpSm7+DeIZPQKYpF -kFUlNn3N4MRvek5lxOw6jLE1QmzG3lTB79g6iBiGKsYLPoJqNS6VxMoLrMC+qFhM -0QM5eIzRpdfYa83IDIYcbUYx7fLG/azX+FMFh/O5yPtS+bqbxGinxofRIyuKGs9r -dks6I5lGncRs0Liysp4mHJAjyj9G2W2onI3Y00BYhiOy4mYvZ5/S31KI4550HZ+p -dnexuC29CsWGkOTXTOS7+e7Zmbh8UjsYcA5YOojew+EjJfETPVO+Pn7WGg/+XrFX -8UOG3o9k8M0ePQof4R6FTJ+BQxtSkWWdp1HrMQbZ1TXfZx84XkmFdcmy8FjYiHbP -M+M= ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/cert.pem b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/cert.pem deleted file mode 100644 index f3cad55..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/cert.pem +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID4TCCAsugAwIBAgIIEoDcqfKl/s4wCwYJKoZIhvcNAQELMG0xCzAJBgNVBAYT -AlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJlMRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2lu -ZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9y -bmlhMB4XDTE1MDQxOTE2MTkwMFoXDTE2MDQxODE2MTkwMFowX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ce8FWW13Wj55x64peb8ZiW1jUyoaJQcxQxFpRHIVu26nXApWtg== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/db-config.json b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/db-config.json deleted file mode 100644 index f93728c..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/db-config.json +++ /dev/null @@ -1 +0,0 @@ -{"driver":"sqlite3","data_source":"sqlite_test.db"} diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/resp64.pem b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/resp64.pem deleted file mode 100644 index dea2591..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/resp64.pem +++ /dev/null @@ -1,2 +0,0 @@ -MIIFCAoBAKCCBQEwggT9BgkrBgEFBQcwAQEEggTuMIIE6jCBrKADAgEAoS0wKzEpMCcGA1UEAwwgY2Fja2xpbmcgY3J5cHRvZ3JhcGhlciBmYWtlIFJPT1QYDzIwMTUxMDIxMjEyNjAwWjBlMGMwOzAJBgUrDgMCGgUABBSwLsMRhyg1dJUwnXWk++D57lvgagQU6aQ/7p6l5vLV13lgPJOmLiSOl6oCAhJNgAAYDzIwMTUwOTAxMDAwMDAwWqARGA8yMDE0MDEwMTAwMDAwMFowDQYJKoZIhvcNAQELBQADggEBAHlFcNKa7mZDJeWzJt1S45kx4gDqOLzyeZzflFbSjsrHRrLA7Y3RKoy0i4Y9Vi6Jfhe7xj6dgDMJy1Z1qayI/Q8QvnaU6V2kFcnaD7pah9uALu2xNYMJPllq8KsQYvDLa1E2PMvQTqDhY2/QrIuxw3jkqtzeI5aG0idFm3aF1z/v3dt6XPWjE8IlAJfXY4CeUorLvA+mK2YHJ3V7MSgymVXZdyth1rg0/0cP9v77Rlb8hmWA/EUMcIPKQqErVQK+gZiVC0SfElaMO25CD9cjY+fd904oC5+ahvhHXxOSEbXVZBT1FY2teFCKEpx86gAVcZWpGmVwJO+dpsrkgwpN786g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gLHWEvLTdpPkrzeDJs9Oo6g38jfT9b4+9Ahs+FvvwqneAkbeZgBC2NWKB+drMuNBTPbF/W1a8czAzHeOs6qy0dBlTHNjL62/o9cRKNiKe3IqwHJdd01V1aLSUgIbe2HrP9EC1djnUXWR3jx3ursaKt7PTKsC52UJkRqnai80MzQj0WwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU6aQ/7p6l5vLV13lgPJOmLiSOl6owDQYJKoZIhvcNAQELBQADggEBACuwILDTvaBrdorv2zMsYnZuKvXtknWAf/DTcvF4N5PMOPBNkeHuGfv0VDe6VXpBHiU5G9E2RdU435W7o0kRSn27YcqrxaXGt9m2kArW6e49136+MnFx47jjk0p4T48s6MeaL5JVLJzxYouu1ZOZqlVokwNPO+8bxn6ALumIVUOD1jSBN7Y9pgLUS2rzO5pe5pxS2Ak/eO7Q7M21r1sEuG/uPuWqBFogk+4Z9omKVZdRDbzm9vYUATgEZdlTe2tct3BVBQ2zWbe0R2svIuCs8XzERykvfv1JawxI68I9vN0Dh9vj/xDM6udorfALlhjgQdftmbHovRLpJ1ZSOMIUNGY= diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/response.der b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/response.der deleted file mode 100644 index bd43e37bfd1890562dcd75c4fb8df9f6dcedc916..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 540 zcmXqLVv^uuWLVI|BxumY#LLF1&Bn;e%5K2O$kN34&!CC%mqFv>1YnJ6x3Xlh_$WMpV*WNKibYhYqvV31*u zW?&7plU19KnMsP3fki~){mn=Ded%pMn!25zC$0YK)^TG4i^%G8#^)dQ`RkpUcWU0E z(p&OuR)RB`m>5eJFf%g#m*5AQWC(^phJiuU0znKRpu;(}+C196^D;7WvobI@F)}iQ zPta&6-L@~gsr8#NN8XLh)1P!^WXf{+XM2Chvxzt`Yqx{CBFoY1TGM}-FSy-5IXr*T zhBKmDO*~?n8YEIyOFvJ2Cds8{cT|4Tzon7ZH`z{h%y-V;VlgQvnpawH{kADR)2G?| z^ehUotuQzLYN&B0ZCN?%+go>DdALoE^sE;YxRbY~;qV8Bf+@P0yfYWX*G9OUIurRq zHe>Bh<^2tdw>>)em!Es@-Zt;&brV`OxcujQl=<^U z^@fU5Va0~3YY~C>n5(x`^6io6zPnzeXO`)atmkv)n0}uidC_1E%SPpm$$L`xkAJb! NU-SNdcUg1PN&uLi!Pfu) diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/response_broken.pem b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/response_broken.pem deleted file mode 100644 index 29a64c6..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/response_broken.pem +++ /dev/null @@ -1 +0,0 @@ -MIICGAoBAKCCAhEwggINBgkrBgEFBQcwAQEEggH+OZ4ZSKS2J85Kr9UaI2LAEFKvOM8/hjk8uyp7KnqJ12h8GOhGZAgIBdaADAQH/GA8wMDAxMDEwMTAwMDAwMFqgERgPMDAwMTAxMDEwMDAwMDBaMA0GCSqGSIb3DQEBCwUAA4IBAQCBGs+8UNwUdkEBladnajZIV+sHtmao/mMTIvpyPqnmV2Ab9KfNWlSDSDuMtZYKS4VsEwtbZ+4kKWI8DugE6egjP3o64R7VP2aqrh41IORwccLGVsexILBpxg4h602JbhXM0sxgXoh5WAt9f1oy6PsHAt/XAuJGSo7yMNv3nHKNFwjExmZt21sNLYlWlljjtX92rlo/mBTWKO0js4YRNyeNQhchARbn9oL18jW0yAVqB9a8rees+EippbTfoktFf0cIhnmkiknPZSZ+dN2qHkxiXIujWlymZzUZcqRTNtrmmhlOdt35QSg7Vw8eyw2rl8ZU94zaI5DPWn1QYn0dk7l9 \ No newline at end of file diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/response_mix.pem b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/response_mix.pem deleted file mode 100644 index 43249fb0aeb8001000e55d8fc0bcdf265c48ef69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1260 zcmZXPeQXnD9LIOvR$$8*%cc%-L4z-o3VZH$U0XoobG>VOyWaKf+G|e@xxU@??XK;$ zyS7H1B@hS%mqA1b!70(ifC33DF%n;*#E3+rF$#z#LgI|kfGJAARTi}(*S6i`pio#W~94&5kQcxCUOHbk?Y{uOLLtjq~oQH;0d%BEHQV6 zyUc^8a0p!nmbQzY!9`R}Dirf6v>)`fN$;SUS2C)sqql>hHdr*+7n0PwU1dp4Wb}lF z4uXL;Up(03l=7LhR#r389RsKp;24HFFe?CS01g09KpL!XWp-PZcAD<&?&umCy?pMX zwo~2`d~nUS-)0Y8b!|O+v}@?lC*z-fx6`-w^nud{Uap>BXZ{dzuG{9mer}hb%^p2-+X>wBcyoFigwA_djxK z-%|F(+V(pRn-8=R?zu`~1%s*VS*{-6aXVR}4-9Mkd@T14I zD@H#vu9mU;iGJSjJHa-<4PoIhXFrvKv=Bjt556)kF@9+NJ69-2c);D%# zmUEjgZ8DF19{XZ=;lMnz@bt{)(H`IaU+((rr~A&{OO$Fy8(&5P-*!HEyuS40@b+(x z4DHxw{UE!rf4}wG%<|8`;jUw=jwMbe`#=1B-PqyFH@8o15?^C!+UbTG0U4(gDwHA1 zG)Ks}G9gngB9Jg(fTCpCV`;r3ELkUkPe2mN6x1SiBg#`=7UtX#4O4`|IwKLbMv>4* z$XtYg8c%=-9urU_?he<;25kAZxy}>$pe6}cHPN61mI(YiUt_s2=Bm<^SdR(TtQ6(4 z@dm}S1a+(LBv>YZxpYYorxFEgF&0b&Sw3uVB;8>7oZ%y(;pHJ*W16du91-W{P3n&Q%2IHzj^P={w0O~MOA{>&voJ#2y zDpM@R`Lvd+xY8g&D{3K^$*F!ZBwCUjR`TR(nJ8V&3i*0LY=p%`Dadn`a-pE)eaXtW iH4u_*5yPIU8?9)&7G6(n=EyyG8D1+Gv4 diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.crt b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.crt deleted file mode 100644 index 9e4deb0..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.crt +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICATCCAWoCCQDidF+uNJR6czANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB -VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 -cyBQdHkgTHRkMB4XDTEyMDUwMTIyNTUxN1oXDTEzMDUwMTIyNTUxN1owRTELMAkG -A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 -IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtpjl -nodhz31kLEJoeLSkRmrv8l7exkGtO0REtIbirj9BBy64ZXVBE7khKGO2cnM8U7yj -w7Ntfh+IvCjZVA3d2XqHS3Pjrt4HmU/cGCONE8+NEXoqdzLUDPOix1qDDRBvXs81 -KAV2qh6CYHZbdqixhDerjvJcD4Nsd7kExEZfHuECAwEAATANBgkqhkiG9w0BAQUF -AAOBgQCyOqs7+qpMrYCgL6OamDeCVojLoEp036PsnaYWf2NPmsVXdpYW40Foyyjp -iv5otkxO5rxtGPv7o2J1eMBpCuSkydvoz3Ey/QwGqbBwEXQ4xYCgra336gqW2KQt -+LnDCkE8f5oBhCIisExc2i8PDvsRsY70g/2gs983ImJjVR8sDw== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.key b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.key deleted file mode 100644 index ab10162..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQC2mOWeh2HPfWQsQmh4tKRGau/yXt7GQa07RES0huKuP0EHLrhl -dUETuSEoY7ZyczxTvKPDs21+H4i8KNlUDd3ZeodLc+Ou3geZT9wYI40Tz40Reip3 -MtQM86LHWoMNEG9ezzUoBXaqHoJgdlt2qLGEN6uO8lwPg2x3uQTERl8e4QIDAQAB -AoGAVxnsPojZ8X4g8LPk3d9dlXGhb/4tSmk9102jcHH/Y5ssy95Pe6ZJGr1uwbN+ -7m1l05PikpHeoxEryoW51cyfjDVkXUT0zPp2JC38DUA/0A8qWav/aENM64wg1I0P -Dil8FywzZEonRNJst53+9cxFye70ely5br/tWxEp4/MsM1kCQQDqV4Lwn8BXOeKg -xOwNmcL+0XPedvSPBSPUoGJCzu12rH6Z+UHXipXsqRNSyQ+KGlur14y0kCh5uiVA -jmWYVEEjAkEAx3keAo1nFsVW35EPt5LIbh6L6ty7GrvGRvOVeSd6YLtixMety24k -hpt1cEv2xlFnbjbBbMkr9eUiUNpttLT6KwJBANGKaLoSjqEwUFYjX1OV/wdtcGcn -BOzx0qUouFQ2xZ0NBrNVbyt1bzPLx0yKHkwF35ybw+Qc1yRpby/3ZB6+j/MCQFLl -vtcItOL9uBDJVGLSGYHKKBO/D/MYPlqWOHRVN8KjnXRyF4QHjh5y1OeKalAY3Ict -Mk1nfWF/jDdVz2neHGkCQHHBR4Xt1/euDku+14z5aLpphTEQVuRD2vQoeKi/W/CY -OgNmKj1DzucnCS6yRCrF8Q0Pn8l054a3Wdbl1gqI/gA= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.crt b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.crt deleted file mode 100644 index 09f3f52..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.crt +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN CERTIFICATE----- -IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtpjl -nodhz31kLEJoeLSkRmrv8l7exkGtO0REtIbirj9BBy64ZXVBE7khKGO2cnM8U7yj -w7Ntfh+IvCjZVA3d2XqHS3Pjrt4HmU/cGCONE8+NEXoqdzLUDPOix1qDDRBvXs81 -KAV2qh6CYHZbdqixhDerjvJcD4Nsd7kExEZfHuECAwEAATANBgkqhkiG9w0BAQUF -AAOBgQCyOqs7+qpMrYCgL6OamDeCVojLoEp036PsnaYWf2NPmsVXdpYW40Foyyjp -iv5otkxO5rxtGPv7o2J1eMBpCuSkydvoz3Ey/QwGqbBwEXQ4xYCgra336gqW2KQt -+LnDCkE8f5oBhCIisExc2i8PDvsRsY70g/2gs983ImJjVR8sDw== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.key b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.key deleted file mode 100644 index 98e860f..0000000 --- a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/server_broken.key +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -jmWYVEEjAkEAx3keAo1nFsVW35EPt5LIbh6L6ty7GrvGRvOVeSd6YLtixMety24k -hpt1cEv2xlFnbjbBbMkr9eUiUNpttLT6KwJBANGKaLoSjqEwUFYjX1OV/wdtcGcn -BOzx0qUouFQ2xZ0NBrNVbyt1bzPLx0yKHkwF35ybw+Qc1yRpby/3ZB6+j/MCQFLl -vtcItOL9uBDJVGLSGYHKKBO/D/MYPlqWOHRVN8KjnXRyF4QHjh5y1OeKalAY3Ict -Mk1nfWF/jDdVz2neHGkCQHHBR4Xt1/euDku+14z5aLpphTEQVuRD2vQoeKi/W/CY -OgNmKj1DzucnCS6yRCrF8Q0Pn8l054a3Wdbl1gqI/gA= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/sqlite_ca.pem b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/sqlite_ca.pem deleted file mode 100644 index 9c922de..0000000 --- a/vendor/github.com/clo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uvTybDHyfc1VrdgZmfaukE35VyQ1+xWa/47Q7KISSCH1x0cF -L+WdJqKHD0q/tR2uz/fw9AUlV1LkBEeAZclhPxCLv32gLExQrNCBVa7c9Xkq1muB -o0ootJF9sTZopqnsMldvMBWOl/9cb2dxPKu3AcNpCm28wt+rwqHIu+Fna9Fe/n+y -SmWTaP3l/eiLskFUvmHKSUVwTEPC6kbK9rxKPz7ijQ3h/YuWxxz32L2CpsOfekgT -7jER0Y/xxZq7XykdwZ1VKKfZGnsH8mU2rU335Gd1 ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/ocsp/testdata/sqlite_test.db b/vendor/github.com/cloudflare/cfssl/ocsp/testdata/sqlite_test.db deleted file mode 100644 index 51a720a80d96088b2d0e15a332d3b40b341276b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28672 zcmeI4dyM168Nic$WN&@!Eyph1E2X*=aj+pQvEytWP;|8&Cvg%xapE|el+(&_oWzL} zCw8(O$L&TF$gst(Gs??G}sW4s)L{_w_Vt zX2#YF=DT%6{#4mJESGG1cxua)78`WLvgO$=2hX^E3ke-LBXz02y7&* zE@`r$EH^s!f~46uq(ZMP33evI*_li{ez93q=(H=UCbxUbHL15O7o|p9F3D!A6RQ@~ zVsC@3_p>KfmAXw?J6YwnT$l8=P;d78PNpatOXch_GB-aoLdS~2vLX~D<$aGH%MBdcCvLi|-O*3b+fNcD znk49I<0Mt(M!Rq7^g=_ER@9nQTsAM=hSN|0HKqEncD;0BM1Gi9gB-pw+gxnNsa(F% zJO?0bXs!*ryq+MU21ithA16Z9367~amx9IP?s(?TRQgcuujY^ zELivL9@s3asxB=T3(G5#rps#M`0~h*)#J5;pjwBv_AVFg6vL5WGPQAj+OZ6mpcvB_ zO)^~HkHhI$@8${QzpXc(Wri!u`m)e$DzbDsmD_{Ug`J~lGRoX(BT*wlw-=IKQjH8W%>{13rK(fAOHve0)PM@00;mAfB+x>2mk_r03h&x zPhi`~xMgw@b;F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GtVzlakyMol?YmsbQ%Xt!h19wM#d9S8tN`b0E_Rhy{1Cn~Zf(Ok|ow-R(EpPR(dVsE#w#5CS2|)o}KpbUn)n zNmOx3a$K*4GAs2+ES=#Ej!Y8XS|JwDy0PS{Pp-0P#g*%1yWLgP9d{E=JyDWsWe)OH z$rPM(b-VeNZ>d)+8hM0|#Y*{bLy!3D8Ml@}(Zz5Pfd*$lk_n!8R)qSW5$5&(^rIi? zhXpVW2mk_r03ZMe00MvjAOHve0)PM@00;mA{~H3Hv58%iAM{@9VEzBpO%`(l2@n7T z00BS%5C8-K0YCr{00aO5K;UC1u)l1z*>+uh`OdTUyzu=$-S)31PIu`Hymw?4vRV%B z9how-leS5x%{o3l0b8wOd#!(i_gdeDuX^b_%kVB_GdyV<&5YS*MlxySOn6Jb0L@I0 zUGrZj6$zP!r}~o3Gd8XwH_AHlDR{Oon3$PL3k`cn6B?qdiz+e$Z|%!B%|L{p$majZ zH)LVkw7CYz52J23;z2zyoQG?$3}a@G)L8$HFy#{_36Y zgsy(}$k^!FcN>lF4_hAn&i`NLa}i9BX!DC#jq z=Ex^6Iv6?lmno}t^SEVnuhnW{uPUDR>G214FWj7Qelh>6x4hYj^KD0;-%tB5imcrH zS^Ui(Z~kUy_Un7-`@ZxvvhRG0Y=yZ z{PsWgd`m#4?x{>HiPy?SzcXXe)1e*K$~ z$B#U4-R_AuQiu6>?)N``&d=tLp7pBz-n*W8?*}utpMT@)pZh8D(qCtp+54aTOcRtnh*cM^Z$>1l7kKb0YCr{00aO5KmZT`1ONd*01yBK0D%ufz%ypsHMxGP 0 && !reflect.DeepEqual(certHosts, request.Hosts) { - t.Fatalf("Hosts not the same. cert hosts: %v, expected: %v", certHosts, request.Hosts) - } - - if request.Hosts == nil && !reflect.DeepEqual(certHosts, csrHosts) { - t.Fatalf("Hosts not the same. cert hosts: %v, expected csr hosts: %v", certHosts, csrHosts) - } - - if request.Hosts != nil && len(request.Hosts) == 0 && len(certHosts) != 0 { - t.Fatalf("Hosts not the same. cert hosts: %v, expected: %v", certHosts, request.Hosts) - } - } - } - -} - -func TestOverrideValidity(t *testing.T) { - csrPEM, err := ioutil.ReadFile(fullSubjectCSR) - if err != nil { - t.Fatalf("%v", err) - } - - s := newCustomSigner(t, testECDSACaFile, testECDSACaKeyFile) - - req := signer.SignRequest{ - Request: string(csrPEM), - } - - // The default expiry value. - expiry := 8760 * time.Hour - - // default case - now := time.Now().UTC() - certPEM, err := s.Sign(req) - if err != nil { - t.Fatalf("Error signing default request: %s", err) - } - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%v", err) - } - if !cert.NotBefore.After(now.Add(-10*time.Minute)) || !cert.NotBefore.Before(now.Add(10*time.Minute)) { - t.Fatalf("Unexpected NotBefore: wanted %s +/-10 minutes, got %s", now, cert.NotBefore) - } - expectedNotAfter := now.Round(time.Minute).Add(expiry) - if !cert.NotAfter.After(expectedNotAfter.Add(-10*time.Minute)) || !cert.NotAfter.Before(expectedNotAfter.Add(10*time.Minute)) { - t.Fatalf("Unexpected NotAfter: wanted %s +/-10 minutes, got %s", now, cert.NotAfter) - } - - // custom case, NotBefore only - now = time.Now().UTC() - req.NotBefore = now.Add(-time.Hour * 5).Truncate(time.Hour) - req.NotAfter = time.Time{} - certPEM, err = s.Sign(req) - if err != nil { - t.Fatalf("Error signing default request: %s", err) - } - cert, err = helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%v", err) - } - if !cert.NotBefore.Equal(req.NotBefore) { - t.Fatalf("Unexpected NotBefore: wanted %s, got %s", req.NotBefore, cert.NotBefore) - } - expectedNotAfter = req.NotBefore.Add(expiry) - if !cert.NotAfter.After(expectedNotAfter.Add(-10*time.Minute)) || !cert.NotAfter.Before(expectedNotAfter.Add(10*time.Minute)) { - t.Fatalf("Unexpected NotAfter: wanted %s +/-10 minutes, got %s", expectedNotAfter, cert.NotAfter) - } - - // custom case, NotAfter only - now = time.Now().UTC() - req.NotBefore = time.Time{} - req.NotAfter = now.Add(-time.Hour * 5).Truncate(time.Hour) - certPEM, err = s.Sign(req) - if err != nil { - t.Fatalf("Error signing default request: %s", err) - } - cert, err = helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%v", err) - } - if !cert.NotBefore.After(now.Add(-10*time.Minute)) || !cert.NotBefore.Before(now.Add(10*time.Minute)) { - t.Fatalf("Unexpected NotBefore: wanted %s +/-10 minutes, got %s", now, cert.NotBefore) - } - if !cert.NotAfter.Equal(req.NotAfter) { - t.Fatalf("Unexpected NotAfter: wanted %s, got %s", req.NotAfter, cert.NotAfter) - } - - // custom case, NotBefore and NotAfter - now = time.Now().UTC() - req.NotBefore = now.Add(-time.Hour * 5).Truncate(time.Hour) - req.NotAfter = now.Add(time.Hour * 5).Truncate(time.Hour) - certPEM, err = s.Sign(req) - if err != nil { - t.Fatalf("Error signing default request: %s", err) - } - cert, err = helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%v", err) - } - if !cert.NotBefore.Equal(req.NotBefore) { - t.Fatalf("Unexpected NotBefore: wanted %s, got %s", req.NotBefore, cert.NotBefore) - } - if !cert.NotAfter.Equal(req.NotAfter) { - t.Fatalf("Unexpected NotAfter: wanted %s, got %s", req.NotAfter, cert.NotAfter) - } -} - -func expectOneValueOf(t *testing.T, s []string, e, n string) { - if len(s) != 1 { - t.Fatalf("Expected %s to have a single value, but it has %d values", n, len(s)) - } - - if s[0] != e { - t.Fatalf("Expected %s to be '%s', but it is '%s'", n, e, s[0]) - } -} - -func expectEmpty(t *testing.T, s []string, n string) { - if len(s) != 0 { - t.Fatalf("Expected no values in %s, but have %d values: %v", n, len(s), s) - } -} - -func TestCASignPathlen(t *testing.T) { - var csrPathlenTests = []struct { - name string - caCertFile string - caKeyFile string - caProfile bool - csrFile string - err error - pathlen int - isZero bool - isCA bool - }{ - { - name: "pathlen 1 signing pathlen 0", - caCertFile: testECDSACaFile, - caKeyFile: testECDSACaKeyFile, - caProfile: true, - csrFile: "testdata/inter_pathlen_0.csr", - err: nil, - pathlen: 0, - isZero: true, - isCA: true, - }, - { - name: "pathlen 1 signing pathlen 1", - caCertFile: testECDSACaFile, - caKeyFile: testECDSACaKeyFile, - caProfile: true, - csrFile: "testdata/inter_pathlen_1.csr", - err: cferr.New(cferr.PolicyError, cferr.InvalidRequest), - }, - { - name: "pathlen 0 signing pathlen 0", - caCertFile: testCaFile, - caKeyFile: testCaKeyFile, - caProfile: true, - csrFile: "testdata/inter_pathlen_0.csr", - err: cferr.New(cferr.PolicyError, cferr.InvalidRequest), - }, - { - name: "pathlen 0 signing pathlen 1", - caCertFile: testCaFile, - caKeyFile: testCaKeyFile, - caProfile: true, - csrFile: "testdata/inter_pathlen_1.csr", - err: cferr.New(cferr.PolicyError, cferr.InvalidRequest), - }, - { - name: "pathlen 0 signing pathlen unspecified", - caCertFile: testCaFile, - caKeyFile: testCaKeyFile, - caProfile: true, - csrFile: "testdata/inter_pathlen_unspecified.csr", - err: cferr.New(cferr.PolicyError, cferr.InvalidRequest), - }, - { - name: "pathlen 1 signing unspecified pathlen", - caCertFile: testECDSACaFile, - caKeyFile: testECDSACaKeyFile, - caProfile: true, - csrFile: "testdata/inter_pathlen_unspecified.csr", - err: nil, - // golang x509 parses unspecified pathlen as MaxPathLen == -1 and - // MaxPathLenZero == false - pathlen: -1, - isZero: false, - isCA: true, - }, - { - name: "non-ca singing profile signing pathlen 0", - caCertFile: testECDSACaFile, - caKeyFile: testECDSACaKeyFile, - caProfile: false, - csrFile: "testdata/inter_pathlen_0.csr", - err: cferr.New(cferr.PolicyError, cferr.InvalidRequest), - }, - { - name: "non-ca singing profile signing pathlen 1", - caCertFile: testECDSACaFile, - caKeyFile: testECDSACaKeyFile, - caProfile: false, - csrFile: "testdata/inter_pathlen_1.csr", - err: cferr.New(cferr.PolicyError, cferr.InvalidRequest), - }, - { - name: "non-ca singing profile signing pathlen 0", - caCertFile: testECDSACaFile, - caKeyFile: testECDSACaKeyFile, - caProfile: false, - csrFile: "testdata/inter_pathlen_unspecified.csr", - err: cferr.New(cferr.PolicyError, cferr.InvalidRequest), - }, - } - - for _, testCase := range csrPathlenTests { - csrPEM, err := ioutil.ReadFile(testCase.csrFile) - if err != nil { - t.Fatalf("%v", err) - } - - req := &signer.Subject{ - Names: []csr.Name{ - {O: "sam certificate authority"}, - }, - CN: "localhost", - } - - s := newCustomSigner(t, testCase.caCertFile, testCase.caKeyFile) - // No policy CSR whitelist: the normal set of CSR fields get passed through to - // certificate. - s.policy = &config.Signing{ - Default: &config.SigningProfile{ - Usage: []string{"cert sign", "crl sign"}, - ExpiryString: "1h", - Expiry: 1 * time.Hour, - CAConstraint: config.CAConstraint{IsCA: testCase.caProfile, - MaxPathLen: testCase.pathlen, - MaxPathLenZero: testCase.isZero, - }, - }, - } - - request := signer.SignRequest{ - Hosts: []string{"127.0.0.1", "localhost"}, - Request: string(csrPEM), - Subject: req, - } - - certPEM, err := s.Sign(request) - if !reflect.DeepEqual(err, testCase.err) { - t.Fatalf("%s: expected: %v, actual: %v", testCase.name, testCase.err, err) - } - - if err == nil { - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%s: %v", testCase.name, err) - } - - if cert.IsCA != testCase.isCA { - t.Fatalf("%s: unexpected IsCA value: %v", testCase.name, cert.IsCA) - } - - if cert.MaxPathLen != testCase.pathlen { - t.Fatalf("%s: unexpected pathlen value: %v", testCase.name, cert.MaxPathLen) - } - - if cert.MaxPathLenZero != testCase.isZero { - t.Fatalf("%s: unexpected pathlen value: %v", testCase.name, cert.MaxPathLenZero) - } - } - } -} - -func TestNoWhitelistSign(t *testing.T) { - csrPEM, err := ioutil.ReadFile(fullSubjectCSR) - if err != nil { - t.Fatalf("%v", err) - } - - req := &signer.Subject{ - Names: []csr.Name{ - {O: "sam certificate authority"}, - }, - CN: "localhost", - } - - s := newCustomSigner(t, testECDSACaFile, testECDSACaKeyFile) - // No policy CSR whitelist: the normal set of CSR fields get passed through to - // certificate. - s.policy = &config.Signing{ - Default: &config.SigningProfile{ - Usage: []string{"cert sign", "crl sign"}, - ExpiryString: "1h", - Expiry: 1 * time.Hour, - CAConstraint: config.CAConstraint{IsCA: true}, - }, - } - - request := signer.SignRequest{ - Hosts: []string{"127.0.0.1", "localhost"}, - Request: string(csrPEM), - Subject: req, - } - - certPEM, err := s.Sign(request) - if err != nil { - t.Fatalf("%v", err) - } - - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%v", err) - } - - name := cert.Subject - if name.CommonName != "localhost" { - t.Fatalf("Expected certificate common name to be 'localhost' but have '%v'", name.CommonName) - } - - // CSR has: Subject: C=US, O=CloudFlare, OU=WWW, L=Ithaca, ST=New York - // Expect all to be passed through. - expectOneValueOf(t, name.Organization, "sam certificate authority", "O") - expectOneValueOf(t, name.OrganizationalUnit, "WWW", "OU") - expectOneValueOf(t, name.Province, "New York", "ST") - expectOneValueOf(t, name.Locality, "Ithaca", "L") - expectOneValueOf(t, name.Country, "US", "C") -} - -func TestWhitelistSign(t *testing.T) { - csrPEM, err := ioutil.ReadFile(fullSubjectCSR) - if err != nil { - t.Fatalf("%v", err) - } - - req := &signer.Subject{ - Names: []csr.Name{ - {O: "sam certificate authority"}, - }, - } - - s := newCustomSigner(t, testECDSACaFile, testECDSACaKeyFile) - // Whitelist only key-related fields. Subject, DNSNames, etc shouldn't get - // passed through from CSR. - s.policy = &config.Signing{ - Default: &config.SigningProfile{ - Usage: []string{"cert sign", "crl sign"}, - ExpiryString: "1h", - Expiry: 1 * time.Hour, - CAConstraint: config.CAConstraint{IsCA: true}, - CSRWhitelist: &config.CSRWhitelist{ - PublicKey: true, - PublicKeyAlgorithm: true, - SignatureAlgorithm: true, - }, - }, - } - - request := signer.SignRequest{ - Hosts: []string{"127.0.0.1", "localhost"}, - Request: string(csrPEM), - Subject: req, - } - - certPEM, err := s.Sign(request) - if err != nil { - t.Fatalf("%v", err) - } - - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%v", err) - } - - name := cert.Subject - if name.CommonName != "" { - t.Fatalf("Expected empty certificate common name under policy without "+ - "Subject whitelist, got %v", name.CommonName) - } - // O is provided by the signing API request, not the CSR, so it's allowed to - // be copied into the certificate. - expectOneValueOf(t, name.Organization, "sam certificate authority", "O") - expectEmpty(t, name.OrganizationalUnit, "OU") - expectEmpty(t, name.Province, "ST") - expectEmpty(t, name.Locality, "L") - expectEmpty(t, name.Country, "C") - if cert.PublicKeyAlgorithm != x509.RSA { - t.Fatalf("Expected public key algorithm to be RSA") - } - - // Signature algorithm is allowed to be copied from CSR, but is overridden by - // DefaultSigAlgo. - if cert.SignatureAlgorithm != x509.ECDSAWithSHA256 { - t.Fatalf("Expected public key algorithm to be ECDSAWithSHA256, got %v", - cert.SignatureAlgorithm) - } -} - -func TestNameWhitelistSign(t *testing.T) { - csrPEM, err := ioutil.ReadFile(fullSubjectCSR) - if err != nil { - t.Fatalf("%v", err) - } - - subInvalid := &signer.Subject{ - CN: "localhost.com", - } - subValid := &signer.Subject{ - CN: "1lab41.cf", - } - - wl := regexp.MustCompile("^1[a-z]*[0-9]*\\.cf$") - - s := newCustomSigner(t, testECDSACaFile, testECDSACaKeyFile) - // Whitelist only key-related fields. Subject, DNSNames, etc shouldn't get - // passed through from CSR. - s.policy = &config.Signing{ - Default: &config.SigningProfile{ - Usage: []string{"cert sign", "crl sign"}, - ExpiryString: "1h", - Expiry: 1 * time.Hour, - CAConstraint: config.CAConstraint{IsCA: true}, - NameWhitelist: wl, - }, - } - - request := signer.SignRequest{ - Hosts: []string{"127.0.0.1", "1machine23.cf"}, - Request: string(csrPEM), - } - - _, err = s.Sign(request) - if err != nil { - t.Fatalf("%v", err) - } - - request = signer.SignRequest{ - Hosts: []string{"invalid.cf", "1machine23.cf"}, - Request: string(csrPEM), - } - - _, err = s.Sign(request) - if err == nil { - t.Fatalf("expected a policy error") - } - - request = signer.SignRequest{ - Hosts: []string{"1machine23.cf"}, - Request: string(csrPEM), - Subject: subInvalid, - } - - _, err = s.Sign(request) - if err == nil { - t.Fatalf("expected a policy error") - } - - request = signer.SignRequest{ - Hosts: []string{"1machine23.cf"}, - Request: string(csrPEM), - Subject: subValid, - } - - _, err = s.Sign(request) - if err != nil { - t.Fatalf("%v", err) - } - -} - -func TestExtensionSign(t *testing.T) { - csrPEM, err := ioutil.ReadFile(testCSR) - if err != nil { - t.Fatalf("%v", err) - } - - s := newCustomSigner(t, testECDSACaFile, testECDSACaKeyFile) - - // By default, no extensions should be allowed - request := signer.SignRequest{ - Request: string(csrPEM), - Extensions: []signer.Extension{ - {ID: config.OID(asn1.ObjectIdentifier{1, 2, 3, 4})}, - }, - } - - _, err = s.Sign(request) - if err == nil { - t.Fatalf("expected a policy error") - } - - // Whitelist a specific extension. The extension with OID 1.2.3.4 should be - // allowed through, but the one with OID 1.2.3.5 should not. - s.policy = &config.Signing{ - Default: &config.SigningProfile{ - Usage: []string{"cert sign", "crl sign"}, - ExpiryString: "1h", - Expiry: 1 * time.Hour, - CAConstraint: config.CAConstraint{IsCA: true}, - ExtensionWhitelist: map[string]bool{"1.2.3.4": true}, - }, - } - - // Test that a forbidden extension triggers a sign error - request = signer.SignRequest{ - Request: string(csrPEM), - Extensions: []signer.Extension{ - {ID: config.OID(asn1.ObjectIdentifier{1, 2, 3, 5})}, - }, - } - - _, err = s.Sign(request) - if err == nil { - t.Fatalf("expected a policy error") - } - - extValue := []byte{0x05, 0x00} - extValueHex := hex.EncodeToString(extValue) - - // Test that an allowed extension makes it through - request = signer.SignRequest{ - Request: string(csrPEM), - Extensions: []signer.Extension{ - { - ID: config.OID(asn1.ObjectIdentifier{1, 2, 3, 4}), - Critical: false, - Value: extValueHex, - }, - }, - } - - certPEM, err := s.Sign(request) - if err != nil { - t.Fatalf("%v", err) - } - - cert, err := helpers.ParseCertificatePEM(certPEM) - if err != nil { - t.Fatalf("%v", err) - } - - foundAllowed := false - for _, ext := range cert.Extensions { - if ext.Id.String() == "1.2.3.4" { - foundAllowed = true - - if ext.Critical { - t.Fatalf("Extensions should not be marked critical") - } - - if !bytes.Equal(extValue, ext.Value) { - t.Fatalf("Extension has wrong value: %s != %s", hex.EncodeToString(ext.Value), extValueHex) - } - } - } - if !foundAllowed { - t.Fatalf("Custom extension not included in the certificate") - } -} - -func TestCTFailure(t *testing.T) { - // start a fake CT server that returns bad request - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(400) - })) - defer ts.Close() - - var config = &config.Signing{ - Default: &config.SigningProfile{ - Expiry: helpers.OneYear, - CAConstraint: config.CAConstraint{IsCA: true}, - Usage: []string{"signing", "key encipherment", "server auth", "client auth"}, - ExpiryString: "8760h", - CTLogServers: []string{ts.URL}, - }, - } - testSigner, err := NewSignerFromFile(testCaFile, testCaKeyFile, config) - if err != nil { - t.Fatalf("%v", err) - } - var pem []byte - pem, err = ioutil.ReadFile("testdata/ex.csr") - if err != nil { - t.Fatalf("%v", err) - } - validReq := signer.SignRequest{ - Request: string(pem), - Hosts: []string{"example.com"}, - } - _, err = testSigner.Sign(validReq) - - if err == nil { - t.Fatal("Expected CT log submission failure") - } -} - -func TestCTSuccess(t *testing.T) { - // start a fake CT server that will accept the submission - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(`{"sct_version":0,"id":"KHYaGJAn++880NYaAY12sFBXKcenQRvMvfYE9F1CYVM=","timestamp":1337,"extensions":"","signature":"BAMARjBEAiAIc21J5ZbdKZHw5wLxCP+MhBEsV5+nfvGyakOIv6FOvAIgWYMZb6Pw///uiNM7QTg2Of1OqmK1GbeGuEl9VJN8v8c="}`)) - w.WriteHeader(200) - })) - defer ts.Close() - - var config = &config.Signing{ - Default: &config.SigningProfile{ - Expiry: helpers.OneYear, - CAConstraint: config.CAConstraint{IsCA: true}, - Usage: []string{"signing", "key encipherment", "server auth", "client auth"}, - ExpiryString: "8760h", - CTLogServers: []string{ts.URL}, - }, - } - testSigner, err := NewSignerFromFile(testCaFile, testCaKeyFile, config) - if err != nil { - t.Fatalf("%v", err) - } - var pem []byte - pem, err = ioutil.ReadFile("testdata/ex.csr") - if err != nil { - t.Fatalf("%v", err) - } - validReq := signer.SignRequest{ - Request: string(pem), - Hosts: []string{"example.com"}, - } - _, err = testSigner.Sign(validReq) - - if err != nil { - t.Fatal("Expected CT log submission success") - } -} - -func TestReturnPrecert(t *testing.T) { - var config = &config.Signing{ - Default: &config.SigningProfile{ - Expiry: helpers.OneYear, - CAConstraint: config.CAConstraint{IsCA: true}, - Usage: []string{"signing", "key encipherment", "server auth", "client auth"}, - ExpiryString: "8760h", - }, - } - testSigner, err := NewSignerFromFile(testCaFile, testCaKeyFile, config) - if err != nil { - t.Fatalf("%v", err) - } - csr, err := ioutil.ReadFile("testdata/ex.csr") - if err != nil { - t.Fatalf("%v", err) - } - validReq := signer.SignRequest{ - Request: string(csr), - Hosts: []string{"example.com"}, - ReturnPrecert: true, - } - - certBytes, err := testSigner.Sign(validReq) - if err != nil { - t.Fatal("Failed to sign request") - } - block, _ := pem.Decode(certBytes) - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - t.Fatalf("Failed to parse signed cert: %s", err) - } - - // check cert with poison extension was returned - poisoned := false - for _, ext := range cert.Extensions { - if ext.Id.Equal(signer.CTPoisonOID) { - poisoned = true - break - } - } - if !poisoned { - t.Fatal("Certificate without poison CT extension was returned") - } -} - -func TestSignFromPrecert(t *testing.T) { - var config = &config.Signing{ - Default: &config.SigningProfile{ - Expiry: helpers.OneYear, - CAConstraint: config.CAConstraint{IsCA: true}, - Usage: []string{"signing", "key encipherment", "server auth", "client auth"}, - ExpiryString: "8760h", - }, - } - testSigner, err := NewSignerFromFile(testCaFile, testCaKeyFile, config) - if err != nil { - t.Fatalf("%v", err) - } - - // Generate a precert - k, err := rsa.GenerateKey(rand.Reader, 1024) - if err != nil { - t.Fatalf("Failed to generate test key: %s", err) - } - precertBytes, err := testSigner.sign(&x509.Certificate{ - SignatureAlgorithm: x509.SHA512WithRSA, - PublicKey: k.Public(), - SerialNumber: big.NewInt(10), - Subject: pkix.Name{CommonName: "CN"}, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour), - ExtraExtensions: []pkix.Extension{ - {Id: signer.CTPoisonOID, Critical: true, Value: []byte{0x05, 0x00}}, - }, - ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, - SubjectKeyId: []byte{0, 1}, - AuthorityKeyId: []byte{1, 0}, - OCSPServer: []string{"ocsp?"}, - IssuingCertificateURL: []string{"url"}, - DNSNames: []string{"example.com"}, - EmailAddresses: []string{"email@example.com"}, - IPAddresses: []net.IP{net.ParseIP("1.1.1.1")}, - CRLDistributionPoints: []string{"crl"}, - PolicyIdentifiers: []asn1.ObjectIdentifier{{1, 2, 3}}, - }) - if err != nil { - t.Fatalf("Failed to sign request: %s", err) - } - block, _ := pem.Decode(precertBytes) - precert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - t.Fatalf("Failed to parse signed cert: %s", err) - } - - // Create a cert from the precert - scts := []ct.SignedCertificateTimestamp{{}} - certBytes, err := testSigner.SignFromPrecert(precert, scts) - if err != nil { - t.Fatalf("Failed to sign cert from precert: %s", err) - } - block, _ = pem.Decode(certBytes) - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - t.Fatalf("Failed to parse signed cert: %s", err) - } - - // check cert doesn't contains poison extension - poisoned := false - for _, ext := range cert.Extensions { - if ext.Id.Equal(signer.CTPoisonOID) { - poisoned = true - break - } - } - if poisoned { - t.Fatal("Certificate with poison CT extension was returned") - } - - // check cert contains SCT list extension - list := false - for _, ext := range cert.Extensions { - if ext.Id.Equal(signer.SCTListOID) { - list = true - break - } - } - if !list { - t.Fatal("Certificate without SCT list extension was returned") - } - - // Break poison extension - precert.Extensions[7].Value = []byte{1, 3, 3, 7} - _, err = testSigner.SignFromPrecert(precert, scts) - if err == nil { - t.Fatal("SignFromPrecert didn't fail with invalid poison extension") - } - - precert.Extensions[7].Critical = false - _, err = testSigner.SignFromPrecert(precert, scts) - if err == nil { - t.Fatal("SignFromPrecert didn't fail with non-critical poison extension") - } - - precert.Extensions = append(precert.Extensions[:7], precert.Extensions[8:]...) - _, err = testSigner.SignFromPrecert(precert, scts) - if err == nil { - t.Fatal("SignFromPrecert didn't fail with missing poison extension") - } - - precert.Signature = []byte("nop") - _, err = testSigner.SignFromPrecert(precert, scts) - if err == nil { - t.Fatal("SignFromPrecert didn't fail with signature not from CA") - } -} diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/build_inter_pathlen_csrs.sh b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/build_inter_pathlen_csrs.sh deleted file mode 100644 index b871f9e..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/build_inter_pathlen_csrs.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo '{ "CN": "Pathlen 0 Issuer", "ca": { "pathlen": 0, "pathlenzero": true } }' | cfssl genkey -initca - | cfssljson -bare inter_pathlen_0 -echo '{ "CN": "Pathlen 1 Issuer", "ca": { "pathlen": 1 } }' | cfssl genkey -initca - | cfssljson -bare inter_pathlen_1 -echo '{ "CN": "Pathlen Unspecified", "ca": {} }' | cfssl genkey -initca - | cfssljson -bare inter_pathlen_unspecified diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca.pem b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca.pem deleted file mode 100644 index 1a1f5a9..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEmzCCA4OgAwIBAgIMAMSvNBgypwaaSQ5iMA0GCSqGSIb3DQEBBQUAMIGMMQsw -CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy -YW5jaXNjbzETMBEGA1UEChMKQ0ZTU0wgVEVTVDEbMBkGA1UEAxMSQ0ZTU0wgVEVT -VCBSb290I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1EZYDwed6rS0+YKHdkRGRQ5Rz6A9DIVBPXrSMAGj3 -F5EF2m/GJbhpVbnNJTVlgP9DDyabOZNxzdrCr4cHMkYYnocDdgAodnkw6GZ/GJTc -depbVTR4TpihFNzeDEGJePrEwM1DouGswpu97jyuCYZ3z1a60+a+3C1GwWaJ7Aet -Uqm+yLTUrMISsfnDPqJdM1NeqW3jiZ4IgcqJkieCCSpag9Xuzrp9q6rjmePvlQkv -qz020JGg6VijJ+c6Tf5y0XqbAhkBTqYtVamu9gEth9utn12EhdNjTZMPKMjjgFUd -H0N6yOEuQMl4ky7RxZBM0iPyeob6i4z2LEQilgv9MQ== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca_key.pem b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca_key.pem deleted file mode 100644 index d2de6bf..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ca_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCxGnXFJ8gOgP/j -QGjgeWzewWfh1q/k2DFtkalXIYXt0kj27R4ScvgFQayw9pQUtYLzcJnG6NQSIR8T -Sgpf646GEa/f6PnFJM0zvribZ5KI3ndx1m0rTl2HCr25Lwu2Mo5B43WZDmqaKrEE -x2OQqAyxXDmUwKChgqjnuRooXJfN2k1UPOrD6m0daa420NCMrepPkxrTqZg+YgZi -EhlgtjugkaD1kRo1HQYjDjMhPklGw2JpJvnBMvBprSf/i8snJWMslxiYkG9laPyD -61or4Lgg27+Ma7H5uawL2GrXi1s5pM0Cf80TSo3ygfBxEESp850Rh1mTEjk1Y+Io -1b9D4B5dAgMBAAECggEAKHhjcSomDSptTwDo9mLI/h40HudwSlsc8GzYxZBjinUD -N2n39T9QbeMUE1xFenX/9qFEgq+xxnLLJx1EQacSapCgIAqdCO/f9HMgvGJumdg8 -c0cMq1i9Bp7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+R6cExV -xQB518/lp2eIeMpglWByDwJX ------END PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.csr deleted file mode 100644 index b8f274f..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.csr +++ /dev/null @@ -1,10 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBezCCASECAQAwgYwxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMR0wGwYDVQQDExRjbG91ZGZsYXJl -LWludGVyLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABLgOKlWwIAIeURde -yvDMhgfn6xPp1gn8oUeLmsniBm7I+j84IsVzUso8/MpjMZ9nB8lQUanhv3Kmqcyj -HNj+iFegMjAwBgkqhkiG9w0BCQ4xIzAhMB8GA1UdEQQYMBaCFGNsb3VkZmxhcmUt -aW50ZXIuY29tMAoGCCqGSM49BAMCA0gAMEUCIEJcy2mn2YyK8lVE+HHmr2OsmdbH -4CLDVXFBwxke8ObqAiEAx/il1cDKvQ/I36b4XjBnOX2jcQ5oaCNPFFBE74WQ/ps= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.key b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.key deleted file mode 100644 index 156aec3..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256-inter.key +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHcCAQEEILbwI4u4bw+HtafMqFnrL7LOrqNEZH5rW5ygSrigfrVLoAoGCCqGSM49 -AwEHoUQDQgAEuA4qVbAgAh5RF17K8MyGB+frE+nWCfyhR4uayeIGbsj6PzgixXNS -yjz8ymMxn2cHyVBRqeG/cqapzKMc2P6IVw== ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256.csr deleted file mode 100644 index a699254..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgTCCASgCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABBn9Ldie6BOcMHezn2dPuYqW -z/NoLYMLGNBqhOxUyEidYClI0JW2pWyUgT3A2UazFp1WgE94y7Z+2YlfRz+vcrKg -PzA9BgkqhkiG9w0BCQ4xMDAuMCwGA1UdEQQlMCOCDmNsb3VkZmxhcmUuY29tghF3 -d3djbG91ZGZsYXJlLmNvbTAKBggqhkjOPQQDAgNHADBEAiBM+QRxe8u6rkdr10Jy -cxbR6NxrGrNeg5QqiOqF96JEmgIgDbtjd5e3y3I8W/+ih2us3WtMxgnTXfqPd48i -VLcv28Q= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca.pem b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca.pem deleted file mode 100644 index a205d01..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDU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8SWcIi4e9AUWY5qK+Sr+7W9/gSY3baaHxY9 -T9SO4O1ENFJ8ecWRPdsiBNCpl53qMuYW2lh72N35Iyug6qKFDYg5 ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca_key.pem b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca_key.pem deleted file mode 100644 index 5c3c7a0..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa256_ca_key.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHcCAQEEIC2qaVydr67HuwWMrPQ3ljCVSsnbV7HbN78KqEX6a0GuoAoGCCqGSM49 -AwEHoUQDQgAEjEb98b3L+COUBe8Hvtt4REtsGig33wUYUDFVQDkiCXKW+CZ83FSY -jyYzZTD23M4ub285ECtpJIzj/qJKkImt4A== ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa384.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa384.csr deleted file mode 100644 index 4afd1d0..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa384.csr +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBvzCCAUUCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTB2MBAGByqGSM49AgEGBSuBBAAiA2IABBk/Q+zMsZOJGkufRzGCWtSUtRjq -0QqChDGWbHLaa0h6ODVeEoKYOMvFJTg4V186tuuBe97KEey0OPDegzCBp5kBIiwg -HB/0xWoKdnfdRk6VyjmubPx399cGoZn8aCqgC6A/MD0GCSqGSIb3DQEJDjEwMC4w -LAYDVR0RBCUwI4IOY2xvdWRmbGFyZS5jb22CEXd3d2Nsb3VkZmxhcmUuY29tMAoG -CCqGSM49BAMDA2gAMGUCMQC57VfwMXDyL5kM7vmO2ynbpgSAuFZT6Yd3C3NnV2jz -Biozw3eqIDXqCb2LI09stZMCMGIwCuVARr2IRctxf7AmX7/O2SIaIhCpMFKRedQ7 -RiWGZIucp5r6AfT9381PB29bHA== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa521.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa521.csr deleted file mode 100644 index c8c312f..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ecdsa521.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICCjCCAWsCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCBmzAQBgcqhkjOPQIBBgUrgQQAIwOBhgAEAHt/s9KTZETzu94JIAjZ3BaS -toSG65hGIc1e0Gt7PhdQxPp5FP2D8rQ1wc+pcZhD2O8525kPxopaqTd+fWKBuD3O -AULzoH2OX+atIuumTQzLNbTsIbP0tY3dh7d8LItuERkZn1NfsNl3z6bnNAaR137m -f4aWv49ImbA/Tkv8VmoKX279oD8wPQYJKoZIhvcNAQkOMTAwLjAsBgNVHREEJTAj -gg5jbG91ZGZsYXJlLmNvbYIRd3d3Y2xvdWRmbGFyZS5jb20wCgYIKoZIzj0EAwQD -gYwAMIGIAkIA8OX9LxWOVnyfB25DFBz6JkjhyDpBM/PXlgLnWb/n2mEuMMB44DOG -pljDV768PSW11AC3DtULoIyR92z0TyLEKYoCQgHdGd6PwUtDW5mrAMJQDgebjsxu -MwfcdthzKlFlSmRpHMBnRMOJjlg5f9CTBg9d6wEdv7ZIrQSO6eqQHDQRM0VMnw== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ex.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ex.csr deleted file mode 100644 index ae2f03a..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ex.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBnzCCAQgCAQAwXzELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5ZMQ8wDQYDVQQH -DAZJdGhhY2ExHDAaBgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdGQxFDASBgNVBAMM -C2V4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBPmzv1c1e -QAa1yTtJ45oPOCARrhqDYV66urzNX1zHDZzi4lruIfI3q+1McACs4FIGJAkBUC2O -ZCamsR6ym5PaL9+dGfgVvf6w/GoBb65bxuw/IgHnzhfEHsk9nV8WthTEHmT9m9lh -kPMZBVDIVFW6iOCCpAwR6I9XXB30oKTINwIDAQABoAAwDQYJKoZIhvcNAQELBQAD -gYEAndd8OjJ+Jr74jqwuV9cUDqlItsLc84TYn+lly0EPezGQIIYz2KUoDyHQ+PQ9 -7JI3G3FWR8Wpow7HooLJRxHNWOw7u8ekLCP0LjkoHse+Dou5C0jzo99jfrjXNWGt -DZO0Wrpu2eDclqwMJO/DtiovzcmOsGC52NHUW6+Moo9N2lM= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_0.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_0.csr deleted file mode 100644 index 1101e4c..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_0.csr +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIH4MIGfAgEAMBsxGTAXBgNVBAMTEFBhdGhsZW4gMCBJc3N1ZXIwWTATBgcqhkjO -PQIBBggqhkjOPQMBBwNCAASpwsWOMhWxFRhj5Kejzx9oqsxaTR8sElCDHBALtYEy -8eBZ7znb9cLWlJ8Kx6Jlw1pY7R7Ys9J9SuJ5jaBIBib1oCIwIAYJKoZIhvcNAQkO -MRMwETAPBgNVHRMECDAGAQH/AgEAMAoGCCqGSM49BAMCA0gAMEUCIQDVsX+lxlvu -JDEDEDnaVtN5NhxDYsomk9DpJwwoCa+A8wIgMboDaCkxGh4z+LejGkP+JvNKPX5E -0mlgWQaOp/5qfbI= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_1.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_1.csr deleted file mode 100644 index 4afd525..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_1.csr +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIH5MIGfAgEAMBsxGTAXBgNVBAMTEFBhdGhsZW4gMSBJc3N1ZXIwWTATBgcqhkjO -PQIBBggqhkjOPQMBBwNCAARJV1R1nX2e3Ev2NxG9V9R67Gkg1T0VSXargQSUhHQj -ZNyYaoUKkke6lL3sG7H2t8yoC0AJcE5r30OWQoK1rB8goCIwIAYJKoZIhvcNAQkO -MRMwETAPBgNVHRMECDAGAQH/AgEBMAoGCCqGSM49BAMCA0kAMEYCIQCJdPdRGltY -hIvSBob0vcb5JmQEVByxLwKrWAivXDvMfAIhAP8fO0+Xkx0rNB9KnINeZtMGYy3X -tk1GxikrK7klEnvN ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_unspecified.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_unspecified.csr deleted file mode 100644 index 437166d..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/inter_pathlen_unspecified.csr +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIH3MIGfAgEAMB4xHDAaBgNVBAMTE1BhdGhsZW4gVW5zcGVjaWZpZWQwWTATBgcq -hkjOPQIBBggqhkjOPQMBBwNCAAS01AiSXS4086rrC0SvnEoKz+tAj5+oAXomw/DQ -PljnAeMdUvYSa0HxIoszeSGyx6prN3VnfuR/1nMRGtXAQGREoB8wHQYJKoZIhvcN -AQkOMRAwDjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0cAMEQCIHPU8Jml1HUc -L7v5mp4/njpWoVxPH0XkPYwdgk7nUnOZAiAaS3MpwrXz/l5v550T5nilkomRWeeX -BdXmSA24AN562A== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ip.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ip.csr deleted file mode 100644 index 791f9de..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/ip.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBlTCB/wIBADBWMQswCQYDVQQGEwJVUzELMAkGA1UECAwCTlkxDzANBgNVBAcM -Bkl0aGFjYTEQMA4GA1UECgwHQ29ybmVsbDEXMBUGA1UEAwwOMTI4Ljg0LjEyNi4y -MTMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAME+bO/VzV5ABrXJO0njmg84 -IBGuGoNhXrq6vM1fXMcNnOLiWu4h8jer7UxwAKzgUgYkCQFQLY5kJqaxHrKbk9ov -350Z+BW9/rD8agFvrlvG7D8iAefOF8QeyT2dXxa2FMQeZP2b2WGQ8xkFUMhUVbqI -4IKkDBHoj1dcHfSgpMg3AgMBAAGgADANBgkqhkiG9w0BAQsFAAOBgQBS7FBieNEN -PfXQRhPeiZ86QatshBBrj+TmhdC4GjtJ9lQA2NSRg2HnSHDErxdezZ7tw1ordd5D -hZpJ8XkPggsb7mghwPD7Zzgp0M/ldqbZ9fFEtNcpiEL05vKtap5uSGzNn32NDbQa -g+4QnDavffTQuzfuOoGJ9bG3jQtxo9HZCA== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/key.pem b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/key.pem deleted file mode 100644 index 58e4cd6..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQCbp/6OQ/a3mr+8zRgBRlmSGr8QBgP4vUIxLn2Mk4uiZ8OcpRY4 -YqL+TtREGDUc0ve+bv8RINrNlYXL2X+eJtbE2RJQ+RAiu+saw2K+RFTNeTCA1fwg -3ws5gBDcFbECqK1dOkuN/gV4JMHobn2/15iUBfeSJxdF1j5yqES8sVu7cwIDAQAB -AoGBALZOnnBV3aLRlnw04kar9MCQnvLPeNteHyanQtjg/oxqZ8sR9+J2dFzSSv6u -M5bc6Nmb+xY+msZqt9g3l6bN6n+qCvNnLauIY/YPjd577uMTpx/QTOQSK8oc5Dhi -WgdU8GCtUmY+LE8qYx2NFitKCN4hubdrI76c+rnezIPVncZRAkEA9T5+vlfwk/Zl -DOte+JtbXx3RtXKFJPMirOFqNVp1qnIlUm8XtBW6760ugiNYbVbGHgbd8JsZnkPH -NC17TNLVJwJBAKJ7pDlJ2mvVr0cLrFhjAibz45dOipt8B4+dKtDIEuqbtKzJCGuP -SCk4X2SgYz0gC5kH62S7rn6Bsa9lM98dztUCQASdLWNFYkhWXWZV006YFar/c5+X -TPv5+xAHmajxT79qMFuRrX983Sx/NJ3MLnC4LjgIZwqM0HmSyt+nb2dtnAcCQCKi -nIUhuw+Vg0FvuZM1t7W581/DfERckfgJFqFepLmh60eRqtvStR0kSSFYFw9mj1JV -n9XfM/j/iHLM7du3rOkCQAw9R64yjcIBwcoSQxW/dr0Q9j+SnYgt+EhyXYXT30DS -DdOJ06GXtb/P0peFBp26BnQU4CSS75yseZ1TdB4ZqaA= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa-old.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa-old.csr deleted file mode 100644 index 80d67c2..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa-old.csr +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN NEW CERTIFICATE REQUEST----- -MIIDCTCCAfMCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTWdoYxX4KN51fP -WxQAyGH++VsPbfpAoXIbCPXSmU04BvIxyjzpHQ0ChMKkT/2VNcUeFJwk2fCf+ZwU -f0raTQTplofwkckE0gEYA3WcEfJp+hbvbTb/2recsf+JE6JACYJe2Uu5wsjtrE5j -A+7aT2BEU9RWzBdSy/5281ZfW3PArqcWaf8+RUyA3WRxVWmjmhFsVB+mdNLhCpW0 -C0QNMYR1ppEZiKVnEdao8gcI5sOvSd+35t8g82aPXcNSPU6jKcx1YNUPX5wgPEmu -+anfc9RliQbYqqJYVODgBmV8IR5grw93yTsODoWKtFQ4PKVlnt9CD8AS/iSMQYm3 -OUogqgMCAwEAAaA/MD0GCSqGSIb3DQEJDjEwMC4wLAYDVR0RBCUwI4IOY2xvdWRm -bGFyZS5jb22CEXd3d2Nsb3VkZmxhcmUuY29tMAsGCSqGSIb3DQEBCwOCAQEAl809 -gk9uZkRK+MJVYDSLjgGR2xqk5qOwnhovnispA7N3Z1GshodJRQa6ngNCKuXIm2/6 -AxB9kDGK14n186Qq4odXqHSHs8FG9i0zUcBXeLv1rPAKtwKTas/SLmsOpPgWPZFa -iYiHHeu4HjOQoF987d7uGRYwc3xfstKwJsEXc12eCw2NH8TM1tJgSc/o6CzIpA91 -QnZKhx6uGM4xI2gnOaJA1YikNhyFGBuOGMZgd0k2+/IcR2pg0z4pc5oQw1bXLANx -anqlA/MDrCM9v9019bRJ73zK8LQ3k/FW61PA9nL7RZ8ku65R+uYcVEdLa8pUeqnH -cJZNboDRsItpccZuRQ== ------END NEW CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.csr deleted file mode 100644 index 232fa77..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.csr +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIDCjCCAfQCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOLFLykOd2j31AQn -kaToYtstGvw5wLb4YnlzipQ6aULlD0H0GHM9IwhdSmcTWUWPb/U83g/ma1uD3Pp2 -IdWd6xfjyOJF5XhgkyfRY65wS6vPZRm2MNSFXem+0AKHdhxIhb/QPMASqC/yaiPi -nvtOpBiCNl1Q2N4y9pkV0oD/T4rrn3RXP6iL1k4CNRS54JPCd+aI5Om+axVPU8Id -ZeUXQwXISaFrcC/bFXAHGX5hBMVu34lhCxvR4smweZkVmW++bIv26az8TSb5nVn4 -TstLJIaOoOqot0sis04+0oX/GXfTPfkWyzfTVFN7cb9H+gz0FZJKtXQZv6qdntji -9FdR+pkCAwEAAaBAMD4GCSqGSIb3DQEJDjExMC8wLQYDVR0RBCYwJIIOY2xvdWRm -bGFyZS5jb22CEnd3dy5jbG91ZGZsYXJlLmNvbTALBgkqhkiG9w0BAQsDggEBABfM -9XTMqMqmfAAymWC4/W+vbh301KBoydcTnDQ/7B+ftHRE0O3FUsdL3wobj3qBieJo -MiQwiL7+GksszHvN9+YOUi70wpFuKghLhadb7p5GzL0+JgK2eQnLYb37/lQSiWwn -hht1YMOzErR/KHlxNUafk71bDEeytUcOvvtujf86nZiEnBpvp47zDjMkDersczM0 -wj7S50IY8/vRsc2Q8vy+Q7D2FPEwjs4wCGVSqzwX2NPn3fZb/2pWRCie9kxHUfUP -L5xO4WoFGuirT6E2GnUWDdH661Pj5yEKvmr+qPl+eVoLjrtx0g5rAmA7rGlGrkqp -r4idH/BbJUaDlRHM/Hk= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.key b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.key deleted file mode 100644 index 36ecabb..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048-inter.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA4sUvKQ53aPfUBCeRpOhi2y0a/DnAtvhieXOKlDppQuUPQfQY -cz0jCF1KZxNZRY9v9TzeD+ZrW4Pc+nYh1Z3rF+PI4kXleGCTJ9FjrnBLq89lGbYw -1IVd6b7QAod2HEiFv9A8wBKoL/JqI+Ke+06kGII2XVDY3jL2mRXSgP9PiuufdFc/ -qIvWTgI1FLngk8J35ojk6b5rFU9Twh1l5RdDBchJoWtwL9sVcAcZfmEExW7fiWEL -G9HiybB5mRWZb75si/bprPxNJvmdWfhOy0skho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2EWZ6q/vFuWhjXKwO//3DNLODX3WbK9SBh7I7vBmpJbzA980J5Y3rONa3oLjDB -+XbHecECgYEArOEv2D3fE3Hd6rEbxXinqekxMa+V1OCDO1IPz4wwr9RDMVUMxwqF -f0es1PQ2eMJGrAMbySxPfSZG05ou/tA+zR0qPwc/+dX0BbaXCiNT3gbhvL1L2fBc -7wr+MIUe2fi54JUWrUNMDHngRhXRKt2rZZRTfqVaFmZX02Y3fMZ2dWg= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048.csr deleted file mode 100644 index 6bbca71..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa2048.csr +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIDCTCCAfMCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTWdoYxX4KN51fP -WxQAyGH++VsPbfpAoXIbCPXSmU04BvIxyjzpHQ0ChMKkT/2VNcUeFJwk2fCf+ZwU -f0raTQTplofwkckE0gEYA3WcEfJp+hbvbTb/2recsf+JE6JACYJe2Uu5wsjtrE5j -A+7aT2BEU9RWzBdSy/5281ZfW3PArqcWaf8+RUyA3WRxVWmjmhFsVB+mdNLhCpW0 -C0QNMYR1ppEZiKVnEdao8gcI5sOvSd+35t8g82aPXcNSPU6jKcx1YNUPX5wgPEmu -+anfc9RliQbYqqJYVODgBmV8IR5grw93yTsODoWKtFQ4PKVlnt9CD8AS/iSMQYm3 -OUogqgMCAwEAAaA/MD0GCSqGSIb3DQEJDjEwMC4wLAYDVR0RBCUwI4IOY2xvdWRm -bGFyZS5jb22CEXd3d2Nsb3VkZmxhcmUuY29tMAsGCSqGSIb3DQEBCwOCAQEAl809 -gk9uZkRK+MJVYDSLjgGR2xqk5qOwnhovnispA7N3Z1GshodJRQa6ngNCKuXIm2/6 -AxB9kDGK14n186Qq4odXqHSHs8FG9i0zUcBXeLv1rPAKtwKTas/SLmsOpPgWPZFa -iYiHHeu4HjOQoF987d7uGRYwc3xfstKwJsEXc12eCw2NH8TM1tJgSc/o6CzIpA91 -QnZKhx6uGM4xI2gnOaJA1YikNhyFGBuOGMZgd0k2+/IcR2pg0z4pc5oQw1bXLANx -anqlA/MDrCM9v9019bRJ73zK8LQ3k/FW61PA9nL7RZ8ku65R+uYcVEdLa8pUeqnH -cJZNboDRsItpccZuRQ== ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa3072.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa3072.csr deleted file mode 100644 index e0b4219..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa3072.csr +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIECTCCAnMCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAL0zzgBv+VTwZOPy -LtuLFweQrj5Lfrje2hnNB7Y3TD4+yCM/cA4yTILixCe/B+N7LQysJgVDbW8u6BZQ -8ZqeDKOP6KCt37WhmcbT45tLpHmH+Z/uAnCz0hVc/7AyJ3CJXo6PaDCcJjgLuUun -W47iy4h79AxyuzELmUeZZGYcO8nqClqcnAzQ6sClGZvJwSbYg2QAFGoA2lHqZ9uN -ygAxNLd+rX9cP+yFwAeKzuKtOnVPiJD5lT3wufSkAbd6M7lOoqmTYnbv0A1WfA/e -upXno9lbgB6iwF5U0V7OtxdA1bTbvgJgNLlxFF1do0sB28CWmqCFNwLfzcPzt5A4 -gLnOyLhNZOmUMXn35KOtp1Zv/yethlgZHxUYGcl6OYwMEFye3Du6dgnTwONzaLhA -7hMI8R60p2YrTLkgSKdFohAY/mKuxHyXxugOHHthlRCOn9m49edcdZ1HrkJXm9jd -P9katjCXgTwSdTQlvaMJkfH7wF3ZMjAxPcDf4RKFEpF2wABeNQIDAQABoD8wPQYJ -KoZIhvcNAQkOMTAwLjAsBgNVHREEJTAjgg5jbG91ZGZsYXJlLmNvbYIRd3d3Y2xv -dWRmbGFyZS5jb20wCwYJKoZIhvcNAQEMA4IBgQBF/RCHNAAOAaRI4VyO0tRPA5Dw -0/1/pgmBm/VejHIwDJnMFCl9njh0RSo1RgsVLhw6ovYbk3ORb4OD4UczPTq3GrFp -KP9uPR+2pR4FWJpCVfCl76YabQv6fUDdiT7ojzyRhsAmkd5rOdiMvWV3Rp+YmBuU -KH/dwkukfn+OeJIbERS5unzOBtQL+g5dU4CHWAqJQIqHr373w38OlYN+JY9QLrYy -sWU9Ye6RjdySXPJ5UzyfOEfc9Ji89RJsVeceB1+As5u5vBvtzGgIMSFUzN947RZo -DZ48JiB71VpmKXbn9LIRn25dlbVMzxRdSeZ194L3JFVAf9OxJTsc1QNFhOacoFgy -hqvtN2iKntEyPo2nacYhpz/FAdJ2JThNH+4WtpPWAqx8Lw/e1OttiDt+6M0FEuVz -svkSHnK206yo+a9Md37nUDDYxtlJEB+9F2qUZNQ7Hv+dxjmJOIgHOXxy1pLEdpVU -rGdGLVXeJNPCh9x+GK21QjdxZABmYAaF8k36Pv4= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa4096.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa4096.csr deleted file mode 100644 index 603d179..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/rsa4096.csr +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIFCTCCAvMCAQAwgYYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpDbG91ZEZsYXJl -MRwwGgYDVQQLExNTeXN0ZW1zIEVuZ2luZWVyaW5nMRYwFAYDVQQHEw1TYW4gRnJh -bmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRcwFQYDVQQDEw5jbG91ZGZsYXJl -LmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANkKL22jMn3eFCpj -T6lbeq4nC3aEqwTGrLARidAmO29WIhzs6LxRpM6xSMoPI6DvJVUGpMFEKF4xNTc5 -X9/gSFrw2eI5Q3U3aGcaToSCxH4hXejwIzX8Ftlb/LfpXhbSsFr5MS3kiTY4zZxM -n3dSy2gZljD/g0tlQf5BdHdR4WKRhWnqRiGng+BmW4rjbcO7SoN33jSXsMcguCg5 -8dmYuf5G5KVXsqwEoCQBeKGnca9orcm4i90VnGt4qZUpfAn1cADzYGpRzX79USJ6 -tol4ovgGPN08LJFqcVl+dK8VzJ03JWBhI1jePbWS4Bz5oNtkhQQXilU+G6FQxc6a -UPf6KcFyOB+qMJmEwJZD9yaNK1YbsKfSztQEsb1JEezQnVHxp91Ch3AcWoikuOiY -yCg0V5lcK15SLv1+5sj9YzF7ngMmThcIJ6B5gS3swpD5AX6FJaI1BrGwT/RXKKQP -tRX1BySLx8RcINjFb5wv3q9QIE8vrW1BOk9f4dfmxiFYnc+6bCCbIrg7APQVtKTa -ixNJFSqZz7fm9loeNPHHXfUT5RoW5yzVa8igc+yv4qeYsWHcZ4c/Y91OJp19HMjM -bYm2alt8XagBgJjO0FW8wvsKwhhlhWK0WO6sQ7Fkl7fH1GtxEpc248hAW24SZMmS -led3LblCT8IC3a9BLhqJ2q8cfPp9AgMBAAGgPzA9BgkqhkiG9w0BCQ4xMDAuMCwG -A1UdEQQlMCOCDmNsb3VkZmxhcmUuY29tghF3d3djbG91ZGZsYXJlLmNvbTALBgkq -hkiG9w0BAQ0DggIBAAgz3NuN43+F+8+WhQ9hb7DOp6Amut7XubOkEBtBVgP3R8U1 -uSsgocR1rvnZ1/bhkeGyTly0eQPhcSEdMo/GgIrcn+co0KLcDyV6Rf3Cgksx9dUZ -TzHSkxmFkxlxYfIGes6abH+2OPiacwK2gLvvmXFYIxEhv+LKzzteQi0xlinewv7R -FnSykZ4QialsFyCgOjOxa11aEdRv6T8qKwhjUOk0VedtzOkt/k95aydTNLjXl2OV -jloeTsbB00yWIqdyhG12+TgcJOa0pNP1zTjgFPodMuRUuiAcbT7Mt7sLCefKNzvZ -Ln6b4y7e6N3YLOHALTIP+LI4y8ar47WlXCNw/zeOM2sW8udjYrukN6WOV3X68oMf -Zsv6jqyGSaCDwdImR4VECUVvkabg9Sq4pz+ijTT+9cNA66omYL+/QAh0GahlROgW -kDGI8zeEUoAC8RkAbFGMJA8jEbAfbT000ZwnLX2SZ8YRQX4Jd1FTmAH99FkvvT8N -ovaGRSQQI5rWQGQYqF67So7PywEaEXeUHTBrv41Msva6CdaWHn7bh/fj4B21ETS7 -VJvrk5DLJTyruqon7EVJU1pn38ppaXF4Z6a9n3C8TqudT/gdJUYn/SBo5jx20uGJ -d9k6vDqixntvk/TRZ848k1AXiv5uUJTdnoPPhzSGjxEaeKuB0R1ZHomVdjU4 ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/san_domain.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/san_domain.csr deleted file mode 100644 index 6fbaedb..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/san_domain.csr +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIDATCCAekCAQAwQTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQH -DA1TYW4gRnJhbmNpc2NvMQ0wCwYDVQQLDARBQ01FMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAy5owAK9W3y4RBV6T0/z1/Tnwj/jeI8APpLIszT1c1QY8 -GssT0SuSF6l2KsIotWrjIHYgxjPU914moacJ90lluJ467QtrBLvcT8HMd6771olL -CYxw6AlDLUcIN7paegaBVrKoxZ2daFBeu4bfRD4AiuaOOXZd7NjAb/EX+KKehWgM -svkrxXSqgOgpo46Dm9bvNxnX6PS2PF11C7Mwz48YAbec2wyajXtQSIwVOSuHNikW -juy9DPMq6lcmgMLFQftZLMUY4qf27JBTstbpLVc9kqWeJYemmBblUVN+54oQD+YQ -GkZrfzAOe+TVGcdu8cTQL+roK9bpxxAKCG//VzEh9QIDAQABoHsweQYJKoZIhvcN -AQkOMWwwajAJBgNVHRMEAjAAMAsGA1UdDwQEAwIF4DBQBgNVHREESTBHgg5rYi5l -eGFtcGxlLmNvbYIUaGVscGRlc2suZXhhbXBsZS5vcmeCE3N5c3RlbXMuZXhhbXBs -ZS5uZXSHBMCoAQGHBMCoRQ4wDQYJKoZIhvcNAQEFBQADggEBAJ/0z/+f2sqzZIB8 -GoOHAEa0xslNW/3igoKM8iO6H3bylHNeB2sBAgfgppGVNItu2QkVnP/eYfZXLD91 -Fj44evp9L8PBIM1/pxaEUqMXNTRXgnshyq6tUc1akD7rA6CkF/v0OsyYLhxMvQBP -A9hjw1CDmfX9djSot9GCVjoWFY8Vi+SvkyopWhtJ5+k8MvMMdgptShAguu3OZkSh -39KG2jAPr5PFuE2BceJafECyvUqt+gNjp7x++oTRivx6W+E4GvZQ2yAy5MSuraUb -ZplmAEZckDkXZOc2bHoDwQubFTwyGW0dgqknTp9abBBdxtt04sVQCpWM3NfBYOlV -SSEZghc= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/test.csr b/vendor/github.com/cloudflare/cfssl/signer/local/testdata/test.csr deleted file mode 100644 index bb4c3a9..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/local/testdata/test.csr +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIC0TCCAbsCAQAwVDELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkNsb3VkRmxhcmUx -DDAKBgNVBAsTA1dXVzEPMA0GA1UEBxMGSXRoYWNhMREwDwYDVQQIEwhOZXcgWW9y -azCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANRGyaKqITV+IdyBWQ5y -2cDjWdDCq2sfv1YVQ720GnsdWgC+v3HcAV1+LxU/7LYbGeHIDsx7XcnbY1fWWvCt -knf/1eW0dGgyDPinrZuZKrldO/48I1mdCcb2MujolwjEj0yzczTeqi3jWMo0NdvX -mVprMkmz9FGwRgMbmXEyfmaG7/qgn/nG/zP0dikrYuR+WNbBPIIDuDIVHPHIln+7 -H5SNLmgVr+q5V9Pqt1DdOBf3Zwo0KyLQa4LDxzQzQ62LNWYG+AtPSb6VVt/ZWtsx -vd2WrE875UGM1wgCfU6g0XaQs+8xblOteMRaqpVKqw/frpeoG9W8bdJhtiL2DqqN -wKsCAwEAAaA6MDgGCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5j -b22CD3d3dy5leGFtcGxlLmNvbTALBgkqhkiG9w0BAQsDggEBAB7fimhMshyrk/sk -BQIKtsOHCFFAEyj0A/mfJO7Cx2Ys16s+u+EOv6eyJssePBb+XyM9a253bt6nKL4y -wETMnp98f2svsaVLZC1BzmVRxfraJzgP5J8m2L0eCYTMd920KpEx7iyCqyeoHRCs -1P8H7z0Azrx2D/dfNw1L+5VUT1Hm8xFFzke7WdwlTxYhIhe2Hds0xqDLoZK765xx -tLOKmrcVE/5ZcSkL/APFXX1U87vAeECMl/KTtGYw8lLjS6mXfN3sPNk8aw2VcV0U -n0ZaV96ppWUQHsBWvkomj7829QLn9yalrqdz0F49ni562d4rIuogCSdUGawpEJfN -8xnNVaU= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/signer/signer_test.go b/vendor/github.com/cloudflare/cfssl/signer/signer_test.go deleted file mode 100644 index bab6ef7..0000000 --- a/vendor/github.com/cloudflare/cfssl/signer/signer_test.go +++ /dev/null @@ -1,150 +0,0 @@ -package signer - -import ( - "bytes" - "crypto/x509" - "encoding/asn1" - "encoding/hex" - "fmt" - "reflect" - "testing" - - "github.com/cloudflare/cfssl/config" - "github.com/cloudflare/cfssl/csr" -) - -func TestAppendIf(t *testing.T) { - s := "" - a := make([]string, 0, 5) - appendIf(s, &a) - if len(a) != 0 { - t.Fatal("appendIf should not append to a with an empty s") - } - s = "test" - appendIf(s, &a) - if len(a[0]) != 4 { - t.Fatal("appendIf should append s to a") - } -} - -func TestSplitHosts(t *testing.T) { - list := SplitHosts("") - if list != nil { - t.Fatal("SplitHost should return nil with empty input") - } - - list = SplitHosts("single.domain") - if len(list) != 1 { - t.Fatal("SplitHost fails to split single domain") - } - - list = SplitHosts("comma,separated,values") - if len(list) != 3 { - t.Fatal("SplitHost fails to split multiple domains") - } - if list[0] != "comma" || list[1] != "separated" || list[2] != "values" { - t.Fatal("SplitHost fails to split multiple domains") - } -} - -func TestAddPolicies(t *testing.T) { - var cert x509.Certificate - addPolicies(&cert, []config.CertificatePolicy{ - { - ID: config.OID([]int{1, 2, 3, 4}), - }, - }) - - if len(cert.ExtraExtensions) != 1 { - t.Fatal("No extension added") - } - ext := cert.ExtraExtensions[0] - if !reflect.DeepEqual(ext.Id, asn1.ObjectIdentifier{2, 5, 29, 32}) { - t.Fatal(fmt.Sprintf("Wrong OID for policy qualifier %v", ext.Id)) - } - if ext.Critical { - t.Fatal("Policy qualifier marked critical") - } - expectedBytes, _ := hex.DecodeString("3007300506032a0304") - if !bytes.Equal(ext.Value, expectedBytes) { - t.Fatal(fmt.Sprintf("Value didn't match expected bytes: got %s, expected %s", - hex.EncodeToString(ext.Value), hex.EncodeToString(expectedBytes))) - } -} - -func TestAddPoliciesWithQualifiers(t *testing.T) { - var cert x509.Certificate - addPolicies(&cert, []config.CertificatePolicy{ - { - ID: config.OID([]int{1, 2, 3, 4}), - Qualifiers: []config.CertificatePolicyQualifier{ - { - Type: "id-qt-cps", - Value: "http://example.com/cps", - }, - { - Type: "id-qt-unotice", - Value: "Do What Thou Wilt", - }, - }, - }, - }) - - if len(cert.ExtraExtensions) != 1 { - t.Fatal("No extension added") - } - ext := cert.ExtraExtensions[0] - if !reflect.DeepEqual(ext.Id, asn1.ObjectIdentifier{2, 5, 29, 32}) { - t.Fatal(fmt.Sprintf("Wrong OID for policy qualifier %v", ext.Id)) - } - if ext.Critical { - t.Fatal("Policy qualifier marked critical") - } - expectedBytes, _ := hex.DecodeString("304e304c06032a03043045302206082b060105050702011616687474703a2f2f6578616d706c652e636f6d2f637073301f06082b0601050507020230130c11446f20576861742054686f752057696c74") - if !bytes.Equal(ext.Value, expectedBytes) { - t.Fatal(fmt.Sprintf("Value didn't match expected bytes: %s vs %s", - hex.EncodeToString(ext.Value), hex.EncodeToString(expectedBytes))) - } -} - -func TestName(t *testing.T) { - sub := &Subject{ - CN: "foobar", - Names: []csr.Name{ - { - C: "US", - ST: "CA", - L: "Cool Locality", - O: "Cool Org", - OU: "Really Cool Sub Org", - }, - { - L: "Another Cool Locality", - }, - }, - SerialNumber: "deadbeef", - } - name := sub.Name() - if name.CommonName != sub.CN { - t.Errorf("CommonName: want %#v, got %#v", sub.CN, name.CommonName) - } - if name.SerialNumber != sub.SerialNumber { - t.Errorf("SerialNumber: want %#v, got %#v", sub.SerialNumber, name.SerialNumber) - } - if !reflect.DeepEqual([]string{"US"}, name.Country) { - t.Errorf("Country: want %s, got %s", []string{"US"}, name.Country) - } - if !reflect.DeepEqual([]string{"CA"}, name.Province) { - t.Errorf("Province: want %s, got %s", []string{"CA"}, name.Province) - } - if !reflect.DeepEqual([]string{"Cool Org"}, name.Organization) { - t.Errorf("Organization: want %s, got %s", []string{"Cool Org"}, name.Organization) - } - if !reflect.DeepEqual([]string{"Really Cool Sub Org"}, name.OrganizationalUnit) { - t.Errorf("Organizational Unit: want %s, got %s", []string{"Really Cool Sub Org"}, name.OrganizationalUnit) - } - if !reflect.DeepEqual([]string{"Cool Locality", "Another Cool Locality"}, name.Locality) { - t.Errorf("Locality: want %s, got %s", []string{"CA"}, name.Locality) - } - -} diff --git a/vendor/github.com/cloudflare/cfssl/testdata/csr.json b/vendor/github.com/cloudflare/cfssl/testdata/csr.json deleted file mode 100644 index 8fb67cf..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/csr.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "hosts": [ - "cloudflare.com", - "www.cloudflare.com" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "US", - "L": "San Francisco", - "O": "CloudFlare", - "OU": "Systems Engineering", - "ST": "California" - } - ] -} diff --git a/vendor/github.com/cloudflare/cfssl/testdata/garbage.crt b/vendor/github.com/cloudflare/cfssl/testdata/garbage.crt deleted file mode 100644 index b8bb487..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/garbage.crt +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICATCCAWoCCQDidF+uNJR6czANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB -cyBQdHkgTHRkMB4XDTEyMDUwMTIyNTUxN1oXDTEzMDUwMTIyNTUxN1owRTELMAkG -A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 -nodhz31kLEJoeLSkRmrv8l7exkGtO0REtIbirj9BBy64ZXVBE7khKGO2cnM8U7yj -w7Ntfh+IvCjZVA3d2XqHS3Pjrt4HmU/cGCONE8+NEXoqdzLUDPOix1qDDRBvXs81 -IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtpjl -KAV2qh6CYHZbdqixhDerjvJcD4Nsd7kExEZfHuECAwEAATANBgkqhkiG9w0BAQUF -AAOBgQCyOqs7+qpMrYCgL6OamDeCVojLoEp036PsnaYWf2NPmsVXdpYW40Foyyjp -VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 -iv5otkxO5rxtGPv7o2J1eMBpCuSkydvoz3Ey/QwGqbBwEXQ4xYCgra336gqW2KQt -+LnDCkE8f5oBhCIisExc2i8PDvsRsY70g/2gs983ImJjVR8sDw== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/garbage.key b/vendor/github.com/cloudflare/cfssl/testdata/garbage.key deleted file mode 100644 index 252661c..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/garbage.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -BOzx0qUouFQ2xZ0NBrNVbyt1bzPLx0yKHkwF35ybw+Qc1yRpby/3ZB6+j/MCQFLl -Dil8FywzZEonRNJst53+9cxFye70ely5br/tWxEp4/MsM1kCQQDqV4Lwn8BXOeKg -dUETuSEoY7ZyczxTvKPDs21+H4i8KNlUDd3ZeodLc+Ou3geZT9wYI40Tz40Reip3 -MtQM86LHWoMNEG9ezzUoBXaqHoJgdlt2qLGEN6uO8lwPg2x3uQTERl8e4QIDAQAB -AoGAVxnsPojZ8X4g8LPk3d9dlXGhb/4tSmk9102jcHH/Y5ssy95Pe6ZJGr1uwbN+ -7m1l05PikpHeoxEryoW51cyfjDVkXUT0zPp2JC38DUA/0A8qWav/aENM64wg1I0P -xOwNmcL+0XPedvSPBSPUoGJCzu12rH6Z+UHXipXsqRNSyQ+KGlur14y0kCh5uiVA -jmWYVEEjAkEAx3keAo1nFsVW35EPt5LIbh6L6ty7GrvGRvOVeSd6YLtixMety24k -hpt1cEv2xlFnbjbBbMkr9eUiUNpttLT6KwJBANGKaLoSjqEwUFYjX1OV/wdtcGcn -vtcItOL9uBDJVGLSGYHKKBO/D/MYPlqWOHRVN8KjnXRyF4QHjh5y1OeKalAY3Ict -MIICXAIBAAKBgQC2mOWeh2HPfWQsQmh4tKRGau/yXt7GQa07RES0huKuP0EHLrhl -Mk1nfWF/jDdVz2neHGkCQHHBR4Xt1/euDku+14z5aLpphTEQVuRD2vQoeKi/W/CY -OgNmKj1DzucnCS6yRCrF8Q0Pn8l054a3Wdbl1gqI/gA= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/gd_bundle.crt b/vendor/github.com/cloudflare/cfssl/testdata/gd_bundle.crt deleted file mode 100644 index c0de627..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/gd_bundle.crt +++ /dev/null @@ -1,76 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVMx -ITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g -RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMTYw -MTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UECBMH -QXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWRkeS5j -b20sIEluYy4xMzAxBgNVBAsTKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5j -b20vcmVwb3NpdG9yeTEwMC4GA1UEAxMnR28gRGFkZHkgU2VjdXJlIENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5MREwDwYDVQQFEwgwNzk2OTI4NzCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAMQt1RWMnCZM7DI161+4WQFapmGBWTtwY6vj3D3H -KrjJM9N55DrtPDAjhI6zMBS2sofDPZV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5MDYyNjAwMTk1NFoXDTE5MDYy -NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y -azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw -Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl -cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY -dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9 -WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS -v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v -UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu -IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC -W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/good_config.json b/vendor/github.com/cloudflare/cfssl/testdata/good_config.json deleted file mode 100644 index 0b5342d..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/good_config.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "signing": { - "default": { - "expiry": "168h" - }, - "profiles": { - "www": { - "usages": [ - "signing", - "key encipherment", - "server auth" - ], - "name_whitelist": "^.*\\.cloudflare.com$" - } - } - } -} diff --git a/vendor/github.com/cloudflare/cfssl/testdata/roots/httplib2_cacerts.txt b/vendor/github.com/cloudflare/cfssl/testdata/roots/httplib2_cacerts.txt deleted file mode 100644 index 79a4928..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/roots/httplib2_cacerts.txt +++ /dev/null @@ -1,738 +0,0 @@ -# Certifcate Authority certificates for validating SSL connections. -# -# This file contains PEM format certificates generated from -# http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Netscape security libraries. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1994-2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -Verisign/RSA Secure Server CA -============================= - ------BEGIN CERTIFICATE----- -MIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYD -VQQLEyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0 -MTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxIDAeBgNV -BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2Vy -dmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUAA4GJ -ADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII -0haGN1XpsSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphI -uR2nKRoTLkoRWZweFdVJVCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZI -hvcNAQECBQADfgBl3X7hsuyw4jrg7HFGmhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3 -YQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2qUtN8iD3zV9/ZHuO3ABc -1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA== ------END CERTIFICATE----- - -Thawte Personal Basic CA -======================== - ------BEGIN CERTIFICATE----- -MIIDITCCAoqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCByzELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD -VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT -ZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFBlcnNvbmFsIEJhc2lj -IENBMSgwJgYJKoZIhvcNAQkBFhlwZXJzb25hbC1iYXNpY0B0aGF3dGUuY29tMB4X -DTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgcsxCzAJBgNVBAYTAlpBMRUw -EwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UE -ChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy -dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQZXJzb25hbCBCYXNpYyBD -QTEoMCYGCSqGSIb3DQEJARYZcGVyc29uYWwtYmFzaWNAdGhhd3RlLmNvbTCBnzAN -BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvLyTU23AUE+CFeZIlDWmWr5vQvoPR+53 -dXLdjUmbllegeNTKP1GzaQuRdhciB5dqxFGTS+CN7zeVoQxN2jSQHReJl+A1OFdK -wPQIcOk8RHtQfmGakOMj04gRRif1CwcOu93RfyAKiLlWCy4cgNrx454p7xS9CkT7 -G1sY0b8jkyECAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQF -AAOBgQAt4plrsD16iddZopQBHyvdEktTwq1/qqcAXJFAVyVKOKqEcLnZgA+le1z7 -c8a914phXAPjLSeoF+CEhULcXpvGt7Jtu3Sv5D/Lp7ew4F2+eIMllNLbgQ95B21P -9DkVWlIBe94y1k049hJcBlDfBVu9FEuh3ym6O0GN92NWod8isQ== ------END CERTIFICATE----- - -Thawte Personal Premium CA -========================== - ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBzzELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD -VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT -ZXJ2aWNlcyBEaXZpc2lvbjEjMCEGA1UEAxMaVGhhd3RlIFBlcnNvbmFsIFByZW1p -dW0gQ0ExKjAoBgkqhkiG9w0BCQEWG3BlcnNvbmFsLXByZW1pdW1AdGhhd3RlLmNv -bTAeFw05NjAxMDEwMDAwMDBaFw0yMDEyMzEyMzU5NTlaMIHPMQswCQYDVQQGEwJa -QTEVMBMGA1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xGjAY -BgNVBAoTEVRoYXd0ZSBDb25zdWx0aW5nMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9u -IFNlcnZpY2VzIERpdmlzaW9uMSMwIQYDVQQDExpUaGF3dGUgUGVyc29uYWwgUHJl -bWl1bSBDQTEqMCgGCSqGSIb3DQEJARYbcGVyc29uYWwtcHJlbWl1bUB0aGF3dGUu -Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJZtn4B0TPuYwu8KHvE0Vs -Bd/eJxZRNkERbGw77f4QfRKe5ZtCmv5gMcNmt3M6SK5O0DI3lIi1DbbZ8/JE2dWI -Et12TfIa/G8jHnrx2JhFTgcQ7xZC0EN1bUre4qrJMf8fAHB8Zs8QJQi6+u4A6UYD -ZicRFTuqW/KY3TZCstqIdQIDAQABoxMwETAPBgNVHRMBAf8EBTADAQH/MA0GCSqG -SIb3DQEBBAUAA4GBAGk2ifc0KjNyL2071CKyuG+axTZmDhs8obF1Wub9NdP4qPIH -b4Vnjt4rueIXsDqg8A6iAJrf8xQVbrvIhVqYgPn/vnQdPfP+MCXRNzRn+qVxeTBh -KXLA4CxM+1bkOqhv5TJZUtt1KFBZDPgLGeSs2a+WjS9Q2wfD6h+rM+D1KzGJ ------END CERTIFICATE----- - -Thawte Personal Freemail CA -=========================== - ------BEGIN CERTIFICATE----- -MIIDLTCCApagAwIBAgIBADANBgkqhkiG9w0BAQQFADCB0TELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD -VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT -ZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMbVGhhd3RlIFBlcnNvbmFsIEZyZWVt -YWlsIENBMSswKQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVlbWFpbEB0aGF3dGUu -Y29tMB4XDTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNVBAYT -AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEa -MBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRp -b24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBG -cmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxAdGhh -d3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1GnX1LCUZFtx6UfY -DFG26nKRsIRefS0Nj3sS34UldSh0OkIsYyeflXtL734Zhx2G6qPduc6WZBrCFG5E -rHzmj+hND3EfQDimAKOHePb5lIZererAXnbr2RSjXW56fAylS1V/Bhkpf56aJtVq -uzgkCGqYx7Hao5iR/Xnb5VrEHLkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zAN -BgkqhkiG9w0BAQQFAAOBgQDH7JJ+Tvj1lqVnYiqk8E0RYNBvjWBYYawmu1I1XAjP -MPuoSpaKH2JCI4wXD/S6ZJwXrEcp352YXtJsYHFcoqzceePnbgBHH7UNKOgCneSa -/RP0ptl8sfjcXyMmCZGAc9AUG95DqYMl8uacLxXK/qarigd1iwzdUYRr5PjRznei -gQ== ------END CERTIFICATE----- - -Thawte Server CA -================ - ------BEGIN CERTIFICATE----- -MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm -MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx -MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 -dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl -cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 -DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD -gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 -yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX -L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj -EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG -7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e -QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ -qdq5snUb9kLy78fyGPmJvKP/iiMucEc= ------END CERTIFICATE----- - -Thawte Premium Server CA -======================== - ------BEGIN CERTIFICATE----- -MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD -VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy -dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t -MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB -MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG -A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp -b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl -cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv -bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE -VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ -ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR -uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG -9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI -hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM -pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== ------END CERTIFICATE----- - -Equifax Secure CA -================= - ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIB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KHee9570+sB3c4 ------END CERTIFICATE----- - -Verisign Class 1 Public Primary Certification Authority -======================================================= - ------BEGIN CERTIFICATE----- -MIICPTCCAaYCEQDNun9W8N/kvFT+IqyzcqpVMA0GCSqGSIb3DQEBAgUAMF8xCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh -c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05 -NjAxMjkwMDAwMDBaFw0yODA4MDEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD -VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMSBQdWJsaWMgUHJp -bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB -jQAwgYkCgYEA5Rm/baNWYS2ZSHH2Z965jeu3noaACpEO+jglr0aIguVzqKCbJF0N -H8xlbgyw0FaEGIeaBpsQoXPftFg5a27B9hXVqKg/qhIGjTGsf7A01480Z4gJzRQR -4k5FVmkfeAKA2txHkSm7NsljXMXg1y2He6G3MrB7MLoqLzGq7qNn2tsCAwEAATAN -BgkqhkiG9w0BAQIFAAOBgQBMP7iLxmjf7kMzDl3ppssHhE16M/+SG/Q2rdiVIjZo -EWx8QszznC7EBz8UsA9P/5CSdvnivErpj82ggAr3xSnxgiJduLHdgSOjeyUVRjB5 -FvjqBUuUfx3CHMjjt/QQQDwTw18fU+hI5Ia0e6E1sHslurjTjqs/OJ0ANACY89Fx -lA== ------END CERTIFICATE----- - -Verisign Class 2 Public Primary Certification Authority -======================================================= - ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEC0b/EoXjaOR6+f/9YtFvgswDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAyIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAyIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQC2WoujDWojg4BrzzmH9CETMwZMJaLtVRKXxaeAufqDwSCg+i8VDXyh -YGt+eSz6Bg86rvYbb7HS/y8oUl+DfUvEerf4Zh+AVPy3wo5ZShRXRtGak75BkQO7 -FYCTXOvnzAhsPz6zSvz/S2wj1VCCJkQZjiPDceoZJEcEnnW/yKYAHwIDAQABMA0G -CSqGSIb3DQEBAgUAA4GBAIobK/o5wXTXXtgZZKJYSi034DNHD6zt96rbHuSLBlxg -J8pFUs4W7z8GZOeUaHxgMxURaa+dYo2jA1Rrpr7l7gUYYAS/QoD90KioHgE796Nc -r6Pc5iaAIzy4RHT3Cq5Ji2F4zCS/iIqnDupzGUH9TQPwiNHleI2lKk/2lw0Xd8rY ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority -======================================================= - ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE -BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is -I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G -CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do -lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc -AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k ------END CERTIFICATE----- - -Verisign Class 1 Public Primary Certification Authority - G2 -============================================================ - ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgdk4xWArzZbxpvUjZudVYK -VdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIqWpDBucSm -Fc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0J -h9ZrbWB85a7FkCMMXErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2ul -uIncrKTdcu1OofdPvAbT6shkdHvClUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68 -DzFc6PLZ ------END CERTIFICATE----- - -Verisign Class 2 Public Primary Certification Authority - G2 -============================================================ - ------BEGIN CERTIFICATE----- -MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns -YXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH -MjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y -aXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe -Fw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX -MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj -IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx -KGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM -HiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw -DqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji -nb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX -rXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn -jBJ7xUS0rg== ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G2 -============================================================ - ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4 -pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0 -13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk -U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i -F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY -oJ2daZH9 ------END CERTIFICATE----- - -Verisign Class 4 Public Primary Certification Authority - G2 -============================================================ - ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEDKIjprS9esTR/h/xCA3JfgwDQYJKoZIhvcNAQEFBQAwgcExCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh -c3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy -MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp -emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X -DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw -FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMg -UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo -YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 -MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQC68OTP+cSuhVS5B1f5j8V/aBH4xBewRNzjMHPVKmIquNDM -HO0oW369atyzkSTKQWI8/AIBvxwWMZQFl3Zuoq29YRdsTjCG8FE3KlDHqGKB3FtK -qsGgtG7rL+VXxbErQHDbWk2hjh+9Ax/YA9SPTJlxvOKCzFjomDqG04Y48wApHwID -AQABMA0GCSqGSIb3DQEBBQUAA4GBAIWMEsGnuVAVess+rLhDityq3RS6iYF+ATwj -cSGIL4LcY/oCRaxFWdcqWERbt5+BO5JoPeI3JPV7bI92NZYJqFmduc4jq3TWg/0y -cyfYaT5DdPauxYma51N86Xv2S/PBZYPejYqcPIiNOVn8qj8ijaHBZlCBckztImRP -T8qAkbYp ------END CERTIFICATE----- - -Verisign Class 1 Public Primary Certification Authority - G3 -============================================================ - ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMD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WcSzy27YfpO8/7g== ------END CERTIFICATE----- - -Verisign Class 2 Public Primary Certification Authority - G3 -============================================================ - ------BEGIN CERTIFICATE----- -MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJ -BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVy -aVNpZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24s -IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNp -Z24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJBgNV -BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp -Z24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIElu -Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24g -Q2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt -IEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwoNwtUs22e5LeWU -J92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6tW8UvxDO -JxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUY -wZF7C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9o -koqQHgiBVrKtaaNS0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjN -qWm6o+sdDZykIKbBoMXRRkwXbdKsZj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/E -Srg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0JhU8wI1NQ0kdvekhktdmnLfe -xbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf0xwLRtxyID+u -7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU -sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RI -sH/7NiXaldDxJBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTP -cjnhsUPgKM+351psE2tJs//jGHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G3 -============================================================ - ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b -N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t -KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu -kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm -CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ -Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu -imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te -2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe -DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p -F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt -TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - -Verisign Class 4 Public Primary Certification Authority - G3 -============================================================ - ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWdu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sjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c -2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/ -bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- - -Equifax Secure Global eBusiness CA -================================== - ------BEGIN CERTIFICATE----- -MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT -ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw -MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj -dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l -c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC -UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc -58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/ -o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH -MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr -aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA -A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA -Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv -8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV ------END CERTIFICATE----- - -Equifax Secure eBusiness CA 1 -============================= - ------BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc -MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT -ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw -MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j -LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ -KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo -RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu -WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw -Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD -AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK -eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM -zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+ -WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN -/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ== ------END CERTIFICATE-----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zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1 -E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUmV+GRMOrN ------END CERTIFICATE----- - -Thawte Time Stamping CA -======================= - ------BEGIN CERTIFICATE----- -MIICoTCCAgqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBizELMAkGA1UEBhMCWkEx -FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzAN -BgNVBAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAd -BgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcgQ0EwHhcNOTcwMTAxMDAwMDAwWhcN -MjAxMjMxMjM1OTU5WjCBizELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4g -Q2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsG -A1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1l -c3RhbXBpbmcgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYrWHhhRYZT -6jR7UZztsOYuGA7+4F+oJ9O0yeB8WU4WDnNUYMF/9p8u6TqFJBU820cEY8OexJQa -Wt9MevPZQx08EHp5JduQ/vBR5zDWQQD9nyjfeb6Uu522FOMjhdepQeBMpHmwKxqL -8vg7ij5FrHGSALSQQZj7X+36ty6K+Ig3AgMBAAGjEzARMA8GA1UdEwEB/wQFMAMB -Af8wDQYJKoZIhvcNAQEEBQADgYEAZ9viwuaHPUCDhjc1fR/OmsMMZiCouqoEiYbC -9RAIDb/LogWK0E02PvTX72nGXuSwlG9KuefeW4i2e9vjJ+V2w/A1wcu1J5szedyQ -pgCed/r8zSeUQhac0xxo7L9c3eWpexAKMnRUEzGLhQOEkbdYATAUOK8oyvyxUBkZ -CayJSdM= ------END CERTIF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/BAQDAgEGMB0GA1UdDgQWBBR7W0XP -r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU -DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz -YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX -xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 -/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ -LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 -jVaMaA== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G5 -============================================================ - ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUU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hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- - -Entrust.net Secure Server Certification Authority -================================================= - ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 -MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE -ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j -b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF -bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg -U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/ -I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3 -wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC -AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb -oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5 -BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p -dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk -MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp -b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu -dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0 -MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi -E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa -MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI -hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN -95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd -2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- - -Go Daddy Certification Authority Root Certificate Bundle -======================================================== - ------BEGIN CERTIFICATE----- -MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVMx -ITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g -RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMTYw -MTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UECBMH -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Pd ------END CERTIFICATE----- - -GeoTrust Global CA -================== - ------BEGIN CERTIFICATE----- -MIIDfTCCAuagAwIBAgIDErvmMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT -MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0 -aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDIwNTIxMDQwMDAwWhcNMTgwODIxMDQwMDAw -WjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UE -AxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9m -OSm9BXiLnTjoBbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIu -T8rxh0PBFpVXLVDviS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6c -JmTM386DGXHKTubU1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmR -Cw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5asz -PeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo4HwMIHtMB8GA1UdIwQYMBaAFEjm -aPkr0rKV10fYIyAQTzOYkJ/UMB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrM -TjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjA6BgNVHR8EMzAxMC+g -LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDBO -BgNVHSAERzBFMEMGBFUdIAAwOzA5BggrBgEFBQcCARYtaHR0cHM6Ly93d3cuZ2Vv -dHJ1c3QuY29tL3Jlc291cmNlcy9yZXBvc2l0b3J5MA0GCSqGSIb3DQEBBQUAA4GB -AHbhEm5OSxYShjAGsoEIz/AIx8dxfmbuwu3UOx//8PDITtZDOLC5MH0Y0FWDomrL -NhGc6Ehmo21/uBPUR/6LWlxz/K7ZGzIZOKuXNBSqltLroxwUCEm2u+WR74M26x1W -b8ravHNjkOR/ez4iyz0H7V84dJzjA1BOoa+Y7mHyhD8S ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/server.crt b/vendor/github.com/cloudflare/cfssl/testdata/server.crt deleted file mode 100644 index 9e4deb0..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/server.crt +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICATCCAWoCCQDidF+uNJR6czANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB -VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 -cyBQdHkgTHRkMB4XDTEyMDUwMTIyNTUxN1oXDTEzMDUwMTIyNTUxN1owRTELMAkG -A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 -IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtpjl -nodhz31kLEJoeLSkRmrv8l7exkGtO0REtIbirj9BBy64ZXVBE7khKGO2cnM8U7yj -w7Ntfh+IvCjZVA3d2XqHS3Pjrt4HmU/cGCONE8+NEXoqdzLUDPOix1qDDRBvXs81 -KAV2qh6CYHZbdqixhDerjvJcD4Nsd7kExEZfHuECAwEAATANBgkqhkiG9w0BAQUF -AAOBgQCyOqs7+qpMrYCgL6OamDeCVojLoEp036PsnaYWf2NPmsVXdpYW40Foyyjp -iv5otkxO5rxtGPv7o2J1eMBpCuSkydvoz3Ey/QwGqbBwEXQ4xYCgra336gqW2KQt -+LnDCkE8f5oBhCIisExc2i8PDvsRsY70g/2gs983ImJjVR8sDw== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/server.csr b/vendor/github.com/cloudflare/cfssl/testdata/server.csr deleted file mode 100644 index e6a2f64..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/server.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBhDCB7gIBADBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEh -MB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQC2mOWeh2HPfWQsQmh4tKRGau/yXt7GQa07RES0huKuP0EH -LrhldUETuSEoY7ZyczxTvKPDs21+H4i8KNlUDd3ZeodLc+Ou3geZT9wYI40Tz40R -eip3MtQM86LHWoMNEG9ezzUoBXaqHoJgdlt2qLGEN6uO8lwPg2x3uQTERl8e4QID -AQABoAAwDQYJKoZIhvcNAQEFBQADgYEALOuXHteRZ7f+vH5mv2Odz8KHgFm+YfdD -YSRDiFGnMXZ4/Z5440Jl+lsytH9XRdU+CAvMwXISCLx6NI8JfNpSMvltDNRmBGfM -HjTdVKPDb9xns7by8sgwuSNnOONuefbZNXPGbjDfKzEa2UdHJT+YaLOVzCDPlPBr -BUo2gGkLUAs= ------END CERTIFICATE REQUEST----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/server.key b/vendor/github.com/cloudflare/cfssl/testdata/server.key deleted file mode 100644 index ab10162..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/server.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQC2mOWeh2HPfWQsQmh4tKRGau/yXt7GQa07RES0huKuP0EHLrhl -dUETuSEoY7ZyczxTvKPDs21+H4i8KNlUDd3ZeodLc+Ou3geZT9wYI40Tz40Reip3 -MtQM86LHWoMNEG9ezzUoBXaqHoJgdlt2qLGEN6uO8lwPg2x3uQTERl8e4QIDAQAB -AoGAVxnsPojZ8X4g8LPk3d9dlXGhb/4tSmk9102jcHH/Y5ssy95Pe6ZJGr1uwbN+ -7m1l05PikpHeoxEryoW51cyfjDVkXUT0zPp2JC38DUA/0A8qWav/aENM64wg1I0P -Dil8FywzZEonRNJst53+9cxFye70ely5br/tWxEp4/MsM1kCQQDqV4Lwn8BXOeKg -xOwNmcL+0XPedvSPBSPUoGJCzu12rH6Z+UHXipXsqRNSyQ+KGlur14y0kCh5uiVA -jmWYVEEjAkEAx3keAo1nFsVW35EPt5LIbh6L6ty7GrvGRvOVeSd6YLtixMety24k -hpt1cEv2xlFnbjbBbMkr9eUiUNpttLT6KwJBANGKaLoSjqEwUFYjX1OV/wdtcGcn -BOzx0qUouFQ2xZ0NBrNVbyt1bzPLx0yKHkwF35ybw+Qc1yRpby/3ZB6+j/MCQFLl -vtcItOL9uBDJVGLSGYHKKBO/D/MYPlqWOHRVN8KjnXRyF4QHjh5y1OeKalAY3Ict -Mk1nfWF/jDdVz2neHGkCQHHBR4Xt1/euDku+14z5aLpphTEQVuRD2vQoeKi/W/CY -OgNmKj1DzucnCS6yRCrF8Q0Pn8l054a3Wdbl1gqI/gA= ------END RSA PRIVATE KEY----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/ssl-verifier.sh b/vendor/github.com/cloudflare/cfssl/testdata/ssl-verifier.sh deleted file mode 100644 index cde2904..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/ssl-verifier.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -KEY=$1 -CRT=$2 -IMM=$3 - -if [ "`cat $KEY | grep ENCRYPTED`" ]; then - echo >&2 "Key is password-protected" - exit 1 -fi - -KEYMOD=`openssl rsa -noout -modulus -in $KEY` -CRTMOD=`openssl x509 -noout -modulus -in $CRT` - -if [ "$KEYMOD" != "$CRTMOD" ]; then - echo >&2 "Key doesn't match the certificate" - exit 1 -fi - -if [ -n "$IMM" ]; then - cat $CRT $IMM > bundle.crt - - if [ "`openssl verify bundle.crt`" == "$CRT: OK" ]; then - echo "Done (bundle ok)" - exit 0 - fi -fi - -while true; do - - if [ "`openssl verify $CRT`" == "$CRT: OK" ]; then - echo "Done" - exit 0 - fi - - NEXT=`openssl x509 -noout -issuer_hash -in $CRT` - - if [ ! -f $NEXT ]; then - echo >&2 "Could not generate trusted bundle" - exit 1 - fi - - cat $CRT $NEXT > tmp.crt - mv tmp.crt bundle.crt - CRT="bundle.crt" - -done diff --git a/vendor/github.com/cloudflare/cfssl/testdata/temp.crt b/vendor/github.com/cloudflare/cfssl/testdata/temp.crt deleted file mode 100644 index 22b4384..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/temp.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDADCCAeqgAwIBAgIICYNCnX0enRAwCwYJKoZIhvcNAQELMIGMMQswCQYDVQQG -EwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNj -bzETMBEGA1UEChMKQ0ZTU0wgVEVTVDEbMBkGA1UEAxMSQ0ZTU0wgVEVTVCBSb290 -IENBMR4wHAYJKoZIhvcNAQkBFg90ZXN0QHRlc3QubG9jYWwwHhcNMTQwNDI5MjIy -MjQyWhcNMTkwNDI5MjIyNzQyWjAAMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB -gQC2mOWeh2HPfWQsQmh4tKRGau/yXt7GQa07RES0huKuP0EHLrhldUETuSEoY7Zy -czxTvKPDs21+H4i8KNlUDd3ZeodLc+Ou3geZT9wYI40Tz40Reip3MtQM86LHWoMN -EG9ezzUoBXaqHoJgdlt2qLGEN6uO8lwPg2x3uQTERl8e4QIDAQABo3kwdzAOBgNV -HQ8BAf8EBAMCAKAwDwYDVR0TAQH/BAUwAwIBADAdBgNVHQ4EFgQUv8IODn80eHdL -LQRdN5bJmn8wjNcwHwYDVR0jBBgwFoAUt9L3hLqoOdX7rBDOKf2LlqQT7L0wFAYD -VR0RBA0wC4IJbG9jYWxob3N0MAsGCSqGSIb3DQEBCwOCAQEAnuCKD+UzlDjFKFIm -eMmXi77DDjOx3YmL8idPuglMwL75ZYCTwhctN3yC+xWS8TpurIMfyXtyINSRv6lW -oBt8hj6NhXRyo/tC5CMRPoasB5FyhcLivD1117zYdDoouGxIOlEPw/nVQGgNQKvS -ebXGkgDwMNm+qkQ69V38NzNeS36BzwvX9ElUmAS9PH78CRM3RteUMfi6JtWQjDWq -U6pATxkKJ4mQA2D0SFoNe64DilbAZyKhHd07K9rZoM1bZ7ND6F8Qiow7/qQz3BW2 -kOfSlY9zanzbOrF35H0dDCd9i0VQBkwZbWC06ZH2bgdHOCh8zn3WC2AOy9SaIuC8 -L4mJZQ== ------END CERTIFICATE----- diff --git a/vendor/github.com/cloudflare/cfssl/testdata/test.py b/vendor/github.com/cloudflare/cfssl/testdata/test.py deleted file mode 100644 index 6de4d0e..0000000 --- a/vendor/github.com/cloudflare/cfssl/testdata/test.py +++ /dev/null @@ -1,12 +0,0 @@ -import sys -from m2ext import SSL -from M2Crypto import X509 - -print "Validating certificate %s using CApath %s" % (sys.argv[1], sys.argv[2]) -cert = X509.load_cert(sys.argv[1]) -ctx = SSL.Context() -ctx.load_verify_locations(capath=sys.argv[2]) -if ctx.validate_certificate(cert): - print "valid" -else: - print "invalid" diff --git a/vendor/github.com/golang/protobuf/AUTHORS b/vendor/github.com/golang/protobuf/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/github.com/golang/protobuf/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/golang/protobuf/CONTRIBUTORS b/vendor/github.com/golang/protobuf/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/github.com/golang/protobuf/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/golang/protobuf/LICENSE b/vendor/github.com/golang/protobuf/LICENSE new file mode 100644 index 0000000..1b1b192 --- /dev/null +++ b/vendor/github.com/golang/protobuf/LICENSE @@ -0,0 +1,31 @@ +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/golang/protobuf/proto/all_test.go b/vendor/github.com/golang/protobuf/proto/all_test.go deleted file mode 100644 index 361f72f..0000000 --- a/vendor/github.com/golang/protobuf/proto/all_test.go +++ /dev/null @@ -1,2410 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto_test - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "math" - "math/rand" - "reflect" - "runtime/debug" - "strings" - "sync" - "testing" - "time" - - . "github.com/golang/protobuf/proto" - . "github.com/golang/protobuf/proto/test_proto" -) - -var globalO *Buffer - -func old() *Buffer { - if globalO == nil { - globalO = NewBuffer(nil) - } - globalO.Reset() - return globalO -} - -func equalbytes(b1, b2 []byte, t *testing.T) { - if len(b1) != len(b2) { - t.Errorf("wrong lengths: 2*%d != %d", len(b1), len(b2)) - return - } - for i := 0; i < len(b1); i++ { - if b1[i] != b2[i] { - t.Errorf("bad byte[%d]:%x %x: %s %s", i, b1[i], b2[i], b1, b2) - } - } -} - -func initGoTestField() *GoTestField { - f := new(GoTestField) - f.Label = String("label") - f.Type = String("type") - return f -} - -// These are all structurally equivalent but the tag numbers differ. -// (It's remarkable that required, optional, and repeated all have -// 8 letters.) -func initGoTest_RequiredGroup() *GoTest_RequiredGroup { - return &GoTest_RequiredGroup{ - RequiredField: String("required"), - } -} - -func initGoTest_OptionalGroup() *GoTest_OptionalGroup { - return &GoTest_OptionalGroup{ - RequiredField: String("optional"), - } -} - -func initGoTest_RepeatedGroup() *GoTest_RepeatedGroup { - return &GoTest_RepeatedGroup{ - RequiredField: String("repeated"), - } -} - -func initGoTest(setdefaults bool) *GoTest { - pb := new(GoTest) - if setdefaults { - pb.F_BoolDefaulted = Bool(Default_GoTest_F_BoolDefaulted) - pb.F_Int32Defaulted = Int32(Default_GoTest_F_Int32Defaulted) - pb.F_Int64Defaulted = Int64(Default_GoTest_F_Int64Defaulted) - pb.F_Fixed32Defaulted = Uint32(Default_GoTest_F_Fixed32Defaulted) - pb.F_Fixed64Defaulted = Uint64(Default_GoTest_F_Fixed64Defaulted) - pb.F_Uint32Defaulted = Uint32(Default_GoTest_F_Uint32Defaulted) - pb.F_Uint64Defaulted = Uint64(Default_GoTest_F_Uint64Defaulted) - pb.F_FloatDefaulted = Float32(Default_GoTest_F_FloatDefaulted) - pb.F_DoubleDefaulted = Float64(Default_GoTest_F_DoubleDefaulted) - pb.F_StringDefaulted = String(Default_GoTest_F_StringDefaulted) - pb.F_BytesDefaulted = Default_GoTest_F_BytesDefaulted - pb.F_Sint32Defaulted = Int32(Default_GoTest_F_Sint32Defaulted) - pb.F_Sint64Defaulted = Int64(Default_GoTest_F_Sint64Defaulted) - pb.F_Sfixed32Defaulted = Int32(Default_GoTest_F_Sfixed32Defaulted) - pb.F_Sfixed64Defaulted = Int64(Default_GoTest_F_Sfixed64Defaulted) - } - - pb.Kind = GoTest_TIME.Enum() - pb.RequiredField = initGoTestField() - pb.F_BoolRequired = Bool(true) - pb.F_Int32Required = Int32(3) - pb.F_Int64Required = Int64(6) - pb.F_Fixed32Required = Uint32(32) - pb.F_Fixed64Required = Uint64(64) - pb.F_Uint32Required = Uint32(3232) - pb.F_Uint64Required = Uint64(6464) - pb.F_FloatRequired = Float32(3232) - pb.F_DoubleRequired = Float64(6464) - pb.F_StringRequired = String("string") - pb.F_BytesRequired = []byte("bytes") - pb.F_Sint32Required = Int32(-32) - pb.F_Sint64Required = Int64(-64) - pb.F_Sfixed32Required = Int32(-32) - pb.F_Sfixed64Required = Int64(-64) - pb.Requiredgroup = initGoTest_RequiredGroup() - - return pb -} - -func hex(c uint8) uint8 { - if '0' <= c && c <= '9' { - return c - '0' - } - if 'a' <= c && c <= 'f' { - return 10 + c - 'a' - } - if 'A' <= c && c <= 'F' { - return 10 + c - 'A' - } - return 0 -} - -func equal(b []byte, s string, t *testing.T) bool { - if 2*len(b) != len(s) { - // fail(fmt.Sprintf("wrong lengths: 2*%d != %d", len(b), len(s)), b, s, t) - fmt.Printf("wrong lengths: 2*%d != %d\n", len(b), len(s)) - return false - } - for i, j := 0, 0; i < len(b); i, j = i+1, j+2 { - x := hex(s[j])*16 + hex(s[j+1]) - if b[i] != x { - // fail(fmt.Sprintf("bad byte[%d]:%x %x", i, b[i], x), b, s, t) - fmt.Printf("bad byte[%d]:%x %x", i, b[i], x) - return false - } - } - return true -} - -func overify(t *testing.T, pb *GoTest, expected string) { - o := old() - err := o.Marshal(pb) - if err != nil { - fmt.Printf("overify marshal-1 err = %v", err) - o.DebugPrint("", o.Bytes()) - t.Fatalf("expected = %s", expected) - } - if !equal(o.Bytes(), expected, t) { - o.DebugPrint("overify neq 1", o.Bytes()) - t.Fatalf("expected = %s", expected) - } - - // Now test Unmarshal by recreating the original buffer. - pbd := new(GoTest) - err = o.Unmarshal(pbd) - if err != nil { - t.Fatalf("overify unmarshal err = %v", err) - o.DebugPrint("", o.Bytes()) - t.Fatalf("string = %s", expected) - } - o.Reset() - err = o.Marshal(pbd) - if err != nil { - t.Errorf("overify marshal-2 err = %v", err) - o.DebugPrint("", o.Bytes()) - t.Fatalf("string = %s", expected) - } - if !equal(o.Bytes(), expected, t) { - o.DebugPrint("overify neq 2", o.Bytes()) - t.Fatalf("string = %s", expected) - } -} - -// Simple tests for numeric encode/decode primitives (varint, etc.) -func TestNumericPrimitives(t *testing.T) { - for i := uint64(0); i < 1e6; i += 111 { - o := old() - if o.EncodeVarint(i) != nil { - t.Error("EncodeVarint") - break - } - x, e := o.DecodeVarint() - if e != nil { - t.Fatal("DecodeVarint") - } - if x != i { - t.Fatal("varint decode fail:", i, x) - } - - o = old() - if o.EncodeFixed32(i) != nil { - t.Fatal("encFixed32") - } - x, e = o.DecodeFixed32() - if e != nil { - t.Fatal("decFixed32") - } - if x != i { - t.Fatal("fixed32 decode fail:", i, x) - } - - o = old() - if o.EncodeFixed64(i*1234567) != nil { - t.Error("encFixed64") - break - } - x, e = o.DecodeFixed64() - if e != nil { - t.Error("decFixed64") - break - } - if x != i*1234567 { - t.Error("fixed64 decode fail:", i*1234567, x) - break - } - - o = old() - i32 := int32(i - 12345) - if o.EncodeZigzag32(uint64(i32)) != nil { - t.Fatal("EncodeZigzag32") - } - x, e = o.DecodeZigzag32() - if e != nil { - t.Fatal("DecodeZigzag32") - } - if x != uint64(uint32(i32)) { - t.Fatal("zigzag32 decode fail:", i32, x) - } - - o = old() - i64 := int64(i - 12345) - if o.EncodeZigzag64(uint64(i64)) != nil { - t.Fatal("EncodeZigzag64") - } - x, e = o.DecodeZigzag64() - if e != nil { - t.Fatal("DecodeZigzag64") - } - if x != uint64(i64) { - t.Fatal("zigzag64 decode fail:", i64, x) - } - } -} - -// fakeMarshaler is a simple struct implementing Marshaler and Message interfaces. -type fakeMarshaler struct { - b []byte - err error -} - -func (f *fakeMarshaler) Marshal() ([]byte, error) { return f.b, f.err } -func (f *fakeMarshaler) String() string { return fmt.Sprintf("Bytes: %v Error: %v", f.b, f.err) } -func (f *fakeMarshaler) ProtoMessage() {} -func (f *fakeMarshaler) Reset() {} - -type msgWithFakeMarshaler struct { - M *fakeMarshaler `protobuf:"bytes,1,opt,name=fake"` -} - -func (m *msgWithFakeMarshaler) String() string { return CompactTextString(m) } -func (m *msgWithFakeMarshaler) ProtoMessage() {} -func (m *msgWithFakeMarshaler) Reset() {} - -// Simple tests for proto messages that implement the Marshaler interface. -func TestMarshalerEncoding(t *testing.T) { - tests := []struct { - name string - m Message - want []byte - errType reflect.Type - }{ - { - name: "Marshaler that fails", - m: &fakeMarshaler{ - err: errors.New("some marshal err"), - b: []byte{5, 6, 7}, - }, - // Since the Marshal method returned bytes, they should be written to the - // buffer. (For efficiency, we assume that Marshal implementations are - // always correct w.r.t. RequiredNotSetError and output.) - want: []byte{5, 6, 7}, - errType: reflect.TypeOf(errors.New("some marshal err")), - }, - { - name: "Marshaler that fails with RequiredNotSetError", - m: &msgWithFakeMarshaler{ - M: &fakeMarshaler{ - err: &RequiredNotSetError{}, - b: []byte{5, 6, 7}, - }, - }, - // Since there's an error that can be continued after, - // the buffer should be written. - want: []byte{ - 10, 3, // for &msgWithFakeMarshaler - 5, 6, 7, // for &fakeMarshaler - }, - errType: reflect.TypeOf(&RequiredNotSetError{}), - }, - { - name: "Marshaler that succeeds", - m: &fakeMarshaler{ - b: []byte{0, 1, 2, 3, 4, 127, 255}, - }, - want: []byte{0, 1, 2, 3, 4, 127, 255}, - }, - } - for _, test := range tests { - b := NewBuffer(nil) - err := b.Marshal(test.m) - if reflect.TypeOf(err) != test.errType { - t.Errorf("%s: got err %T(%v) wanted %T", test.name, err, err, test.errType) - } - if !reflect.DeepEqual(test.want, b.Bytes()) { - t.Errorf("%s: got bytes %v wanted %v", test.name, b.Bytes(), test.want) - } - if size := Size(test.m); size != len(b.Bytes()) { - t.Errorf("%s: Size(_) = %v, but marshaled to %v bytes", test.name, size, len(b.Bytes())) - } - - m, mErr := Marshal(test.m) - if !bytes.Equal(b.Bytes(), m) { - t.Errorf("%s: Marshal returned %v, but (*Buffer).Marshal wrote %v", test.name, m, b.Bytes()) - } - if !reflect.DeepEqual(err, mErr) { - t.Errorf("%s: Marshal err = %q, but (*Buffer).Marshal returned %q", - test.name, fmt.Sprint(mErr), fmt.Sprint(err)) - } - } -} - -// Ensure that Buffer.Marshal uses O(N) memory for N messages -func TestBufferMarshalAllocs(t *testing.T) { - value := &OtherMessage{Key: Int64(1)} - msg := &MyMessage{Count: Int32(1), Others: []*OtherMessage{value}} - - reallocSize := func(t *testing.T, items int, prealloc int) (int64, int64) { - var b Buffer - b.SetBuf(make([]byte, 0, prealloc)) - - var allocSpace int64 - prevCap := cap(b.Bytes()) - for i := 0; i < items; i++ { - err := b.Marshal(msg) - if err != nil { - t.Errorf("Marshal err = %q", err) - break - } - if c := cap(b.Bytes()); prevCap != c { - allocSpace += int64(c) - prevCap = c - } - } - needSpace := int64(len(b.Bytes())) - return allocSpace, needSpace - } - - for _, prealloc := range []int{0, 100, 10000} { - for _, items := range []int{1, 2, 5, 10, 20, 50, 100, 200, 500, 1000} { - runtimeSpace, need := reallocSize(t, items, prealloc) - totalSpace := int64(prealloc) + runtimeSpace - - runtimeRatio := float64(runtimeSpace) / float64(need) - totalRatio := float64(totalSpace) / float64(need) - - if totalRatio < 1 || runtimeRatio > 4 { - t.Errorf("needed %dB, allocated %dB total (ratio %.1f), allocated %dB at runtime (ratio %.1f)", - need, totalSpace, totalRatio, runtimeSpace, runtimeRatio) - } - } - } -} - -// Simple tests for bytes -func TestBytesPrimitives(t *testing.T) { - o := old() - bytes := []byte{'n', 'o', 'w', ' ', 'i', 's', ' ', 't', 'h', 'e', ' ', 't', 'i', 'm', 'e'} - if o.EncodeRawBytes(bytes) != nil { - t.Error("EncodeRawBytes") - } - decb, e := o.DecodeRawBytes(false) - if e != nil { - t.Error("DecodeRawBytes") - } - equalbytes(bytes, decb, t) -} - -// Simple tests for strings -func TestStringPrimitives(t *testing.T) { - o := old() - s := "now is the time" - if o.EncodeStringBytes(s) != nil { - t.Error("enc_string") - } - decs, e := o.DecodeStringBytes() - if e != nil { - t.Error("dec_string") - } - if s != decs { - t.Error("string encode/decode fail:", s, decs) - } -} - -// Do we catch the "required bit not set" case? -func TestRequiredBit(t *testing.T) { - o := old() - pb := new(GoTest) - err := o.Marshal(pb) - if err == nil { - t.Error("did not catch missing required fields") - } else if !strings.Contains(err.Error(), "Kind") { - t.Error("wrong error type:", err) - } -} - -// Check that all fields are nil. -// Clearly silly, and a residue from a more interesting test with an earlier, -// different initialization property, but it once caught a compiler bug so -// it lives. -func checkInitialized(pb *GoTest, t *testing.T) { - if pb.F_BoolDefaulted != nil { - t.Error("New or Reset did not set boolean:", *pb.F_BoolDefaulted) - } - if pb.F_Int32Defaulted != nil { - t.Error("New or Reset did not set int32:", *pb.F_Int32Defaulted) - } - if pb.F_Int64Defaulted != nil { - t.Error("New or Reset did not set int64:", *pb.F_Int64Defaulted) - } - if pb.F_Fixed32Defaulted != nil { - t.Error("New or Reset did not set fixed32:", *pb.F_Fixed32Defaulted) - } - if pb.F_Fixed64Defaulted != nil { - t.Error("New or Reset did not set fixed64:", *pb.F_Fixed64Defaulted) - } - if pb.F_Uint32Defaulted != nil { - t.Error("New or Reset did not set uint32:", *pb.F_Uint32Defaulted) - } - if pb.F_Uint64Defaulted != nil { - t.Error("New or Reset did not set uint64:", *pb.F_Uint64Defaulted) - } - if pb.F_FloatDefaulted != nil { - t.Error("New or Reset did not set float:", *pb.F_FloatDefaulted) - } - if pb.F_DoubleDefaulted != nil { - t.Error("New or Reset did not set double:", *pb.F_DoubleDefaulted) - } - if pb.F_StringDefaulted != nil { - t.Error("New or Reset did not set string:", *pb.F_StringDefaulted) - } - if pb.F_BytesDefaulted != nil { - t.Error("New or Reset did not set bytes:", string(pb.F_BytesDefaulted)) - } - if pb.F_Sint32Defaulted != nil { - t.Error("New or Reset did not set int32:", *pb.F_Sint32Defaulted) - } - if pb.F_Sint64Defaulted != nil { - t.Error("New or Reset did not set int64:", *pb.F_Sint64Defaulted) - } -} - -// Does Reset() reset? -func TestReset(t *testing.T) { - pb := initGoTest(true) - // muck with some values - pb.F_BoolDefaulted = Bool(false) - pb.F_Int32Defaulted = Int32(237) - pb.F_Int64Defaulted = Int64(12346) - pb.F_Fixed32Defaulted = Uint32(32000) - pb.F_Fixed64Defaulted = Uint64(666) - pb.F_Uint32Defaulted = Uint32(323232) - pb.F_Uint64Defaulted = nil - pb.F_FloatDefaulted = nil - pb.F_DoubleDefaulted = Float64(0) - pb.F_StringDefaulted = String("gotcha") - pb.F_BytesDefaulted = []byte("asdfasdf") - pb.F_Sint32Defaulted = Int32(123) - pb.F_Sint64Defaulted = Int64(789) - pb.Reset() - checkInitialized(pb, t) -} - -// All required fields set, no defaults provided. -func TestEncodeDecode1(t *testing.T) { - pb := initGoTest(false) - overify(t, pb, - "0807"+ // field 1, encoding 0, value 7 - "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) - "5001"+ // field 10, encoding 0, value 1 - "5803"+ // field 11, encoding 0, value 3 - "6006"+ // field 12, encoding 0, value 6 - "6d20000000"+ // field 13, encoding 5, value 0x20 - "714000000000000000"+ // field 14, encoding 1, value 0x40 - "78a019"+ // field 15, encoding 0, value 0xca0 = 3232 - "8001c032"+ // field 16, encoding 0, value 0x1940 = 6464 - "8d0100004a45"+ // field 17, encoding 5, value 3232.0 - "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 - "9a0106"+"737472696e67"+ // field 19, encoding 2, string "string" - "b304"+ // field 70, encoding 3, start group - "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" - "b404"+ // field 70, encoding 4, end group - "aa0605"+"6279746573"+ // field 101, encoding 2, string "bytes" - "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 - "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 - "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32 - "c906c0ffffffffffffff") // field 105, encoding 1, -64 fixed64 -} - -// All required fields set, defaults provided. -func TestEncodeDecode2(t *testing.T) { - pb := initGoTest(true) - overify(t, pb, - "0807"+ // field 1, encoding 0, value 7 - "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) - "5001"+ // field 10, encoding 0, value 1 - "5803"+ // field 11, encoding 0, value 3 - "6006"+ // field 12, encoding 0, value 6 - "6d20000000"+ // field 13, encoding 5, value 32 - "714000000000000000"+ // field 14, encoding 1, value 64 - "78a019"+ // field 15, encoding 0, value 3232 - "8001c032"+ // field 16, encoding 0, value 6464 - "8d0100004a45"+ // field 17, encoding 5, value 3232.0 - "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 - "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" - "c00201"+ // field 40, encoding 0, value 1 - "c80220"+ // field 41, encoding 0, value 32 - "d00240"+ // field 42, encoding 0, value 64 - "dd0240010000"+ // field 43, encoding 5, value 320 - "e1028002000000000000"+ // field 44, encoding 1, value 640 - "e8028019"+ // field 45, encoding 0, value 3200 - "f0028032"+ // field 46, encoding 0, value 6400 - "fd02e0659948"+ // field 47, encoding 5, value 314159.0 - "81030000000050971041"+ // field 48, encoding 1, value 271828.0 - "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" - "b304"+ // start group field 70 level 1 - "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" - "b404"+ // end group field 70 level 1 - "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" - "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 - "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 - "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32 - "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64 - "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" - "90193f"+ // field 402, encoding 0, value 63 - "98197f"+ // field 403, encoding 0, value 127 - "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32 - "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64 - -} - -// All default fields set to their default value by hand -func TestEncodeDecode3(t *testing.T) { - pb := initGoTest(false) - pb.F_BoolDefaulted = Bool(true) - pb.F_Int32Defaulted = Int32(32) - pb.F_Int64Defaulted = Int64(64) - pb.F_Fixed32Defaulted = Uint32(320) - pb.F_Fixed64Defaulted = Uint64(640) - pb.F_Uint32Defaulted = Uint32(3200) - pb.F_Uint64Defaulted = Uint64(6400) - pb.F_FloatDefaulted = Float32(314159) - pb.F_DoubleDefaulted = Float64(271828) - pb.F_StringDefaulted = String("hello, \"world!\"\n") - pb.F_BytesDefaulted = []byte("Bignose") - pb.F_Sint32Defaulted = Int32(-32) - pb.F_Sint64Defaulted = Int64(-64) - pb.F_Sfixed32Defaulted = Int32(-32) - pb.F_Sfixed64Defaulted = Int64(-64) - - overify(t, pb, - "0807"+ // field 1, encoding 0, value 7 - "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) - "5001"+ // field 10, encoding 0, value 1 - "5803"+ // field 11, encoding 0, value 3 - "6006"+ // field 12, encoding 0, value 6 - "6d20000000"+ // field 13, encoding 5, value 32 - "714000000000000000"+ // field 14, encoding 1, value 64 - "78a019"+ // field 15, encoding 0, value 3232 - "8001c032"+ // field 16, encoding 0, value 6464 - "8d0100004a45"+ // field 17, encoding 5, value 3232.0 - "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 - "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" - "c00201"+ // field 40, encoding 0, value 1 - "c80220"+ // field 41, encoding 0, value 32 - "d00240"+ // field 42, encoding 0, value 64 - "dd0240010000"+ // field 43, encoding 5, value 320 - "e1028002000000000000"+ // field 44, encoding 1, value 640 - "e8028019"+ // field 45, encoding 0, value 3200 - "f0028032"+ // field 46, encoding 0, value 6400 - "fd02e0659948"+ // field 47, encoding 5, value 314159.0 - "81030000000050971041"+ // field 48, encoding 1, value 271828.0 - "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" - "b304"+ // start group field 70 level 1 - "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" - "b404"+ // end group field 70 level 1 - "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" - "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 - "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 - "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32 - "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64 - "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" - "90193f"+ // field 402, encoding 0, value 63 - "98197f"+ // field 403, encoding 0, value 127 - "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32 - "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64 - -} - -// All required fields set, defaults provided, all non-defaulted optional fields have values. -func TestEncodeDecode4(t *testing.T) { - pb := initGoTest(true) - pb.Table = String("hello") - pb.Param = Int32(7) - pb.OptionalField = initGoTestField() - pb.F_BoolOptional = Bool(true) - pb.F_Int32Optional = Int32(32) - pb.F_Int64Optional = Int64(64) - pb.F_Fixed32Optional = Uint32(3232) - pb.F_Fixed64Optional = Uint64(6464) - pb.F_Uint32Optional = Uint32(323232) - pb.F_Uint64Optional = Uint64(646464) - pb.F_FloatOptional = Float32(32.) - pb.F_DoubleOptional = Float64(64.) - pb.F_StringOptional = String("hello") - pb.F_BytesOptional = []byte("Bignose") - pb.F_Sint32Optional = Int32(-32) - pb.F_Sint64Optional = Int64(-64) - pb.F_Sfixed32Optional = Int32(-32) - pb.F_Sfixed64Optional = Int64(-64) - pb.Optionalgroup = initGoTest_OptionalGroup() - - overify(t, pb, - "0807"+ // field 1, encoding 0, value 7 - "1205"+"68656c6c6f"+ // field 2, encoding 2, string "hello" - "1807"+ // field 3, encoding 0, value 7 - "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) - "320d"+"0a056c6162656c120474797065"+ // field 6, encoding 2 (GoTestField) - "5001"+ // field 10, encoding 0, value 1 - "5803"+ // field 11, encoding 0, value 3 - "6006"+ // field 12, encoding 0, value 6 - "6d20000000"+ // field 13, encoding 5, value 32 - "714000000000000000"+ // field 14, encoding 1, value 64 - "78a019"+ // field 15, encoding 0, value 3232 - "8001c032"+ // field 16, encoding 0, value 6464 - "8d0100004a45"+ // field 17, encoding 5, value 3232.0 - "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 - "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" - "f00101"+ // field 30, encoding 0, value 1 - "f80120"+ // field 31, encoding 0, value 32 - "800240"+ // field 32, encoding 0, value 64 - "8d02a00c0000"+ // field 33, encoding 5, value 3232 - "91024019000000000000"+ // field 34, encoding 1, value 6464 - "9802a0dd13"+ // field 35, encoding 0, value 323232 - "a002c0ba27"+ // field 36, encoding 0, value 646464 - "ad0200000042"+ // field 37, encoding 5, value 32.0 - "b1020000000000005040"+ // field 38, encoding 1, value 64.0 - "ba0205"+"68656c6c6f"+ // field 39, encoding 2, string "hello" - "c00201"+ // field 40, encoding 0, value 1 - "c80220"+ // field 41, encoding 0, value 32 - "d00240"+ // field 42, encoding 0, value 64 - "dd0240010000"+ // field 43, encoding 5, value 320 - "e1028002000000000000"+ // field 44, encoding 1, value 640 - "e8028019"+ // field 45, encoding 0, value 3200 - "f0028032"+ // field 46, encoding 0, value 6400 - "fd02e0659948"+ // field 47, encoding 5, value 314159.0 - "81030000000050971041"+ // field 48, encoding 1, value 271828.0 - "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" - "b304"+ // start group field 70 level 1 - "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" - "b404"+ // end group field 70 level 1 - "d305"+ // start group field 90 level 1 - "da0508"+"6f7074696f6e616c"+ // field 91, encoding 2, string "optional" - "d405"+ // end group field 90 level 1 - "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" - "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 - "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 - "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32 - "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64 - "ea1207"+"4269676e6f7365"+ // field 301, encoding 2, string "Bignose" - "f0123f"+ // field 302, encoding 0, value 63 - "f8127f"+ // field 303, encoding 0, value 127 - "8513e0ffffff"+ // field 304, encoding 5, -32 fixed32 - "8913c0ffffffffffffff"+ // field 305, encoding 1, -64 fixed64 - "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" - "90193f"+ // field 402, encoding 0, value 63 - "98197f"+ // field 403, encoding 0, value 127 - "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32 - "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64 - -} - -// All required fields set, defaults provided, all repeated fields given two values. -func TestEncodeDecode5(t *testing.T) { - pb := initGoTest(true) - pb.RepeatedField = []*GoTestField{initGoTestField(), initGoTestField()} - pb.F_BoolRepeated = []bool{false, true} - pb.F_Int32Repeated = []int32{32, 33} - pb.F_Int64Repeated = []int64{64, 65} - pb.F_Fixed32Repeated = []uint32{3232, 3333} - pb.F_Fixed64Repeated = []uint64{6464, 6565} - pb.F_Uint32Repeated = []uint32{323232, 333333} - pb.F_Uint64Repeated = []uint64{646464, 656565} - pb.F_FloatRepeated = []float32{32., 33.} - pb.F_DoubleRepeated = []float64{64., 65.} - pb.F_StringRepeated = []string{"hello", "sailor"} - pb.F_BytesRepeated = [][]byte{[]byte("big"), []byte("nose")} - pb.F_Sint32Repeated = []int32{32, -32} - pb.F_Sint64Repeated = []int64{64, -64} - pb.F_Sfixed32Repeated = []int32{32, -32} - pb.F_Sfixed64Repeated = []int64{64, -64} - pb.Repeatedgroup = []*GoTest_RepeatedGroup{initGoTest_RepeatedGroup(), initGoTest_RepeatedGroup()} - - overify(t, pb, - "0807"+ // field 1, encoding 0, value 7 - "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) - "2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField) - "2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField) - "5001"+ // field 10, encoding 0, value 1 - "5803"+ // field 11, encoding 0, value 3 - "6006"+ // field 12, encoding 0, value 6 - "6d20000000"+ // field 13, encoding 5, value 32 - "714000000000000000"+ // field 14, encoding 1, value 64 - "78a019"+ // field 15, encoding 0, value 3232 - "8001c032"+ // field 16, encoding 0, value 6464 - "8d0100004a45"+ // field 17, encoding 5, value 3232.0 - "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 - "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" - "a00100"+ // field 20, encoding 0, value 0 - "a00101"+ // field 20, encoding 0, value 1 - "a80120"+ // field 21, encoding 0, value 32 - "a80121"+ // field 21, encoding 0, value 33 - "b00140"+ // field 22, encoding 0, value 64 - "b00141"+ // field 22, encoding 0, value 65 - "bd01a00c0000"+ // field 23, encoding 5, value 3232 - "bd01050d0000"+ // field 23, encoding 5, value 3333 - "c1014019000000000000"+ // field 24, encoding 1, value 6464 - "c101a519000000000000"+ // field 24, encoding 1, value 6565 - "c801a0dd13"+ // field 25, encoding 0, value 323232 - "c80195ac14"+ // field 25, encoding 0, value 333333 - "d001c0ba27"+ // field 26, encoding 0, value 646464 - "d001b58928"+ // field 26, encoding 0, value 656565 - "dd0100000042"+ // field 27, encoding 5, value 32.0 - "dd0100000442"+ // field 27, encoding 5, value 33.0 - "e1010000000000005040"+ // field 28, encoding 1, value 64.0 - "e1010000000000405040"+ // field 28, encoding 1, value 65.0 - "ea0105"+"68656c6c6f"+ // field 29, encoding 2, string "hello" - "ea0106"+"7361696c6f72"+ // field 29, encoding 2, string "sailor" - "c00201"+ // field 40, encoding 0, value 1 - "c80220"+ // field 41, encoding 0, value 32 - "d00240"+ // field 42, encoding 0, value 64 - "dd0240010000"+ // field 43, encoding 5, value 320 - "e1028002000000000000"+ // field 44, encoding 1, value 640 - "e8028019"+ // field 45, encoding 0, value 3200 - "f0028032"+ // field 46, encoding 0, value 6400 - "fd02e0659948"+ // field 47, encoding 5, value 314159.0 - "81030000000050971041"+ // field 48, encoding 1, value 271828.0 - "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" - "b304"+ // start group field 70 level 1 - "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" - "b404"+ // end group field 70 level 1 - "8305"+ // start group field 80 level 1 - "8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated" - "8405"+ // end group field 80 level 1 - "8305"+ // start group field 80 level 1 - "8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated" - "8405"+ // end group field 80 level 1 - "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" - "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 - "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 - "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32 - "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64 - "ca0c03"+"626967"+ // field 201, encoding 2, string "big" - "ca0c04"+"6e6f7365"+ // field 201, encoding 2, string "nose" - "d00c40"+ // field 202, encoding 0, value 32 - "d00c3f"+ // field 202, encoding 0, value -32 - "d80c8001"+ // field 203, encoding 0, value 64 - "d80c7f"+ // field 203, encoding 0, value -64 - "e50c20000000"+ // field 204, encoding 5, 32 fixed32 - "e50ce0ffffff"+ // field 204, encoding 5, -32 fixed32 - "e90c4000000000000000"+ // field 205, encoding 1, 64 fixed64 - "e90cc0ffffffffffffff"+ // field 205, encoding 1, -64 fixed64 - "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" - "90193f"+ // field 402, encoding 0, value 63 - "98197f"+ // field 403, encoding 0, value 127 - "a519e0ffffff"+ // field 404, encoding 5, -32 fixed32 - "a919c0ffffffffffffff") // field 405, encoding 1, -64 fixed64 - -} - -// All required fields set, all packed repeated fields given two values. -func TestEncodeDecode6(t *testing.T) { - pb := initGoTest(false) - pb.F_BoolRepeatedPacked = []bool{false, true} - pb.F_Int32RepeatedPacked = []int32{32, 33} - pb.F_Int64RepeatedPacked = []int64{64, 65} - pb.F_Fixed32RepeatedPacked = []uint32{3232, 3333} - pb.F_Fixed64RepeatedPacked = []uint64{6464, 6565} - pb.F_Uint32RepeatedPacked = []uint32{323232, 333333} - pb.F_Uint64RepeatedPacked = []uint64{646464, 656565} - pb.F_FloatRepeatedPacked = []float32{32., 33.} - pb.F_DoubleRepeatedPacked = []float64{64., 65.} - pb.F_Sint32RepeatedPacked = []int32{32, -32} - pb.F_Sint64RepeatedPacked = []int64{64, -64} - pb.F_Sfixed32RepeatedPacked = []int32{32, -32} - pb.F_Sfixed64RepeatedPacked = []int64{64, -64} - - overify(t, pb, - "0807"+ // field 1, encoding 0, value 7 - "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) - "5001"+ // field 10, encoding 0, value 1 - "5803"+ // field 11, encoding 0, value 3 - "6006"+ // field 12, encoding 0, value 6 - "6d20000000"+ // field 13, encoding 5, value 32 - "714000000000000000"+ // field 14, encoding 1, value 64 - "78a019"+ // field 15, encoding 0, value 3232 - "8001c032"+ // field 16, encoding 0, value 6464 - "8d0100004a45"+ // field 17, encoding 5, value 3232.0 - "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 - "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" - "9203020001"+ // field 50, encoding 2, 2 bytes, value 0, value 1 - "9a03022021"+ // field 51, encoding 2, 2 bytes, value 32, value 33 - "a203024041"+ // field 52, encoding 2, 2 bytes, value 64, value 65 - "aa0308"+ // field 53, encoding 2, 8 bytes - "a00c0000050d0000"+ // value 3232, value 3333 - "b20310"+ // field 54, encoding 2, 16 bytes - "4019000000000000a519000000000000"+ // value 6464, value 6565 - "ba0306"+ // field 55, encoding 2, 6 bytes - "a0dd1395ac14"+ // value 323232, value 333333 - "c20306"+ // field 56, encoding 2, 6 bytes - "c0ba27b58928"+ // value 646464, value 656565 - "ca0308"+ // field 57, encoding 2, 8 bytes - "0000004200000442"+ // value 32.0, value 33.0 - "d20310"+ // field 58, encoding 2, 16 bytes - "00000000000050400000000000405040"+ // value 64.0, value 65.0 - "b304"+ // start group field 70 level 1 - "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" - "b404"+ // end group field 70 level 1 - "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" - "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 - "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 - "c506e0ffffff"+ // field 104, encoding 5, -32 fixed32 - "c906c0ffffffffffffff"+ // field 105, encoding 1, -64 fixed64 - "b21f02"+ // field 502, encoding 2, 2 bytes - "403f"+ // value 32, value -32 - "ba1f03"+ // field 503, encoding 2, 3 bytes - "80017f"+ // value 64, value -64 - "c21f08"+ // field 504, encoding 2, 8 bytes - "20000000e0ffffff"+ // value 32, value -32 - "ca1f10"+ // field 505, encoding 2, 16 bytes - "4000000000000000c0ffffffffffffff") // value 64, value -64 - -} - -// Test that we can encode empty bytes fields. -func TestEncodeDecodeBytes1(t *testing.T) { - pb := initGoTest(false) - - // Create our bytes - pb.F_BytesRequired = []byte{} - pb.F_BytesRepeated = [][]byte{{}} - pb.F_BytesOptional = []byte{} - - d, err := Marshal(pb) - if err != nil { - t.Error(err) - } - - pbd := new(GoTest) - if err := Unmarshal(d, pbd); err != nil { - t.Error(err) - } - - if pbd.F_BytesRequired == nil || len(pbd.F_BytesRequired) != 0 { - t.Error("required empty bytes field is incorrect") - } - if pbd.F_BytesRepeated == nil || len(pbd.F_BytesRepeated) == 1 && pbd.F_BytesRepeated[0] == nil { - t.Error("repeated empty bytes field is incorrect") - } - if pbd.F_BytesOptional == nil || len(pbd.F_BytesOptional) != 0 { - t.Error("optional empty bytes field is incorrect") - } -} - -// Test that we encode nil-valued fields of a repeated bytes field correctly. -// Since entries in a repeated field cannot be nil, nil must mean empty value. -func TestEncodeDecodeBytes2(t *testing.T) { - pb := initGoTest(false) - - // Create our bytes - pb.F_BytesRepeated = [][]byte{nil} - - d, err := Marshal(pb) - if err != nil { - t.Error(err) - } - - pbd := new(GoTest) - if err := Unmarshal(d, pbd); err != nil { - t.Error(err) - } - - if len(pbd.F_BytesRepeated) != 1 || pbd.F_BytesRepeated[0] == nil { - t.Error("Unexpected value for repeated bytes field") - } -} - -// All required fields set, defaults provided, all repeated fields given two values. -func TestSkippingUnrecognizedFields(t *testing.T) { - o := old() - pb := initGoTestField() - - // Marshal it normally. - o.Marshal(pb) - - // Now new a GoSkipTest record. - skip := &GoSkipTest{ - SkipInt32: Int32(32), - SkipFixed32: Uint32(3232), - SkipFixed64: Uint64(6464), - SkipString: String("skipper"), - Skipgroup: &GoSkipTest_SkipGroup{ - GroupInt32: Int32(75), - GroupString: String("wxyz"), - }, - } - - // Marshal it into same buffer. - o.Marshal(skip) - - pbd := new(GoTestField) - o.Unmarshal(pbd) - - // The __unrecognized field should be a marshaling of GoSkipTest - skipd := new(GoSkipTest) - - o.SetBuf(pbd.XXX_unrecognized) - o.Unmarshal(skipd) - - if *skipd.SkipInt32 != *skip.SkipInt32 { - t.Error("skip int32", skipd.SkipInt32) - } - if *skipd.SkipFixed32 != *skip.SkipFixed32 { - t.Error("skip fixed32", skipd.SkipFixed32) - } - if *skipd.SkipFixed64 != *skip.SkipFixed64 { - t.Error("skip fixed64", skipd.SkipFixed64) - } - if *skipd.SkipString != *skip.SkipString { - t.Error("skip string", *skipd.SkipString) - } - if *skipd.Skipgroup.GroupInt32 != *skip.Skipgroup.GroupInt32 { - t.Error("skip group int32", skipd.Skipgroup.GroupInt32) - } - if *skipd.Skipgroup.GroupString != *skip.Skipgroup.GroupString { - t.Error("skip group string", *skipd.Skipgroup.GroupString) - } -} - -// Check that unrecognized fields of a submessage are preserved. -func TestSubmessageUnrecognizedFields(t *testing.T) { - nm := &NewMessage{ - Nested: &NewMessage_Nested{ - Name: String("Nigel"), - FoodGroup: String("carbs"), - }, - } - b, err := Marshal(nm) - if err != nil { - t.Fatalf("Marshal of NewMessage: %v", err) - } - - // Unmarshal into an OldMessage. - om := new(OldMessage) - if err := Unmarshal(b, om); err != nil { - t.Fatalf("Unmarshal to OldMessage: %v", err) - } - exp := &OldMessage{ - Nested: &OldMessage_Nested{ - Name: String("Nigel"), - // normal protocol buffer users should not do this - XXX_unrecognized: []byte("\x12\x05carbs"), - }, - } - if !Equal(om, exp) { - t.Errorf("om = %v, want %v", om, exp) - } - - // Clone the OldMessage. - om = Clone(om).(*OldMessage) - if !Equal(om, exp) { - t.Errorf("Clone(om) = %v, want %v", om, exp) - } - - // Marshal the OldMessage, then unmarshal it into an empty NewMessage. - if b, err = Marshal(om); err != nil { - t.Fatalf("Marshal of OldMessage: %v", err) - } - t.Logf("Marshal(%v) -> %q", om, b) - nm2 := new(NewMessage) - if err := Unmarshal(b, nm2); err != nil { - t.Fatalf("Unmarshal to NewMessage: %v", err) - } - if !Equal(nm, nm2) { - t.Errorf("NewMessage round-trip: %v => %v", nm, nm2) - } -} - -// Check that an int32 field can be upgraded to an int64 field. -func TestNegativeInt32(t *testing.T) { - om := &OldMessage{ - Num: Int32(-1), - } - b, err := Marshal(om) - if err != nil { - t.Fatalf("Marshal of OldMessage: %v", err) - } - - // Check the size. It should be 11 bytes; - // 1 for the field/wire type, and 10 for the negative number. - if len(b) != 11 { - t.Errorf("%v marshaled as %q, wanted 11 bytes", om, b) - } - - // Unmarshal into a NewMessage. - nm := new(NewMessage) - if err := Unmarshal(b, nm); err != nil { - t.Fatalf("Unmarshal to NewMessage: %v", err) - } - want := &NewMessage{ - Num: Int64(-1), - } - if !Equal(nm, want) { - t.Errorf("nm = %v, want %v", nm, want) - } -} - -// Check that we can grow an array (repeated field) to have many elements. -// This test doesn't depend only on our encoding; for variety, it makes sure -// we create, encode, and decode the correct contents explicitly. It's therefore -// a bit messier. -// This test also uses (and hence tests) the Marshal/Unmarshal functions -// instead of the methods. -func TestBigRepeated(t *testing.T) { - pb := initGoTest(true) - - // Create the arrays - const N = 50 // Internally the library starts much smaller. - pb.Repeatedgroup = make([]*GoTest_RepeatedGroup, N) - pb.F_Sint64Repeated = make([]int64, N) - pb.F_Sint32Repeated = make([]int32, N) - pb.F_BytesRepeated = make([][]byte, N) - pb.F_StringRepeated = make([]string, N) - pb.F_DoubleRepeated = make([]float64, N) - pb.F_FloatRepeated = make([]float32, N) - pb.F_Uint64Repeated = make([]uint64, N) - pb.F_Uint32Repeated = make([]uint32, N) - pb.F_Fixed64Repeated = make([]uint64, N) - pb.F_Fixed32Repeated = make([]uint32, N) - pb.F_Int64Repeated = make([]int64, N) - pb.F_Int32Repeated = make([]int32, N) - pb.F_BoolRepeated = make([]bool, N) - pb.RepeatedField = make([]*GoTestField, N) - - // Fill in the arrays with checkable values. - igtf := initGoTestField() - igtrg := initGoTest_RepeatedGroup() - for i := 0; i < N; i++ { - pb.Repeatedgroup[i] = igtrg - pb.F_Sint64Repeated[i] = int64(i) - pb.F_Sint32Repeated[i] = int32(i) - s := fmt.Sprint(i) - pb.F_BytesRepeated[i] = []byte(s) - pb.F_StringRepeated[i] = s - pb.F_DoubleRepeated[i] = float64(i) - pb.F_FloatRepeated[i] = float32(i) - pb.F_Uint64Repeated[i] = uint64(i) - pb.F_Uint32Repeated[i] = uint32(i) - pb.F_Fixed64Repeated[i] = uint64(i) - pb.F_Fixed32Repeated[i] = uint32(i) - pb.F_Int64Repeated[i] = int64(i) - pb.F_Int32Repeated[i] = int32(i) - pb.F_BoolRepeated[i] = i%2 == 0 - pb.RepeatedField[i] = igtf - } - - // Marshal. - buf, _ := Marshal(pb) - - // Now test Unmarshal by recreating the original buffer. - pbd := new(GoTest) - Unmarshal(buf, pbd) - - // Check the checkable values - for i := uint64(0); i < N; i++ { - if pbd.Repeatedgroup[i] == nil { // TODO: more checking? - t.Error("pbd.Repeatedgroup bad") - } - if x := uint64(pbd.F_Sint64Repeated[i]); x != i { - t.Error("pbd.F_Sint64Repeated bad", x, i) - } - if x := uint64(pbd.F_Sint32Repeated[i]); x != i { - t.Error("pbd.F_Sint32Repeated bad", x, i) - } - s := fmt.Sprint(i) - equalbytes(pbd.F_BytesRepeated[i], []byte(s), t) - if pbd.F_StringRepeated[i] != s { - t.Error("pbd.F_Sint32Repeated bad", pbd.F_StringRepeated[i], i) - } - if x := uint64(pbd.F_DoubleRepeated[i]); x != i { - t.Error("pbd.F_DoubleRepeated bad", x, i) - } - if x := uint64(pbd.F_FloatRepeated[i]); x != i { - t.Error("pbd.F_FloatRepeated bad", x, i) - } - if x := pbd.F_Uint64Repeated[i]; x != i { - t.Error("pbd.F_Uint64Repeated bad", x, i) - } - if x := uint64(pbd.F_Uint32Repeated[i]); x != i { - t.Error("pbd.F_Uint32Repeated bad", x, i) - } - if x := pbd.F_Fixed64Repeated[i]; x != i { - t.Error("pbd.F_Fixed64Repeated bad", x, i) - } - if x := uint64(pbd.F_Fixed32Repeated[i]); x != i { - t.Error("pbd.F_Fixed32Repeated bad", x, i) - } - if x := uint64(pbd.F_Int64Repeated[i]); x != i { - t.Error("pbd.F_Int64Repeated bad", x, i) - } - if x := uint64(pbd.F_Int32Repeated[i]); x != i { - t.Error("pbd.F_Int32Repeated bad", x, i) - } - if x := pbd.F_BoolRepeated[i]; x != (i%2 == 0) { - t.Error("pbd.F_BoolRepeated bad", x, i) - } - if pbd.RepeatedField[i] == nil { // TODO: more checking? - t.Error("pbd.RepeatedField bad") - } - } -} - -func TestBadWireTypeUnknown(t *testing.T) { - var b []byte - fmt.Sscanf("0a01780d00000000080b101612036161611521000000202c220362626225370000002203636363214200000000000000584d5a036464645900000000000056405d63000000", "%x", &b) - - m := new(MyMessage) - if err := Unmarshal(b, m); err != nil { - t.Errorf("unexpected Unmarshal error: %v", err) - } - - var unknown []byte - fmt.Sscanf("0a01780d0000000010161521000000202c2537000000214200000000000000584d5a036464645d63000000", "%x", &unknown) - if !bytes.Equal(m.XXX_unrecognized, unknown) { - t.Errorf("unknown bytes mismatch:\ngot %x\nwant %x", m.XXX_unrecognized, unknown) - } - DiscardUnknown(m) - - want := &MyMessage{Count: Int32(11), Name: String("aaa"), Pet: []string{"bbb", "ccc"}, Bigfloat: Float64(88)} - if !Equal(m, want) { - t.Errorf("message mismatch:\ngot %v\nwant %v", m, want) - } -} - -func encodeDecode(t *testing.T, in, out Message, msg string) { - buf, err := Marshal(in) - if err != nil { - t.Fatalf("failed marshaling %v: %v", msg, err) - } - if err := Unmarshal(buf, out); err != nil { - t.Fatalf("failed unmarshaling %v: %v", msg, err) - } -} - -func TestPackedNonPackedDecoderSwitching(t *testing.T) { - np, p := new(NonPackedTest), new(PackedTest) - - // non-packed -> packed - np.A = []int32{0, 1, 1, 2, 3, 5} - encodeDecode(t, np, p, "non-packed -> packed") - if !reflect.DeepEqual(np.A, p.B) { - t.Errorf("failed non-packed -> packed; np.A=%+v, p.B=%+v", np.A, p.B) - } - - // packed -> non-packed - np.Reset() - p.B = []int32{3, 1, 4, 1, 5, 9} - encodeDecode(t, p, np, "packed -> non-packed") - if !reflect.DeepEqual(p.B, np.A) { - t.Errorf("failed packed -> non-packed; p.B=%+v, np.A=%+v", p.B, np.A) - } -} - -func TestProto1RepeatedGroup(t *testing.T) { - pb := &MessageList{ - Message: []*MessageList_Message{ - { - Name: String("blah"), - Count: Int32(7), - }, - // NOTE: pb.Message[1] is a nil - nil, - }, - } - - o := old() - err := o.Marshal(pb) - if err == nil || !strings.Contains(err.Error(), "repeated field Message has nil") { - t.Fatalf("unexpected or no error when marshaling: %v", err) - } -} - -// Test that enums work. Checks for a bug introduced by making enums -// named types instead of int32: newInt32FromUint64 would crash with -// a type mismatch in reflect.PointTo. -func TestEnum(t *testing.T) { - pb := new(GoEnum) - pb.Foo = FOO_FOO1.Enum() - o := old() - if err := o.Marshal(pb); err != nil { - t.Fatal("error encoding enum:", err) - } - pb1 := new(GoEnum) - if err := o.Unmarshal(pb1); err != nil { - t.Fatal("error decoding enum:", err) - } - if *pb1.Foo != FOO_FOO1 { - t.Error("expected 7 but got ", *pb1.Foo) - } -} - -// Enum types have String methods. Check that enum fields can be printed. -// We don't care what the value actually is, just as long as it doesn't crash. -func TestPrintingNilEnumFields(t *testing.T) { - pb := new(GoEnum) - _ = fmt.Sprintf("%+v", pb) -} - -// Verify that absent required fields cause Marshal/Unmarshal to return errors. -func TestRequiredFieldEnforcement(t *testing.T) { - pb := new(GoTestField) - _, err := Marshal(pb) - if err == nil { - t.Error("marshal: expected error, got nil") - } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Label") { - t.Errorf("marshal: bad error type: %v", err) - } - - // A slightly sneaky, yet valid, proto. It encodes the same required field twice, - // so simply counting the required fields is insufficient. - // field 1, encoding 2, value "hi" - buf := []byte("\x0A\x02hi\x0A\x02hi") - err = Unmarshal(buf, pb) - if err == nil { - t.Error("unmarshal: expected error, got nil") - } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Type") && !strings.Contains(err.Error(), "{Unknown}") { - // TODO: remove unknown cases once we commit to the new unmarshaler. - t.Errorf("unmarshal: bad error type: %v", err) - } -} - -// Verify that absent required fields in groups cause Marshal/Unmarshal to return errors. -func TestRequiredFieldEnforcementGroups(t *testing.T) { - pb := &GoTestRequiredGroupField{Group: &GoTestRequiredGroupField_Group{}} - if _, err := Marshal(pb); err == nil { - t.Error("marshal: expected error, got nil") - } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Group.Field") { - t.Errorf("marshal: bad error type: %v", err) - } - - buf := []byte{11, 12} - if err := Unmarshal(buf, pb); err == nil { - t.Error("unmarshal: expected error, got nil") - } else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Group.Field") && !strings.Contains(err.Error(), "Group.{Unknown}") { - t.Errorf("unmarshal: bad error type: %v", err) - } -} - -func TestTypedNilMarshal(t *testing.T) { - // A typed nil should return ErrNil and not crash. - { - var m *GoEnum - if _, err := Marshal(m); err != ErrNil { - t.Errorf("Marshal(%#v): got %v, want ErrNil", m, err) - } - } - - { - m := &Communique{Union: &Communique_Msg{nil}} - if _, err := Marshal(m); err == nil || err == ErrNil { - t.Errorf("Marshal(%#v): got %v, want errOneofHasNil", m, err) - } - } -} - -// A type that implements the Marshaler interface, but is not nillable. -type nonNillableInt uint64 - -func (nni nonNillableInt) Marshal() ([]byte, error) { - return EncodeVarint(uint64(nni)), nil -} - -type NNIMessage struct { - nni nonNillableInt -} - -func (*NNIMessage) Reset() {} -func (*NNIMessage) String() string { return "" } -func (*NNIMessage) ProtoMessage() {} - -type NMMessage struct{} - -func (*NMMessage) Reset() {} -func (*NMMessage) String() string { return "" } -func (*NMMessage) ProtoMessage() {} - -// Verify a type that uses the Marshaler interface, but has a nil pointer. -func TestNilMarshaler(t *testing.T) { - // Try a struct with a Marshaler field that is nil. - // It should be directly marshable. - nmm := new(NMMessage) - if _, err := Marshal(nmm); err != nil { - t.Error("unexpected error marshaling nmm: ", err) - } - - // Try a struct with a Marshaler field that is not nillable. - nnim := new(NNIMessage) - nnim.nni = 7 - var _ Marshaler = nnim.nni // verify it is truly a Marshaler - if _, err := Marshal(nnim); err != nil { - t.Error("unexpected error marshaling nnim: ", err) - } -} - -func TestAllSetDefaults(t *testing.T) { - // Exercise SetDefaults with all scalar field types. - m := &Defaults{ - // NaN != NaN, so override that here. - F_Nan: Float32(1.7), - } - expected := &Defaults{ - F_Bool: Bool(true), - F_Int32: Int32(32), - F_Int64: Int64(64), - F_Fixed32: Uint32(320), - F_Fixed64: Uint64(640), - F_Uint32: Uint32(3200), - F_Uint64: Uint64(6400), - F_Float: Float32(314159), - F_Double: Float64(271828), - F_String: String(`hello, "world!"` + "\n"), - F_Bytes: []byte("Bignose"), - F_Sint32: Int32(-32), - F_Sint64: Int64(-64), - F_Enum: Defaults_GREEN.Enum(), - F_Pinf: Float32(float32(math.Inf(1))), - F_Ninf: Float32(float32(math.Inf(-1))), - F_Nan: Float32(1.7), - StrZero: String(""), - } - SetDefaults(m) - if !Equal(m, expected) { - t.Errorf("SetDefaults failed\n got %v\nwant %v", m, expected) - } -} - -func TestSetDefaultsWithSetField(t *testing.T) { - // Check that a set value is not overridden. - m := &Defaults{ - F_Int32: Int32(12), - } - SetDefaults(m) - if v := m.GetF_Int32(); v != 12 { - t.Errorf("m.FInt32 = %v, want 12", v) - } -} - -func TestSetDefaultsWithSubMessage(t *testing.T) { - m := &OtherMessage{ - Key: Int64(123), - Inner: &InnerMessage{ - Host: String("gopher"), - }, - } - expected := &OtherMessage{ - Key: Int64(123), - Inner: &InnerMessage{ - Host: String("gopher"), - Port: Int32(4000), - }, - } - SetDefaults(m) - if !Equal(m, expected) { - t.Errorf("\n got %v\nwant %v", m, expected) - } -} - -func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) { - m := &MyMessage{ - RepInner: []*InnerMessage{{}}, - } - expected := &MyMessage{ - RepInner: []*InnerMessage{{ - Port: Int32(4000), - }}, - } - SetDefaults(m) - if !Equal(m, expected) { - t.Errorf("\n got %v\nwant %v", m, expected) - } -} - -func TestSetDefaultWithRepeatedNonMessage(t *testing.T) { - m := &MyMessage{ - Pet: []string{"turtle", "wombat"}, - } - expected := Clone(m) - SetDefaults(m) - if !Equal(m, expected) { - t.Errorf("\n got %v\nwant %v", m, expected) - } -} - -func TestMaximumTagNumber(t *testing.T) { - m := &MaxTag{ - LastField: String("natural goat essence"), - } - buf, err := Marshal(m) - if err != nil { - t.Fatalf("proto.Marshal failed: %v", err) - } - m2 := new(MaxTag) - if err := Unmarshal(buf, m2); err != nil { - t.Fatalf("proto.Unmarshal failed: %v", err) - } - if got, want := m2.GetLastField(), *m.LastField; got != want { - t.Errorf("got %q, want %q", got, want) - } -} - -func TestJSON(t *testing.T) { - m := &MyMessage{ - Count: Int32(4), - Pet: []string{"bunny", "kitty"}, - Inner: &InnerMessage{ - Host: String("cauchy"), - }, - Bikeshed: MyMessage_GREEN.Enum(), - } - const expected = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":1}` - - b, err := json.Marshal(m) - if err != nil { - t.Fatalf("json.Marshal failed: %v", err) - } - s := string(b) - if s != expected { - t.Errorf("got %s\nwant %s", s, expected) - } - - received := new(MyMessage) - if err := json.Unmarshal(b, received); err != nil { - t.Fatalf("json.Unmarshal failed: %v", err) - } - if !Equal(received, m) { - t.Fatalf("got %s, want %s", received, m) - } - - // Test unmarshalling of JSON with symbolic enum name. - const old = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":"GREEN"}` - received.Reset() - if err := json.Unmarshal([]byte(old), received); err != nil { - t.Fatalf("json.Unmarshal failed: %v", err) - } - if !Equal(received, m) { - t.Fatalf("got %s, want %s", received, m) - } -} - -func TestBadWireType(t *testing.T) { - b := []byte{7<<3 | 6} // field 7, wire type 6 - pb := new(OtherMessage) - if err := Unmarshal(b, pb); err == nil { - t.Errorf("Unmarshal did not fail") - } else if !strings.Contains(err.Error(), "unknown wire type") { - t.Errorf("wrong error: %v", err) - } -} - -func TestBytesWithInvalidLength(t *testing.T) { - // If a byte sequence has an invalid (negative) length, Unmarshal should not panic. - b := []byte{2<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0} - Unmarshal(b, new(MyMessage)) -} - -func TestLengthOverflow(t *testing.T) { - // Overflowing a length should not panic. - b := []byte{2<<3 | WireBytes, 1, 1, 3<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01} - Unmarshal(b, new(MyMessage)) -} - -func TestVarintOverflow(t *testing.T) { - // Overflowing a 64-bit length should not be allowed. - b := []byte{1<<3 | WireVarint, 0x01, 3<<3 | WireBytes, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01} - if err := Unmarshal(b, new(MyMessage)); err == nil { - t.Fatalf("Overflowed uint64 length without error") - } -} - -func TestBytesWithInvalidLengthInGroup(t *testing.T) { - // Overflowing a 64-bit length should not be allowed. - b := []byte{0xbb, 0x30, 0xb2, 0x30, 0xb0, 0xb2, 0x83, 0xf1, 0xb0, 0xb2, 0xef, 0xbf, 0xbd, 0x01} - if err := Unmarshal(b, new(MyMessage)); err == nil { - t.Fatalf("Overflowed uint64 length without error") - } -} - -func TestUnmarshalFuzz(t *testing.T) { - const N = 1000 - seed := time.Now().UnixNano() - t.Logf("RNG seed is %d", seed) - rng := rand.New(rand.NewSource(seed)) - buf := make([]byte, 20) - for i := 0; i < N; i++ { - for j := range buf { - buf[j] = byte(rng.Intn(256)) - } - fuzzUnmarshal(t, buf) - } -} - -func TestMergeMessages(t *testing.T) { - pb := &MessageList{Message: []*MessageList_Message{{Name: String("x"), Count: Int32(1)}}} - data, err := Marshal(pb) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - - pb1 := new(MessageList) - if err := Unmarshal(data, pb1); err != nil { - t.Fatalf("first Unmarshal: %v", err) - } - if err := Unmarshal(data, pb1); err != nil { - t.Fatalf("second Unmarshal: %v", err) - } - if len(pb1.Message) != 1 { - t.Errorf("two Unmarshals produced %d Messages, want 1", len(pb1.Message)) - } - - pb2 := new(MessageList) - if err := UnmarshalMerge(data, pb2); err != nil { - t.Fatalf("first UnmarshalMerge: %v", err) - } - if err := UnmarshalMerge(data, pb2); err != nil { - t.Fatalf("second UnmarshalMerge: %v", err) - } - if len(pb2.Message) != 2 { - t.Errorf("two UnmarshalMerges produced %d Messages, want 2", len(pb2.Message)) - } -} - -func TestExtensionMarshalOrder(t *testing.T) { - m := &MyMessage{Count: Int(123)} - if err := SetExtension(m, E_Ext_More, &Ext{Data: String("alpha")}); err != nil { - t.Fatalf("SetExtension: %v", err) - } - if err := SetExtension(m, E_Ext_Text, String("aleph")); err != nil { - t.Fatalf("SetExtension: %v", err) - } - if err := SetExtension(m, E_Ext_Number, Int32(1)); err != nil { - t.Fatalf("SetExtension: %v", err) - } - - // Serialize m several times, and check we get the same bytes each time. - var orig []byte - for i := 0; i < 100; i++ { - b, err := Marshal(m) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - if i == 0 { - orig = b - continue - } - if !bytes.Equal(b, orig) { - t.Errorf("Bytes differ on attempt #%d", i) - } - } -} - -func TestExtensionMapFieldMarshalDeterministic(t *testing.T) { - m := &MyMessage{Count: Int(123)} - if err := SetExtension(m, E_Ext_More, &Ext{MapField: map[int32]int32{1: 1, 2: 2, 3: 3, 4: 4}}); err != nil { - t.Fatalf("SetExtension: %v", err) - } - marshal := func(m Message) []byte { - var b Buffer - b.SetDeterministic(true) - if err := b.Marshal(m); err != nil { - t.Fatalf("Marshal failed: %v", err) - } - return b.Bytes() - } - - want := marshal(m) - for i := 0; i < 100; i++ { - if got := marshal(m); !bytes.Equal(got, want) { - t.Errorf("Marshal produced inconsistent output with determinism enabled (pass %d).\n got %v\nwant %v", i, got, want) - } - } -} - -// Many extensions, because small maps might not iterate differently on each iteration. -var exts = []*ExtensionDesc{ - E_X201, - E_X202, - E_X203, - E_X204, - E_X205, - E_X206, - E_X207, - E_X208, - E_X209, - E_X210, - E_X211, - E_X212, - E_X213, - E_X214, - E_X215, - E_X216, - E_X217, - E_X218, - E_X219, - E_X220, - E_X221, - E_X222, - E_X223, - E_X224, - E_X225, - E_X226, - E_X227, - E_X228, - E_X229, - E_X230, - E_X231, - E_X232, - E_X233, - E_X234, - E_X235, - E_X236, - E_X237, - E_X238, - E_X239, - E_X240, - E_X241, - E_X242, - E_X243, - E_X244, - E_X245, - E_X246, - E_X247, - E_X248, - E_X249, - E_X250, -} - -func TestMessageSetMarshalOrder(t *testing.T) { - m := &MyMessageSet{} - for _, x := range exts { - if err := SetExtension(m, x, &Empty{}); err != nil { - t.Fatalf("SetExtension: %v", err) - } - } - - buf, err := Marshal(m) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - - // Serialize m several times, and check we get the same bytes each time. - for i := 0; i < 10; i++ { - b1, err := Marshal(m) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - if !bytes.Equal(b1, buf) { - t.Errorf("Bytes differ on re-Marshal #%d", i) - } - - m2 := &MyMessageSet{} - if err := Unmarshal(buf, m2); err != nil { - t.Errorf("Unmarshal: %v", err) - } - b2, err := Marshal(m2) - if err != nil { - t.Errorf("re-Marshal: %v", err) - } - if !bytes.Equal(b2, buf) { - t.Errorf("Bytes differ on round-trip #%d", i) - } - } -} - -func TestUnmarshalMergesMessages(t *testing.T) { - // If a nested message occurs twice in the input, - // the fields should be merged when decoding. - a := &OtherMessage{ - Key: Int64(123), - Inner: &InnerMessage{ - Host: String("polhode"), - Port: Int32(1234), - }, - } - aData, err := Marshal(a) - if err != nil { - t.Fatalf("Marshal(a): %v", err) - } - b := &OtherMessage{ - Weight: Float32(1.2), - Inner: &InnerMessage{ - Host: String("herpolhode"), - Connected: Bool(true), - }, - } - bData, err := Marshal(b) - if err != nil { - t.Fatalf("Marshal(b): %v", err) - } - want := &OtherMessage{ - Key: Int64(123), - Weight: Float32(1.2), - Inner: &InnerMessage{ - Host: String("herpolhode"), - Port: Int32(1234), - Connected: Bool(true), - }, - } - got := new(OtherMessage) - if err := Unmarshal(append(aData, bData...), got); err != nil { - t.Fatalf("Unmarshal: %v", err) - } - if !Equal(got, want) { - t.Errorf("\n got %v\nwant %v", got, want) - } -} - -func TestUnmarshalMergesGroups(t *testing.T) { - // If a nested group occurs twice in the input, - // the fields should be merged when decoding. - a := &GroupNew{ - G: &GroupNew_G{ - X: Int32(7), - Y: Int32(8), - }, - } - aData, err := Marshal(a) - if err != nil { - t.Fatalf("Marshal(a): %v", err) - } - b := &GroupNew{ - G: &GroupNew_G{ - X: Int32(9), - }, - } - bData, err := Marshal(b) - if err != nil { - t.Fatalf("Marshal(b): %v", err) - } - want := &GroupNew{ - G: &GroupNew_G{ - X: Int32(9), - Y: Int32(8), - }, - } - got := new(GroupNew) - if err := Unmarshal(append(aData, bData...), got); err != nil { - t.Fatalf("Unmarshal: %v", err) - } - if !Equal(got, want) { - t.Errorf("\n got %v\nwant %v", got, want) - } -} - -func TestEncodingSizes(t *testing.T) { - tests := []struct { - m Message - n int - }{ - {&Defaults{F_Int32: Int32(math.MaxInt32)}, 6}, - {&Defaults{F_Int32: Int32(math.MinInt32)}, 11}, - {&Defaults{F_Uint32: Uint32(uint32(math.MaxInt32) + 1)}, 6}, - {&Defaults{F_Uint32: Uint32(math.MaxUint32)}, 6}, - } - for _, test := range tests { - b, err := Marshal(test.m) - if err != nil { - t.Errorf("Marshal(%v): %v", test.m, err) - continue - } - if len(b) != test.n { - t.Errorf("Marshal(%v) yielded %d bytes, want %d bytes", test.m, len(b), test.n) - } - } -} - -func TestRequiredNotSetError(t *testing.T) { - pb := initGoTest(false) - pb.RequiredField.Label = nil - pb.F_Int32Required = nil - pb.F_Int64Required = nil - - expected := "0807" + // field 1, encoding 0, value 7 - "2206" + "120474797065" + // field 4, encoding 2 (GoTestField) - "5001" + // field 10, encoding 0, value 1 - "6d20000000" + // field 13, encoding 5, value 0x20 - "714000000000000000" + // field 14, encoding 1, value 0x40 - "78a019" + // field 15, encoding 0, value 0xca0 = 3232 - "8001c032" + // field 16, encoding 0, value 0x1940 = 6464 - "8d0100004a45" + // field 17, encoding 5, value 3232.0 - "9101000000000040b940" + // field 18, encoding 1, value 6464.0 - "9a0106" + "737472696e67" + // field 19, encoding 2, string "string" - "b304" + // field 70, encoding 3, start group - "ba0408" + "7265717569726564" + // field 71, encoding 2, string "required" - "b404" + // field 70, encoding 4, end group - "aa0605" + "6279746573" + // field 101, encoding 2, string "bytes" - "b0063f" + // field 102, encoding 0, 0x3f zigzag32 - "b8067f" + // field 103, encoding 0, 0x7f zigzag64 - "c506e0ffffff" + // field 104, encoding 5, -32 fixed32 - "c906c0ffffffffffffff" // field 105, encoding 1, -64 fixed64 - - o := old() - bytes, err := Marshal(pb) - if _, ok := err.(*RequiredNotSetError); !ok { - fmt.Printf("marshal-1 err = %v, want *RequiredNotSetError", err) - o.DebugPrint("", bytes) - t.Fatalf("expected = %s", expected) - } - if !strings.Contains(err.Error(), "RequiredField.Label") { - t.Errorf("marshal-1 wrong err msg: %v", err) - } - if !equal(bytes, expected, t) { - o.DebugPrint("neq 1", bytes) - t.Fatalf("expected = %s", expected) - } - - // Now test Unmarshal by recreating the original buffer. - pbd := new(GoTest) - err = Unmarshal(bytes, pbd) - if _, ok := err.(*RequiredNotSetError); !ok { - t.Fatalf("unmarshal err = %v, want *RequiredNotSetError", err) - o.DebugPrint("", bytes) - t.Fatalf("string = %s", expected) - } - if !strings.Contains(err.Error(), "RequiredField.Label") && !strings.Contains(err.Error(), "RequiredField.{Unknown}") { - t.Errorf("unmarshal wrong err msg: %v", err) - } - bytes, err = Marshal(pbd) - if _, ok := err.(*RequiredNotSetError); !ok { - t.Errorf("marshal-2 err = %v, want *RequiredNotSetError", err) - o.DebugPrint("", bytes) - t.Fatalf("string = %s", expected) - } - if !strings.Contains(err.Error(), "RequiredField.Label") { - t.Errorf("marshal-2 wrong err msg: %v", err) - } - if !equal(bytes, expected, t) { - o.DebugPrint("neq 2", bytes) - t.Fatalf("string = %s", expected) - } -} - -func TestRequiredNotSetErrorWithBadWireTypes(t *testing.T) { - // Required field expects a varint, and properly found a varint. - if err := Unmarshal([]byte{0x08, 0x00}, new(GoEnum)); err != nil { - t.Errorf("Unmarshal = %v, want nil", err) - } - // Required field expects a varint, but found a fixed32 instead. - if err := Unmarshal([]byte{0x0d, 0x00, 0x00, 0x00, 0x00}, new(GoEnum)); err == nil { - t.Errorf("Unmarshal = nil, want RequiredNotSetError") - } - // Required field expects a varint, and found both a varint and fixed32 (ignored). - m := new(GoEnum) - if err := Unmarshal([]byte{0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00}, m); err != nil { - t.Errorf("Unmarshal = %v, want nil", err) - } - if !bytes.Equal(m.XXX_unrecognized, []byte{0x0d, 0x00, 0x00, 0x00, 0x00}) { - t.Errorf("expected fixed32 to appear as unknown bytes: %x", m.XXX_unrecognized) - } -} - -func fuzzUnmarshal(t *testing.T, data []byte) { - defer func() { - if e := recover(); e != nil { - t.Errorf("These bytes caused a panic: %+v", data) - t.Logf("Stack:\n%s", debug.Stack()) - t.FailNow() - } - }() - - pb := new(MyMessage) - Unmarshal(data, pb) -} - -func TestMapFieldMarshal(t *testing.T) { - m := &MessageWithMap{ - NameMapping: map[int32]string{ - 1: "Rob", - 4: "Ian", - 8: "Dave", - }, - } - b, err := Marshal(m) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - - // b should be the concatenation of these three byte sequences in some order. - parts := []string{ - "\n\a\b\x01\x12\x03Rob", - "\n\a\b\x04\x12\x03Ian", - "\n\b\b\x08\x12\x04Dave", - } - ok := false - for i := range parts { - for j := range parts { - if j == i { - continue - } - for k := range parts { - if k == i || k == j { - continue - } - try := parts[i] + parts[j] + parts[k] - if bytes.Equal(b, []byte(try)) { - ok = true - break - } - } - } - } - if !ok { - t.Fatalf("Incorrect Marshal output.\n got %q\nwant %q (or a permutation of that)", b, parts[0]+parts[1]+parts[2]) - } - t.Logf("FYI b: %q", b) - - (new(Buffer)).DebugPrint("Dump of b", b) -} - -func TestMapFieldDeterministicMarshal(t *testing.T) { - m := &MessageWithMap{ - NameMapping: map[int32]string{ - 1: "Rob", - 4: "Ian", - 8: "Dave", - }, - } - - marshal := func(m Message) []byte { - var b Buffer - b.SetDeterministic(true) - if err := b.Marshal(m); err != nil { - t.Fatalf("Marshal failed: %v", err) - } - return b.Bytes() - } - - want := marshal(m) - for i := 0; i < 10; i++ { - if got := marshal(m); !bytes.Equal(got, want) { - t.Errorf("Marshal produced inconsistent output with determinism enabled (pass %d).\n got %v\nwant %v", i, got, want) - } - } -} - -func TestMapFieldRoundTrips(t *testing.T) { - m := &MessageWithMap{ - NameMapping: map[int32]string{ - 1: "Rob", - 4: "Ian", - 8: "Dave", - }, - MsgMapping: map[int64]*FloatingPoint{ - 0x7001: {F: Float64(2.0)}, - }, - ByteMapping: map[bool][]byte{ - false: []byte("that's not right!"), - true: []byte("aye, 'tis true!"), - }, - } - b, err := Marshal(m) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - t.Logf("FYI b: %q", b) - m2 := new(MessageWithMap) - if err := Unmarshal(b, m2); err != nil { - t.Fatalf("Unmarshal: %v", err) - } - if !Equal(m, m2) { - t.Errorf("Map did not survive a round trip.\ninitial: %v\n final: %v", m, m2) - } -} - -func TestMapFieldWithNil(t *testing.T) { - m1 := &MessageWithMap{ - MsgMapping: map[int64]*FloatingPoint{ - 1: nil, - }, - } - b, err := Marshal(m1) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - m2 := new(MessageWithMap) - if err := Unmarshal(b, m2); err != nil { - t.Fatalf("Unmarshal: %v, got these bytes: %v", err, b) - } - if v, ok := m2.MsgMapping[1]; !ok { - t.Error("msg_mapping[1] not present") - } else if v != nil { - t.Errorf("msg_mapping[1] not nil: %v", v) - } -} - -func TestMapFieldWithNilBytes(t *testing.T) { - m1 := &MessageWithMap{ - ByteMapping: map[bool][]byte{ - false: {}, - true: nil, - }, - } - n := Size(m1) - b, err := Marshal(m1) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - if n != len(b) { - t.Errorf("Size(m1) = %d; want len(Marshal(m1)) = %d", n, len(b)) - } - m2 := new(MessageWithMap) - if err := Unmarshal(b, m2); err != nil { - t.Fatalf("Unmarshal: %v, got these bytes: %v", err, b) - } - if v, ok := m2.ByteMapping[false]; !ok { - t.Error("byte_mapping[false] not present") - } else if len(v) != 0 { - t.Errorf("byte_mapping[false] not empty: %#v", v) - } - if v, ok := m2.ByteMapping[true]; !ok { - t.Error("byte_mapping[true] not present") - } else if len(v) != 0 { - t.Errorf("byte_mapping[true] not empty: %#v", v) - } -} - -func TestDecodeMapFieldMissingKey(t *testing.T) { - b := []byte{ - 0x0A, 0x03, // message, tag 1 (name_mapping), of length 3 bytes - // no key - 0x12, 0x01, 0x6D, // string value of length 1 byte, value "m" - } - got := &MessageWithMap{} - err := Unmarshal(b, got) - if err != nil { - t.Fatalf("failed to marshal map with missing key: %v", err) - } - want := &MessageWithMap{NameMapping: map[int32]string{0: "m"}} - if !Equal(got, want) { - t.Errorf("Unmarshaled map with no key was not as expected. got: %v, want %v", got, want) - } -} - -func TestDecodeMapFieldMissingValue(t *testing.T) { - b := []byte{ - 0x0A, 0x02, // message, tag 1 (name_mapping), of length 2 bytes - 0x08, 0x01, // varint key, value 1 - // no value - } - got := &MessageWithMap{} - err := Unmarshal(b, got) - if err != nil { - t.Fatalf("failed to marshal map with missing value: %v", err) - } - want := &MessageWithMap{NameMapping: map[int32]string{1: ""}} - if !Equal(got, want) { - t.Errorf("Unmarshaled map with no value was not as expected. got: %v, want %v", got, want) - } -} - -func TestOneof(t *testing.T) { - m := &Communique{} - b, err := Marshal(m) - if err != nil { - t.Fatalf("Marshal of empty message with oneof: %v", err) - } - if len(b) != 0 { - t.Errorf("Marshal of empty message yielded too many bytes: %v", b) - } - - m = &Communique{ - Union: &Communique_Name{"Barry"}, - } - - // Round-trip. - b, err = Marshal(m) - if err != nil { - t.Fatalf("Marshal of message with oneof: %v", err) - } - if len(b) != 7 { // name tag/wire (1) + name len (1) + name (5) - t.Errorf("Incorrect marshal of message with oneof: %v", b) - } - m.Reset() - if err := Unmarshal(b, m); err != nil { - t.Fatalf("Unmarshal of message with oneof: %v", err) - } - if x, ok := m.Union.(*Communique_Name); !ok || x.Name != "Barry" { - t.Errorf("After round trip, Union = %+v", m.Union) - } - if name := m.GetName(); name != "Barry" { - t.Errorf("After round trip, GetName = %q, want %q", name, "Barry") - } - - // Let's try with a message in the oneof. - m.Union = &Communique_Msg{&Strings{StringField: String("deep deep string")}} - b, err = Marshal(m) - if err != nil { - t.Fatalf("Marshal of message with oneof set to message: %v", err) - } - if len(b) != 20 { // msg tag/wire (1) + msg len (1) + msg (1 + 1 + 16) - t.Errorf("Incorrect marshal of message with oneof set to message: %v", b) - } - m.Reset() - if err := Unmarshal(b, m); err != nil { - t.Fatalf("Unmarshal of message with oneof set to message: %v", err) - } - ss, ok := m.Union.(*Communique_Msg) - if !ok || ss.Msg.GetStringField() != "deep deep string" { - t.Errorf("After round trip with oneof set to message, Union = %+v", m.Union) - } -} - -func TestOneofNilBytes(t *testing.T) { - // A oneof with nil byte slice should marshal to tag + 0 (size), with no error. - m := &Communique{Union: &Communique_Data{Data: nil}} - b, err := Marshal(m) - if err != nil { - t.Fatalf("Marshal failed: %v", err) - } - want := []byte{ - 7<<3 | 2, // tag 7, wire type 2 - 0, // size - } - if !bytes.Equal(b, want) { - t.Errorf("Wrong result of Marshal: got %x, want %x", b, want) - } -} - -func TestInefficientPackedBool(t *testing.T) { - // https://github.com/golang/protobuf/issues/76 - inp := []byte{ - 0x12, 0x02, // 0x12 = 2<<3|2; 2 bytes - // Usually a bool should take a single byte, - // but it is permitted to be any varint. - 0xb9, 0x30, - } - if err := Unmarshal(inp, new(MoreRepeated)); err != nil { - t.Error(err) - } -} - -// Make sure pure-reflect-based implementation handles -// []int32-[]enum conversion correctly. -func TestRepeatedEnum2(t *testing.T) { - pb := &RepeatedEnum{ - Color: []RepeatedEnum_Color{RepeatedEnum_RED}, - } - b, err := Marshal(pb) - if err != nil { - t.Fatalf("Marshal failed: %v", err) - } - x := new(RepeatedEnum) - err = Unmarshal(b, x) - if err != nil { - t.Fatalf("Unmarshal failed: %v", err) - } - if !Equal(pb, x) { - t.Errorf("Incorrect result: want: %v got: %v", pb, x) - } -} - -// TestConcurrentMarshal makes sure that it is safe to marshal -// same message in multiple goroutines concurrently. -func TestConcurrentMarshal(t *testing.T) { - pb := initGoTest(true) - const N = 100 - b := make([][]byte, N) - - var wg sync.WaitGroup - for i := 0; i < N; i++ { - wg.Add(1) - go func(i int) { - defer wg.Done() - var err error - b[i], err = Marshal(pb) - if err != nil { - t.Errorf("marshal error: %v", err) - } - }(i) - } - - wg.Wait() - for i := 1; i < N; i++ { - if !bytes.Equal(b[0], b[i]) { - t.Errorf("concurrent marshal result not same: b[0] = %v, b[%d] = %v", b[0], i, b[i]) - } - } -} - -func TestInvalidUTF8(t *testing.T) { - const wire = "\x12\x04\xde\xea\xca\xfe" - - var m GoTest - if err := Unmarshal([]byte(wire), &m); err == nil { - t.Errorf("Unmarshal error: got nil, want non-nil") - } - - m.Reset() - m.Table = String(wire[2:]) - if _, err := Marshal(&m); err == nil { - t.Errorf("Marshal error: got nil, want non-nil") - } -} - -// Benchmarks - -func testMsg() *GoTest { - pb := initGoTest(true) - const N = 1000 // Internally the library starts much smaller. - pb.F_Int32Repeated = make([]int32, N) - pb.F_DoubleRepeated = make([]float64, N) - for i := 0; i < N; i++ { - pb.F_Int32Repeated[i] = int32(i) - pb.F_DoubleRepeated[i] = float64(i) - } - return pb -} - -func bytesMsg() *GoTest { - pb := initGoTest(true) - buf := make([]byte, 4000) - for i := range buf { - buf[i] = byte(i) - } - pb.F_BytesDefaulted = buf - return pb -} - -func benchmarkMarshal(b *testing.B, pb Message, marshal func(Message) ([]byte, error)) { - d, _ := marshal(pb) - b.SetBytes(int64(len(d))) - b.ResetTimer() - for i := 0; i < b.N; i++ { - marshal(pb) - } -} - -func benchmarkBufferMarshal(b *testing.B, pb Message) { - p := NewBuffer(nil) - benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) { - p.Reset() - err := p.Marshal(pb0) - return p.Bytes(), err - }) -} - -func benchmarkSize(b *testing.B, pb Message) { - benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) { - Size(pb) - return nil, nil - }) -} - -func newOf(pb Message) Message { - in := reflect.ValueOf(pb) - if in.IsNil() { - return pb - } - return reflect.New(in.Type().Elem()).Interface().(Message) -} - -func benchmarkUnmarshal(b *testing.B, pb Message, unmarshal func([]byte, Message) error) { - d, _ := Marshal(pb) - b.SetBytes(int64(len(d))) - pbd := newOf(pb) - - b.ResetTimer() - for i := 0; i < b.N; i++ { - unmarshal(d, pbd) - } -} - -func benchmarkBufferUnmarshal(b *testing.B, pb Message) { - p := NewBuffer(nil) - benchmarkUnmarshal(b, pb, func(d []byte, pb0 Message) error { - p.SetBuf(d) - return p.Unmarshal(pb0) - }) -} - -// Benchmark{Marshal,BufferMarshal,Size,Unmarshal,BufferUnmarshal}{,Bytes} - -func BenchmarkMarshal(b *testing.B) { - benchmarkMarshal(b, testMsg(), Marshal) -} - -func BenchmarkBufferMarshal(b *testing.B) { - benchmarkBufferMarshal(b, testMsg()) -} - -func BenchmarkSize(b *testing.B) { - benchmarkSize(b, testMsg()) -} - -func BenchmarkUnmarshal(b *testing.B) { - benchmarkUnmarshal(b, testMsg(), Unmarshal) -} - -func BenchmarkBufferUnmarshal(b *testing.B) { - benchmarkBufferUnmarshal(b, testMsg()) -} - -func BenchmarkMarshalBytes(b *testing.B) { - benchmarkMarshal(b, bytesMsg(), Marshal) -} - -func BenchmarkBufferMarshalBytes(b *testing.B) { - benchmarkBufferMarshal(b, bytesMsg()) -} - -func BenchmarkSizeBytes(b *testing.B) { - benchmarkSize(b, bytesMsg()) -} - -func BenchmarkUnmarshalBytes(b *testing.B) { - benchmarkUnmarshal(b, bytesMsg(), Unmarshal) -} - -func BenchmarkBufferUnmarshalBytes(b *testing.B) { - benchmarkBufferUnmarshal(b, bytesMsg()) -} - -func BenchmarkUnmarshalUnrecognizedFields(b *testing.B) { - b.StopTimer() - pb := initGoTestField() - skip := &GoSkipTest{ - SkipInt32: Int32(32), - SkipFixed32: Uint32(3232), - SkipFixed64: Uint64(6464), - SkipString: String("skipper"), - Skipgroup: &GoSkipTest_SkipGroup{ - GroupInt32: Int32(75), - GroupString: String("wxyz"), - }, - } - - pbd := new(GoTestField) - p := NewBuffer(nil) - p.Marshal(pb) - p.Marshal(skip) - p2 := NewBuffer(nil) - - b.StartTimer() - for i := 0; i < b.N; i++ { - p2.SetBuf(p.Bytes()) - p2.Unmarshal(pbd) - } -} diff --git a/vendor/github.com/golang/protobuf/proto/any_test.go b/vendor/github.com/golang/protobuf/proto/any_test.go deleted file mode 100644 index 56fc97c..0000000 --- a/vendor/github.com/golang/protobuf/proto/any_test.go +++ /dev/null @@ -1,300 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto_test - -import ( - "strings" - "testing" - - "github.com/golang/protobuf/proto" - - pb "github.com/golang/protobuf/proto/proto3_proto" - testpb "github.com/golang/protobuf/proto/test_proto" - anypb "github.com/golang/protobuf/ptypes/any" -) - -var ( - expandedMarshaler = proto.TextMarshaler{ExpandAny: true} - expandedCompactMarshaler = proto.TextMarshaler{Compact: true, ExpandAny: true} -) - -// anyEqual reports whether two messages which may be google.protobuf.Any or may -// contain google.protobuf.Any fields are equal. We can't use proto.Equal for -// comparison, because semantically equivalent messages may be marshaled to -// binary in different tag order. Instead, trust that TextMarshaler with -// ExpandAny option works and compare the text marshaling results. -func anyEqual(got, want proto.Message) bool { - // if messages are proto.Equal, no need to marshal. - if proto.Equal(got, want) { - return true - } - g := expandedMarshaler.Text(got) - w := expandedMarshaler.Text(want) - return g == w -} - -type golden struct { - m proto.Message - t, c string -} - -var goldenMessages = makeGolden() - -func makeGolden() []golden { - nested := &pb.Nested{Bunny: "Monty"} - nb, err := proto.Marshal(nested) - if err != nil { - panic(err) - } - m1 := &pb.Message{ - Name: "David", - ResultCount: 47, - Anything: &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(nested), Value: nb}, - } - m2 := &pb.Message{ - Name: "David", - ResultCount: 47, - Anything: &anypb.Any{TypeUrl: "http://[::1]/type.googleapis.com/" + proto.MessageName(nested), Value: nb}, - } - m3 := &pb.Message{ - Name: "David", - ResultCount: 47, - Anything: &anypb.Any{TypeUrl: `type.googleapis.com/"/` + proto.MessageName(nested), Value: nb}, - } - m4 := &pb.Message{ - Name: "David", - ResultCount: 47, - Anything: &anypb.Any{TypeUrl: "type.googleapis.com/a/path/" + proto.MessageName(nested), Value: nb}, - } - m5 := &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(nested), Value: nb} - - any1 := &testpb.MyMessage{Count: proto.Int32(47), Name: proto.String("David")} - proto.SetExtension(any1, testpb.E_Ext_More, &testpb.Ext{Data: proto.String("foo")}) - proto.SetExtension(any1, testpb.E_Ext_Text, proto.String("bar")) - any1b, err := proto.Marshal(any1) - if err != nil { - panic(err) - } - any2 := &testpb.MyMessage{Count: proto.Int32(42), Bikeshed: testpb.MyMessage_GREEN.Enum(), RepBytes: [][]byte{[]byte("roboto")}} - proto.SetExtension(any2, testpb.E_Ext_More, &testpb.Ext{Data: proto.String("baz")}) - any2b, err := proto.Marshal(any2) - if err != nil { - panic(err) - } - m6 := &pb.Message{ - Name: "David", - ResultCount: 47, - Anything: &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any1), Value: any1b}, - ManyThings: []*anypb.Any{ - &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any2), Value: any2b}, - &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any1), Value: any1b}, - }, - } - - const ( - m1Golden = ` -name: "David" -result_count: 47 -anything: < - [type.googleapis.com/proto3_proto.Nested]: < - bunny: "Monty" - > -> -` - m2Golden = ` -name: "David" -result_count: 47 -anything: < - ["http://[::1]/type.googleapis.com/proto3_proto.Nested"]: < - bunny: "Monty" - > -> -` - m3Golden = ` -name: "David" -result_count: 47 -anything: < - ["type.googleapis.com/\"/proto3_proto.Nested"]: < - bunny: "Monty" - > -> -` - m4Golden = ` -name: "David" -result_count: 47 -anything: < - [type.googleapis.com/a/path/proto3_proto.Nested]: < - bunny: "Monty" - > -> -` - m5Golden = ` -[type.googleapis.com/proto3_proto.Nested]: < - bunny: "Monty" -> -` - m6Golden = ` -name: "David" -result_count: 47 -anything: < - [type.googleapis.com/test_proto.MyMessage]: < - count: 47 - name: "David" - [test_proto.Ext.more]: < - data: "foo" - > - [test_proto.Ext.text]: "bar" - > -> -many_things: < - [type.googleapis.com/test_proto.MyMessage]: < - count: 42 - bikeshed: GREEN - rep_bytes: "roboto" - [test_proto.Ext.more]: < - data: "baz" - > - > -> -many_things: < - [type.googleapis.com/test_proto.MyMessage]: < - count: 47 - name: "David" - [test_proto.Ext.more]: < - data: "foo" - > - [test_proto.Ext.text]: "bar" - > -> -` - ) - return []golden{ - {m1, strings.TrimSpace(m1Golden) + "\n", strings.TrimSpace(compact(m1Golden)) + " "}, - {m2, strings.TrimSpace(m2Golden) + "\n", strings.TrimSpace(compact(m2Golden)) + " "}, - {m3, strings.TrimSpace(m3Golden) + "\n", strings.TrimSpace(compact(m3Golden)) + " "}, - {m4, strings.TrimSpace(m4Golden) + "\n", strings.TrimSpace(compact(m4Golden)) + " "}, - {m5, strings.TrimSpace(m5Golden) + "\n", strings.TrimSpace(compact(m5Golden)) + " "}, - {m6, strings.TrimSpace(m6Golden) + "\n", strings.TrimSpace(compact(m6Golden)) + " "}, - } -} - -func TestMarshalGolden(t *testing.T) { - for _, tt := range goldenMessages { - if got, want := expandedMarshaler.Text(tt.m), tt.t; got != want { - t.Errorf("message %v: got:\n%s\nwant:\n%s", tt.m, got, want) - } - if got, want := expandedCompactMarshaler.Text(tt.m), tt.c; got != want { - t.Errorf("message %v: got:\n`%s`\nwant:\n`%s`", tt.m, got, want) - } - } -} - -func TestUnmarshalGolden(t *testing.T) { - for _, tt := range goldenMessages { - want := tt.m - got := proto.Clone(tt.m) - got.Reset() - if err := proto.UnmarshalText(tt.t, got); err != nil { - t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.t, err) - } - if !anyEqual(got, want) { - t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.t, got, want) - } - got.Reset() - if err := proto.UnmarshalText(tt.c, got); err != nil { - t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.c, err) - } - if !anyEqual(got, want) { - t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.c, got, want) - } - } -} - -func TestMarshalUnknownAny(t *testing.T) { - m := &pb.Message{ - Anything: &anypb.Any{ - TypeUrl: "foo", - Value: []byte("bar"), - }, - } - want := `anything: < - type_url: "foo" - value: "bar" -> -` - got := expandedMarshaler.Text(m) - if got != want { - t.Errorf("got\n`%s`\nwant\n`%s`", got, want) - } -} - -func TestAmbiguousAny(t *testing.T) { - pb := &anypb.Any{} - err := proto.UnmarshalText(` - type_url: "ttt/proto3_proto.Nested" - value: "\n\x05Monty" - `, pb) - t.Logf("result: %v (error: %v)", expandedMarshaler.Text(pb), err) - if err != nil { - t.Errorf("failed to parse ambiguous Any message: %v", err) - } -} - -func TestUnmarshalOverwriteAny(t *testing.T) { - pb := &anypb.Any{} - err := proto.UnmarshalText(` - [type.googleapis.com/a/path/proto3_proto.Nested]: < - bunny: "Monty" - > - [type.googleapis.com/a/path/proto3_proto.Nested]: < - bunny: "Rabbit of Caerbannog" - > - `, pb) - want := `line 7: Any message unpacked multiple times, or "type_url" already set` - if err.Error() != want { - t.Errorf("incorrect error.\nHave: %v\nWant: %v", err.Error(), want) - } -} - -func TestUnmarshalAnyMixAndMatch(t *testing.T) { - pb := &anypb.Any{} - err := proto.UnmarshalText(` - value: "\n\x05Monty" - [type.googleapis.com/a/path/proto3_proto.Nested]: < - bunny: "Rabbit of Caerbannog" - > - `, pb) - want := `line 5: Any message unpacked multiple times, or "value" already set` - if err.Error() != want { - t.Errorf("incorrect error.\nHave: %v\nWant: %v", err.Error(), want) - } -} diff --git a/vendor/github.com/golang/protobuf/proto/clone_test.go b/vendor/github.com/golang/protobuf/proto/clone_test.go deleted file mode 100644 index 0d3b127..0000000 --- a/vendor/github.com/golang/protobuf/proto/clone_test.go +++ /dev/null @@ -1,390 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2011 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto_test - -import ( - "testing" - - "github.com/golang/protobuf/proto" - - proto3pb "github.com/golang/protobuf/proto/proto3_proto" - pb "github.com/golang/protobuf/proto/test_proto" -) - -var cloneTestMessage = &pb.MyMessage{ - Count: proto.Int32(42), - Name: proto.String("Dave"), - Pet: []string{"bunny", "kitty", "horsey"}, - Inner: &pb.InnerMessage{ - Host: proto.String("niles"), - Port: proto.Int32(9099), - Connected: proto.Bool(true), - }, - Others: []*pb.OtherMessage{ - { - Value: []byte("some bytes"), - }, - }, - Somegroup: &pb.MyMessage_SomeGroup{ - GroupField: proto.Int32(6), - }, - RepBytes: [][]byte{[]byte("sham"), []byte("wow")}, -} - -func init() { - ext := &pb.Ext{ - Data: proto.String("extension"), - } - if err := proto.SetExtension(cloneTestMessage, pb.E_Ext_More, ext); err != nil { - panic("SetExtension: " + err.Error()) - } -} - -func TestClone(t *testing.T) { - m := proto.Clone(cloneTestMessage).(*pb.MyMessage) - if !proto.Equal(m, cloneTestMessage) { - t.Fatalf("Clone(%v) = %v", cloneTestMessage, m) - } - - // Verify it was a deep copy. - *m.Inner.Port++ - if proto.Equal(m, cloneTestMessage) { - t.Error("Mutating clone changed the original") - } - // Byte fields and repeated fields should be copied. - if &m.Pet[0] == &cloneTestMessage.Pet[0] { - t.Error("Pet: repeated field not copied") - } - if &m.Others[0] == &cloneTestMessage.Others[0] { - t.Error("Others: repeated field not copied") - } - if &m.Others[0].Value[0] == &cloneTestMessage.Others[0].Value[0] { - t.Error("Others[0].Value: bytes field not copied") - } - if &m.RepBytes[0] == &cloneTestMessage.RepBytes[0] { - t.Error("RepBytes: repeated field not copied") - } - if &m.RepBytes[0][0] == &cloneTestMessage.RepBytes[0][0] { - t.Error("RepBytes[0]: bytes field not copied") - } -} - -func TestCloneNil(t *testing.T) { - var m *pb.MyMessage - if c := proto.Clone(m); !proto.Equal(m, c) { - t.Errorf("Clone(%v) = %v", m, c) - } -} - -var mergeTests = []struct { - src, dst, want proto.Message -}{ - { - src: &pb.MyMessage{ - Count: proto.Int32(42), - }, - dst: &pb.MyMessage{ - Name: proto.String("Dave"), - }, - want: &pb.MyMessage{ - Count: proto.Int32(42), - Name: proto.String("Dave"), - }, - }, - { - src: &pb.MyMessage{ - Inner: &pb.InnerMessage{ - Host: proto.String("hey"), - Connected: proto.Bool(true), - }, - Pet: []string{"horsey"}, - Others: []*pb.OtherMessage{ - { - Value: []byte("some bytes"), - }, - }, - }, - dst: &pb.MyMessage{ - Inner: &pb.InnerMessage{ - Host: proto.String("niles"), - Port: proto.Int32(9099), - }, - Pet: []string{"bunny", "kitty"}, - Others: []*pb.OtherMessage{ - { - Key: proto.Int64(31415926535), - }, - { - // Explicitly test a src=nil field - Inner: nil, - }, - }, - }, - want: &pb.MyMessage{ - Inner: &pb.InnerMessage{ - Host: proto.String("hey"), - Connected: proto.Bool(true), - Port: proto.Int32(9099), - }, - Pet: []string{"bunny", "kitty", "horsey"}, - Others: []*pb.OtherMessage{ - { - Key: proto.Int64(31415926535), - }, - {}, - { - Value: []byte("some bytes"), - }, - }, - }, - }, - { - src: &pb.MyMessage{ - RepBytes: [][]byte{[]byte("wow")}, - }, - dst: &pb.MyMessage{ - Somegroup: &pb.MyMessage_SomeGroup{ - GroupField: proto.Int32(6), - }, - RepBytes: [][]byte{[]byte("sham")}, - }, - want: &pb.MyMessage{ - Somegroup: &pb.MyMessage_SomeGroup{ - GroupField: proto.Int32(6), - }, - RepBytes: [][]byte{[]byte("sham"), []byte("wow")}, - }, - }, - // Check that a scalar bytes field replaces rather than appends. - { - src: &pb.OtherMessage{Value: []byte("foo")}, - dst: &pb.OtherMessage{Value: []byte("bar")}, - want: &pb.OtherMessage{Value: []byte("foo")}, - }, - { - src: &pb.MessageWithMap{ - NameMapping: map[int32]string{6: "Nigel"}, - MsgMapping: map[int64]*pb.FloatingPoint{ - 0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)}, - 0x4002: &pb.FloatingPoint{ - F: proto.Float64(2.0), - }, - }, - ByteMapping: map[bool][]byte{true: []byte("wowsa")}, - }, - dst: &pb.MessageWithMap{ - NameMapping: map[int32]string{ - 6: "Bruce", // should be overwritten - 7: "Andrew", - }, - MsgMapping: map[int64]*pb.FloatingPoint{ - 0x4002: &pb.FloatingPoint{ - F: proto.Float64(3.0), - Exact: proto.Bool(true), - }, // the entire message should be overwritten - }, - }, - want: &pb.MessageWithMap{ - NameMapping: map[int32]string{ - 6: "Nigel", - 7: "Andrew", - }, - MsgMapping: map[int64]*pb.FloatingPoint{ - 0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)}, - 0x4002: &pb.FloatingPoint{ - F: proto.Float64(2.0), - }, - }, - ByteMapping: map[bool][]byte{true: []byte("wowsa")}, - }, - }, - // proto3 shouldn't merge zero values, - // in the same way that proto2 shouldn't merge nils. - { - src: &proto3pb.Message{ - Name: "Aaron", - Data: []byte(""), // zero value, but not nil - }, - dst: &proto3pb.Message{ - HeightInCm: 176, - Data: []byte("texas!"), - }, - want: &proto3pb.Message{ - Name: "Aaron", - HeightInCm: 176, - Data: []byte("texas!"), - }, - }, - { // Oneof fields should merge by assignment. - src: &pb.Communique{Union: &pb.Communique_Number{41}}, - dst: &pb.Communique{Union: &pb.Communique_Name{"Bobby Tables"}}, - want: &pb.Communique{Union: &pb.Communique_Number{41}}, - }, - { // Oneof nil is the same as not set. - src: &pb.Communique{}, - dst: &pb.Communique{Union: &pb.Communique_Name{"Bobby Tables"}}, - want: &pb.Communique{Union: &pb.Communique_Name{"Bobby Tables"}}, - }, - { - src: &pb.Communique{Union: &pb.Communique_Number{1337}}, - dst: &pb.Communique{}, - want: &pb.Communique{Union: &pb.Communique_Number{1337}}, - }, - { - src: &pb.Communique{Union: &pb.Communique_Col{pb.MyMessage_RED}}, - dst: &pb.Communique{}, - want: &pb.Communique{Union: &pb.Communique_Col{pb.MyMessage_RED}}, - }, - { - src: &pb.Communique{Union: &pb.Communique_Data{[]byte("hello")}}, - dst: &pb.Communique{}, - want: &pb.Communique{Union: &pb.Communique_Data{[]byte("hello")}}, - }, - { - src: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{BytesField: []byte{1, 2, 3}}}}, - dst: &pb.Communique{}, - want: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{BytesField: []byte{1, 2, 3}}}}, - }, - { - src: &pb.Communique{Union: &pb.Communique_Msg{}}, - dst: &pb.Communique{}, - want: &pb.Communique{Union: &pb.Communique_Msg{}}, - }, - { - src: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{StringField: proto.String("123")}}}, - dst: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{BytesField: []byte{1, 2, 3}}}}, - want: &pb.Communique{Union: &pb.Communique_Msg{&pb.Strings{StringField: proto.String("123"), BytesField: []byte{1, 2, 3}}}}, - }, - { - src: &proto3pb.Message{ - Terrain: map[string]*proto3pb.Nested{ - "kay_a": &proto3pb.Nested{Cute: true}, // replace - "kay_b": &proto3pb.Nested{Bunny: "rabbit"}, // insert - }, - }, - dst: &proto3pb.Message{ - Terrain: map[string]*proto3pb.Nested{ - "kay_a": &proto3pb.Nested{Bunny: "lost"}, // replaced - "kay_c": &proto3pb.Nested{Bunny: "bunny"}, // keep - }, - }, - want: &proto3pb.Message{ - Terrain: map[string]*proto3pb.Nested{ - "kay_a": &proto3pb.Nested{Cute: true}, - "kay_b": &proto3pb.Nested{Bunny: "rabbit"}, - "kay_c": &proto3pb.Nested{Bunny: "bunny"}, - }, - }, - }, - { - src: &pb.GoTest{ - F_BoolRepeated: []bool{}, - F_Int32Repeated: []int32{}, - F_Int64Repeated: []int64{}, - F_Uint32Repeated: []uint32{}, - F_Uint64Repeated: []uint64{}, - F_FloatRepeated: []float32{}, - F_DoubleRepeated: []float64{}, - F_StringRepeated: []string{}, - F_BytesRepeated: [][]byte{}, - }, - dst: &pb.GoTest{}, - want: &pb.GoTest{ - F_BoolRepeated: []bool{}, - F_Int32Repeated: []int32{}, - F_Int64Repeated: []int64{}, - F_Uint32Repeated: []uint32{}, - F_Uint64Repeated: []uint64{}, - F_FloatRepeated: []float32{}, - F_DoubleRepeated: []float64{}, - F_StringRepeated: []string{}, - F_BytesRepeated: [][]byte{}, - }, - }, - { - src: &pb.GoTest{}, - dst: &pb.GoTest{ - F_BoolRepeated: []bool{}, - F_Int32Repeated: []int32{}, - F_Int64Repeated: []int64{}, - F_Uint32Repeated: []uint32{}, - F_Uint64Repeated: []uint64{}, - F_FloatRepeated: []float32{}, - F_DoubleRepeated: []float64{}, - F_StringRepeated: []string{}, - F_BytesRepeated: [][]byte{}, - }, - want: &pb.GoTest{ - F_BoolRepeated: []bool{}, - F_Int32Repeated: []int32{}, - F_Int64Repeated: []int64{}, - F_Uint32Repeated: []uint32{}, - F_Uint64Repeated: []uint64{}, - F_FloatRepeated: []float32{}, - F_DoubleRepeated: []float64{}, - F_StringRepeated: []string{}, - F_BytesRepeated: [][]byte{}, - }, - }, - { - src: &pb.GoTest{ - F_BytesRepeated: [][]byte{nil, []byte{}, []byte{0}}, - }, - dst: &pb.GoTest{}, - want: &pb.GoTest{ - F_BytesRepeated: [][]byte{nil, []byte{}, []byte{0}}, - }, - }, - { - src: &pb.MyMessage{ - Others: []*pb.OtherMessage{}, - }, - dst: &pb.MyMessage{}, - want: &pb.MyMessage{ - Others: []*pb.OtherMessage{}, - }, - }, -} - -func TestMerge(t *testing.T) { - for _, m := range mergeTests { - got := proto.Clone(m.dst) - if !proto.Equal(got, m.dst) { - t.Errorf("Clone()\ngot %v\nwant %v", got, m.dst) - continue - } - proto.Merge(got, m.src) - if !proto.Equal(got, m.want) { - t.Errorf("Merge(%v, %v)\ngot %v\nwant %v", m.dst, m.src, got, m.want) - } - } -} diff --git a/vendor/github.com/golang/protobuf/proto/decode_test.go b/vendor/github.com/golang/protobuf/proto/decode_test.go deleted file mode 100644 index 949be3a..0000000 --- a/vendor/github.com/golang/protobuf/proto/decode_test.go +++ /dev/null @@ -1,255 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build go1.7 - -package proto_test - -import ( - "fmt" - "testing" - - "github.com/golang/protobuf/proto" - tpb "github.com/golang/protobuf/proto/proto3_proto" -) - -var msgBlackhole = new(tpb.Message) - -// BenchmarkVarint32ArraySmall shows the performance on an array of small int32 fields (1 and -// 2 bytes long). -func BenchmarkVarint32ArraySmall(b *testing.B) { - for i := uint(1); i <= 10; i++ { - dist := genInt32Dist([7]int{0, 3, 1}, 1<unmarshal. -} - -func TestMarshalUnmarshalRepeatedExtension(t *testing.T) { - // Add a repeated extension to the result. - tests := []struct { - name string - ext []*pb.ComplexExtension - }{ - { - "two fields", - []*pb.ComplexExtension{ - {First: proto.Int32(7)}, - {Second: proto.Int32(11)}, - }, - }, - { - "repeated field", - []*pb.ComplexExtension{ - {Third: []int32{1000}}, - {Third: []int32{2000}}, - }, - }, - { - "two fields and repeated field", - []*pb.ComplexExtension{ - {Third: []int32{1000}}, - {First: proto.Int32(9)}, - {Second: proto.Int32(21)}, - {Third: []int32{2000}}, - }, - }, - } - for _, test := range tests { - // Marshal message with a repeated extension. - msg1 := new(pb.OtherMessage) - err := proto.SetExtension(msg1, pb.E_RComplex, test.ext) - if err != nil { - t.Fatalf("[%s] Error setting extension: %v", test.name, err) - } - b, err := proto.Marshal(msg1) - if err != nil { - t.Fatalf("[%s] Error marshaling message: %v", test.name, err) - } - - // Unmarshal and read the merged proto. - msg2 := new(pb.OtherMessage) - err = proto.Unmarshal(b, msg2) - if err != nil { - t.Fatalf("[%s] Error unmarshaling message: %v", test.name, err) - } - e, err := proto.GetExtension(msg2, pb.E_RComplex) - if err != nil { - t.Fatalf("[%s] Error getting extension: %v", test.name, err) - } - ext := e.([]*pb.ComplexExtension) - if ext == nil { - t.Fatalf("[%s] Invalid extension", test.name) - } - if len(ext) != len(test.ext) { - t.Errorf("[%s] Wrong length of ComplexExtension: got: %v want: %v\n", test.name, len(ext), len(test.ext)) - } - for i := range test.ext { - if !proto.Equal(ext[i], test.ext[i]) { - t.Errorf("[%s] Wrong value for ComplexExtension[%d]: got: %v want: %v\n", test.name, i, ext[i], test.ext[i]) - } - } - } -} - -func TestUnmarshalRepeatingNonRepeatedExtension(t *testing.T) { - // We may see multiple instances of the same extension in the wire - // format. For example, the proto compiler may encode custom options in - // this way. Here, we verify that we merge the extensions together. - tests := []struct { - name string - ext []*pb.ComplexExtension - }{ - { - "two fields", - []*pb.ComplexExtension{ - {First: proto.Int32(7)}, - {Second: proto.Int32(11)}, - }, - }, - { - "repeated field", - []*pb.ComplexExtension{ - {Third: []int32{1000}}, - {Third: []int32{2000}}, - }, - }, - { - "two fields and repeated field", - []*pb.ComplexExtension{ - {Third: []int32{1000}}, - {First: proto.Int32(9)}, - {Second: proto.Int32(21)}, - {Third: []int32{2000}}, - }, - }, - } - for _, test := range tests { - var buf bytes.Buffer - var want pb.ComplexExtension - - // Generate a serialized representation of a repeated extension - // by catenating bytes together. - for i, e := range test.ext { - // Merge to create the wanted proto. - proto.Merge(&want, e) - - // serialize the message - msg := new(pb.OtherMessage) - err := proto.SetExtension(msg, pb.E_Complex, e) - if err != nil { - t.Fatalf("[%s] Error setting extension %d: %v", test.name, i, err) - } - b, err := proto.Marshal(msg) - if err != nil { - t.Fatalf("[%s] Error marshaling message %d: %v", test.name, i, err) - } - buf.Write(b) - } - - // Unmarshal and read the merged proto. - msg2 := new(pb.OtherMessage) - err := proto.Unmarshal(buf.Bytes(), msg2) - if err != nil { - t.Fatalf("[%s] Error unmarshaling message: %v", test.name, err) - } - e, err := proto.GetExtension(msg2, pb.E_Complex) - if err != nil { - t.Fatalf("[%s] Error getting extension: %v", test.name, err) - } - ext := e.(*pb.ComplexExtension) - if ext == nil { - t.Fatalf("[%s] Invalid extension", test.name) - } - if !proto.Equal(ext, &want) { - t.Errorf("[%s] Wrong value for ComplexExtension: got: %s want: %s\n", test.name, ext, &want) - } - } -} - -func TestClearAllExtensions(t *testing.T) { - // unregistered extension - desc := &proto.ExtensionDesc{ - ExtendedType: (*pb.MyMessage)(nil), - ExtensionType: (*bool)(nil), - Field: 101010100, - Name: "emptyextension", - Tag: "varint,0,opt", - } - m := &pb.MyMessage{} - if proto.HasExtension(m, desc) { - t.Errorf("proto.HasExtension(%s): got true, want false", proto.MarshalTextString(m)) - } - if err := proto.SetExtension(m, desc, proto.Bool(true)); err != nil { - t.Errorf("proto.SetExtension(m, desc, true): got error %q, want nil", err) - } - if !proto.HasExtension(m, desc) { - t.Errorf("proto.HasExtension(%s): got false, want true", proto.MarshalTextString(m)) - } - proto.ClearAllExtensions(m) - if proto.HasExtension(m, desc) { - t.Errorf("proto.HasExtension(%s): got true, want false", proto.MarshalTextString(m)) - } -} - -func TestMarshalRace(t *testing.T) { - ext := &pb.Ext{} - m := &pb.MyMessage{Count: proto.Int32(4)} - if err := proto.SetExtension(m, pb.E_Ext_More, ext); err != nil { - t.Fatalf("proto.SetExtension(m, desc, true): got error %q, want nil", err) - } - - b, err := proto.Marshal(m) - if err != nil { - t.Fatalf("Could not marshal message: %v", err) - } - if err := proto.Unmarshal(b, m); err != nil { - t.Fatalf("Could not unmarshal message: %v", err) - } - // after Unmarshal, the extension is in undecoded form. - // GetExtension will decode it lazily. Make sure this does - // not race against Marshal. - - var g errgroup.Group - for n := 3; n > 0; n-- { - g.Go(func() error { - _, err := proto.Marshal(m) - return err - }) - g.Go(func() error { - _, err := proto.GetExtension(m, pb.E_Ext_More) - return err - }) - } - if err := g.Wait(); err != nil { - t.Fatal(err) - } -} diff --git a/vendor/github.com/golang/protobuf/proto/map_test.go b/vendor/github.com/golang/protobuf/proto/map_test.go deleted file mode 100644 index b1e1529..0000000 --- a/vendor/github.com/golang/protobuf/proto/map_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package proto_test - -import ( - "fmt" - "reflect" - "testing" - - "github.com/golang/protobuf/proto" - ppb "github.com/golang/protobuf/proto/proto3_proto" -) - -func TestMap(t *testing.T) { - var b []byte - fmt.Sscanf("a2010c0a044b657931120456616c31a201130a044b657932120556616c3261120456616c32a201240a044b6579330d05000000120556616c33621a0556616c3361120456616c331505000000a20100a201260a044b657934130a07536f6d6555524c1209536f6d655469746c651a08536e69707065743114", "%x", &b) - - var m ppb.Message - if err := proto.Unmarshal(b, &m); err != nil { - t.Fatalf("proto.Unmarshal error: %v", err) - } - - got := m.StringMap - want := map[string]string{ - "": "", - "Key1": "Val1", - "Key2": "Val2", - "Key3": "Val3", - "Key4": "", - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("maps differ:\ngot %#v\nwant %#v", got, want) - } -} - -func marshalled() []byte { - m := &ppb.IntMaps{} - for i := 0; i < 1000; i++ { - m.Maps = append(m.Maps, &ppb.IntMap{ - Rtt: map[int32]int32{1: 2}, - }) - } - b, err := proto.Marshal(m) - if err != nil { - panic(fmt.Sprintf("Can't marshal %+v: %v", m, err)) - } - return b -} - -func BenchmarkConcurrentMapUnmarshal(b *testing.B) { - in := marshalled() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - var out ppb.IntMaps - if err := proto.Unmarshal(in, &out); err != nil { - b.Errorf("Can't unmarshal ppb.IntMaps: %v", err) - } - } - }) -} - -func BenchmarkSequentialMapUnmarshal(b *testing.B) { - in := marshalled() - b.ResetTimer() - for i := 0; i < b.N; i++ { - var out ppb.IntMaps - if err := proto.Unmarshal(in, &out); err != nil { - b.Errorf("Can't unmarshal ppb.IntMaps: %v", err) - } - } -} diff --git a/vendor/github.com/golang/protobuf/proto/message_set_test.go b/vendor/github.com/golang/protobuf/proto/message_set_test.go deleted file mode 100644 index 2c170c5..0000000 --- a/vendor/github.com/golang/protobuf/proto/message_set_test.go +++ /dev/null @@ -1,77 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2014 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto - -import ( - "bytes" - "testing" -) - -func TestUnmarshalMessageSetWithDuplicate(t *testing.T) { - // Check that a repeated message set entry will be concatenated. - in := &messageSet{ - Item: []*_MessageSet_Item{ - {TypeId: Int32(12345), Message: []byte("hoo")}, - {TypeId: Int32(12345), Message: []byte("hah")}, - }, - } - b, err := Marshal(in) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - t.Logf("Marshaled bytes: %q", b) - - var extensions XXX_InternalExtensions - if err := UnmarshalMessageSet(b, &extensions); err != nil { - t.Fatalf("UnmarshalMessageSet: %v", err) - } - ext, ok := extensions.p.extensionMap[12345] - if !ok { - t.Fatalf("Didn't retrieve extension 12345; map is %v", extensions.p.extensionMap) - } - // Skip wire type/field number and length varints. - got := skipVarint(skipVarint(ext.enc)) - if want := []byte("hoohah"); !bytes.Equal(got, want) { - t.Errorf("Combined extension is %q, want %q", got, want) - } -} - -func TestMarshalMessageSetJSON_UnknownType(t *testing.T) { - extMap := map[int32]Extension{12345: Extension{}} - got, err := MarshalMessageSetJSON(extMap) - if err != nil { - t.Fatalf("MarshalMessageSetJSON: %v", err) - } - if want := []byte("{}"); !bytes.Equal(got, want) { - t.Errorf("MarshalMessageSetJSON(%v) = %q, want %q", extMap, got, want) - } -} diff --git a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go b/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go deleted file mode 100644 index a80f089..0000000 --- a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go +++ /dev/null @@ -1,461 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: proto3_proto/proto3.proto - -package proto3_proto - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import test_proto "github.com/golang/protobuf/proto/test_proto" -import any "github.com/golang/protobuf/ptypes/any" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Message_Humour int32 - -const ( - Message_UNKNOWN Message_Humour = 0 - Message_PUNS Message_Humour = 1 - Message_SLAPSTICK Message_Humour = 2 - Message_BILL_BAILEY Message_Humour = 3 -) - -var Message_Humour_name = map[int32]string{ - 0: "UNKNOWN", - 1: "PUNS", - 2: "SLAPSTICK", - 3: "BILL_BAILEY", -} -var Message_Humour_value = map[string]int32{ - "UNKNOWN": 0, - "PUNS": 1, - "SLAPSTICK": 2, - "BILL_BAILEY": 3, -} - -func (x Message_Humour) String() string { - return proto.EnumName(Message_Humour_name, int32(x)) -} -func (Message_Humour) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_proto3_e706e4ff19a5dbea, []int{0, 0} -} - -type Message struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Hilarity Message_Humour `protobuf:"varint,2,opt,name=hilarity,enum=proto3_proto.Message_Humour" json:"hilarity,omitempty"` - HeightInCm uint32 `protobuf:"varint,3,opt,name=height_in_cm,json=heightInCm" json:"height_in_cm,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - ResultCount int64 `protobuf:"varint,7,opt,name=result_count,json=resultCount" json:"result_count,omitempty"` - TrueScotsman bool `protobuf:"varint,8,opt,name=true_scotsman,json=trueScotsman" json:"true_scotsman,omitempty"` - Score float32 `protobuf:"fixed32,9,opt,name=score" json:"score,omitempty"` - Key []uint64 `protobuf:"varint,5,rep,packed,name=key" json:"key,omitempty"` - ShortKey []int32 `protobuf:"varint,19,rep,packed,name=short_key,json=shortKey" json:"short_key,omitempty"` - Nested *Nested `protobuf:"bytes,6,opt,name=nested" json:"nested,omitempty"` - RFunny []Message_Humour `protobuf:"varint,16,rep,packed,name=r_funny,json=rFunny,enum=proto3_proto.Message_Humour" json:"r_funny,omitempty"` - Terrain map[string]*Nested `protobuf:"bytes,10,rep,name=terrain" json:"terrain,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Proto2Field *test_proto.SubDefaults `protobuf:"bytes,11,opt,name=proto2_field,json=proto2Field" json:"proto2_field,omitempty"` - Proto2Value map[string]*test_proto.SubDefaults `protobuf:"bytes,13,rep,name=proto2_value,json=proto2Value" json:"proto2_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Anything *any.Any `protobuf:"bytes,14,opt,name=anything" json:"anything,omitempty"` - ManyThings []*any.Any `protobuf:"bytes,15,rep,name=many_things,json=manyThings" json:"many_things,omitempty"` - Submessage *Message `protobuf:"bytes,17,opt,name=submessage" json:"submessage,omitempty"` - Children []*Message `protobuf:"bytes,18,rep,name=children" json:"children,omitempty"` - StringMap map[string]string `protobuf:"bytes,20,rep,name=string_map,json=stringMap" json:"string_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_proto3_e706e4ff19a5dbea, []int{0} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Message.Unmarshal(m, b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) -} -func (dst *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(dst, src) -} -func (m *Message) XXX_Size() int { - return xxx_messageInfo_Message.Size(m) -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -func (m *Message) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Message) GetHilarity() Message_Humour { - if m != nil { - return m.Hilarity - } - return Message_UNKNOWN -} - -func (m *Message) GetHeightInCm() uint32 { - if m != nil { - return m.HeightInCm - } - return 0 -} - -func (m *Message) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *Message) GetResultCount() int64 { - if m != nil { - return m.ResultCount - } - return 0 -} - -func (m *Message) GetTrueScotsman() bool { - if m != nil { - return m.TrueScotsman - } - return false -} - -func (m *Message) GetScore() float32 { - if m != nil { - return m.Score - } - return 0 -} - -func (m *Message) GetKey() []uint64 { - if m != nil { - return m.Key - } - return nil -} - -func (m *Message) GetShortKey() []int32 { - if m != nil { - return m.ShortKey - } - return nil -} - -func (m *Message) GetNested() *Nested { - if m != nil { - return m.Nested - } - return nil -} - -func (m *Message) GetRFunny() []Message_Humour { - if m != nil { - return m.RFunny - } - return nil -} - -func (m *Message) GetTerrain() map[string]*Nested { - if m != nil { - return m.Terrain - } - return nil -} - -func (m *Message) GetProto2Field() *test_proto.SubDefaults { - if m != nil { - return m.Proto2Field - } - return nil -} - -func (m *Message) GetProto2Value() map[string]*test_proto.SubDefaults { - if m != nil { - return m.Proto2Value - } - return nil -} - -func (m *Message) GetAnything() *any.Any { - if m != nil { - return m.Anything - } - return nil -} - -func (m *Message) GetManyThings() []*any.Any { - if m != nil { - return m.ManyThings - } - return nil -} - -func (m *Message) GetSubmessage() *Message { - if m != nil { - return m.Submessage - } - return nil -} - -func (m *Message) GetChildren() []*Message { - if m != nil { - return m.Children - } - return nil -} - -func (m *Message) GetStringMap() map[string]string { - if m != nil { - return m.StringMap - } - return nil -} - -type Nested struct { - Bunny string `protobuf:"bytes,1,opt,name=bunny" json:"bunny,omitempty"` - Cute bool `protobuf:"varint,2,opt,name=cute" json:"cute,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Nested) Reset() { *m = Nested{} } -func (m *Nested) String() string { return proto.CompactTextString(m) } -func (*Nested) ProtoMessage() {} -func (*Nested) Descriptor() ([]byte, []int) { - return fileDescriptor_proto3_e706e4ff19a5dbea, []int{1} -} -func (m *Nested) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Nested.Unmarshal(m, b) -} -func (m *Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Nested.Marshal(b, m, deterministic) -} -func (dst *Nested) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested.Merge(dst, src) -} -func (m *Nested) XXX_Size() int { - return xxx_messageInfo_Nested.Size(m) -} -func (m *Nested) XXX_DiscardUnknown() { - xxx_messageInfo_Nested.DiscardUnknown(m) -} - -var xxx_messageInfo_Nested proto.InternalMessageInfo - -func (m *Nested) GetBunny() string { - if m != nil { - return m.Bunny - } - return "" -} - -func (m *Nested) GetCute() bool { - if m != nil { - return m.Cute - } - return false -} - -type MessageWithMap struct { - ByteMapping map[bool][]byte `protobuf:"bytes,1,rep,name=byte_mapping,json=byteMapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } -func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } -func (*MessageWithMap) ProtoMessage() {} -func (*MessageWithMap) Descriptor() ([]byte, []int) { - return fileDescriptor_proto3_e706e4ff19a5dbea, []int{2} -} -func (m *MessageWithMap) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithMap.Unmarshal(m, b) -} -func (m *MessageWithMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithMap.Marshal(b, m, deterministic) -} -func (dst *MessageWithMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithMap.Merge(dst, src) -} -func (m *MessageWithMap) XXX_Size() int { - return xxx_messageInfo_MessageWithMap.Size(m) -} -func (m *MessageWithMap) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithMap.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithMap proto.InternalMessageInfo - -func (m *MessageWithMap) GetByteMapping() map[bool][]byte { - if m != nil { - return m.ByteMapping - } - return nil -} - -type IntMap struct { - Rtt map[int32]int32 `protobuf:"bytes,1,rep,name=rtt" json:"rtt,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IntMap) Reset() { *m = IntMap{} } -func (m *IntMap) String() string { return proto.CompactTextString(m) } -func (*IntMap) ProtoMessage() {} -func (*IntMap) Descriptor() ([]byte, []int) { - return fileDescriptor_proto3_e706e4ff19a5dbea, []int{3} -} -func (m *IntMap) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IntMap.Unmarshal(m, b) -} -func (m *IntMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IntMap.Marshal(b, m, deterministic) -} -func (dst *IntMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_IntMap.Merge(dst, src) -} -func (m *IntMap) XXX_Size() int { - return xxx_messageInfo_IntMap.Size(m) -} -func (m *IntMap) XXX_DiscardUnknown() { - xxx_messageInfo_IntMap.DiscardUnknown(m) -} - -var xxx_messageInfo_IntMap proto.InternalMessageInfo - -func (m *IntMap) GetRtt() map[int32]int32 { - if m != nil { - return m.Rtt - } - return nil -} - -type IntMaps struct { - Maps []*IntMap `protobuf:"bytes,1,rep,name=maps" json:"maps,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IntMaps) Reset() { *m = IntMaps{} } -func (m *IntMaps) String() string { return proto.CompactTextString(m) } -func (*IntMaps) ProtoMessage() {} -func (*IntMaps) Descriptor() ([]byte, []int) { - return fileDescriptor_proto3_e706e4ff19a5dbea, []int{4} -} -func (m *IntMaps) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IntMaps.Unmarshal(m, b) -} -func (m *IntMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IntMaps.Marshal(b, m, deterministic) -} -func (dst *IntMaps) XXX_Merge(src proto.Message) { - xxx_messageInfo_IntMaps.Merge(dst, src) -} -func (m *IntMaps) XXX_Size() int { - return xxx_messageInfo_IntMaps.Size(m) -} -func (m *IntMaps) XXX_DiscardUnknown() { - xxx_messageInfo_IntMaps.DiscardUnknown(m) -} - -var xxx_messageInfo_IntMaps proto.InternalMessageInfo - -func (m *IntMaps) GetMaps() []*IntMap { - if m != nil { - return m.Maps - } - return nil -} - -func init() { - proto.RegisterType((*Message)(nil), "proto3_proto.Message") - proto.RegisterMapType((map[string]*test_proto.SubDefaults)(nil), "proto3_proto.Message.Proto2ValueEntry") - proto.RegisterMapType((map[string]string)(nil), "proto3_proto.Message.StringMapEntry") - proto.RegisterMapType((map[string]*Nested)(nil), "proto3_proto.Message.TerrainEntry") - proto.RegisterType((*Nested)(nil), "proto3_proto.Nested") - proto.RegisterType((*MessageWithMap)(nil), "proto3_proto.MessageWithMap") - proto.RegisterMapType((map[bool][]byte)(nil), "proto3_proto.MessageWithMap.ByteMappingEntry") - proto.RegisterType((*IntMap)(nil), "proto3_proto.IntMap") - proto.RegisterMapType((map[int32]int32)(nil), "proto3_proto.IntMap.RttEntry") - proto.RegisterType((*IntMaps)(nil), "proto3_proto.IntMaps") - proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value) -} - -func init() { proto.RegisterFile("proto3_proto/proto3.proto", fileDescriptor_proto3_e706e4ff19a5dbea) } - -var fileDescriptor_proto3_e706e4ff19a5dbea = []byte{ - // 774 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0x6f, 0x8f, 0xdb, 0x44, - 0x10, 0xc6, 0x71, 0x9c, 0x3f, 0xce, 0xd8, 0x77, 0x35, 0x4b, 0x2a, 0xb6, 0x01, 0x24, 0x13, 0x10, - 0xb2, 0x10, 0xf5, 0x41, 0xaa, 0x43, 0x55, 0x55, 0x81, 0xee, 0x8e, 0x56, 0x44, 0x77, 0x17, 0xa2, - 0xcd, 0x95, 0x13, 0xaf, 0xac, 0x4d, 0x6e, 0x93, 0x58, 0xc4, 0xeb, 0xe0, 0x5d, 0x23, 0xf9, 0x0b, - 0xf0, 0x41, 0xf8, 0xa4, 0x68, 0x77, 0x9d, 0xd4, 0xa9, 0x5c, 0xfa, 0x2a, 0xbb, 0x8f, 0x7f, 0x33, - 0xcf, 0x78, 0x66, 0x1c, 0x78, 0xb2, 0xcb, 0x33, 0x99, 0x3d, 0x8b, 0xf5, 0xcf, 0x99, 0xb9, 0x44, - 0xfa, 0x07, 0x79, 0xf5, 0x47, 0xc3, 0x27, 0xeb, 0x2c, 0x5b, 0x6f, 0x99, 0x41, 0x16, 0xc5, 0xea, - 0x8c, 0xf2, 0xd2, 0x80, 0xc3, 0xc7, 0x92, 0x09, 0x59, 0x65, 0x50, 0x47, 0x23, 0x8f, 0xfe, 0xe9, - 0x43, 0xef, 0x96, 0x09, 0x41, 0xd7, 0x0c, 0x21, 0x68, 0x73, 0x9a, 0x32, 0x6c, 0x05, 0x56, 0xd8, - 0x27, 0xfa, 0x8c, 0x9e, 0x83, 0xb3, 0x49, 0xb6, 0x34, 0x4f, 0x64, 0x89, 0x5b, 0x81, 0x15, 0x9e, - 0x8e, 0x3f, 0x8f, 0xea, 0x96, 0x51, 0x15, 0x1c, 0xfd, 0x5a, 0xa4, 0x59, 0x91, 0x93, 0x03, 0x8d, - 0x02, 0xf0, 0x36, 0x2c, 0x59, 0x6f, 0x64, 0x9c, 0xf0, 0x78, 0x99, 0x62, 0x3b, 0xb0, 0xc2, 0x13, - 0x02, 0x46, 0x9b, 0xf0, 0xab, 0x54, 0xf9, 0x3d, 0x50, 0x49, 0x71, 0x3b, 0xb0, 0x42, 0x8f, 0xe8, - 0x33, 0xfa, 0x12, 0xbc, 0x9c, 0x89, 0x62, 0x2b, 0xe3, 0x65, 0x56, 0x70, 0x89, 0x7b, 0x81, 0x15, - 0xda, 0xc4, 0x35, 0xda, 0x95, 0x92, 0xd0, 0x57, 0x70, 0x22, 0xf3, 0x82, 0xc5, 0x62, 0x99, 0x49, - 0x91, 0x52, 0x8e, 0x9d, 0xc0,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 0x5c, 0x5d, - 0xfb, 0x2d, 0xf4, 0x08, 0xdc, 0xcb, 0xc9, 0xcd, 0x4d, 0x7c, 0x79, 0x31, 0xb9, 0x79, 0xf5, 0x87, - 0x6f, 0x8f, 0xc6, 0xd0, 0x35, 0x2f, 0xab, 0x4c, 0x16, 0xfa, 0x2b, 0x32, 0xc6, 0xe6, 0xa2, 0xfe, - 0x2c, 0x96, 0x85, 0x34, 0xce, 0x0e, 0xd1, 0xe7, 0xd1, 0xbf, 0x16, 0x9c, 0x56, 0x33, 0xb8, 0x4f, - 0xe4, 0xe6, 0x96, 0xee, 0xd0, 0x0c, 0xbc, 0x45, 0x29, 0x99, 0x9a, 0xd9, 0x4e, 0x2d, 0xa3, 0xa5, - 0xe7, 0xf6, 0xb4, 0x71, 0x6e, 0x55, 0x4c, 0x74, 0x59, 0x4a, 0x76, 0x6b, 0xf8, 0x6a, 0xb5, 0x17, - 0x6f, 0x95, 0xe1, 0x4f, 0xe0, 0xbf, 0x0b, 0xd4, 0x3b, 0xe3, 0x34, 0x74, 0xc6, 0xab, 0x77, 0xe6, - 0x2f, 0xe8, 0x4e, 0xb8, 0x54, 0xb5, 0x9d, 0x81, 0x9d, 0x4b, 0x59, 0x95, 0xf4, 0xc5, 0x71, 0x49, - 0x06, 0x89, 0x88, 0x94, 0xa6, 0x04, 0x45, 0x0e, 0x7f, 0x04, 0x67, 0x2f, 0xd4, 0x2d, 0x3b, 0x0d, - 0x96, 0x9d, 0xba, 0xe5, 0x33, 0xe8, 0x99, 0x7c, 0x02, 0x85, 0xd0, 0x4e, 0xe9, 0x4e, 0x54, 0xa6, - 0x83, 0x26, 0x53, 0xa2, 0x89, 0x45, 0xd7, 0x3c, 0xfa, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x99, 0x24, - 0x6b, 0x12, 0x6d, 0x06, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto b/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto deleted file mode 100644 index c81fe1e..0000000 --- a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto +++ /dev/null @@ -1,89 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2014 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -import "google/protobuf/any.proto"; -import "test_proto/test.proto"; - -package proto3_proto; - -message Message { - enum Humour { - UNKNOWN = 0; - PUNS = 1; - SLAPSTICK = 2; - BILL_BAILEY = 3; - } - - string name = 1; - Humour hilarity = 2; - uint32 height_in_cm = 3; - bytes data = 4; - int64 result_count = 7; - bool true_scotsman = 8; - float score = 9; - - repeated uint64 key = 5; - repeated int32 short_key = 19; - Nested nested = 6; - repeated Humour r_funny = 16; - - map terrain = 10; - test_proto.SubDefaults proto2_field = 11; - map proto2_value = 13; - - google.protobuf.Any anything = 14; - repeated google.protobuf.Any many_things = 15; - - Message submessage = 17; - repeated Message children = 18; - - map string_map = 20; -} - -message Nested { - string bunny = 1; - bool cute = 2; -} - -message MessageWithMap { - map byte_mapping = 1; -} - - -message IntMap { - map rtt = 1; -} - -message IntMaps { - repeated IntMap maps = 1; -} diff --git a/vendor/github.com/golang/protobuf/proto/proto3_test.go b/vendor/github.com/golang/protobuf/proto/proto3_test.go deleted file mode 100644 index 73eed6c..0000000 --- a/vendor/github.com/golang/protobuf/proto/proto3_test.go +++ /dev/null @@ -1,151 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2014 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto_test - -import ( - "bytes" - "testing" - - "github.com/golang/protobuf/proto" - pb "github.com/golang/protobuf/proto/proto3_proto" - tpb "github.com/golang/protobuf/proto/test_proto" -) - -func TestProto3ZeroValues(t *testing.T) { - tests := []struct { - desc string - m proto.Message - }{ - {"zero message", &pb.Message{}}, - {"empty bytes field", &pb.Message{Data: []byte{}}}, - } - for _, test := range tests { - b, err := proto.Marshal(test.m) - if err != nil { - t.Errorf("%s: proto.Marshal: %v", test.desc, err) - continue - } - if len(b) > 0 { - t.Errorf("%s: Encoding is non-empty: %q", test.desc, b) - } - } -} - -func TestRoundTripProto3(t *testing.T) { - m := &pb.Message{ - Name: "David", // (2 | 1<<3): 0x0a 0x05 "David" - Hilarity: pb.Message_PUNS, // (0 | 2<<3): 0x10 0x01 - HeightInCm: 178, // (0 | 3<<3): 0x18 0xb2 0x01 - Data: []byte("roboto"), // (2 | 4<<3): 0x20 0x06 "roboto" - ResultCount: 47, // (0 | 7<<3): 0x38 0x2f - TrueScotsman: true, // (0 | 8<<3): 0x40 0x01 - Score: 8.1, // (5 | 9<<3): 0x4d <8.1> - - Key: []uint64{1, 0xdeadbeef}, - Nested: &pb.Nested{ - Bunny: "Monty", - }, - } - t.Logf(" m: %v", m) - - b, err := proto.Marshal(m) - if err != nil { - t.Fatalf("proto.Marshal: %v", err) - } - t.Logf(" b: %q", b) - - m2 := new(pb.Message) - if err := proto.Unmarshal(b, m2); err != nil { - t.Fatalf("proto.Unmarshal: %v", err) - } - t.Logf("m2: %v", m2) - - if !proto.Equal(m, m2) { - t.Errorf("proto.Equal returned false:\n m: %v\nm2: %v", m, m2) - } -} - -func TestGettersForBasicTypesExist(t *testing.T) { - var m pb.Message - if got := m.GetNested().GetBunny(); got != "" { - t.Errorf("m.GetNested().GetBunny() = %q, want empty string", got) - } - if got := m.GetNested().GetCute(); got { - t.Errorf("m.GetNested().GetCute() = %t, want false", got) - } -} - -func TestProto3SetDefaults(t *testing.T) { - in := &pb.Message{ - Terrain: map[string]*pb.Nested{ - "meadow": new(pb.Nested), - }, - Proto2Field: new(tpb.SubDefaults), - Proto2Value: map[string]*tpb.SubDefaults{ - "badlands": new(tpb.SubDefaults), - }, - } - - got := proto.Clone(in).(*pb.Message) - proto.SetDefaults(got) - - // There are no defaults in proto3. Everything should be the zero value, but - // we need to remember to set defaults for nested proto2 messages. - want := &pb.Message{ - Terrain: map[string]*pb.Nested{ - "meadow": new(pb.Nested), - }, - Proto2Field: &tpb.SubDefaults{N: proto.Int64(7)}, - Proto2Value: map[string]*tpb.SubDefaults{ - "badlands": &tpb.SubDefaults{N: proto.Int64(7)}, - }, - } - - if !proto.Equal(got, want) { - t.Errorf("with in = %v\nproto.SetDefaults(in) =>\ngot %v\nwant %v", in, got, want) - } -} - -func TestUnknownFieldPreservation(t *testing.T) { - b1 := "\x0a\x05David" // Known tag 1 - b2 := "\xc2\x0c\x06Google" // Unknown tag 200 - b := []byte(b1 + b2) - - m := new(pb.Message) - if err := proto.Unmarshal(b, m); err != nil { - t.Fatalf("proto.Unmarshal: %v", err) - } - - if !bytes.Equal(m.XXX_unrecognized, []byte(b2)) { - t.Fatalf("mismatching unknown fields:\ngot %q\nwant %q", m.XXX_unrecognized, b2) - } -} diff --git a/vendor/github.com/golang/protobuf/proto/size2_test.go b/vendor/github.com/golang/protobuf/proto/size2_test.go deleted file mode 100644 index 7846b06..0000000 --- a/vendor/github.com/golang/protobuf/proto/size2_test.go +++ /dev/null @@ -1,63 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2012 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto - -import ( - "testing" -) - -// This is a separate file and package from size_test.go because that one uses -// generated messages and thus may not be in package proto without having a circular -// dependency, whereas this file tests unexported details of size.go. - -func TestVarintSize(t *testing.T) { - // Check the edge cases carefully. - testCases := []struct { - n uint64 - size int - }{ - {0, 1}, - {1, 1}, - {127, 1}, - {128, 2}, - {16383, 2}, - {16384, 3}, - {1<<63 - 1, 9}, - {1 << 63, 10}, - } - for _, tc := range testCases { - size := SizeVarint(tc.n) - if size != tc.size { - t.Errorf("sizeVarint(%d) = %d, want %d", tc.n, size, tc.size) - } - } -} diff --git a/vendor/github.com/golang/protobuf/proto/size_test.go b/vendor/github.com/golang/protobuf/proto/size_test.go deleted file mode 100644 index 3abac41..0000000 --- a/vendor/github.com/golang/protobuf/proto/size_test.go +++ /dev/null @@ -1,191 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2012 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto_test - -import ( - "log" - "strings" - "testing" - - . "github.com/golang/protobuf/proto" - proto3pb "github.com/golang/protobuf/proto/proto3_proto" - pb "github.com/golang/protobuf/proto/test_proto" -) - -var messageWithExtension1 = &pb.MyMessage{Count: Int32(7)} - -// messageWithExtension2 is in equal_test.go. -var messageWithExtension3 = &pb.MyMessage{Count: Int32(8)} - -func init() { - if err := SetExtension(messageWithExtension1, pb.E_Ext_More, &pb.Ext{Data: String("Abbott")}); err != nil { - log.Panicf("SetExtension: %v", err) - } - if err := SetExtension(messageWithExtension3, pb.E_Ext_More, &pb.Ext{Data: String("Costello")}); err != nil { - log.Panicf("SetExtension: %v", err) - } - - // Force messageWithExtension3 to have the extension encoded. - Marshal(messageWithExtension3) - -} - -// non-pointer custom message -type nonptrMessage struct{} - -func (m nonptrMessage) ProtoMessage() {} -func (m nonptrMessage) Reset() {} -func (m nonptrMessage) String() string { return "" } - -func (m nonptrMessage) Marshal() ([]byte, error) { - return []byte{42}, nil -} - -// custom message embedding a proto.Message -type messageWithEmbedding struct { - *pb.OtherMessage -} - -func (m *messageWithEmbedding) ProtoMessage() {} -func (m *messageWithEmbedding) Reset() {} -func (m *messageWithEmbedding) String() string { return "" } - -func (m *messageWithEmbedding) Marshal() ([]byte, error) { - return []byte{42}, nil -} - -var SizeTests = []struct { - desc string - pb Message -}{ - {"empty", &pb.OtherMessage{}}, - // Basic types. - {"bool", &pb.Defaults{F_Bool: Bool(true)}}, - {"int32", &pb.Defaults{F_Int32: Int32(12)}}, - {"negative int32", &pb.Defaults{F_Int32: Int32(-1)}}, - {"small int64", &pb.Defaults{F_Int64: Int64(1)}}, - {"big int64", &pb.Defaults{F_Int64: Int64(1 << 20)}}, - {"negative int64", &pb.Defaults{F_Int64: Int64(-1)}}, - {"fixed32", &pb.Defaults{F_Fixed32: Uint32(71)}}, - {"fixed64", &pb.Defaults{F_Fixed64: Uint64(72)}}, - {"uint32", &pb.Defaults{F_Uint32: Uint32(123)}}, - {"uint64", &pb.Defaults{F_Uint64: Uint64(124)}}, - {"float", &pb.Defaults{F_Float: Float32(12.6)}}, - {"double", &pb.Defaults{F_Double: Float64(13.9)}}, - {"string", &pb.Defaults{F_String: String("niles")}}, - {"bytes", &pb.Defaults{F_Bytes: []byte("wowsa")}}, - {"bytes, empty", &pb.Defaults{F_Bytes: []byte{}}}, - {"sint32", &pb.Defaults{F_Sint32: Int32(65)}}, - {"sint64", &pb.Defaults{F_Sint64: Int64(67)}}, - {"enum", &pb.Defaults{F_Enum: pb.Defaults_BLUE.Enum()}}, - // Repeated. - {"empty repeated bool", &pb.MoreRepeated{Bools: []bool{}}}, - {"repeated bool", &pb.MoreRepeated{Bools: []bool{false, true, true, false}}}, - {"packed repeated bool", &pb.MoreRepeated{BoolsPacked: []bool{false, true, true, false, true, true, true}}}, - {"repeated int32", &pb.MoreRepeated{Ints: []int32{1, 12203, 1729, -1}}}, - {"repeated int32 packed", &pb.MoreRepeated{IntsPacked: []int32{1, 12203, 1729}}}, - {"repeated int64 packed", &pb.MoreRepeated{Int64SPacked: []int64{ - // Need enough large numbers to verify that the header is counting the number of bytes - // for the field, not the number of elements. - 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, - 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, - }}}, - {"repeated string", &pb.MoreRepeated{Strings: []string{"r", "ken", "gri"}}}, - {"repeated fixed", &pb.MoreRepeated{Fixeds: []uint32{1, 2, 3, 4}}}, - // Nested. - {"nested", &pb.OldMessage{Nested: &pb.OldMessage_Nested{Name: String("whatever")}}}, - {"group", &pb.GroupOld{G: &pb.GroupOld_G{X: Int32(12345)}}}, - // Other things. - {"unrecognized", &pb.MoreRepeated{XXX_unrecognized: []byte{13<<3 | 0, 4}}}, - {"extension (unencoded)", messageWithExtension1}, - {"extension (encoded)", messageWithExtension3}, - // proto3 message - {"proto3 empty", &proto3pb.Message{}}, - {"proto3 bool", &proto3pb.Message{TrueScotsman: true}}, - {"proto3 int64", &proto3pb.Message{ResultCount: 1}}, - {"proto3 uint32", &proto3pb.Message{HeightInCm: 123}}, - {"proto3 float", &proto3pb.Message{Score: 12.6}}, - {"proto3 string", &proto3pb.Message{Name: "Snezana"}}, - {"proto3 bytes", &proto3pb.Message{Data: []byte("wowsa")}}, - {"proto3 bytes, empty", &proto3pb.Message{Data: []byte{}}}, - {"proto3 enum", &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}}, - {"proto3 map field with empty bytes", &proto3pb.MessageWithMap{ByteMapping: map[bool][]byte{false: []byte{}}}}, - - {"map field", &pb.MessageWithMap{NameMapping: map[int32]string{1: "Rob", 7: "Andrew"}}}, - {"map field with message", &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{0x7001: &pb.FloatingPoint{F: Float64(2.0)}}}}, - {"map field with bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte("this time for sure")}}}, - {"map field with empty bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte{}}}}, - - {"map field with big entry", &pb.MessageWithMap{NameMapping: map[int32]string{8: strings.Repeat("x", 125)}}}, - {"map field with big key and val", &pb.MessageWithMap{StrToStr: map[string]string{strings.Repeat("x", 70): strings.Repeat("y", 70)}}}, - {"map field with big numeric key", &pb.MessageWithMap{NameMapping: map[int32]string{0xf00d: "om nom nom"}}}, - - {"oneof not set", &pb.Oneof{}}, - {"oneof bool", &pb.Oneof{Union: &pb.Oneof_F_Bool{true}}}, - {"oneof zero int32", &pb.Oneof{Union: &pb.Oneof_F_Int32{0}}}, - {"oneof big int32", &pb.Oneof{Union: &pb.Oneof_F_Int32{1 << 20}}}, - {"oneof int64", &pb.Oneof{Union: &pb.Oneof_F_Int64{42}}}, - {"oneof fixed32", &pb.Oneof{Union: &pb.Oneof_F_Fixed32{43}}}, - {"oneof fixed64", &pb.Oneof{Union: &pb.Oneof_F_Fixed64{44}}}, - {"oneof uint32", &pb.Oneof{Union: &pb.Oneof_F_Uint32{45}}}, - {"oneof uint64", &pb.Oneof{Union: &pb.Oneof_F_Uint64{46}}}, - {"oneof float", &pb.Oneof{Union: &pb.Oneof_F_Float{47.1}}}, - {"oneof double", &pb.Oneof{Union: &pb.Oneof_F_Double{48.9}}}, - {"oneof string", &pb.Oneof{Union: &pb.Oneof_F_String{"Rhythmic Fman"}}}, - {"oneof bytes", &pb.Oneof{Union: &pb.Oneof_F_Bytes{[]byte("let go")}}}, - {"oneof sint32", &pb.Oneof{Union: &pb.Oneof_F_Sint32{50}}}, - {"oneof sint64", &pb.Oneof{Union: &pb.Oneof_F_Sint64{51}}}, - {"oneof enum", &pb.Oneof{Union: &pb.Oneof_F_Enum{pb.MyMessage_BLUE}}}, - {"message for oneof", &pb.GoTestField{Label: String("k"), Type: String("v")}}, - {"oneof message", &pb.Oneof{Union: &pb.Oneof_F_Message{&pb.GoTestField{Label: String("k"), Type: String("v")}}}}, - {"oneof group", &pb.Oneof{Union: &pb.Oneof_FGroup{&pb.Oneof_F_Group{X: Int32(52)}}}}, - {"oneof largest tag", &pb.Oneof{Union: &pb.Oneof_F_Largest_Tag{1}}}, - {"multiple oneofs", &pb.Oneof{Union: &pb.Oneof_F_Int32{1}, Tormato: &pb.Oneof_Value{2}}}, - - {"non-pointer message", nonptrMessage{}}, - {"custom message with embedding", &messageWithEmbedding{&pb.OtherMessage{}}}, -} - -func TestSize(t *testing.T) { - for _, tc := range SizeTests { - size := Size(tc.pb) - b, err := Marshal(tc.pb) - if err != nil { - t.Errorf("%v: Marshal failed: %v", tc.desc, err) - continue - } - if size != len(b) { - t.Errorf("%v: Size(%v) = %d, want %d", tc.desc, tc.pb, size, len(b)) - t.Logf("%v: bytes: %#v", tc.desc, b) - } - } -} diff --git a/vendor/github.com/golang/protobuf/proto/test_proto/test.pb.go b/vendor/github.com/golang/protobuf/proto/test_proto/test.pb.go deleted file mode 100644 index 049b5dd..0000000 --- a/vendor/github.com/golang/protobuf/proto/test_proto/test.pb.go +++ /dev/null @@ -1,5118 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: test_proto/test.proto - -package test_proto // import "github.com/golang/protobuf/proto/test_proto" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type FOO int32 - -const ( - FOO_FOO1 FOO = 1 -) - -var FOO_name = map[int32]string{ - 1: "FOO1", -} -var FOO_value = map[string]int32{ - "FOO1": 1, -} - -func (x FOO) Enum() *FOO { - p := new(FOO) - *p = x - return p -} -func (x FOO) String() string { - return proto.EnumName(FOO_name, int32(x)) -} -func (x *FOO) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FOO_value, data, "FOO") - if err != nil { - return err - } - *x = FOO(value) - return nil -} -func (FOO) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{0} -} - -// An enum, for completeness. -type GoTest_KIND int32 - -const ( - GoTest_VOID GoTest_KIND = 0 - // Basic types - GoTest_BOOL GoTest_KIND = 1 - GoTest_BYTES GoTest_KIND = 2 - GoTest_FINGERPRINT GoTest_KIND = 3 - GoTest_FLOAT GoTest_KIND = 4 - GoTest_INT GoTest_KIND = 5 - GoTest_STRING GoTest_KIND = 6 - GoTest_TIME GoTest_KIND = 7 - // Groupings - GoTest_TUPLE GoTest_KIND = 8 - GoTest_ARRAY GoTest_KIND = 9 - GoTest_MAP GoTest_KIND = 10 - // Table types - GoTest_TABLE GoTest_KIND = 11 - // Functions - GoTest_FUNCTION GoTest_KIND = 12 -) - -var GoTest_KIND_name = map[int32]string{ - 0: "VOID", - 1: "BOOL", - 2: "BYTES", - 3: "FINGERPRINT", - 4: "FLOAT", - 5: "INT", - 6: "STRING", - 7: "TIME", - 8: "TUPLE", - 9: "ARRAY", - 10: "MAP", - 11: "TABLE", - 12: "FUNCTION", -} -var GoTest_KIND_value = map[string]int32{ - "VOID": 0, - "BOOL": 1, - "BYTES": 2, - "FINGERPRINT": 3, - "FLOAT": 4, - "INT": 5, - "STRING": 6, - "TIME": 7, - "TUPLE": 8, - "ARRAY": 9, - "MAP": 10, - "TABLE": 11, - "FUNCTION": 12, -} - -func (x GoTest_KIND) Enum() *GoTest_KIND { - p := new(GoTest_KIND) - *p = x - return p -} -func (x GoTest_KIND) String() string { - return proto.EnumName(GoTest_KIND_name, int32(x)) -} -func (x *GoTest_KIND) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(GoTest_KIND_value, data, "GoTest_KIND") - if err != nil { - return err - } - *x = GoTest_KIND(value) - return nil -} -func (GoTest_KIND) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{2, 0} -} - -type MyMessage_Color int32 - -const ( - MyMessage_RED MyMessage_Color = 0 - MyMessage_GREEN MyMessage_Color = 1 - MyMessage_BLUE MyMessage_Color = 2 -) - -var MyMessage_Color_name = map[int32]string{ - 0: "RED", - 1: "GREEN", - 2: "BLUE", -} -var MyMessage_Color_value = map[string]int32{ - "RED": 0, - "GREEN": 1, - "BLUE": 2, -} - -func (x MyMessage_Color) Enum() *MyMessage_Color { - p := new(MyMessage_Color) - *p = x - return p -} -func (x MyMessage_Color) String() string { - return proto.EnumName(MyMessage_Color_name, int32(x)) -} -func (x *MyMessage_Color) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MyMessage_Color_value, data, "MyMessage_Color") - if err != nil { - return err - } - *x = MyMessage_Color(value) - return nil -} -func (MyMessage_Color) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{13, 0} -} - -type DefaultsMessage_DefaultsEnum int32 - -const ( - DefaultsMessage_ZERO DefaultsMessage_DefaultsEnum = 0 - DefaultsMessage_ONE DefaultsMessage_DefaultsEnum = 1 - DefaultsMessage_TWO DefaultsMessage_DefaultsEnum = 2 -) - -var DefaultsMessage_DefaultsEnum_name = map[int32]string{ - 0: "ZERO", - 1: "ONE", - 2: "TWO", -} -var DefaultsMessage_DefaultsEnum_value = map[string]int32{ - "ZERO": 0, - "ONE": 1, - "TWO": 2, -} - -func (x DefaultsMessage_DefaultsEnum) Enum() *DefaultsMessage_DefaultsEnum { - p := new(DefaultsMessage_DefaultsEnum) - *p = x - return p -} -func (x DefaultsMessage_DefaultsEnum) String() string { - return proto.EnumName(DefaultsMessage_DefaultsEnum_name, int32(x)) -} -func (x *DefaultsMessage_DefaultsEnum) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DefaultsMessage_DefaultsEnum_value, data, "DefaultsMessage_DefaultsEnum") - if err != nil { - return err - } - *x = DefaultsMessage_DefaultsEnum(value) - return nil -} -func (DefaultsMessage_DefaultsEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{16, 0} -} - -type Defaults_Color int32 - -const ( - Defaults_RED Defaults_Color = 0 - Defaults_GREEN Defaults_Color = 1 - Defaults_BLUE Defaults_Color = 2 -) - -var Defaults_Color_name = map[int32]string{ - 0: "RED", - 1: "GREEN", - 2: "BLUE", -} -var Defaults_Color_value = map[string]int32{ - "RED": 0, - "GREEN": 1, - "BLUE": 2, -} - -func (x Defaults_Color) Enum() *Defaults_Color { - p := new(Defaults_Color) - *p = x - return p -} -func (x Defaults_Color) String() string { - return proto.EnumName(Defaults_Color_name, int32(x)) -} -func (x *Defaults_Color) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Defaults_Color_value, data, "Defaults_Color") - if err != nil { - return err - } - *x = Defaults_Color(value) - return nil -} -func (Defaults_Color) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{21, 0} -} - -type RepeatedEnum_Color int32 - -const ( - RepeatedEnum_RED RepeatedEnum_Color = 1 -) - -var RepeatedEnum_Color_name = map[int32]string{ - 1: "RED", -} -var RepeatedEnum_Color_value = map[string]int32{ - "RED": 1, -} - -func (x RepeatedEnum_Color) Enum() *RepeatedEnum_Color { - p := new(RepeatedEnum_Color) - *p = x - return p -} -func (x RepeatedEnum_Color) String() string { - return proto.EnumName(RepeatedEnum_Color_name, int32(x)) -} -func (x *RepeatedEnum_Color) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(RepeatedEnum_Color_value, data, "RepeatedEnum_Color") - if err != nil { - return err - } - *x = RepeatedEnum_Color(value) - return nil -} -func (RepeatedEnum_Color) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{23, 0} -} - -type GoEnum struct { - Foo *FOO `protobuf:"varint,1,req,name=foo,enum=test_proto.FOO" json:"foo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoEnum) Reset() { *m = GoEnum{} } -func (m *GoEnum) String() string { return proto.CompactTextString(m) } -func (*GoEnum) ProtoMessage() {} -func (*GoEnum) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{0} -} -func (m *GoEnum) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoEnum.Unmarshal(m, b) -} -func (m *GoEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoEnum.Marshal(b, m, deterministic) -} -func (dst *GoEnum) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoEnum.Merge(dst, src) -} -func (m *GoEnum) XXX_Size() int { - return xxx_messageInfo_GoEnum.Size(m) -} -func (m *GoEnum) XXX_DiscardUnknown() { - xxx_messageInfo_GoEnum.DiscardUnknown(m) -} - -var xxx_messageInfo_GoEnum proto.InternalMessageInfo - -func (m *GoEnum) GetFoo() FOO { - if m != nil && m.Foo != nil { - return *m.Foo - } - return FOO_FOO1 -} - -type GoTestField struct { - Label *string `protobuf:"bytes,1,req,name=Label" json:"Label,omitempty"` - Type *string `protobuf:"bytes,2,req,name=Type" json:"Type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoTestField) Reset() { *m = GoTestField{} } -func (m *GoTestField) String() string { return proto.CompactTextString(m) } -func (*GoTestField) ProtoMessage() {} -func (*GoTestField) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{1} -} -func (m *GoTestField) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoTestField.Unmarshal(m, b) -} -func (m *GoTestField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoTestField.Marshal(b, m, deterministic) -} -func (dst *GoTestField) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoTestField.Merge(dst, src) -} -func (m *GoTestField) XXX_Size() int { - return xxx_messageInfo_GoTestField.Size(m) -} -func (m *GoTestField) XXX_DiscardUnknown() { - xxx_messageInfo_GoTestField.DiscardUnknown(m) -} - -var xxx_messageInfo_GoTestField proto.InternalMessageInfo - -func (m *GoTestField) GetLabel() string { - if m != nil && m.Label != nil { - return *m.Label - } - return "" -} - -func (m *GoTestField) GetType() string { - if m != nil && m.Type != nil { - return *m.Type - } - return "" -} - -type GoTest struct { - // Some typical parameters - Kind *GoTest_KIND `protobuf:"varint,1,req,name=Kind,enum=test_proto.GoTest_KIND" json:"Kind,omitempty"` - Table *string `protobuf:"bytes,2,opt,name=Table" json:"Table,omitempty"` - Param *int32 `protobuf:"varint,3,opt,name=Param" json:"Param,omitempty"` - // Required, repeated and optional foreign fields. - RequiredField *GoTestField `protobuf:"bytes,4,req,name=RequiredField" json:"RequiredField,omitempty"` - RepeatedField []*GoTestField `protobuf:"bytes,5,rep,name=RepeatedField" json:"RepeatedField,omitempty"` - OptionalField *GoTestField `protobuf:"bytes,6,opt,name=OptionalField" json:"OptionalField,omitempty"` - // Required fields of all basic types - F_BoolRequired *bool `protobuf:"varint,10,req,name=F_Bool_required,json=FBoolRequired" json:"F_Bool_required,omitempty"` - F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required,json=FInt32Required" json:"F_Int32_required,omitempty"` - F_Int64Required *int64 `protobuf:"varint,12,req,name=F_Int64_required,json=FInt64Required" json:"F_Int64_required,omitempty"` - F_Fixed32Required *uint32 `protobuf:"fixed32,13,req,name=F_Fixed32_required,json=FFixed32Required" json:"F_Fixed32_required,omitempty"` - F_Fixed64Required *uint64 `protobuf:"fixed64,14,req,name=F_Fixed64_required,json=FFixed64Required" json:"F_Fixed64_required,omitempty"` - F_Uint32Required *uint32 `protobuf:"varint,15,req,name=F_Uint32_required,json=FUint32Required" json:"F_Uint32_required,omitempty"` - F_Uint64Required *uint64 `protobuf:"varint,16,req,name=F_Uint64_required,json=FUint64Required" json:"F_Uint64_required,omitempty"` - F_FloatRequired *float32 `protobuf:"fixed32,17,req,name=F_Float_required,json=FFloatRequired" json:"F_Float_required,omitempty"` - F_DoubleRequired *float64 `protobuf:"fixed64,18,req,name=F_Double_required,json=FDoubleRequired" json:"F_Double_required,omitempty"` - F_StringRequired *string `protobuf:"bytes,19,req,name=F_String_required,json=FStringRequired" json:"F_String_required,omitempty"` - F_BytesRequired []byte `protobuf:"bytes,101,req,name=F_Bytes_required,json=FBytesRequired" json:"F_Bytes_required,omitempty"` - F_Sint32Required *int32 `protobuf:"zigzag32,102,req,name=F_Sint32_required,json=FSint32Required" json:"F_Sint32_required,omitempty"` - F_Sint64Required *int64 `protobuf:"zigzag64,103,req,name=F_Sint64_required,json=FSint64Required" json:"F_Sint64_required,omitempty"` - F_Sfixed32Required *int32 `protobuf:"fixed32,104,req,name=F_Sfixed32_required,json=FSfixed32Required" json:"F_Sfixed32_required,omitempty"` - F_Sfixed64Required *int64 `protobuf:"fixed64,105,req,name=F_Sfixed64_required,json=FSfixed64Required" json:"F_Sfixed64_required,omitempty"` - // Repeated fields of all basic types - F_BoolRepeated []bool `protobuf:"varint,20,rep,name=F_Bool_repeated,json=FBoolRepeated" json:"F_Bool_repeated,omitempty"` - F_Int32Repeated []int32 `protobuf:"varint,21,rep,name=F_Int32_repeated,json=FInt32Repeated" json:"F_Int32_repeated,omitempty"` - F_Int64Repeated []int64 `protobuf:"varint,22,rep,name=F_Int64_repeated,json=FInt64Repeated" json:"F_Int64_repeated,omitempty"` - F_Fixed32Repeated []uint32 `protobuf:"fixed32,23,rep,name=F_Fixed32_repeated,json=FFixed32Repeated" json:"F_Fixed32_repeated,omitempty"` - F_Fixed64Repeated []uint64 `protobuf:"fixed64,24,rep,name=F_Fixed64_repeated,json=FFixed64Repeated" json:"F_Fixed64_repeated,omitempty"` - F_Uint32Repeated []uint32 `protobuf:"varint,25,rep,name=F_Uint32_repeated,json=FUint32Repeated" json:"F_Uint32_repeated,omitempty"` - F_Uint64Repeated []uint64 `protobuf:"varint,26,rep,name=F_Uint64_repeated,json=FUint64Repeated" json:"F_Uint64_repeated,omitempty"` - F_FloatRepeated []float32 `protobuf:"fixed32,27,rep,name=F_Float_repeated,json=FFloatRepeated" json:"F_Float_repeated,omitempty"` - F_DoubleRepeated []float64 `protobuf:"fixed64,28,rep,name=F_Double_repeated,json=FDoubleRepeated" json:"F_Double_repeated,omitempty"` - F_StringRepeated []string `protobuf:"bytes,29,rep,name=F_String_repeated,json=FStringRepeated" json:"F_String_repeated,omitempty"` - F_BytesRepeated [][]byte `protobuf:"bytes,201,rep,name=F_Bytes_repeated,json=FBytesRepeated" json:"F_Bytes_repeated,omitempty"` - F_Sint32Repeated []int32 `protobuf:"zigzag32,202,rep,name=F_Sint32_repeated,json=FSint32Repeated" json:"F_Sint32_repeated,omitempty"` - F_Sint64Repeated []int64 `protobuf:"zigzag64,203,rep,name=F_Sint64_repeated,json=FSint64Repeated" json:"F_Sint64_repeated,omitempty"` - F_Sfixed32Repeated []int32 `protobuf:"fixed32,204,rep,name=F_Sfixed32_repeated,json=FSfixed32Repeated" json:"F_Sfixed32_repeated,omitempty"` - F_Sfixed64Repeated []int64 `protobuf:"fixed64,205,rep,name=F_Sfixed64_repeated,json=FSfixed64Repeated" json:"F_Sfixed64_repeated,omitempty"` - // Optional fields of all basic types - F_BoolOptional *bool `protobuf:"varint,30,opt,name=F_Bool_optional,json=FBoolOptional" json:"F_Bool_optional,omitempty"` - F_Int32Optional *int32 `protobuf:"varint,31,opt,name=F_Int32_optional,json=FInt32Optional" json:"F_Int32_optional,omitempty"` - F_Int64Optional *int64 `protobuf:"varint,32,opt,name=F_Int64_optional,json=FInt64Optional" json:"F_Int64_optional,omitempty"` - F_Fixed32Optional *uint32 `protobuf:"fixed32,33,opt,name=F_Fixed32_optional,json=FFixed32Optional" json:"F_Fixed32_optional,omitempty"` - F_Fixed64Optional *uint64 `protobuf:"fixed64,34,opt,name=F_Fixed64_optional,json=FFixed64Optional" json:"F_Fixed64_optional,omitempty"` - F_Uint32Optional *uint32 `protobuf:"varint,35,opt,name=F_Uint32_optional,json=FUint32Optional" json:"F_Uint32_optional,omitempty"` - F_Uint64Optional *uint64 `protobuf:"varint,36,opt,name=F_Uint64_optional,json=FUint64Optional" json:"F_Uint64_optional,omitempty"` - F_FloatOptional *float32 `protobuf:"fixed32,37,opt,name=F_Float_optional,json=FFloatOptional" json:"F_Float_optional,omitempty"` - F_DoubleOptional *float64 `protobuf:"fixed64,38,opt,name=F_Double_optional,json=FDoubleOptional" json:"F_Double_optional,omitempty"` - F_StringOptional *string `protobuf:"bytes,39,opt,name=F_String_optional,json=FStringOptional" json:"F_String_optional,omitempty"` - F_BytesOptional []byte `protobuf:"bytes,301,opt,name=F_Bytes_optional,json=FBytesOptional" json:"F_Bytes_optional,omitempty"` - F_Sint32Optional *int32 `protobuf:"zigzag32,302,opt,name=F_Sint32_optional,json=FSint32Optional" json:"F_Sint32_optional,omitempty"` - F_Sint64Optional *int64 `protobuf:"zigzag64,303,opt,name=F_Sint64_optional,json=FSint64Optional" json:"F_Sint64_optional,omitempty"` - F_Sfixed32Optional *int32 `protobuf:"fixed32,304,opt,name=F_Sfixed32_optional,json=FSfixed32Optional" json:"F_Sfixed32_optional,omitempty"` - F_Sfixed64Optional *int64 `protobuf:"fixed64,305,opt,name=F_Sfixed64_optional,json=FSfixed64Optional" json:"F_Sfixed64_optional,omitempty"` - // Default-valued fields of all basic types - F_BoolDefaulted *bool `protobuf:"varint,40,opt,name=F_Bool_defaulted,json=FBoolDefaulted,def=1" json:"F_Bool_defaulted,omitempty"` - F_Int32Defaulted *int32 `protobuf:"varint,41,opt,name=F_Int32_defaulted,json=FInt32Defaulted,def=32" json:"F_Int32_defaulted,omitempty"` - F_Int64Defaulted *int64 `protobuf:"varint,42,opt,name=F_Int64_defaulted,json=FInt64Defaulted,def=64" json:"F_Int64_defaulted,omitempty"` - F_Fixed32Defaulted *uint32 `protobuf:"fixed32,43,opt,name=F_Fixed32_defaulted,json=FFixed32Defaulted,def=320" json:"F_Fixed32_defaulted,omitempty"` - F_Fixed64Defaulted *uint64 `protobuf:"fixed64,44,opt,name=F_Fixed64_defaulted,json=FFixed64Defaulted,def=640" json:"F_Fixed64_defaulted,omitempty"` - F_Uint32Defaulted *uint32 `protobuf:"varint,45,opt,name=F_Uint32_defaulted,json=FUint32Defaulted,def=3200" json:"F_Uint32_defaulted,omitempty"` - F_Uint64Defaulted *uint64 `protobuf:"varint,46,opt,name=F_Uint64_defaulted,json=FUint64Defaulted,def=6400" json:"F_Uint64_defaulted,omitempty"` - F_FloatDefaulted *float32 `protobuf:"fixed32,47,opt,name=F_Float_defaulted,json=FFloatDefaulted,def=314159" json:"F_Float_defaulted,omitempty"` - F_DoubleDefaulted *float64 `protobuf:"fixed64,48,opt,name=F_Double_defaulted,json=FDoubleDefaulted,def=271828" json:"F_Double_defaulted,omitempty"` - F_StringDefaulted *string `protobuf:"bytes,49,opt,name=F_String_defaulted,json=FStringDefaulted,def=hello, \"world!\"\n" json:"F_String_defaulted,omitempty"` - F_BytesDefaulted []byte `protobuf:"bytes,401,opt,name=F_Bytes_defaulted,json=FBytesDefaulted,def=Bignose" json:"F_Bytes_defaulted,omitempty"` - F_Sint32Defaulted *int32 `protobuf:"zigzag32,402,opt,name=F_Sint32_defaulted,json=FSint32Defaulted,def=-32" json:"F_Sint32_defaulted,omitempty"` - F_Sint64Defaulted *int64 `protobuf:"zigzag64,403,opt,name=F_Sint64_defaulted,json=FSint64Defaulted,def=-64" json:"F_Sint64_defaulted,omitempty"` - F_Sfixed32Defaulted *int32 `protobuf:"fixed32,404,opt,name=F_Sfixed32_defaulted,json=FSfixed32Defaulted,def=-32" json:"F_Sfixed32_defaulted,omitempty"` - F_Sfixed64Defaulted *int64 `protobuf:"fixed64,405,opt,name=F_Sfixed64_defaulted,json=FSfixed64Defaulted,def=-64" json:"F_Sfixed64_defaulted,omitempty"` - // Packed repeated fields (no string or bytes). - F_BoolRepeatedPacked []bool `protobuf:"varint,50,rep,packed,name=F_Bool_repeated_packed,json=FBoolRepeatedPacked" json:"F_Bool_repeated_packed,omitempty"` - F_Int32RepeatedPacked []int32 `protobuf:"varint,51,rep,packed,name=F_Int32_repeated_packed,json=FInt32RepeatedPacked" json:"F_Int32_repeated_packed,omitempty"` - F_Int64RepeatedPacked []int64 `protobuf:"varint,52,rep,packed,name=F_Int64_repeated_packed,json=FInt64RepeatedPacked" json:"F_Int64_repeated_packed,omitempty"` - F_Fixed32RepeatedPacked []uint32 `protobuf:"fixed32,53,rep,packed,name=F_Fixed32_repeated_packed,json=FFixed32RepeatedPacked" json:"F_Fixed32_repeated_packed,omitempty"` - F_Fixed64RepeatedPacked []uint64 `protobuf:"fixed64,54,rep,packed,name=F_Fixed64_repeated_packed,json=FFixed64RepeatedPacked" json:"F_Fixed64_repeated_packed,omitempty"` - F_Uint32RepeatedPacked []uint32 `protobuf:"varint,55,rep,packed,name=F_Uint32_repeated_packed,json=FUint32RepeatedPacked" json:"F_Uint32_repeated_packed,omitempty"` - F_Uint64RepeatedPacked []uint64 `protobuf:"varint,56,rep,packed,name=F_Uint64_repeated_packed,json=FUint64RepeatedPacked" json:"F_Uint64_repeated_packed,omitempty"` - F_FloatRepeatedPacked []float32 `protobuf:"fixed32,57,rep,packed,name=F_Float_repeated_packed,json=FFloatRepeatedPacked" json:"F_Float_repeated_packed,omitempty"` - F_DoubleRepeatedPacked []float64 `protobuf:"fixed64,58,rep,packed,name=F_Double_repeated_packed,json=FDoubleRepeatedPacked" json:"F_Double_repeated_packed,omitempty"` - F_Sint32RepeatedPacked []int32 `protobuf:"zigzag32,502,rep,packed,name=F_Sint32_repeated_packed,json=FSint32RepeatedPacked" json:"F_Sint32_repeated_packed,omitempty"` - F_Sint64RepeatedPacked []int64 `protobuf:"zigzag64,503,rep,packed,name=F_Sint64_repeated_packed,json=FSint64RepeatedPacked" json:"F_Sint64_repeated_packed,omitempty"` - F_Sfixed32RepeatedPacked []int32 `protobuf:"fixed32,504,rep,packed,name=F_Sfixed32_repeated_packed,json=FSfixed32RepeatedPacked" json:"F_Sfixed32_repeated_packed,omitempty"` - F_Sfixed64RepeatedPacked []int64 `protobuf:"fixed64,505,rep,packed,name=F_Sfixed64_repeated_packed,json=FSfixed64RepeatedPacked" json:"F_Sfixed64_repeated_packed,omitempty"` - Requiredgroup *GoTest_RequiredGroup `protobuf:"group,70,req,name=RequiredGroup,json=requiredgroup" json:"requiredgroup,omitempty"` - Repeatedgroup []*GoTest_RepeatedGroup `protobuf:"group,80,rep,name=RepeatedGroup,json=repeatedgroup" json:"repeatedgroup,omitempty"` - Optionalgroup *GoTest_OptionalGroup `protobuf:"group,90,opt,name=OptionalGroup,json=optionalgroup" json:"optionalgroup,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoTest) Reset() { *m = GoTest{} } -func (m *GoTest) String() string { return proto.CompactTextString(m) } -func (*GoTest) ProtoMessage() {} -func (*GoTest) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{2} -} -func (m *GoTest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoTest.Unmarshal(m, b) -} -func (m *GoTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoTest.Marshal(b, m, deterministic) -} -func (dst *GoTest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoTest.Merge(dst, src) -} -func (m *GoTest) XXX_Size() int { - return xxx_messageInfo_GoTest.Size(m) -} -func (m *GoTest) XXX_DiscardUnknown() { - xxx_messageInfo_GoTest.DiscardUnknown(m) -} - -var xxx_messageInfo_GoTest proto.InternalMessageInfo - -const Default_GoTest_F_BoolDefaulted bool = true -const Default_GoTest_F_Int32Defaulted int32 = 32 -const Default_GoTest_F_Int64Defaulted int64 = 64 -const Default_GoTest_F_Fixed32Defaulted uint32 = 320 -const Default_GoTest_F_Fixed64Defaulted uint64 = 640 -const Default_GoTest_F_Uint32Defaulted uint32 = 3200 -const Default_GoTest_F_Uint64Defaulted uint64 = 6400 -const Default_GoTest_F_FloatDefaulted float32 = 314159 -const Default_GoTest_F_DoubleDefaulted float64 = 271828 -const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n" - -var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose") - -const Default_GoTest_F_Sint32Defaulted int32 = -32 -const Default_GoTest_F_Sint64Defaulted int64 = -64 -const Default_GoTest_F_Sfixed32Defaulted int32 = -32 -const Default_GoTest_F_Sfixed64Defaulted int64 = -64 - -func (m *GoTest) GetKind() GoTest_KIND { - if m != nil && m.Kind != nil { - return *m.Kind - } - return GoTest_VOID -} - -func (m *GoTest) GetTable() string { - if m != nil && m.Table != nil { - return *m.Table - } - return "" -} - -func (m *GoTest) GetParam() int32 { - if m != nil && m.Param != nil { - return *m.Param - } - return 0 -} - -func (m *GoTest) GetRequiredField() *GoTestField { - if m != nil { - return m.RequiredField - } - return nil -} - -func (m *GoTest) GetRepeatedField() []*GoTestField { - if m != nil { - return m.RepeatedField - } - return nil -} - -func (m *GoTest) GetOptionalField() *GoTestField { - if m != nil { - return m.OptionalField - } - return nil -} - -func (m *GoTest) GetF_BoolRequired() bool { - if m != nil && m.F_BoolRequired != nil { - return *m.F_BoolRequired - } - return false -} - -func (m *GoTest) GetF_Int32Required() int32 { - if m != nil && m.F_Int32Required != nil { - return *m.F_Int32Required - } - return 0 -} - -func (m *GoTest) GetF_Int64Required() int64 { - if m != nil && m.F_Int64Required != nil { - return *m.F_Int64Required - } - return 0 -} - -func (m *GoTest) GetF_Fixed32Required() uint32 { - if m != nil && m.F_Fixed32Required != nil { - return *m.F_Fixed32Required - } - return 0 -} - -func (m *GoTest) GetF_Fixed64Required() uint64 { - if m != nil && m.F_Fixed64Required != nil { - return *m.F_Fixed64Required - } - return 0 -} - -func (m *GoTest) GetF_Uint32Required() uint32 { - if m != nil && m.F_Uint32Required != nil { - return *m.F_Uint32Required - } - return 0 -} - -func (m *GoTest) GetF_Uint64Required() uint64 { - if m != nil && m.F_Uint64Required != nil { - return *m.F_Uint64Required - } - return 0 -} - -func (m *GoTest) GetF_FloatRequired() float32 { - if m != nil && m.F_FloatRequired != nil { - return *m.F_FloatRequired - } - return 0 -} - -func (m *GoTest) GetF_DoubleRequired() float64 { - if m != nil && m.F_DoubleRequired != nil { - return *m.F_DoubleRequired - } - return 0 -} - -func (m *GoTest) GetF_StringRequired() string { - if m != nil && m.F_StringRequired != nil { - return *m.F_StringRequired - } - return "" -} - -func (m *GoTest) GetF_BytesRequired() []byte { - if m != nil { - return m.F_BytesRequired - } - return nil -} - -func (m *GoTest) GetF_Sint32Required() int32 { - if m != nil && m.F_Sint32Required != nil { - return *m.F_Sint32Required - } - return 0 -} - -func (m *GoTest) GetF_Sint64Required() int64 { - if m != nil && m.F_Sint64Required != nil { - return *m.F_Sint64Required - } - return 0 -} - -func (m *GoTest) GetF_Sfixed32Required() int32 { - if m != nil && m.F_Sfixed32Required != nil { - return *m.F_Sfixed32Required - } - return 0 -} - -func (m *GoTest) GetF_Sfixed64Required() int64 { - if m != nil && m.F_Sfixed64Required != nil { - return *m.F_Sfixed64Required - } - return 0 -} - -func (m *GoTest) GetF_BoolRepeated() []bool { - if m != nil { - return m.F_BoolRepeated - } - return nil -} - -func (m *GoTest) GetF_Int32Repeated() []int32 { - if m != nil { - return m.F_Int32Repeated - } - return nil -} - -func (m *GoTest) GetF_Int64Repeated() []int64 { - if m != nil { - return m.F_Int64Repeated - } - return nil -} - -func (m *GoTest) GetF_Fixed32Repeated() []uint32 { - if m != nil { - return m.F_Fixed32Repeated - } - return nil -} - -func (m *GoTest) GetF_Fixed64Repeated() []uint64 { - if m != nil { - return m.F_Fixed64Repeated - } - return nil -} - -func (m *GoTest) GetF_Uint32Repeated() []uint32 { - if m != nil { - return m.F_Uint32Repeated - } - return nil -} - -func (m *GoTest) GetF_Uint64Repeated() []uint64 { - if m != nil { - return m.F_Uint64Repeated - } - return nil -} - -func (m *GoTest) GetF_FloatRepeated() []float32 { - if m != nil { - return m.F_FloatRepeated - } - return nil -} - -func (m *GoTest) GetF_DoubleRepeated() []float64 { - if m != nil { - return m.F_DoubleRepeated - } - return nil -} - -func (m *GoTest) GetF_StringRepeated() []string { - if m != nil { - return m.F_StringRepeated - } - return nil -} - -func (m *GoTest) GetF_BytesRepeated() [][]byte { - if m != nil { - return m.F_BytesRepeated - } - return nil -} - -func (m *GoTest) GetF_Sint32Repeated() []int32 { - if m != nil { - return m.F_Sint32Repeated - } - return nil -} - -func (m *GoTest) GetF_Sint64Repeated() []int64 { - if m != nil { - return m.F_Sint64Repeated - } - return nil -} - -func (m *GoTest) GetF_Sfixed32Repeated() []int32 { - if m != nil { - return m.F_Sfixed32Repeated - } - return nil -} - -func (m *GoTest) GetF_Sfixed64Repeated() []int64 { - if m != nil { - return m.F_Sfixed64Repeated - } - return nil -} - -func (m *GoTest) GetF_BoolOptional() bool { - if m != nil && m.F_BoolOptional != nil { - return *m.F_BoolOptional - } - return false -} - -func (m *GoTest) GetF_Int32Optional() int32 { - if m != nil && m.F_Int32Optional != nil { - return *m.F_Int32Optional - } - return 0 -} - -func (m *GoTest) GetF_Int64Optional() int64 { - if m != nil && m.F_Int64Optional != nil { - return *m.F_Int64Optional - } - return 0 -} - -func (m *GoTest) GetF_Fixed32Optional() uint32 { - if m != nil && m.F_Fixed32Optional != nil { - return *m.F_Fixed32Optional - } - return 0 -} - -func (m *GoTest) GetF_Fixed64Optional() uint64 { - if m != nil && m.F_Fixed64Optional != nil { - return *m.F_Fixed64Optional - } - return 0 -} - -func (m *GoTest) GetF_Uint32Optional() uint32 { - if m != nil && m.F_Uint32Optional != nil { - return *m.F_Uint32Optional - } - return 0 -} - -func (m *GoTest) GetF_Uint64Optional() uint64 { - if m != nil && m.F_Uint64Optional != nil { - return *m.F_Uint64Optional - } - return 0 -} - -func (m *GoTest) GetF_FloatOptional() float32 { - if m != nil && m.F_FloatOptional != nil { - return *m.F_FloatOptional - } - return 0 -} - -func (m *GoTest) GetF_DoubleOptional() float64 { - if m != nil && m.F_DoubleOptional != nil { - return *m.F_DoubleOptional - } - return 0 -} - -func (m *GoTest) GetF_StringOptional() string { - if m != nil && m.F_StringOptional != nil { - return *m.F_StringOptional - } - return "" -} - -func (m *GoTest) GetF_BytesOptional() []byte { - if m != nil { - return m.F_BytesOptional - } - return nil -} - -func (m *GoTest) GetF_Sint32Optional() int32 { - if m != nil && m.F_Sint32Optional != nil { - return *m.F_Sint32Optional - } - return 0 -} - -func (m *GoTest) GetF_Sint64Optional() int64 { - if m != nil && m.F_Sint64Optional != nil { - return *m.F_Sint64Optional - } - return 0 -} - -func (m *GoTest) GetF_Sfixed32Optional() int32 { - if m != nil && m.F_Sfixed32Optional != nil { - return *m.F_Sfixed32Optional - } - return 0 -} - -func (m *GoTest) GetF_Sfixed64Optional() int64 { - if m != nil && m.F_Sfixed64Optional != nil { - return *m.F_Sfixed64Optional - } - return 0 -} - -func (m *GoTest) GetF_BoolDefaulted() bool { - if m != nil && m.F_BoolDefaulted != nil { - return *m.F_BoolDefaulted - } - return Default_GoTest_F_BoolDefaulted -} - -func (m *GoTest) GetF_Int32Defaulted() int32 { - if m != nil && m.F_Int32Defaulted != nil { - return *m.F_Int32Defaulted - } - return Default_GoTest_F_Int32Defaulted -} - -func (m *GoTest) GetF_Int64Defaulted() int64 { - if m != nil && m.F_Int64Defaulted != nil { - return *m.F_Int64Defaulted - } - return Default_GoTest_F_Int64Defaulted -} - -func (m *GoTest) GetF_Fixed32Defaulted() uint32 { - if m != nil && m.F_Fixed32Defaulted != nil { - return *m.F_Fixed32Defaulted - } - return Default_GoTest_F_Fixed32Defaulted -} - -func (m *GoTest) GetF_Fixed64Defaulted() uint64 { - if m != nil && m.F_Fixed64Defaulted != nil { - return *m.F_Fixed64Defaulted - } - return Default_GoTest_F_Fixed64Defaulted -} - -func (m *GoTest) GetF_Uint32Defaulted() uint32 { - if m != nil && m.F_Uint32Defaulted != nil { - return *m.F_Uint32Defaulted - } - return Default_GoTest_F_Uint32Defaulted -} - -func (m *GoTest) GetF_Uint64Defaulted() uint64 { - if m != nil && m.F_Uint64Defaulted != nil { - return *m.F_Uint64Defaulted - } - return Default_GoTest_F_Uint64Defaulted -} - -func (m *GoTest) GetF_FloatDefaulted() float32 { - if m != nil && m.F_FloatDefaulted != nil { - return *m.F_FloatDefaulted - } - return Default_GoTest_F_FloatDefaulted -} - -func (m *GoTest) GetF_DoubleDefaulted() float64 { - if m != nil && m.F_DoubleDefaulted != nil { - return *m.F_DoubleDefaulted - } - return Default_GoTest_F_DoubleDefaulted -} - -func (m *GoTest) GetF_StringDefaulted() string { - if m != nil && m.F_StringDefaulted != nil { - return *m.F_StringDefaulted - } - return Default_GoTest_F_StringDefaulted -} - -func (m *GoTest) GetF_BytesDefaulted() []byte { - if m != nil && m.F_BytesDefaulted != nil { - return m.F_BytesDefaulted - } - return append([]byte(nil), Default_GoTest_F_BytesDefaulted...) -} - -func (m *GoTest) GetF_Sint32Defaulted() int32 { - if m != nil && m.F_Sint32Defaulted != nil { - return *m.F_Sint32Defaulted - } - return Default_GoTest_F_Sint32Defaulted -} - -func (m *GoTest) GetF_Sint64Defaulted() int64 { - if m != nil && m.F_Sint64Defaulted != nil { - return *m.F_Sint64Defaulted - } - return Default_GoTest_F_Sint64Defaulted -} - -func (m *GoTest) GetF_Sfixed32Defaulted() int32 { - if m != nil && m.F_Sfixed32Defaulted != nil { - return *m.F_Sfixed32Defaulted - } - return Default_GoTest_F_Sfixed32Defaulted -} - -func (m *GoTest) GetF_Sfixed64Defaulted() int64 { - if m != nil && m.F_Sfixed64Defaulted != nil { - return *m.F_Sfixed64Defaulted - } - return Default_GoTest_F_Sfixed64Defaulted -} - -func (m *GoTest) GetF_BoolRepeatedPacked() []bool { - if m != nil { - return m.F_BoolRepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Int32RepeatedPacked() []int32 { - if m != nil { - return m.F_Int32RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Int64RepeatedPacked() []int64 { - if m != nil { - return m.F_Int64RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Fixed32RepeatedPacked() []uint32 { - if m != nil { - return m.F_Fixed32RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Fixed64RepeatedPacked() []uint64 { - if m != nil { - return m.F_Fixed64RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Uint32RepeatedPacked() []uint32 { - if m != nil { - return m.F_Uint32RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Uint64RepeatedPacked() []uint64 { - if m != nil { - return m.F_Uint64RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_FloatRepeatedPacked() []float32 { - if m != nil { - return m.F_FloatRepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_DoubleRepeatedPacked() []float64 { - if m != nil { - return m.F_DoubleRepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Sint32RepeatedPacked() []int32 { - if m != nil { - return m.F_Sint32RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Sint64RepeatedPacked() []int64 { - if m != nil { - return m.F_Sint64RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Sfixed32RepeatedPacked() []int32 { - if m != nil { - return m.F_Sfixed32RepeatedPacked - } - return nil -} - -func (m *GoTest) GetF_Sfixed64RepeatedPacked() []int64 { - if m != nil { - return m.F_Sfixed64RepeatedPacked - } - return nil -} - -func (m *GoTest) GetRequiredgroup() *GoTest_RequiredGroup { - if m != nil { - return m.Requiredgroup - } - return nil -} - -func (m *GoTest) GetRepeatedgroup() []*GoTest_RepeatedGroup { - if m != nil { - return m.Repeatedgroup - } - return nil -} - -func (m *GoTest) GetOptionalgroup() *GoTest_OptionalGroup { - if m != nil { - return m.Optionalgroup - } - return nil -} - -// Required, repeated, and optional groups. -type GoTest_RequiredGroup struct { - RequiredField *string `protobuf:"bytes,71,req,name=RequiredField" json:"RequiredField,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoTest_RequiredGroup) Reset() { *m = GoTest_RequiredGroup{} } -func (m *GoTest_RequiredGroup) String() string { return proto.CompactTextString(m) } -func (*GoTest_RequiredGroup) ProtoMessage() {} -func (*GoTest_RequiredGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{2, 0} -} -func (m *GoTest_RequiredGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoTest_RequiredGroup.Unmarshal(m, b) -} -func (m *GoTest_RequiredGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoTest_RequiredGroup.Marshal(b, m, deterministic) -} -func (dst *GoTest_RequiredGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoTest_RequiredGroup.Merge(dst, src) -} -func (m *GoTest_RequiredGroup) XXX_Size() int { - return xxx_messageInfo_GoTest_RequiredGroup.Size(m) -} -func (m *GoTest_RequiredGroup) XXX_DiscardUnknown() { - xxx_messageInfo_GoTest_RequiredGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_GoTest_RequiredGroup proto.InternalMessageInfo - -func (m *GoTest_RequiredGroup) GetRequiredField() string { - if m != nil && m.RequiredField != nil { - return *m.RequiredField - } - return "" -} - -type GoTest_RepeatedGroup struct { - RequiredField *string `protobuf:"bytes,81,req,name=RequiredField" json:"RequiredField,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoTest_RepeatedGroup) Reset() { *m = GoTest_RepeatedGroup{} } -func (m *GoTest_RepeatedGroup) String() string { return proto.CompactTextString(m) } -func (*GoTest_RepeatedGroup) ProtoMessage() {} -func (*GoTest_RepeatedGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{2, 1} -} -func (m *GoTest_RepeatedGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoTest_RepeatedGroup.Unmarshal(m, b) -} -func (m *GoTest_RepeatedGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoTest_RepeatedGroup.Marshal(b, m, deterministic) -} -func (dst *GoTest_RepeatedGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoTest_RepeatedGroup.Merge(dst, src) -} -func (m *GoTest_RepeatedGroup) XXX_Size() int { - return xxx_messageInfo_GoTest_RepeatedGroup.Size(m) -} -func (m *GoTest_RepeatedGroup) XXX_DiscardUnknown() { - xxx_messageInfo_GoTest_RepeatedGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_GoTest_RepeatedGroup proto.InternalMessageInfo - -func (m *GoTest_RepeatedGroup) GetRequiredField() string { - if m != nil && m.RequiredField != nil { - return *m.RequiredField - } - return "" -} - -type GoTest_OptionalGroup struct { - RequiredField *string `protobuf:"bytes,91,req,name=RequiredField" json:"RequiredField,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoTest_OptionalGroup) Reset() { *m = GoTest_OptionalGroup{} } -func (m *GoTest_OptionalGroup) String() string { return proto.CompactTextString(m) } -func (*GoTest_OptionalGroup) ProtoMessage() {} -func (*GoTest_OptionalGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{2, 2} -} -func (m *GoTest_OptionalGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoTest_OptionalGroup.Unmarshal(m, b) -} -func (m *GoTest_OptionalGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoTest_OptionalGroup.Marshal(b, m, deterministic) -} -func (dst *GoTest_OptionalGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoTest_OptionalGroup.Merge(dst, src) -} -func (m *GoTest_OptionalGroup) XXX_Size() int { - return xxx_messageInfo_GoTest_OptionalGroup.Size(m) -} -func (m *GoTest_OptionalGroup) XXX_DiscardUnknown() { - xxx_messageInfo_GoTest_OptionalGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_GoTest_OptionalGroup proto.InternalMessageInfo - -func (m *GoTest_OptionalGroup) GetRequiredField() string { - if m != nil && m.RequiredField != nil { - return *m.RequiredField - } - return "" -} - -// For testing a group containing a required field. -type GoTestRequiredGroupField struct { - Group *GoTestRequiredGroupField_Group `protobuf:"group,1,req,name=Group,json=group" json:"group,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoTestRequiredGroupField) Reset() { *m = GoTestRequiredGroupField{} } -func (m *GoTestRequiredGroupField) String() string { return proto.CompactTextString(m) } -func (*GoTestRequiredGroupField) ProtoMessage() {} -func (*GoTestRequiredGroupField) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{3} -} -func (m *GoTestRequiredGroupField) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoTestRequiredGroupField.Unmarshal(m, b) -} -func (m *GoTestRequiredGroupField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoTestRequiredGroupField.Marshal(b, m, deterministic) -} -func (dst *GoTestRequiredGroupField) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoTestRequiredGroupField.Merge(dst, src) -} -func (m *GoTestRequiredGroupField) XXX_Size() int { - return xxx_messageInfo_GoTestRequiredGroupField.Size(m) -} -func (m *GoTestRequiredGroupField) XXX_DiscardUnknown() { - xxx_messageInfo_GoTestRequiredGroupField.DiscardUnknown(m) -} - -var xxx_messageInfo_GoTestRequiredGroupField proto.InternalMessageInfo - -func (m *GoTestRequiredGroupField) GetGroup() *GoTestRequiredGroupField_Group { - if m != nil { - return m.Group - } - return nil -} - -type GoTestRequiredGroupField_Group struct { - Field *int32 `protobuf:"varint,2,req,name=Field" json:"Field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoTestRequiredGroupField_Group) Reset() { *m = GoTestRequiredGroupField_Group{} } -func (m *GoTestRequiredGroupField_Group) String() string { return proto.CompactTextString(m) } -func (*GoTestRequiredGroupField_Group) ProtoMessage() {} -func (*GoTestRequiredGroupField_Group) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{3, 0} -} -func (m *GoTestRequiredGroupField_Group) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoTestRequiredGroupField_Group.Unmarshal(m, b) -} -func (m *GoTestRequiredGroupField_Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoTestRequiredGroupField_Group.Marshal(b, m, deterministic) -} -func (dst *GoTestRequiredGroupField_Group) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoTestRequiredGroupField_Group.Merge(dst, src) -} -func (m *GoTestRequiredGroupField_Group) XXX_Size() int { - return xxx_messageInfo_GoTestRequiredGroupField_Group.Size(m) -} -func (m *GoTestRequiredGroupField_Group) XXX_DiscardUnknown() { - xxx_messageInfo_GoTestRequiredGroupField_Group.DiscardUnknown(m) -} - -var xxx_messageInfo_GoTestRequiredGroupField_Group proto.InternalMessageInfo - -func (m *GoTestRequiredGroupField_Group) GetField() int32 { - if m != nil && m.Field != nil { - return *m.Field - } - return 0 -} - -// For testing skipping of unrecognized fields. -// Numbers are all big, larger than tag numbers in GoTestField, -// the message used in the corresponding test. -type GoSkipTest struct { - SkipInt32 *int32 `protobuf:"varint,11,req,name=skip_int32,json=skipInt32" json:"skip_int32,omitempty"` - SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32,json=skipFixed32" json:"skip_fixed32,omitempty"` - SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64,json=skipFixed64" json:"skip_fixed64,omitempty"` - SkipString *string `protobuf:"bytes,14,req,name=skip_string,json=skipString" json:"skip_string,omitempty"` - Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup,json=skipgroup" json:"skipgroup,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoSkipTest) Reset() { *m = GoSkipTest{} } -func (m *GoSkipTest) String() string { return proto.CompactTextString(m) } -func (*GoSkipTest) ProtoMessage() {} -func (*GoSkipTest) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{4} -} -func (m *GoSkipTest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoSkipTest.Unmarshal(m, b) -} -func (m *GoSkipTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoSkipTest.Marshal(b, m, deterministic) -} -func (dst *GoSkipTest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoSkipTest.Merge(dst, src) -} -func (m *GoSkipTest) XXX_Size() int { - return xxx_messageInfo_GoSkipTest.Size(m) -} -func (m *GoSkipTest) XXX_DiscardUnknown() { - xxx_messageInfo_GoSkipTest.DiscardUnknown(m) -} - -var xxx_messageInfo_GoSkipTest proto.InternalMessageInfo - -func (m *GoSkipTest) GetSkipInt32() int32 { - if m != nil && m.SkipInt32 != nil { - return *m.SkipInt32 - } - return 0 -} - -func (m *GoSkipTest) GetSkipFixed32() uint32 { - if m != nil && m.SkipFixed32 != nil { - return *m.SkipFixed32 - } - return 0 -} - -func (m *GoSkipTest) GetSkipFixed64() uint64 { - if m != nil && m.SkipFixed64 != nil { - return *m.SkipFixed64 - } - return 0 -} - -func (m *GoSkipTest) GetSkipString() string { - if m != nil && m.SkipString != nil { - return *m.SkipString - } - return "" -} - -func (m *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup { - if m != nil { - return m.Skipgroup - } - return nil -} - -type GoSkipTest_SkipGroup struct { - GroupInt32 *int32 `protobuf:"varint,16,req,name=group_int32,json=groupInt32" json:"group_int32,omitempty"` - GroupString *string `protobuf:"bytes,17,req,name=group_string,json=groupString" json:"group_string,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GoSkipTest_SkipGroup) Reset() { *m = GoSkipTest_SkipGroup{} } -func (m *GoSkipTest_SkipGroup) String() string { return proto.CompactTextString(m) } -func (*GoSkipTest_SkipGroup) ProtoMessage() {} -func (*GoSkipTest_SkipGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{4, 0} -} -func (m *GoSkipTest_SkipGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoSkipTest_SkipGroup.Unmarshal(m, b) -} -func (m *GoSkipTest_SkipGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoSkipTest_SkipGroup.Marshal(b, m, deterministic) -} -func (dst *GoSkipTest_SkipGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoSkipTest_SkipGroup.Merge(dst, src) -} -func (m *GoSkipTest_SkipGroup) XXX_Size() int { - return xxx_messageInfo_GoSkipTest_SkipGroup.Size(m) -} -func (m *GoSkipTest_SkipGroup) XXX_DiscardUnknown() { - xxx_messageInfo_GoSkipTest_SkipGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_GoSkipTest_SkipGroup proto.InternalMessageInfo - -func (m *GoSkipTest_SkipGroup) GetGroupInt32() int32 { - if m != nil && m.GroupInt32 != nil { - return *m.GroupInt32 - } - return 0 -} - -func (m *GoSkipTest_SkipGroup) GetGroupString() string { - if m != nil && m.GroupString != nil { - return *m.GroupString - } - return "" -} - -// For testing packed/non-packed decoder switching. -// A serialized instance of one should be deserializable as the other. -type NonPackedTest struct { - A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NonPackedTest) Reset() { *m = NonPackedTest{} } -func (m *NonPackedTest) String() string { return proto.CompactTextString(m) } -func (*NonPackedTest) ProtoMessage() {} -func (*NonPackedTest) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{5} -} -func (m *NonPackedTest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NonPackedTest.Unmarshal(m, b) -} -func (m *NonPackedTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NonPackedTest.Marshal(b, m, deterministic) -} -func (dst *NonPackedTest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NonPackedTest.Merge(dst, src) -} -func (m *NonPackedTest) XXX_Size() int { - return xxx_messageInfo_NonPackedTest.Size(m) -} -func (m *NonPackedTest) XXX_DiscardUnknown() { - xxx_messageInfo_NonPackedTest.DiscardUnknown(m) -} - -var xxx_messageInfo_NonPackedTest proto.InternalMessageInfo - -func (m *NonPackedTest) GetA() []int32 { - if m != nil { - return m.A - } - return nil -} - -type PackedTest struct { - B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PackedTest) Reset() { *m = PackedTest{} } -func (m *PackedTest) String() string { return proto.CompactTextString(m) } -func (*PackedTest) ProtoMessage() {} -func (*PackedTest) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{6} -} -func (m *PackedTest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PackedTest.Unmarshal(m, b) -} -func (m *PackedTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PackedTest.Marshal(b, m, deterministic) -} -func (dst *PackedTest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PackedTest.Merge(dst, src) -} -func (m *PackedTest) XXX_Size() int { - return xxx_messageInfo_PackedTest.Size(m) -} -func (m *PackedTest) XXX_DiscardUnknown() { - xxx_messageInfo_PackedTest.DiscardUnknown(m) -} - -var xxx_messageInfo_PackedTest proto.InternalMessageInfo - -func (m *PackedTest) GetB() []int32 { - if m != nil { - return m.B - } - return nil -} - -type MaxTag struct { - // Maximum possible tag number. - LastField *string `protobuf:"bytes,536870911,opt,name=last_field,json=lastField" json:"last_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MaxTag) Reset() { *m = MaxTag{} } -func (m *MaxTag) String() string { return proto.CompactTextString(m) } -func (*MaxTag) ProtoMessage() {} -func (*MaxTag) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{7} -} -func (m *MaxTag) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MaxTag.Unmarshal(m, b) -} -func (m *MaxTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MaxTag.Marshal(b, m, deterministic) -} -func (dst *MaxTag) XXX_Merge(src proto.Message) { - xxx_messageInfo_MaxTag.Merge(dst, src) -} -func (m *MaxTag) XXX_Size() int { - return xxx_messageInfo_MaxTag.Size(m) -} -func (m *MaxTag) XXX_DiscardUnknown() { - xxx_messageInfo_MaxTag.DiscardUnknown(m) -} - -var xxx_messageInfo_MaxTag proto.InternalMessageInfo - -func (m *MaxTag) GetLastField() string { - if m != nil && m.LastField != nil { - return *m.LastField - } - return "" -} - -type OldMessage struct { - Nested *OldMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` - Num *int32 `protobuf:"varint,2,opt,name=num" json:"num,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OldMessage) Reset() { *m = OldMessage{} } -func (m *OldMessage) String() string { return proto.CompactTextString(m) } -func (*OldMessage) ProtoMessage() {} -func (*OldMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{8} -} -func (m *OldMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OldMessage.Unmarshal(m, b) -} -func (m *OldMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OldMessage.Marshal(b, m, deterministic) -} -func (dst *OldMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_OldMessage.Merge(dst, src) -} -func (m *OldMessage) XXX_Size() int { - return xxx_messageInfo_OldMessage.Size(m) -} -func (m *OldMessage) XXX_DiscardUnknown() { - xxx_messageInfo_OldMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_OldMessage proto.InternalMessageInfo - -func (m *OldMessage) GetNested() *OldMessage_Nested { - if m != nil { - return m.Nested - } - return nil -} - -func (m *OldMessage) GetNum() int32 { - if m != nil && m.Num != nil { - return *m.Num - } - return 0 -} - -type OldMessage_Nested struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OldMessage_Nested) Reset() { *m = OldMessage_Nested{} } -func (m *OldMessage_Nested) String() string { return proto.CompactTextString(m) } -func (*OldMessage_Nested) ProtoMessage() {} -func (*OldMessage_Nested) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{8, 0} -} -func (m *OldMessage_Nested) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OldMessage_Nested.Unmarshal(m, b) -} -func (m *OldMessage_Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OldMessage_Nested.Marshal(b, m, deterministic) -} -func (dst *OldMessage_Nested) XXX_Merge(src proto.Message) { - xxx_messageInfo_OldMessage_Nested.Merge(dst, src) -} -func (m *OldMessage_Nested) XXX_Size() int { - return xxx_messageInfo_OldMessage_Nested.Size(m) -} -func (m *OldMessage_Nested) XXX_DiscardUnknown() { - xxx_messageInfo_OldMessage_Nested.DiscardUnknown(m) -} - -var xxx_messageInfo_OldMessage_Nested proto.InternalMessageInfo - -func (m *OldMessage_Nested) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -// NewMessage is wire compatible with OldMessage; -// imagine it as a future version. -type NewMessage struct { - Nested *NewMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` - // This is an int32 in OldMessage. - Num *int64 `protobuf:"varint,2,opt,name=num" json:"num,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewMessage) Reset() { *m = NewMessage{} } -func (m *NewMessage) String() string { return proto.CompactTextString(m) } -func (*NewMessage) ProtoMessage() {} -func (*NewMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{9} -} -func (m *NewMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewMessage.Unmarshal(m, b) -} -func (m *NewMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewMessage.Marshal(b, m, deterministic) -} -func (dst *NewMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewMessage.Merge(dst, src) -} -func (m *NewMessage) XXX_Size() int { - return xxx_messageInfo_NewMessage.Size(m) -} -func (m *NewMessage) XXX_DiscardUnknown() { - xxx_messageInfo_NewMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_NewMessage proto.InternalMessageInfo - -func (m *NewMessage) GetNested() *NewMessage_Nested { - if m != nil { - return m.Nested - } - return nil -} - -func (m *NewMessage) GetNum() int64 { - if m != nil && m.Num != nil { - return *m.Num - } - return 0 -} - -type NewMessage_Nested struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - FoodGroup *string `protobuf:"bytes,2,opt,name=food_group,json=foodGroup" json:"food_group,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NewMessage_Nested) Reset() { *m = NewMessage_Nested{} } -func (m *NewMessage_Nested) String() string { return proto.CompactTextString(m) } -func (*NewMessage_Nested) ProtoMessage() {} -func (*NewMessage_Nested) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{9, 0} -} -func (m *NewMessage_Nested) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewMessage_Nested.Unmarshal(m, b) -} -func (m *NewMessage_Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewMessage_Nested.Marshal(b, m, deterministic) -} -func (dst *NewMessage_Nested) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewMessage_Nested.Merge(dst, src) -} -func (m *NewMessage_Nested) XXX_Size() int { - return xxx_messageInfo_NewMessage_Nested.Size(m) -} -func (m *NewMessage_Nested) XXX_DiscardUnknown() { - xxx_messageInfo_NewMessage_Nested.DiscardUnknown(m) -} - -var xxx_messageInfo_NewMessage_Nested proto.InternalMessageInfo - -func (m *NewMessage_Nested) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *NewMessage_Nested) GetFoodGroup() string { - if m != nil && m.FoodGroup != nil { - return *m.FoodGroup - } - return "" -} - -type InnerMessage struct { - Host *string `protobuf:"bytes,1,req,name=host" json:"host,omitempty"` - Port *int32 `protobuf:"varint,2,opt,name=port,def=4000" json:"port,omitempty"` - Connected *bool `protobuf:"varint,3,opt,name=connected" json:"connected,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InnerMessage) Reset() { *m = InnerMessage{} } -func (m *InnerMessage) String() string { return proto.CompactTextString(m) } -func (*InnerMessage) ProtoMessage() {} -func (*InnerMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{10} -} -func (m *InnerMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InnerMessage.Unmarshal(m, b) -} -func (m *InnerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InnerMessage.Marshal(b, m, deterministic) -} -func (dst *InnerMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_InnerMessage.Merge(dst, src) -} -func (m *InnerMessage) XXX_Size() int { - return xxx_messageInfo_InnerMessage.Size(m) -} -func (m *InnerMessage) XXX_DiscardUnknown() { - xxx_messageInfo_InnerMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_InnerMessage proto.InternalMessageInfo - -const Default_InnerMessage_Port int32 = 4000 - -func (m *InnerMessage) GetHost() string { - if m != nil && m.Host != nil { - return *m.Host - } - return "" -} - -func (m *InnerMessage) GetPort() int32 { - if m != nil && m.Port != nil { - return *m.Port - } - return Default_InnerMessage_Port -} - -func (m *InnerMessage) GetConnected() bool { - if m != nil && m.Connected != nil { - return *m.Connected - } - return false -} - -type OtherMessage struct { - Key *int64 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - Weight *float32 `protobuf:"fixed32,3,opt,name=weight" json:"weight,omitempty"` - Inner *InnerMessage `protobuf:"bytes,4,opt,name=inner" json:"inner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OtherMessage) Reset() { *m = OtherMessage{} } -func (m *OtherMessage) String() string { return proto.CompactTextString(m) } -func (*OtherMessage) ProtoMessage() {} -func (*OtherMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{11} -} - -var extRange_OtherMessage = []proto.ExtensionRange{ - {Start: 100, End: 536870911}, -} - -func (*OtherMessage) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_OtherMessage -} -func (m *OtherMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OtherMessage.Unmarshal(m, b) -} -func (m *OtherMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OtherMessage.Marshal(b, m, deterministic) -} -func (dst *OtherMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_OtherMessage.Merge(dst, src) -} -func (m *OtherMessage) XXX_Size() int { - return xxx_messageInfo_OtherMessage.Size(m) -} -func (m *OtherMessage) XXX_DiscardUnknown() { - xxx_messageInfo_OtherMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_OtherMessage proto.InternalMessageInfo - -func (m *OtherMessage) GetKey() int64 { - if m != nil && m.Key != nil { - return *m.Key - } - return 0 -} - -func (m *OtherMessage) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *OtherMessage) GetWeight() float32 { - if m != nil && m.Weight != nil { - return *m.Weight - } - return 0 -} - -func (m *OtherMessage) GetInner() *InnerMessage { - if m != nil { - return m.Inner - } - return nil -} - -type RequiredInnerMessage struct { - LeoFinallyWonAnOscar *InnerMessage `protobuf:"bytes,1,req,name=leo_finally_won_an_oscar,json=leoFinallyWonAnOscar" json:"leo_finally_won_an_oscar,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RequiredInnerMessage) Reset() { *m = RequiredInnerMessage{} } -func (m *RequiredInnerMessage) String() string { return proto.CompactTextString(m) } -func (*RequiredInnerMessage) ProtoMessage() {} -func (*RequiredInnerMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{12} -} -func (m *RequiredInnerMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RequiredInnerMessage.Unmarshal(m, b) -} -func (m *RequiredInnerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RequiredInnerMessage.Marshal(b, m, deterministic) -} -func (dst *RequiredInnerMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequiredInnerMessage.Merge(dst, src) -} -func (m *RequiredInnerMessage) XXX_Size() int { - return xxx_messageInfo_RequiredInnerMessage.Size(m) -} -func (m *RequiredInnerMessage) XXX_DiscardUnknown() { - xxx_messageInfo_RequiredInnerMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_RequiredInnerMessage proto.InternalMessageInfo - -func (m *RequiredInnerMessage) GetLeoFinallyWonAnOscar() *InnerMessage { - if m != nil { - return m.LeoFinallyWonAnOscar - } - return nil -} - -type MyMessage struct { - Count *int32 `protobuf:"varint,1,req,name=count" json:"count,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Quote *string `protobuf:"bytes,3,opt,name=quote" json:"quote,omitempty"` - Pet []string `protobuf:"bytes,4,rep,name=pet" json:"pet,omitempty"` - Inner *InnerMessage `protobuf:"bytes,5,opt,name=inner" json:"inner,omitempty"` - Others []*OtherMessage `protobuf:"bytes,6,rep,name=others" json:"others,omitempty"` - WeMustGoDeeper *RequiredInnerMessage `protobuf:"bytes,13,opt,name=we_must_go_deeper,json=weMustGoDeeper" json:"we_must_go_deeper,omitempty"` - RepInner []*InnerMessage `protobuf:"bytes,12,rep,name=rep_inner,json=repInner" json:"rep_inner,omitempty"` - Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=test_proto.MyMessage_Color" json:"bikeshed,omitempty"` - Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup,json=somegroup" json:"somegroup,omitempty"` - // This field becomes [][]byte in the generated code. - RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes,json=repBytes" json:"rep_bytes,omitempty"` - Bigfloat *float64 `protobuf:"fixed64,11,opt,name=bigfloat" json:"bigfloat,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MyMessage) Reset() { *m = MyMessage{} } -func (m *MyMessage) String() string { return proto.CompactTextString(m) } -func (*MyMessage) ProtoMessage() {} -func (*MyMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{13} -} - -var extRange_MyMessage = []proto.ExtensionRange{ - {Start: 100, End: 536870911}, -} - -func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MyMessage -} -func (m *MyMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MyMessage.Unmarshal(m, b) -} -func (m *MyMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MyMessage.Marshal(b, m, deterministic) -} -func (dst *MyMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_MyMessage.Merge(dst, src) -} -func (m *MyMessage) XXX_Size() int { - return xxx_messageInfo_MyMessage.Size(m) -} -func (m *MyMessage) XXX_DiscardUnknown() { - xxx_messageInfo_MyMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_MyMessage proto.InternalMessageInfo - -func (m *MyMessage) GetCount() int32 { - if m != nil && m.Count != nil { - return *m.Count - } - return 0 -} - -func (m *MyMessage) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *MyMessage) GetQuote() string { - if m != nil && m.Quote != nil { - return *m.Quote - } - return "" -} - -func (m *MyMessage) GetPet() []string { - if m != nil { - return m.Pet - } - return nil -} - -func (m *MyMessage) GetInner() *InnerMessage { - if m != nil { - return m.Inner - } - return nil -} - -func (m *MyMessage) GetOthers() []*OtherMessage { - if m != nil { - return m.Others - } - return nil -} - -func (m *MyMessage) GetWeMustGoDeeper() *RequiredInnerMessage { - if m != nil { - return m.WeMustGoDeeper - } - return nil -} - -func (m *MyMessage) GetRepInner() []*InnerMessage { - if m != nil { - return m.RepInner - } - return nil -} - -func (m *MyMessage) GetBikeshed() MyMessage_Color { - if m != nil && m.Bikeshed != nil { - return *m.Bikeshed - } - return MyMessage_RED -} - -func (m *MyMessage) GetSomegroup() *MyMessage_SomeGroup { - if m != nil { - return m.Somegroup - } - return nil -} - -func (m *MyMessage) GetRepBytes() [][]byte { - if m != nil { - return m.RepBytes - } - return nil -} - -func (m *MyMessage) GetBigfloat() float64 { - if m != nil && m.Bigfloat != nil { - return *m.Bigfloat - } - return 0 -} - -type MyMessage_SomeGroup struct { - GroupField *int32 `protobuf:"varint,9,opt,name=group_field,json=groupField" json:"group_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MyMessage_SomeGroup) Reset() { *m = MyMessage_SomeGroup{} } -func (m *MyMessage_SomeGroup) String() string { return proto.CompactTextString(m) } -func (*MyMessage_SomeGroup) ProtoMessage() {} -func (*MyMessage_SomeGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{13, 0} -} -func (m *MyMessage_SomeGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MyMessage_SomeGroup.Unmarshal(m, b) -} -func (m *MyMessage_SomeGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MyMessage_SomeGroup.Marshal(b, m, deterministic) -} -func (dst *MyMessage_SomeGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_MyMessage_SomeGroup.Merge(dst, src) -} -func (m *MyMessage_SomeGroup) XXX_Size() int { - return xxx_messageInfo_MyMessage_SomeGroup.Size(m) -} -func (m *MyMessage_SomeGroup) XXX_DiscardUnknown() { - xxx_messageInfo_MyMessage_SomeGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_MyMessage_SomeGroup proto.InternalMessageInfo - -func (m *MyMessage_SomeGroup) GetGroupField() int32 { - if m != nil && m.GroupField != nil { - return *m.GroupField - } - return 0 -} - -type Ext struct { - Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` - MapField map[int32]int32 `protobuf:"bytes,2,rep,name=map_field,json=mapField" json:"map_field,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Ext) Reset() { *m = Ext{} } -func (m *Ext) String() string { return proto.CompactTextString(m) } -func (*Ext) ProtoMessage() {} -func (*Ext) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{14} -} -func (m *Ext) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ext.Unmarshal(m, b) -} -func (m *Ext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ext.Marshal(b, m, deterministic) -} -func (dst *Ext) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ext.Merge(dst, src) -} -func (m *Ext) XXX_Size() int { - return xxx_messageInfo_Ext.Size(m) -} -func (m *Ext) XXX_DiscardUnknown() { - xxx_messageInfo_Ext.DiscardUnknown(m) -} - -var xxx_messageInfo_Ext proto.InternalMessageInfo - -func (m *Ext) GetData() string { - if m != nil && m.Data != nil { - return *m.Data - } - return "" -} - -func (m *Ext) GetMapField() map[int32]int32 { - if m != nil { - return m.MapField - } - return nil -} - -var E_Ext_More = &proto.ExtensionDesc{ - ExtendedType: (*MyMessage)(nil), - ExtensionType: (*Ext)(nil), - Field: 103, - Name: "test_proto.Ext.more", - Tag: "bytes,103,opt,name=more", - Filename: "test_proto/test.proto", -} - -var E_Ext_Text = &proto.ExtensionDesc{ - ExtendedType: (*MyMessage)(nil), - ExtensionType: (*string)(nil), - Field: 104, - Name: "test_proto.Ext.text", - Tag: "bytes,104,opt,name=text", - Filename: "test_proto/test.proto", -} - -var E_Ext_Number = &proto.ExtensionDesc{ - ExtendedType: (*MyMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 105, - Name: "test_proto.Ext.number", - Tag: "varint,105,opt,name=number", - Filename: "test_proto/test.proto", -} - -type ComplexExtension struct { - First *int32 `protobuf:"varint,1,opt,name=first" json:"first,omitempty"` - Second *int32 `protobuf:"varint,2,opt,name=second" json:"second,omitempty"` - Third []int32 `protobuf:"varint,3,rep,name=third" json:"third,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ComplexExtension) Reset() { *m = ComplexExtension{} } -func (m *ComplexExtension) String() string { return proto.CompactTextString(m) } -func (*ComplexExtension) ProtoMessage() {} -func (*ComplexExtension) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{15} -} -func (m *ComplexExtension) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ComplexExtension.Unmarshal(m, b) -} -func (m *ComplexExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ComplexExtension.Marshal(b, m, deterministic) -} -func (dst *ComplexExtension) XXX_Merge(src proto.Message) { - xxx_messageInfo_ComplexExtension.Merge(dst, src) -} -func (m *ComplexExtension) XXX_Size() int { - return xxx_messageInfo_ComplexExtension.Size(m) -} -func (m *ComplexExtension) XXX_DiscardUnknown() { - xxx_messageInfo_ComplexExtension.DiscardUnknown(m) -} - -var xxx_messageInfo_ComplexExtension proto.InternalMessageInfo - -func (m *ComplexExtension) GetFirst() int32 { - if m != nil && m.First != nil { - return *m.First - } - return 0 -} - -func (m *ComplexExtension) GetSecond() int32 { - if m != nil && m.Second != nil { - return *m.Second - } - return 0 -} - -func (m *ComplexExtension) GetThird() []int32 { - if m != nil { - return m.Third - } - return nil -} - -type DefaultsMessage struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DefaultsMessage) Reset() { *m = DefaultsMessage{} } -func (m *DefaultsMessage) String() string { return proto.CompactTextString(m) } -func (*DefaultsMessage) ProtoMessage() {} -func (*DefaultsMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{16} -} - -var extRange_DefaultsMessage = []proto.ExtensionRange{ - {Start: 100, End: 536870911}, -} - -func (*DefaultsMessage) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_DefaultsMessage -} -func (m *DefaultsMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DefaultsMessage.Unmarshal(m, b) -} -func (m *DefaultsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DefaultsMessage.Marshal(b, m, deterministic) -} -func (dst *DefaultsMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefaultsMessage.Merge(dst, src) -} -func (m *DefaultsMessage) XXX_Size() int { - return xxx_messageInfo_DefaultsMessage.Size(m) -} -func (m *DefaultsMessage) XXX_DiscardUnknown() { - xxx_messageInfo_DefaultsMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_DefaultsMessage proto.InternalMessageInfo - -type MyMessageSet struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `protobuf_messageset:"1" json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MyMessageSet) Reset() { *m = MyMessageSet{} } -func (m *MyMessageSet) String() string { return proto.CompactTextString(m) } -func (*MyMessageSet) ProtoMessage() {} -func (*MyMessageSet) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{17} -} - -func (m *MyMessageSet) MarshalJSON() ([]byte, error) { - return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions) -} -func (m *MyMessageSet) UnmarshalJSON(buf []byte) error { - return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions) -} - -var extRange_MyMessageSet = []proto.ExtensionRange{ - {Start: 100, End: 2147483646}, -} - -func (*MyMessageSet) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MyMessageSet -} -func (m *MyMessageSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MyMessageSet.Unmarshal(m, b) -} -func (m *MyMessageSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MyMessageSet.Marshal(b, m, deterministic) -} -func (dst *MyMessageSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_MyMessageSet.Merge(dst, src) -} -func (m *MyMessageSet) XXX_Size() int { - return xxx_messageInfo_MyMessageSet.Size(m) -} -func (m *MyMessageSet) XXX_DiscardUnknown() { - xxx_messageInfo_MyMessageSet.DiscardUnknown(m) -} - -var xxx_messageInfo_MyMessageSet proto.InternalMessageInfo - -type Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{18} -} -func (m *Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty.Unmarshal(m, b) -} -func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty.Marshal(b, m, deterministic) -} -func (dst *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(dst, src) -} -func (m *Empty) XXX_Size() int { - return xxx_messageInfo_Empty.Size(m) -} -func (m *Empty) XXX_DiscardUnknown() { - xxx_messageInfo_Empty.DiscardUnknown(m) -} - -var xxx_messageInfo_Empty proto.InternalMessageInfo - -type MessageList struct { - Message []*MessageList_Message `protobuf:"group,1,rep,name=Message,json=message" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageList) Reset() { *m = MessageList{} } -func (m *MessageList) String() string { return proto.CompactTextString(m) } -func (*MessageList) ProtoMessage() {} -func (*MessageList) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{19} -} -func (m *MessageList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageList.Unmarshal(m, b) -} -func (m *MessageList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageList.Marshal(b, m, deterministic) -} -func (dst *MessageList) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageList.Merge(dst, src) -} -func (m *MessageList) XXX_Size() int { - return xxx_messageInfo_MessageList.Size(m) -} -func (m *MessageList) XXX_DiscardUnknown() { - xxx_messageInfo_MessageList.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageList proto.InternalMessageInfo - -func (m *MessageList) GetMessage() []*MessageList_Message { - if m != nil { - return m.Message - } - return nil -} - -type MessageList_Message struct { - Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` - Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageList_Message) Reset() { *m = MessageList_Message{} } -func (m *MessageList_Message) String() string { return proto.CompactTextString(m) } -func (*MessageList_Message) ProtoMessage() {} -func (*MessageList_Message) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{19, 0} -} -func (m *MessageList_Message) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageList_Message.Unmarshal(m, b) -} -func (m *MessageList_Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageList_Message.Marshal(b, m, deterministic) -} -func (dst *MessageList_Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageList_Message.Merge(dst, src) -} -func (m *MessageList_Message) XXX_Size() int { - return xxx_messageInfo_MessageList_Message.Size(m) -} -func (m *MessageList_Message) XXX_DiscardUnknown() { - xxx_messageInfo_MessageList_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageList_Message proto.InternalMessageInfo - -func (m *MessageList_Message) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *MessageList_Message) GetCount() int32 { - if m != nil && m.Count != nil { - return *m.Count - } - return 0 -} - -type Strings struct { - StringField *string `protobuf:"bytes,1,opt,name=string_field,json=stringField" json:"string_field,omitempty"` - BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field,json=bytesField" json:"bytes_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Strings) Reset() { *m = Strings{} } -func (m *Strings) String() string { return proto.CompactTextString(m) } -func (*Strings) ProtoMessage() {} -func (*Strings) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{20} -} -func (m *Strings) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Strings.Unmarshal(m, b) -} -func (m *Strings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Strings.Marshal(b, m, deterministic) -} -func (dst *Strings) XXX_Merge(src proto.Message) { - xxx_messageInfo_Strings.Merge(dst, src) -} -func (m *Strings) XXX_Size() int { - return xxx_messageInfo_Strings.Size(m) -} -func (m *Strings) XXX_DiscardUnknown() { - xxx_messageInfo_Strings.DiscardUnknown(m) -} - -var xxx_messageInfo_Strings proto.InternalMessageInfo - -func (m *Strings) GetStringField() string { - if m != nil && m.StringField != nil { - return *m.StringField - } - return "" -} - -func (m *Strings) GetBytesField() []byte { - if m != nil { - return m.BytesField - } - return nil -} - -type Defaults struct { - // Default-valued fields of all basic types. - // Same as GoTest, but copied here to make testing easier. - F_Bool *bool `protobuf:"varint,1,opt,name=F_Bool,json=FBool,def=1" json:"F_Bool,omitempty"` - F_Int32 *int32 `protobuf:"varint,2,opt,name=F_Int32,json=FInt32,def=32" json:"F_Int32,omitempty"` - F_Int64 *int64 `protobuf:"varint,3,opt,name=F_Int64,json=FInt64,def=64" json:"F_Int64,omitempty"` - F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,name=F_Fixed32,json=FFixed32,def=320" json:"F_Fixed32,omitempty"` - F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,name=F_Fixed64,json=FFixed64,def=640" json:"F_Fixed64,omitempty"` - F_Uint32 *uint32 `protobuf:"varint,6,opt,name=F_Uint32,json=FUint32,def=3200" json:"F_Uint32,omitempty"` - F_Uint64 *uint64 `protobuf:"varint,7,opt,name=F_Uint64,json=FUint64,def=6400" json:"F_Uint64,omitempty"` - F_Float *float32 `protobuf:"fixed32,8,opt,name=F_Float,json=FFloat,def=314159" json:"F_Float,omitempty"` - F_Double *float64 `protobuf:"fixed64,9,opt,name=F_Double,json=FDouble,def=271828" json:"F_Double,omitempty"` - F_String *string `protobuf:"bytes,10,opt,name=F_String,json=FString,def=hello, \"world!\"\n" json:"F_String,omitempty"` - F_Bytes []byte `protobuf:"bytes,11,opt,name=F_Bytes,json=FBytes,def=Bignose" json:"F_Bytes,omitempty"` - F_Sint32 *int32 `protobuf:"zigzag32,12,opt,name=F_Sint32,json=FSint32,def=-32" json:"F_Sint32,omitempty"` - F_Sint64 *int64 `protobuf:"zigzag64,13,opt,name=F_Sint64,json=FSint64,def=-64" json:"F_Sint64,omitempty"` - F_Enum *Defaults_Color `protobuf:"varint,14,opt,name=F_Enum,json=FEnum,enum=test_proto.Defaults_Color,def=1" json:"F_Enum,omitempty"` - // More fields with crazy defaults. - F_Pinf *float32 `protobuf:"fixed32,15,opt,name=F_Pinf,json=FPinf,def=inf" json:"F_Pinf,omitempty"` - F_Ninf *float32 `protobuf:"fixed32,16,opt,name=F_Ninf,json=FNinf,def=-inf" json:"F_Ninf,omitempty"` - F_Nan *float32 `protobuf:"fixed32,17,opt,name=F_Nan,json=FNan,def=nan" json:"F_Nan,omitempty"` - // Sub-message. - Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"` - // Redundant but explicit defaults. - StrZero *string `protobuf:"bytes,19,opt,name=str_zero,json=strZero,def=" json:"str_zero,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Defaults) Reset() { *m = Defaults{} } -func (m *Defaults) String() string { return proto.CompactTextString(m) } -func (*Defaults) ProtoMessage() {} -func (*Defaults) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{21} -} -func (m *Defaults) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Defaults.Unmarshal(m, b) -} -func (m *Defaults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Defaults.Marshal(b, m, deterministic) -} -func (dst *Defaults) XXX_Merge(src proto.Message) { - xxx_messageInfo_Defaults.Merge(dst, src) -} -func (m *Defaults) XXX_Size() int { - return xxx_messageInfo_Defaults.Size(m) -} -func (m *Defaults) XXX_DiscardUnknown() { - xxx_messageInfo_Defaults.DiscardUnknown(m) -} - -var xxx_messageInfo_Defaults proto.InternalMessageInfo - -const Default_Defaults_F_Bool bool = true -const Default_Defaults_F_Int32 int32 = 32 -const Default_Defaults_F_Int64 int64 = 64 -const Default_Defaults_F_Fixed32 uint32 = 320 -const Default_Defaults_F_Fixed64 uint64 = 640 -const Default_Defaults_F_Uint32 uint32 = 3200 -const Default_Defaults_F_Uint64 uint64 = 6400 -const Default_Defaults_F_Float float32 = 314159 -const Default_Defaults_F_Double float64 = 271828 -const Default_Defaults_F_String string = "hello, \"world!\"\n" - -var Default_Defaults_F_Bytes []byte = []byte("Bignose") - -const Default_Defaults_F_Sint32 int32 = -32 -const Default_Defaults_F_Sint64 int64 = -64 -const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN - -var Default_Defaults_F_Pinf float32 = float32(math.Inf(1)) -var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1)) -var Default_Defaults_F_Nan float32 = float32(math.NaN()) - -func (m *Defaults) GetF_Bool() bool { - if m != nil && m.F_Bool != nil { - return *m.F_Bool - } - return Default_Defaults_F_Bool -} - -func (m *Defaults) GetF_Int32() int32 { - if m != nil && m.F_Int32 != nil { - return *m.F_Int32 - } - return Default_Defaults_F_Int32 -} - -func (m *Defaults) GetF_Int64() int64 { - if m != nil && m.F_Int64 != nil { - return *m.F_Int64 - } - return Default_Defaults_F_Int64 -} - -func (m *Defaults) GetF_Fixed32() uint32 { - if m != nil && m.F_Fixed32 != nil { - return *m.F_Fixed32 - } - return Default_Defaults_F_Fixed32 -} - -func (m *Defaults) GetF_Fixed64() uint64 { - if m != nil && m.F_Fixed64 != nil { - return *m.F_Fixed64 - } - return Default_Defaults_F_Fixed64 -} - -func (m *Defaults) GetF_Uint32() uint32 { - if m != nil && m.F_Uint32 != nil { - return *m.F_Uint32 - } - return Default_Defaults_F_Uint32 -} - -func (m *Defaults) GetF_Uint64() uint64 { - if m != nil && m.F_Uint64 != nil { - return *m.F_Uint64 - } - return Default_Defaults_F_Uint64 -} - -func (m *Defaults) GetF_Float() float32 { - if m != nil && m.F_Float != nil { - return *m.F_Float - } - return Default_Defaults_F_Float -} - -func (m *Defaults) GetF_Double() float64 { - if m != nil && m.F_Double != nil { - return *m.F_Double - } - return Default_Defaults_F_Double -} - -func (m *Defaults) GetF_String() string { - if m != nil && m.F_String != nil { - return *m.F_String - } - return Default_Defaults_F_String -} - -func (m *Defaults) GetF_Bytes() []byte { - if m != nil && m.F_Bytes != nil { - return m.F_Bytes - } - return append([]byte(nil), Default_Defaults_F_Bytes...) -} - -func (m *Defaults) GetF_Sint32() int32 { - if m != nil && m.F_Sint32 != nil { - return *m.F_Sint32 - } - return Default_Defaults_F_Sint32 -} - -func (m *Defaults) GetF_Sint64() int64 { - if m != nil && m.F_Sint64 != nil { - return *m.F_Sint64 - } - return Default_Defaults_F_Sint64 -} - -func (m *Defaults) GetF_Enum() Defaults_Color { - if m != nil && m.F_Enum != nil { - return *m.F_Enum - } - return Default_Defaults_F_Enum -} - -func (m *Defaults) GetF_Pinf() float32 { - if m != nil && m.F_Pinf != nil { - return *m.F_Pinf - } - return Default_Defaults_F_Pinf -} - -func (m *Defaults) GetF_Ninf() float32 { - if m != nil && m.F_Ninf != nil { - return *m.F_Ninf - } - return Default_Defaults_F_Ninf -} - -func (m *Defaults) GetF_Nan() float32 { - if m != nil && m.F_Nan != nil { - return *m.F_Nan - } - return Default_Defaults_F_Nan -} - -func (m *Defaults) GetSub() *SubDefaults { - if m != nil { - return m.Sub - } - return nil -} - -func (m *Defaults) GetStrZero() string { - if m != nil && m.StrZero != nil { - return *m.StrZero - } - return "" -} - -type SubDefaults struct { - N *int64 `protobuf:"varint,1,opt,name=n,def=7" json:"n,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubDefaults) Reset() { *m = SubDefaults{} } -func (m *SubDefaults) String() string { return proto.CompactTextString(m) } -func (*SubDefaults) ProtoMessage() {} -func (*SubDefaults) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{22} -} -func (m *SubDefaults) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubDefaults.Unmarshal(m, b) -} -func (m *SubDefaults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubDefaults.Marshal(b, m, deterministic) -} -func (dst *SubDefaults) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubDefaults.Merge(dst, src) -} -func (m *SubDefaults) XXX_Size() int { - return xxx_messageInfo_SubDefaults.Size(m) -} -func (m *SubDefaults) XXX_DiscardUnknown() { - xxx_messageInfo_SubDefaults.DiscardUnknown(m) -} - -var xxx_messageInfo_SubDefaults proto.InternalMessageInfo - -const Default_SubDefaults_N int64 = 7 - -func (m *SubDefaults) GetN() int64 { - if m != nil && m.N != nil { - return *m.N - } - return Default_SubDefaults_N -} - -type RepeatedEnum struct { - Color []RepeatedEnum_Color `protobuf:"varint,1,rep,name=color,enum=test_proto.RepeatedEnum_Color" json:"color,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RepeatedEnum) Reset() { *m = RepeatedEnum{} } -func (m *RepeatedEnum) String() string { return proto.CompactTextString(m) } -func (*RepeatedEnum) ProtoMessage() {} -func (*RepeatedEnum) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{23} -} -func (m *RepeatedEnum) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RepeatedEnum.Unmarshal(m, b) -} -func (m *RepeatedEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RepeatedEnum.Marshal(b, m, deterministic) -} -func (dst *RepeatedEnum) XXX_Merge(src proto.Message) { - xxx_messageInfo_RepeatedEnum.Merge(dst, src) -} -func (m *RepeatedEnum) XXX_Size() int { - return xxx_messageInfo_RepeatedEnum.Size(m) -} -func (m *RepeatedEnum) XXX_DiscardUnknown() { - xxx_messageInfo_RepeatedEnum.DiscardUnknown(m) -} - -var xxx_messageInfo_RepeatedEnum proto.InternalMessageInfo - -func (m *RepeatedEnum) GetColor() []RepeatedEnum_Color { - if m != nil { - return m.Color - } - return nil -} - -type MoreRepeated struct { - Bools []bool `protobuf:"varint,1,rep,name=bools" json:"bools,omitempty"` - BoolsPacked []bool `protobuf:"varint,2,rep,packed,name=bools_packed,json=boolsPacked" json:"bools_packed,omitempty"` - Ints []int32 `protobuf:"varint,3,rep,name=ints" json:"ints,omitempty"` - IntsPacked []int32 `protobuf:"varint,4,rep,packed,name=ints_packed,json=intsPacked" json:"ints_packed,omitempty"` - Int64SPacked []int64 `protobuf:"varint,7,rep,packed,name=int64s_packed,json=int64sPacked" json:"int64s_packed,omitempty"` - Strings []string `protobuf:"bytes,5,rep,name=strings" json:"strings,omitempty"` - Fixeds []uint32 `protobuf:"fixed32,6,rep,name=fixeds" json:"fixeds,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MoreRepeated) Reset() { *m = MoreRepeated{} } -func (m *MoreRepeated) String() string { return proto.CompactTextString(m) } -func (*MoreRepeated) ProtoMessage() {} -func (*MoreRepeated) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{24} -} -func (m *MoreRepeated) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MoreRepeated.Unmarshal(m, b) -} -func (m *MoreRepeated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MoreRepeated.Marshal(b, m, deterministic) -} -func (dst *MoreRepeated) XXX_Merge(src proto.Message) { - xxx_messageInfo_MoreRepeated.Merge(dst, src) -} -func (m *MoreRepeated) XXX_Size() int { - return xxx_messageInfo_MoreRepeated.Size(m) -} -func (m *MoreRepeated) XXX_DiscardUnknown() { - xxx_messageInfo_MoreRepeated.DiscardUnknown(m) -} - -var xxx_messageInfo_MoreRepeated proto.InternalMessageInfo - -func (m *MoreRepeated) GetBools() []bool { - if m != nil { - return m.Bools - } - return nil -} - -func (m *MoreRepeated) GetBoolsPacked() []bool { - if m != nil { - return m.BoolsPacked - } - return nil -} - -func (m *MoreRepeated) GetInts() []int32 { - if m != nil { - return m.Ints - } - return nil -} - -func (m *MoreRepeated) GetIntsPacked() []int32 { - if m != nil { - return m.IntsPacked - } - return nil -} - -func (m *MoreRepeated) GetInt64SPacked() []int64 { - if m != nil { - return m.Int64SPacked - } - return nil -} - -func (m *MoreRepeated) GetStrings() []string { - if m != nil { - return m.Strings - } - return nil -} - -func (m *MoreRepeated) GetFixeds() []uint32 { - if m != nil { - return m.Fixeds - } - return nil -} - -type GroupOld struct { - G *GroupOld_G `protobuf:"group,101,opt,name=G,json=g" json:"g,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GroupOld) Reset() { *m = GroupOld{} } -func (m *GroupOld) String() string { return proto.CompactTextString(m) } -func (*GroupOld) ProtoMessage() {} -func (*GroupOld) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{25} -} -func (m *GroupOld) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupOld.Unmarshal(m, b) -} -func (m *GroupOld) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupOld.Marshal(b, m, deterministic) -} -func (dst *GroupOld) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupOld.Merge(dst, src) -} -func (m *GroupOld) XXX_Size() int { - return xxx_messageInfo_GroupOld.Size(m) -} -func (m *GroupOld) XXX_DiscardUnknown() { - xxx_messageInfo_GroupOld.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupOld proto.InternalMessageInfo - -func (m *GroupOld) GetG() *GroupOld_G { - if m != nil { - return m.G - } - return nil -} - -type GroupOld_G struct { - X *int32 `protobuf:"varint,2,opt,name=x" json:"x,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GroupOld_G) Reset() { *m = GroupOld_G{} } -func (m *GroupOld_G) String() string { return proto.CompactTextString(m) } -func (*GroupOld_G) ProtoMessage() {} -func (*GroupOld_G) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{25, 0} -} -func (m *GroupOld_G) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupOld_G.Unmarshal(m, b) -} -func (m *GroupOld_G) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupOld_G.Marshal(b, m, deterministic) -} -func (dst *GroupOld_G) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupOld_G.Merge(dst, src) -} -func (m *GroupOld_G) XXX_Size() int { - return xxx_messageInfo_GroupOld_G.Size(m) -} -func (m *GroupOld_G) XXX_DiscardUnknown() { - xxx_messageInfo_GroupOld_G.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupOld_G proto.InternalMessageInfo - -func (m *GroupOld_G) GetX() int32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -type GroupNew struct { - G *GroupNew_G `protobuf:"group,101,opt,name=G,json=g" json:"g,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GroupNew) Reset() { *m = GroupNew{} } -func (m *GroupNew) String() string { return proto.CompactTextString(m) } -func (*GroupNew) ProtoMessage() {} -func (*GroupNew) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{26} -} -func (m *GroupNew) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupNew.Unmarshal(m, b) -} -func (m *GroupNew) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupNew.Marshal(b, m, deterministic) -} -func (dst *GroupNew) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupNew.Merge(dst, src) -} -func (m *GroupNew) XXX_Size() int { - return xxx_messageInfo_GroupNew.Size(m) -} -func (m *GroupNew) XXX_DiscardUnknown() { - xxx_messageInfo_GroupNew.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupNew proto.InternalMessageInfo - -func (m *GroupNew) GetG() *GroupNew_G { - if m != nil { - return m.G - } - return nil -} - -type GroupNew_G struct { - X *int32 `protobuf:"varint,2,opt,name=x" json:"x,omitempty"` - Y *int32 `protobuf:"varint,3,opt,name=y" json:"y,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GroupNew_G) Reset() { *m = GroupNew_G{} } -func (m *GroupNew_G) String() string { return proto.CompactTextString(m) } -func (*GroupNew_G) ProtoMessage() {} -func (*GroupNew_G) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{26, 0} -} -func (m *GroupNew_G) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupNew_G.Unmarshal(m, b) -} -func (m *GroupNew_G) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupNew_G.Marshal(b, m, deterministic) -} -func (dst *GroupNew_G) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupNew_G.Merge(dst, src) -} -func (m *GroupNew_G) XXX_Size() int { - return xxx_messageInfo_GroupNew_G.Size(m) -} -func (m *GroupNew_G) XXX_DiscardUnknown() { - xxx_messageInfo_GroupNew_G.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupNew_G proto.InternalMessageInfo - -func (m *GroupNew_G) GetX() int32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -func (m *GroupNew_G) GetY() int32 { - if m != nil && m.Y != nil { - return *m.Y - } - return 0 -} - -type FloatingPoint struct { - F *float64 `protobuf:"fixed64,1,req,name=f" json:"f,omitempty"` - Exact *bool `protobuf:"varint,2,opt,name=exact" json:"exact,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FloatingPoint) Reset() { *m = FloatingPoint{} } -func (m *FloatingPoint) String() string { return proto.CompactTextString(m) } -func (*FloatingPoint) ProtoMessage() {} -func (*FloatingPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{27} -} -func (m *FloatingPoint) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FloatingPoint.Unmarshal(m, b) -} -func (m *FloatingPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FloatingPoint.Marshal(b, m, deterministic) -} -func (dst *FloatingPoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_FloatingPoint.Merge(dst, src) -} -func (m *FloatingPoint) XXX_Size() int { - return xxx_messageInfo_FloatingPoint.Size(m) -} -func (m *FloatingPoint) XXX_DiscardUnknown() { - xxx_messageInfo_FloatingPoint.DiscardUnknown(m) -} - -var xxx_messageInfo_FloatingPoint proto.InternalMessageInfo - -func (m *FloatingPoint) GetF() float64 { - if m != nil && m.F != nil { - return *m.F - } - return 0 -} - -func (m *FloatingPoint) GetExact() bool { - if m != nil && m.Exact != nil { - return *m.Exact - } - return false -} - -type MessageWithMap struct { - NameMapping map[int32]string `protobuf:"bytes,1,rep,name=name_mapping,json=nameMapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - MsgMapping map[int64]*FloatingPoint `protobuf:"bytes,2,rep,name=msg_mapping,json=msgMapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - ByteMapping map[bool][]byte `protobuf:"bytes,3,rep,name=byte_mapping,json=byteMapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - StrToStr map[string]string `protobuf:"bytes,4,rep,name=str_to_str,json=strToStr" json:"str_to_str,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } -func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } -func (*MessageWithMap) ProtoMessage() {} -func (*MessageWithMap) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{28} -} -func (m *MessageWithMap) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithMap.Unmarshal(m, b) -} -func (m *MessageWithMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithMap.Marshal(b, m, deterministic) -} -func (dst *MessageWithMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithMap.Merge(dst, src) -} -func (m *MessageWithMap) XXX_Size() int { - return xxx_messageInfo_MessageWithMap.Size(m) -} -func (m *MessageWithMap) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithMap.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithMap proto.InternalMessageInfo - -func (m *MessageWithMap) GetNameMapping() map[int32]string { - if m != nil { - return m.NameMapping - } - return nil -} - -func (m *MessageWithMap) GetMsgMapping() map[int64]*FloatingPoint { - if m != nil { - return m.MsgMapping - } - return nil -} - -func (m *MessageWithMap) GetByteMapping() map[bool][]byte { - if m != nil { - return m.ByteMapping - } - return nil -} - -func (m *MessageWithMap) GetStrToStr() map[string]string { - if m != nil { - return m.StrToStr - } - return nil -} - -type Oneof struct { - // Types that are valid to be assigned to Union: - // *Oneof_F_Bool - // *Oneof_F_Int32 - // *Oneof_F_Int64 - // *Oneof_F_Fixed32 - // *Oneof_F_Fixed64 - // *Oneof_F_Uint32 - // *Oneof_F_Uint64 - // *Oneof_F_Float - // *Oneof_F_Double - // *Oneof_F_String - // *Oneof_F_Bytes - // *Oneof_F_Sint32 - // *Oneof_F_Sint64 - // *Oneof_F_Enum - // *Oneof_F_Message - // *Oneof_FGroup - // *Oneof_F_Largest_Tag - Union isOneof_Union `protobuf_oneof:"union"` - // Types that are valid to be assigned to Tormato: - // *Oneof_Value - Tormato isOneof_Tormato `protobuf_oneof:"tormato"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oneof) Reset() { *m = Oneof{} } -func (m *Oneof) String() string { return proto.CompactTextString(m) } -func (*Oneof) ProtoMessage() {} -func (*Oneof) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{29} -} -func (m *Oneof) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oneof.Unmarshal(m, b) -} -func (m *Oneof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oneof.Marshal(b, m, deterministic) -} -func (dst *Oneof) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oneof.Merge(dst, src) -} -func (m *Oneof) XXX_Size() int { - return xxx_messageInfo_Oneof.Size(m) -} -func (m *Oneof) XXX_DiscardUnknown() { - xxx_messageInfo_Oneof.DiscardUnknown(m) -} - -var xxx_messageInfo_Oneof proto.InternalMessageInfo - -type isOneof_Union interface { - isOneof_Union() -} -type isOneof_Tormato interface { - isOneof_Tormato() -} - -type Oneof_F_Bool struct { - F_Bool bool `protobuf:"varint,1,opt,name=F_Bool,json=FBool,oneof"` -} -type Oneof_F_Int32 struct { - F_Int32 int32 `protobuf:"varint,2,opt,name=F_Int32,json=FInt32,oneof"` -} -type Oneof_F_Int64 struct { - F_Int64 int64 `protobuf:"varint,3,opt,name=F_Int64,json=FInt64,oneof"` -} -type Oneof_F_Fixed32 struct { - F_Fixed32 uint32 `protobuf:"fixed32,4,opt,name=F_Fixed32,json=FFixed32,oneof"` -} -type Oneof_F_Fixed64 struct { - F_Fixed64 uint64 `protobuf:"fixed64,5,opt,name=F_Fixed64,json=FFixed64,oneof"` -} -type Oneof_F_Uint32 struct { - F_Uint32 uint32 `protobuf:"varint,6,opt,name=F_Uint32,json=FUint32,oneof"` -} -type Oneof_F_Uint64 struct { - F_Uint64 uint64 `protobuf:"varint,7,opt,name=F_Uint64,json=FUint64,oneof"` -} -type Oneof_F_Float struct { - F_Float float32 `protobuf:"fixed32,8,opt,name=F_Float,json=FFloat,oneof"` -} -type Oneof_F_Double struct { - F_Double float64 `protobuf:"fixed64,9,opt,name=F_Double,json=FDouble,oneof"` -} -type Oneof_F_String struct { - F_String string `protobuf:"bytes,10,opt,name=F_String,json=FString,oneof"` -} -type Oneof_F_Bytes struct { - F_Bytes []byte `protobuf:"bytes,11,opt,name=F_Bytes,json=FBytes,oneof"` -} -type Oneof_F_Sint32 struct { - F_Sint32 int32 `protobuf:"zigzag32,12,opt,name=F_Sint32,json=FSint32,oneof"` -} -type Oneof_F_Sint64 struct { - F_Sint64 int64 `protobuf:"zigzag64,13,opt,name=F_Sint64,json=FSint64,oneof"` -} -type Oneof_F_Enum struct { - F_Enum MyMessage_Color `protobuf:"varint,14,opt,name=F_Enum,json=FEnum,enum=test_proto.MyMessage_Color,oneof"` -} -type Oneof_F_Message struct { - F_Message *GoTestField `protobuf:"bytes,15,opt,name=F_Message,json=FMessage,oneof"` -} -type Oneof_FGroup struct { - FGroup *Oneof_F_Group `protobuf:"group,16,opt,name=F_Group,json=fGroup,oneof"` -} -type Oneof_F_Largest_Tag struct { - F_Largest_Tag int32 `protobuf:"varint,536870911,opt,name=F_Largest_Tag,json=FLargestTag,oneof"` -} -type Oneof_Value struct { - Value int32 `protobuf:"varint,100,opt,name=value,oneof"` -} - -func (*Oneof_F_Bool) isOneof_Union() {} -func (*Oneof_F_Int32) isOneof_Union() {} -func (*Oneof_F_Int64) isOneof_Union() {} -func (*Oneof_F_Fixed32) isOneof_Union() {} -func (*Oneof_F_Fixed64) isOneof_Union() {} -func (*Oneof_F_Uint32) isOneof_Union() {} -func (*Oneof_F_Uint64) isOneof_Union() {} -func (*Oneof_F_Float) isOneof_Union() {} -func (*Oneof_F_Double) isOneof_Union() {} -func (*Oneof_F_String) isOneof_Union() {} -func (*Oneof_F_Bytes) isOneof_Union() {} -func (*Oneof_F_Sint32) isOneof_Union() {} -func (*Oneof_F_Sint64) isOneof_Union() {} -func (*Oneof_F_Enum) isOneof_Union() {} -func (*Oneof_F_Message) isOneof_Union() {} -func (*Oneof_FGroup) isOneof_Union() {} -func (*Oneof_F_Largest_Tag) isOneof_Union() {} -func (*Oneof_Value) isOneof_Tormato() {} - -func (m *Oneof) GetUnion() isOneof_Union { - if m != nil { - return m.Union - } - return nil -} -func (m *Oneof) GetTormato() isOneof_Tormato { - if m != nil { - return m.Tormato - } - return nil -} - -func (m *Oneof) GetF_Bool() bool { - if x, ok := m.GetUnion().(*Oneof_F_Bool); ok { - return x.F_Bool - } - return false -} - -func (m *Oneof) GetF_Int32() int32 { - if x, ok := m.GetUnion().(*Oneof_F_Int32); ok { - return x.F_Int32 - } - return 0 -} - -func (m *Oneof) GetF_Int64() int64 { - if x, ok := m.GetUnion().(*Oneof_F_Int64); ok { - return x.F_Int64 - } - return 0 -} - -func (m *Oneof) GetF_Fixed32() uint32 { - if x, ok := m.GetUnion().(*Oneof_F_Fixed32); ok { - return x.F_Fixed32 - } - return 0 -} - -func (m *Oneof) GetF_Fixed64() uint64 { - if x, ok := m.GetUnion().(*Oneof_F_Fixed64); ok { - return x.F_Fixed64 - } - return 0 -} - -func (m *Oneof) GetF_Uint32() uint32 { - if x, ok := m.GetUnion().(*Oneof_F_Uint32); ok { - return x.F_Uint32 - } - return 0 -} - -func (m *Oneof) GetF_Uint64() uint64 { - if x, ok := m.GetUnion().(*Oneof_F_Uint64); ok { - return x.F_Uint64 - } - return 0 -} - -func (m *Oneof) GetF_Float() float32 { - if x, ok := m.GetUnion().(*Oneof_F_Float); ok { - return x.F_Float - } - return 0 -} - -func (m *Oneof) GetF_Double() float64 { - if x, ok := m.GetUnion().(*Oneof_F_Double); ok { - return x.F_Double - } - return 0 -} - -func (m *Oneof) GetF_String() string { - if x, ok := m.GetUnion().(*Oneof_F_String); ok { - return x.F_String - } - return "" -} - -func (m *Oneof) GetF_Bytes() []byte { - if x, ok := m.GetUnion().(*Oneof_F_Bytes); ok { - return x.F_Bytes - } - return nil -} - -func (m *Oneof) GetF_Sint32() int32 { - if x, ok := m.GetUnion().(*Oneof_F_Sint32); ok { - return x.F_Sint32 - } - return 0 -} - -func (m *Oneof) GetF_Sint64() int64 { - if x, ok := m.GetUnion().(*Oneof_F_Sint64); ok { - return x.F_Sint64 - } - return 0 -} - -func (m *Oneof) GetF_Enum() MyMessage_Color { - if x, ok := m.GetUnion().(*Oneof_F_Enum); ok { - return x.F_Enum - } - return MyMessage_RED -} - -func (m *Oneof) GetF_Message() *GoTestField { - if x, ok := m.GetUnion().(*Oneof_F_Message); ok { - return x.F_Message - } - return nil -} - -func (m *Oneof) GetFGroup() *Oneof_F_Group { - if x, ok := m.GetUnion().(*Oneof_FGroup); ok { - return x.FGroup - } - return nil -} - -func (m *Oneof) GetF_Largest_Tag() int32 { - if x, ok := m.GetUnion().(*Oneof_F_Largest_Tag); ok { - return x.F_Largest_Tag - } - return 0 -} - -func (m *Oneof) GetValue() int32 { - if x, ok := m.GetTormato().(*Oneof_Value); ok { - return x.Value - } - return 0 -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Oneof) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Oneof_OneofMarshaler, _Oneof_OneofUnmarshaler, _Oneof_OneofSizer, []interface{}{ - (*Oneof_F_Bool)(nil), - (*Oneof_F_Int32)(nil), - (*Oneof_F_Int64)(nil), - (*Oneof_F_Fixed32)(nil), - (*Oneof_F_Fixed64)(nil), - (*Oneof_F_Uint32)(nil), - (*Oneof_F_Uint64)(nil), - (*Oneof_F_Float)(nil), - (*Oneof_F_Double)(nil), - (*Oneof_F_String)(nil), - (*Oneof_F_Bytes)(nil), - (*Oneof_F_Sint32)(nil), - (*Oneof_F_Sint64)(nil), - (*Oneof_F_Enum)(nil), - (*Oneof_F_Message)(nil), - (*Oneof_FGroup)(nil), - (*Oneof_F_Largest_Tag)(nil), - (*Oneof_Value)(nil), - } -} - -func _Oneof_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Oneof) - // union - switch x := m.Union.(type) { - case *Oneof_F_Bool: - t := uint64(0) - if x.F_Bool { - t = 1 - } - b.EncodeVarint(1<<3 | proto.WireVarint) - b.EncodeVarint(t) - case *Oneof_F_Int32: - b.EncodeVarint(2<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.F_Int32)) - case *Oneof_F_Int64: - b.EncodeVarint(3<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.F_Int64)) - case *Oneof_F_Fixed32: - b.EncodeVarint(4<<3 | proto.WireFixed32) - b.EncodeFixed32(uint64(x.F_Fixed32)) - case *Oneof_F_Fixed64: - b.EncodeVarint(5<<3 | proto.WireFixed64) - b.EncodeFixed64(uint64(x.F_Fixed64)) - case *Oneof_F_Uint32: - b.EncodeVarint(6<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.F_Uint32)) - case *Oneof_F_Uint64: - b.EncodeVarint(7<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.F_Uint64)) - case *Oneof_F_Float: - b.EncodeVarint(8<<3 | proto.WireFixed32) - b.EncodeFixed32(uint64(math.Float32bits(x.F_Float))) - case *Oneof_F_Double: - b.EncodeVarint(9<<3 | proto.WireFixed64) - b.EncodeFixed64(math.Float64bits(x.F_Double)) - case *Oneof_F_String: - b.EncodeVarint(10<<3 | proto.WireBytes) - b.EncodeStringBytes(x.F_String) - case *Oneof_F_Bytes: - b.EncodeVarint(11<<3 | proto.WireBytes) - b.EncodeRawBytes(x.F_Bytes) - case *Oneof_F_Sint32: - b.EncodeVarint(12<<3 | proto.WireVarint) - b.EncodeZigzag32(uint64(x.F_Sint32)) - case *Oneof_F_Sint64: - b.EncodeVarint(13<<3 | proto.WireVarint) - b.EncodeZigzag64(uint64(x.F_Sint64)) - case *Oneof_F_Enum: - b.EncodeVarint(14<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.F_Enum)) - case *Oneof_F_Message: - b.EncodeVarint(15<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.F_Message); err != nil { - return err - } - case *Oneof_FGroup: - b.EncodeVarint(16<<3 | proto.WireStartGroup) - if err := b.Marshal(x.FGroup); err != nil { - return err - } - b.EncodeVarint(16<<3 | proto.WireEndGroup) - case *Oneof_F_Largest_Tag: - b.EncodeVarint(536870911<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.F_Largest_Tag)) - case nil: - default: - return fmt.Errorf("Oneof.Union has unexpected type %T", x) - } - // tormato - switch x := m.Tormato.(type) { - case *Oneof_Value: - b.EncodeVarint(100<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.Value)) - case nil: - default: - return fmt.Errorf("Oneof.Tormato has unexpected type %T", x) - } - return nil -} - -func _Oneof_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Oneof) - switch tag { - case 1: // union.F_Bool - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Oneof_F_Bool{x != 0} - return true, err - case 2: // union.F_Int32 - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Oneof_F_Int32{int32(x)} - return true, err - case 3: // union.F_Int64 - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Oneof_F_Int64{int64(x)} - return true, err - case 4: // union.F_Fixed32 - if wire != proto.WireFixed32 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed32() - m.Union = &Oneof_F_Fixed32{uint32(x)} - return true, err - case 5: // union.F_Fixed64 - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Union = &Oneof_F_Fixed64{x} - return true, err - case 6: // union.F_Uint32 - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Oneof_F_Uint32{uint32(x)} - return true, err - case 7: // union.F_Uint64 - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Oneof_F_Uint64{x} - return true, err - case 8: // union.F_Float - if wire != proto.WireFixed32 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed32() - m.Union = &Oneof_F_Float{math.Float32frombits(uint32(x))} - return true, err - case 9: // union.F_Double - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Union = &Oneof_F_Double{math.Float64frombits(x)} - return true, err - case 10: // union.F_String - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Union = &Oneof_F_String{x} - return true, err - case 11: // union.F_Bytes - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeRawBytes(true) - m.Union = &Oneof_F_Bytes{x} - return true, err - case 12: // union.F_Sint32 - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeZigzag32() - m.Union = &Oneof_F_Sint32{int32(x)} - return true, err - case 13: // union.F_Sint64 - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeZigzag64() - m.Union = &Oneof_F_Sint64{int64(x)} - return true, err - case 14: // union.F_Enum - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Oneof_F_Enum{MyMessage_Color(x)} - return true, err - case 15: // union.F_Message - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GoTestField) - err := b.DecodeMessage(msg) - m.Union = &Oneof_F_Message{msg} - return true, err - case 16: // union.f_group - if wire != proto.WireStartGroup { - return true, proto.ErrInternalBadWireType - } - msg := new(Oneof_F_Group) - err := b.DecodeGroup(msg) - m.Union = &Oneof_FGroup{msg} - return true, err - case 536870911: // union.F_Largest_Tag - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Oneof_F_Largest_Tag{int32(x)} - return true, err - case 100: // tormato.value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Tormato = &Oneof_Value{int32(x)} - return true, err - default: - return false, nil - } -} - -func _Oneof_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Oneof) - // union - switch x := m.Union.(type) { - case *Oneof_F_Bool: - n += 1 // tag and wire - n += 1 - case *Oneof_F_Int32: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.F_Int32)) - case *Oneof_F_Int64: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.F_Int64)) - case *Oneof_F_Fixed32: - n += 1 // tag and wire - n += 4 - case *Oneof_F_Fixed64: - n += 1 // tag and wire - n += 8 - case *Oneof_F_Uint32: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.F_Uint32)) - case *Oneof_F_Uint64: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.F_Uint64)) - case *Oneof_F_Float: - n += 1 // tag and wire - n += 4 - case *Oneof_F_Double: - n += 1 // tag and wire - n += 8 - case *Oneof_F_String: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.F_String))) - n += len(x.F_String) - case *Oneof_F_Bytes: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.F_Bytes))) - n += len(x.F_Bytes) - case *Oneof_F_Sint32: - n += 1 // tag and wire - n += proto.SizeVarint(uint64((uint32(x.F_Sint32) << 1) ^ uint32((int32(x.F_Sint32) >> 31)))) - case *Oneof_F_Sint64: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(uint64(x.F_Sint64<<1) ^ uint64((int64(x.F_Sint64) >> 63)))) - case *Oneof_F_Enum: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.F_Enum)) - case *Oneof_F_Message: - s := proto.Size(x.F_Message) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Oneof_FGroup: - n += 2 // tag and wire - n += proto.Size(x.FGroup) - n += 2 // tag and wire - case *Oneof_F_Largest_Tag: - n += 10 // tag and wire - n += proto.SizeVarint(uint64(x.F_Largest_Tag)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - // tormato - switch x := m.Tormato.(type) { - case *Oneof_Value: - n += 2 // tag and wire - n += proto.SizeVarint(uint64(x.Value)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type Oneof_F_Group struct { - X *int32 `protobuf:"varint,17,opt,name=x" json:"x,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oneof_F_Group) Reset() { *m = Oneof_F_Group{} } -func (m *Oneof_F_Group) String() string { return proto.CompactTextString(m) } -func (*Oneof_F_Group) ProtoMessage() {} -func (*Oneof_F_Group) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{29, 0} -} -func (m *Oneof_F_Group) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oneof_F_Group.Unmarshal(m, b) -} -func (m *Oneof_F_Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oneof_F_Group.Marshal(b, m, deterministic) -} -func (dst *Oneof_F_Group) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oneof_F_Group.Merge(dst, src) -} -func (m *Oneof_F_Group) XXX_Size() int { - return xxx_messageInfo_Oneof_F_Group.Size(m) -} -func (m *Oneof_F_Group) XXX_DiscardUnknown() { - xxx_messageInfo_Oneof_F_Group.DiscardUnknown(m) -} - -var xxx_messageInfo_Oneof_F_Group proto.InternalMessageInfo - -func (m *Oneof_F_Group) GetX() int32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -type Communique struct { - MakeMeCry *bool `protobuf:"varint,1,opt,name=make_me_cry,json=makeMeCry" json:"make_me_cry,omitempty"` - // This is a oneof, called "union". - // - // Types that are valid to be assigned to Union: - // *Communique_Number - // *Communique_Name - // *Communique_Data - // *Communique_TempC - // *Communique_Col - // *Communique_Msg - Union isCommunique_Union `protobuf_oneof:"union"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Communique) Reset() { *m = Communique{} } -func (m *Communique) String() string { return proto.CompactTextString(m) } -func (*Communique) ProtoMessage() {} -func (*Communique) Descriptor() ([]byte, []int) { - return fileDescriptor_test_74787bfc6550f8a7, []int{30} -} -func (m *Communique) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Communique.Unmarshal(m, b) -} -func (m *Communique) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Communique.Marshal(b, m, deterministic) -} -func (dst *Communique) XXX_Merge(src proto.Message) { - xxx_messageInfo_Communique.Merge(dst, src) -} -func (m *Communique) XXX_Size() int { - return xxx_messageInfo_Communique.Size(m) -} -func (m *Communique) XXX_DiscardUnknown() { - xxx_messageInfo_Communique.DiscardUnknown(m) -} - -var xxx_messageInfo_Communique proto.InternalMessageInfo - -type isCommunique_Union interface { - isCommunique_Union() -} - -type Communique_Number struct { - Number int32 `protobuf:"varint,5,opt,name=number,oneof"` -} -type Communique_Name struct { - Name string `protobuf:"bytes,6,opt,name=name,oneof"` -} -type Communique_Data struct { - Data []byte `protobuf:"bytes,7,opt,name=data,oneof"` -} -type Communique_TempC struct { - TempC float64 `protobuf:"fixed64,8,opt,name=temp_c,json=tempC,oneof"` -} -type Communique_Col struct { - Col MyMessage_Color `protobuf:"varint,9,opt,name=col,enum=test_proto.MyMessage_Color,oneof"` -} -type Communique_Msg struct { - Msg *Strings `protobuf:"bytes,10,opt,name=msg,oneof"` -} - -func (*Communique_Number) isCommunique_Union() {} -func (*Communique_Name) isCommunique_Union() {} -func (*Communique_Data) isCommunique_Union() {} -func (*Communique_TempC) isCommunique_Union() {} -func (*Communique_Col) isCommunique_Union() {} -func (*Communique_Msg) isCommunique_Union() {} - -func (m *Communique) GetUnion() isCommunique_Union { - if m != nil { - return m.Union - } - return nil -} - -func (m *Communique) GetMakeMeCry() bool { - if m != nil && m.MakeMeCry != nil { - return *m.MakeMeCry - } - return false -} - -func (m *Communique) GetNumber() int32 { - if x, ok := m.GetUnion().(*Communique_Number); ok { - return x.Number - } - return 0 -} - -func (m *Communique) GetName() string { - if x, ok := m.GetUnion().(*Communique_Name); ok { - return x.Name - } - return "" -} - -func (m *Communique) GetData() []byte { - if x, ok := m.GetUnion().(*Communique_Data); ok { - return x.Data - } - return nil -} - -func (m *Communique) GetTempC() float64 { - if x, ok := m.GetUnion().(*Communique_TempC); ok { - return x.TempC - } - return 0 -} - -func (m *Communique) GetCol() MyMessage_Color { - if x, ok := m.GetUnion().(*Communique_Col); ok { - return x.Col - } - return MyMessage_RED -} - -func (m *Communique) GetMsg() *Strings { - if x, ok := m.GetUnion().(*Communique_Msg); ok { - return x.Msg - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Communique) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, _Communique_OneofSizer, []interface{}{ - (*Communique_Number)(nil), - (*Communique_Name)(nil), - (*Communique_Data)(nil), - (*Communique_TempC)(nil), - (*Communique_Col)(nil), - (*Communique_Msg)(nil), - } -} - -func _Communique_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Communique) - // union - switch x := m.Union.(type) { - case *Communique_Number: - b.EncodeVarint(5<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.Number)) - case *Communique_Name: - b.EncodeVarint(6<<3 | proto.WireBytes) - b.EncodeStringBytes(x.Name) - case *Communique_Data: - b.EncodeVarint(7<<3 | proto.WireBytes) - b.EncodeRawBytes(x.Data) - case *Communique_TempC: - b.EncodeVarint(8<<3 | proto.WireFixed64) - b.EncodeFixed64(math.Float64bits(x.TempC)) - case *Communique_Col: - b.EncodeVarint(9<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.Col)) - case *Communique_Msg: - b.EncodeVarint(10<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Msg); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Communique.Union has unexpected type %T", x) - } - return nil -} - -func _Communique_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Communique) - switch tag { - case 5: // union.number - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Communique_Number{int32(x)} - return true, err - case 6: // union.name - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Union = &Communique_Name{x} - return true, err - case 7: // union.data - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeRawBytes(true) - m.Union = &Communique_Data{x} - return true, err - case 8: // union.temp_c - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Union = &Communique_TempC{math.Float64frombits(x)} - return true, err - case 9: // union.col - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Communique_Col{MyMessage_Color(x)} - return true, err - case 10: // union.msg - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Strings) - err := b.DecodeMessage(msg) - m.Union = &Communique_Msg{msg} - return true, err - default: - return false, nil - } -} - -func _Communique_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Communique) - // union - switch x := m.Union.(type) { - case *Communique_Number: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Number)) - case *Communique_Name: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Name))) - n += len(x.Name) - case *Communique_Data: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Data))) - n += len(x.Data) - case *Communique_TempC: - n += 1 // tag and wire - n += 8 - case *Communique_Col: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Col)) - case *Communique_Msg: - s := proto.Size(x.Msg) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -var E_Greeting = &proto.ExtensionDesc{ - ExtendedType: (*MyMessage)(nil), - ExtensionType: ([]string)(nil), - Field: 106, - Name: "test_proto.greeting", - Tag: "bytes,106,rep,name=greeting", - Filename: "test_proto/test.proto", -} - -var E_Complex = &proto.ExtensionDesc{ - ExtendedType: (*OtherMessage)(nil), - ExtensionType: (*ComplexExtension)(nil), - Field: 200, - Name: "test_proto.complex", - Tag: "bytes,200,opt,name=complex", - Filename: "test_proto/test.proto", -} - -var E_RComplex = &proto.ExtensionDesc{ - ExtendedType: (*OtherMessage)(nil), - ExtensionType: ([]*ComplexExtension)(nil), - Field: 201, - Name: "test_proto.r_complex", - Tag: "bytes,201,rep,name=r_complex,json=rComplex", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultDouble = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*float64)(nil), - Field: 101, - Name: "test_proto.no_default_double", - Tag: "fixed64,101,opt,name=no_default_double,json=noDefaultDouble", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultFloat = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*float32)(nil), - Field: 102, - Name: "test_proto.no_default_float", - Tag: "fixed32,102,opt,name=no_default_float,json=noDefaultFloat", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultInt32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 103, - Name: "test_proto.no_default_int32", - Tag: "varint,103,opt,name=no_default_int32,json=noDefaultInt32", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultInt64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int64)(nil), - Field: 104, - Name: "test_proto.no_default_int64", - Tag: "varint,104,opt,name=no_default_int64,json=noDefaultInt64", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultUint32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint32)(nil), - Field: 105, - Name: "test_proto.no_default_uint32", - Tag: "varint,105,opt,name=no_default_uint32,json=noDefaultUint32", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultUint64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint64)(nil), - Field: 106, - Name: "test_proto.no_default_uint64", - Tag: "varint,106,opt,name=no_default_uint64,json=noDefaultUint64", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultSint32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 107, - Name: "test_proto.no_default_sint32", - Tag: "zigzag32,107,opt,name=no_default_sint32,json=noDefaultSint32", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultSint64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int64)(nil), - Field: 108, - Name: "test_proto.no_default_sint64", - Tag: "zigzag64,108,opt,name=no_default_sint64,json=noDefaultSint64", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultFixed32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint32)(nil), - Field: 109, - Name: "test_proto.no_default_fixed32", - Tag: "fixed32,109,opt,name=no_default_fixed32,json=noDefaultFixed32", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultFixed64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint64)(nil), - Field: 110, - Name: "test_proto.no_default_fixed64", - Tag: "fixed64,110,opt,name=no_default_fixed64,json=noDefaultFixed64", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultSfixed32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 111, - Name: "test_proto.no_default_sfixed32", - Tag: "fixed32,111,opt,name=no_default_sfixed32,json=noDefaultSfixed32", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultSfixed64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int64)(nil), - Field: 112, - Name: "test_proto.no_default_sfixed64", - Tag: "fixed64,112,opt,name=no_default_sfixed64,json=noDefaultSfixed64", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultBool = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*bool)(nil), - Field: 113, - Name: "test_proto.no_default_bool", - Tag: "varint,113,opt,name=no_default_bool,json=noDefaultBool", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultString = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*string)(nil), - Field: 114, - Name: "test_proto.no_default_string", - Tag: "bytes,114,opt,name=no_default_string,json=noDefaultString", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultBytes = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: ([]byte)(nil), - Field: 115, - Name: "test_proto.no_default_bytes", - Tag: "bytes,115,opt,name=no_default_bytes,json=noDefaultBytes", - Filename: "test_proto/test.proto", -} - -var E_NoDefaultEnum = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil), - Field: 116, - Name: "test_proto.no_default_enum", - Tag: "varint,116,opt,name=no_default_enum,json=noDefaultEnum,enum=test_proto.DefaultsMessage_DefaultsEnum", - Filename: "test_proto/test.proto", -} - -var E_DefaultDouble = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*float64)(nil), - Field: 201, - Name: "test_proto.default_double", - Tag: "fixed64,201,opt,name=default_double,json=defaultDouble,def=3.1415", - Filename: "test_proto/test.proto", -} - -var E_DefaultFloat = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*float32)(nil), - Field: 202, - Name: "test_proto.default_float", - Tag: "fixed32,202,opt,name=default_float,json=defaultFloat,def=3.14", - Filename: "test_proto/test.proto", -} - -var E_DefaultInt32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 203, - Name: "test_proto.default_int32", - Tag: "varint,203,opt,name=default_int32,json=defaultInt32,def=42", - Filename: "test_proto/test.proto", -} - -var E_DefaultInt64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int64)(nil), - Field: 204, - Name: "test_proto.default_int64", - Tag: "varint,204,opt,name=default_int64,json=defaultInt64,def=43", - Filename: "test_proto/test.proto", -} - -var E_DefaultUint32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint32)(nil), - Field: 205, - Name: "test_proto.default_uint32", - Tag: "varint,205,opt,name=default_uint32,json=defaultUint32,def=44", - Filename: "test_proto/test.proto", -} - -var E_DefaultUint64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint64)(nil), - Field: 206, - Name: "test_proto.default_uint64", - Tag: "varint,206,opt,name=default_uint64,json=defaultUint64,def=45", - Filename: "test_proto/test.proto", -} - -var E_DefaultSint32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 207, - Name: "test_proto.default_sint32", - Tag: "zigzag32,207,opt,name=default_sint32,json=defaultSint32,def=46", - Filename: "test_proto/test.proto", -} - -var E_DefaultSint64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int64)(nil), - Field: 208, - Name: "test_proto.default_sint64", - Tag: "zigzag64,208,opt,name=default_sint64,json=defaultSint64,def=47", - Filename: "test_proto/test.proto", -} - -var E_DefaultFixed32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint32)(nil), - Field: 209, - Name: "test_proto.default_fixed32", - Tag: "fixed32,209,opt,name=default_fixed32,json=defaultFixed32,def=48", - Filename: "test_proto/test.proto", -} - -var E_DefaultFixed64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*uint64)(nil), - Field: 210, - Name: "test_proto.default_fixed64", - Tag: "fixed64,210,opt,name=default_fixed64,json=defaultFixed64,def=49", - Filename: "test_proto/test.proto", -} - -var E_DefaultSfixed32 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 211, - Name: "test_proto.default_sfixed32", - Tag: "fixed32,211,opt,name=default_sfixed32,json=defaultSfixed32,def=50", - Filename: "test_proto/test.proto", -} - -var E_DefaultSfixed64 = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*int64)(nil), - Field: 212, - Name: "test_proto.default_sfixed64", - Tag: "fixed64,212,opt,name=default_sfixed64,json=defaultSfixed64,def=51", - Filename: "test_proto/test.proto", -} - -var E_DefaultBool = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*bool)(nil), - Field: 213, - Name: "test_proto.default_bool", - Tag: "varint,213,opt,name=default_bool,json=defaultBool,def=1", - Filename: "test_proto/test.proto", -} - -var E_DefaultString = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*string)(nil), - Field: 214, - Name: "test_proto.default_string", - Tag: "bytes,214,opt,name=default_string,json=defaultString,def=Hello, string,def=foo", - Filename: "test_proto/test.proto", -} - -var E_DefaultBytes = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: ([]byte)(nil), - Field: 215, - Name: "test_proto.default_bytes", - Tag: "bytes,215,opt,name=default_bytes,json=defaultBytes,def=Hello, bytes", - Filename: "test_proto/test.proto", -} - -var E_DefaultEnum = &proto.ExtensionDesc{ - ExtendedType: (*DefaultsMessage)(nil), - ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil), - Field: 216, - Name: "test_proto.default_enum", - Tag: "varint,216,opt,name=default_enum,json=defaultEnum,enum=test_proto.DefaultsMessage_DefaultsEnum,def=1", - Filename: "test_proto/test.proto", -} - -var E_X201 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 201, - Name: "test_proto.x201", - Tag: "bytes,201,opt,name=x201", - Filename: "test_proto/test.proto", -} - -var E_X202 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 202, - Name: "test_proto.x202", - Tag: "bytes,202,opt,name=x202", - Filename: "test_proto/test.proto", -} - -var E_X203 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 203, - Name: "test_proto.x203", - Tag: "bytes,203,opt,name=x203", - Filename: "test_proto/test.proto", -} - -var E_X204 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 204, - Name: "test_proto.x204", - Tag: "bytes,204,opt,name=x204", - Filename: "test_proto/test.proto", -} - -var E_X205 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 205, - Name: "test_proto.x205", - Tag: "bytes,205,opt,name=x205", - Filename: "test_proto/test.proto", -} - -var E_X206 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 206, - Name: "test_proto.x206", - Tag: "bytes,206,opt,name=x206", - Filename: "test_proto/test.proto", -} - -var E_X207 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 207, - Name: "test_proto.x207", - Tag: "bytes,207,opt,name=x207", - Filename: "test_proto/test.proto", -} - -var E_X208 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 208, - Name: "test_proto.x208", - Tag: "bytes,208,opt,name=x208", - Filename: "test_proto/test.proto", -} - -var E_X209 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 209, - Name: "test_proto.x209", - Tag: "bytes,209,opt,name=x209", - Filename: "test_proto/test.proto", -} - -var E_X210 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 210, - Name: "test_proto.x210", - Tag: "bytes,210,opt,name=x210", - Filename: "test_proto/test.proto", -} - -var E_X211 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 211, - Name: "test_proto.x211", - Tag: "bytes,211,opt,name=x211", - Filename: "test_proto/test.proto", -} - -var E_X212 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 212, - Name: "test_proto.x212", - Tag: "bytes,212,opt,name=x212", - Filename: "test_proto/test.proto", -} - -var E_X213 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 213, - Name: "test_proto.x213", - Tag: "bytes,213,opt,name=x213", - Filename: "test_proto/test.proto", -} - -var E_X214 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 214, - Name: "test_proto.x214", - Tag: "bytes,214,opt,name=x214", - Filename: "test_proto/test.proto", -} - -var E_X215 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 215, - Name: "test_proto.x215", - Tag: "bytes,215,opt,name=x215", - Filename: "test_proto/test.proto", -} - -var E_X216 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 216, - Name: "test_proto.x216", - Tag: "bytes,216,opt,name=x216", - Filename: "test_proto/test.proto", -} - -var E_X217 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 217, - Name: "test_proto.x217", - Tag: "bytes,217,opt,name=x217", - Filename: "test_proto/test.proto", -} - -var E_X218 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 218, - Name: "test_proto.x218", - Tag: "bytes,218,opt,name=x218", - Filename: "test_proto/test.proto", -} - -var E_X219 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 219, - Name: "test_proto.x219", - Tag: "bytes,219,opt,name=x219", - Filename: "test_proto/test.proto", -} - -var E_X220 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 220, - Name: "test_proto.x220", - Tag: "bytes,220,opt,name=x220", - Filename: "test_proto/test.proto", -} - -var E_X221 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 221, - Name: "test_proto.x221", - Tag: "bytes,221,opt,name=x221", - Filename: "test_proto/test.proto", -} - -var E_X222 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 222, - Name: "test_proto.x222", - Tag: "bytes,222,opt,name=x222", - Filename: "test_proto/test.proto", -} - -var E_X223 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 223, - Name: "test_proto.x223", - Tag: "bytes,223,opt,name=x223", - Filename: "test_proto/test.proto", -} - -var E_X224 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 224, - Name: "test_proto.x224", - Tag: "bytes,224,opt,name=x224", - Filename: "test_proto/test.proto", -} - -var E_X225 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 225, - Name: "test_proto.x225", - Tag: "bytes,225,opt,name=x225", - Filename: "test_proto/test.proto", -} - -var E_X226 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 226, - Name: "test_proto.x226", - Tag: "bytes,226,opt,name=x226", - Filename: "test_proto/test.proto", -} - -var E_X227 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 227, - Name: "test_proto.x227", - Tag: "bytes,227,opt,name=x227", - Filename: "test_proto/test.proto", -} - -var E_X228 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 228, - Name: "test_proto.x228", - Tag: "bytes,228,opt,name=x228", - Filename: "test_proto/test.proto", -} - -var E_X229 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 229, - Name: "test_proto.x229", - Tag: "bytes,229,opt,name=x229", - Filename: "test_proto/test.proto", -} - -var E_X230 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 230, - Name: "test_proto.x230", - Tag: "bytes,230,opt,name=x230", - Filename: "test_proto/test.proto", -} - -var E_X231 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 231, - Name: "test_proto.x231", - Tag: "bytes,231,opt,name=x231", - Filename: "test_proto/test.proto", -} - -var E_X232 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 232, - Name: "test_proto.x232", - Tag: "bytes,232,opt,name=x232", - Filename: "test_proto/test.proto", -} - -var E_X233 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 233, - Name: "test_proto.x233", - Tag: "bytes,233,opt,name=x233", - Filename: "test_proto/test.proto", -} - -var E_X234 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 234, - Name: "test_proto.x234", - Tag: "bytes,234,opt,name=x234", - Filename: "test_proto/test.proto", -} - -var E_X235 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 235, - Name: "test_proto.x235", - Tag: "bytes,235,opt,name=x235", - Filename: "test_proto/test.proto", -} - -var E_X236 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 236, - Name: "test_proto.x236", - Tag: "bytes,236,opt,name=x236", - Filename: "test_proto/test.proto", -} - -var E_X237 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 237, - Name: "test_proto.x237", - Tag: "bytes,237,opt,name=x237", - Filename: "test_proto/test.proto", -} - -var E_X238 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 238, - Name: "test_proto.x238", - Tag: "bytes,238,opt,name=x238", - Filename: "test_proto/test.proto", -} - -var E_X239 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 239, - Name: "test_proto.x239", - Tag: "bytes,239,opt,name=x239", - Filename: "test_proto/test.proto", -} - -var E_X240 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 240, - Name: "test_proto.x240", - Tag: "bytes,240,opt,name=x240", - Filename: "test_proto/test.proto", -} - -var E_X241 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 241, - Name: "test_proto.x241", - Tag: "bytes,241,opt,name=x241", - Filename: "test_proto/test.proto", -} - -var E_X242 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 242, - Name: "test_proto.x242", - Tag: "bytes,242,opt,name=x242", - Filename: "test_proto/test.proto", -} - -var E_X243 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 243, - Name: "test_proto.x243", - Tag: "bytes,243,opt,name=x243", - Filename: "test_proto/test.proto", -} - -var E_X244 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 244, - Name: "test_proto.x244", - Tag: "bytes,244,opt,name=x244", - Filename: "test_proto/test.proto", -} - -var E_X245 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 245, - Name: "test_proto.x245", - Tag: "bytes,245,opt,name=x245", - Filename: "test_proto/test.proto", -} - -var E_X246 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 246, - Name: "test_proto.x246", - Tag: "bytes,246,opt,name=x246", - Filename: "test_proto/test.proto", -} - -var E_X247 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 247, - Name: "test_proto.x247", - Tag: "bytes,247,opt,name=x247", - Filename: "test_proto/test.proto", -} - -var E_X248 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 248, - Name: "test_proto.x248", - Tag: "bytes,248,opt,name=x248", - Filename: "test_proto/test.proto", -} - -var E_X249 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 249, - Name: "test_proto.x249", - Tag: "bytes,249,opt,name=x249", - Filename: "test_proto/test.proto", -} - -var E_X250 = &proto.ExtensionDesc{ - ExtendedType: (*MyMessageSet)(nil), - ExtensionType: (*Empty)(nil), - Field: 250, - Name: "test_proto.x250", - Tag: "bytes,250,opt,name=x250", - Filename: "test_proto/test.proto", -} - -func init() { - proto.RegisterType((*GoEnum)(nil), "test_proto.GoEnum") - proto.RegisterType((*GoTestField)(nil), "test_proto.GoTestField") - proto.RegisterType((*GoTest)(nil), "test_proto.GoTest") - proto.RegisterType((*GoTest_RequiredGroup)(nil), "test_proto.GoTest.RequiredGroup") - proto.RegisterType((*GoTest_RepeatedGroup)(nil), "test_proto.GoTest.RepeatedGroup") - proto.RegisterType((*GoTest_OptionalGroup)(nil), "test_proto.GoTest.OptionalGroup") - proto.RegisterType((*GoTestRequiredGroupField)(nil), "test_proto.GoTestRequiredGroupField") - proto.RegisterType((*GoTestRequiredGroupField_Group)(nil), "test_proto.GoTestRequiredGroupField.Group") - proto.RegisterType((*GoSkipTest)(nil), "test_proto.GoSkipTest") - proto.RegisterType((*GoSkipTest_SkipGroup)(nil), "test_proto.GoSkipTest.SkipGroup") - proto.RegisterType((*NonPackedTest)(nil), "test_proto.NonPackedTest") - proto.RegisterType((*PackedTest)(nil), "test_proto.PackedTest") - proto.RegisterType((*MaxTag)(nil), "test_proto.MaxTag") - proto.RegisterType((*OldMessage)(nil), "test_proto.OldMessage") - proto.RegisterType((*OldMessage_Nested)(nil), "test_proto.OldMessage.Nested") - proto.RegisterType((*NewMessage)(nil), "test_proto.NewMessage") - proto.RegisterType((*NewMessage_Nested)(nil), "test_proto.NewMessage.Nested") - proto.RegisterType((*InnerMessage)(nil), "test_proto.InnerMessage") - proto.RegisterType((*OtherMessage)(nil), "test_proto.OtherMessage") - proto.RegisterType((*RequiredInnerMessage)(nil), "test_proto.RequiredInnerMessage") - proto.RegisterType((*MyMessage)(nil), "test_proto.MyMessage") - proto.RegisterType((*MyMessage_SomeGroup)(nil), "test_proto.MyMessage.SomeGroup") - proto.RegisterType((*Ext)(nil), "test_proto.Ext") - proto.RegisterMapType((map[int32]int32)(nil), "test_proto.Ext.MapFieldEntry") - proto.RegisterType((*ComplexExtension)(nil), "test_proto.ComplexExtension") - proto.RegisterType((*DefaultsMessage)(nil), "test_proto.DefaultsMessage") - proto.RegisterType((*MyMessageSet)(nil), "test_proto.MyMessageSet") - proto.RegisterType((*Empty)(nil), "test_proto.Empty") - proto.RegisterType((*MessageList)(nil), "test_proto.MessageList") - proto.RegisterType((*MessageList_Message)(nil), "test_proto.MessageList.Message") - proto.RegisterType((*Strings)(nil), "test_proto.Strings") - proto.RegisterType((*Defaults)(nil), "test_proto.Defaults") - proto.RegisterType((*SubDefaults)(nil), "test_proto.SubDefaults") - proto.RegisterType((*RepeatedEnum)(nil), "test_proto.RepeatedEnum") - proto.RegisterType((*MoreRepeated)(nil), "test_proto.MoreRepeated") - proto.RegisterType((*GroupOld)(nil), "test_proto.GroupOld") - proto.RegisterType((*GroupOld_G)(nil), "test_proto.GroupOld.G") - proto.RegisterType((*GroupNew)(nil), "test_proto.GroupNew") - proto.RegisterType((*GroupNew_G)(nil), "test_proto.GroupNew.G") - proto.RegisterType((*FloatingPoint)(nil), "test_proto.FloatingPoint") - proto.RegisterType((*MessageWithMap)(nil), "test_proto.MessageWithMap") - proto.RegisterMapType((map[bool][]byte)(nil), "test_proto.MessageWithMap.ByteMappingEntry") - proto.RegisterMapType((map[int64]*FloatingPoint)(nil), "test_proto.MessageWithMap.MsgMappingEntry") - proto.RegisterMapType((map[int32]string)(nil), "test_proto.MessageWithMap.NameMappingEntry") - proto.RegisterMapType((map[string]string)(nil), "test_proto.MessageWithMap.StrToStrEntry") - proto.RegisterType((*Oneof)(nil), "test_proto.Oneof") - proto.RegisterType((*Oneof_F_Group)(nil), "test_proto.Oneof.F_Group") - proto.RegisterType((*Communique)(nil), "test_proto.Communique") - proto.RegisterEnum("test_proto.FOO", FOO_name, FOO_value) - proto.RegisterEnum("test_proto.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value) - proto.RegisterEnum("test_proto.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value) - proto.RegisterEnum("test_proto.DefaultsMessage_DefaultsEnum", DefaultsMessage_DefaultsEnum_name, DefaultsMessage_DefaultsEnum_value) - proto.RegisterEnum("test_proto.Defaults_Color", Defaults_Color_name, Defaults_Color_value) - proto.RegisterEnum("test_proto.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value) - proto.RegisterExtension(E_Ext_More) - proto.RegisterExtension(E_Ext_Text) - proto.RegisterExtension(E_Ext_Number) - proto.RegisterExtension(E_Greeting) - proto.RegisterExtension(E_Complex) - proto.RegisterExtension(E_RComplex) - proto.RegisterExtension(E_NoDefaultDouble) - proto.RegisterExtension(E_NoDefaultFloat) - proto.RegisterExtension(E_NoDefaultInt32) - proto.RegisterExtension(E_NoDefaultInt64) - proto.RegisterExtension(E_NoDefaultUint32) - proto.RegisterExtension(E_NoDefaultUint64) - proto.RegisterExtension(E_NoDefaultSint32) - proto.RegisterExtension(E_NoDefaultSint64) - proto.RegisterExtension(E_NoDefaultFixed32) - proto.RegisterExtension(E_NoDefaultFixed64) - proto.RegisterExtension(E_NoDefaultSfixed32) - proto.RegisterExtension(E_NoDefaultSfixed64) - proto.RegisterExtension(E_NoDefaultBool) - proto.RegisterExtension(E_NoDefaultString) - proto.RegisterExtension(E_NoDefaultBytes) - proto.RegisterExtension(E_NoDefaultEnum) - proto.RegisterExtension(E_DefaultDouble) - proto.RegisterExtension(E_DefaultFloat) - proto.RegisterExtension(E_DefaultInt32) - proto.RegisterExtension(E_DefaultInt64) - proto.RegisterExtension(E_DefaultUint32) - proto.RegisterExtension(E_DefaultUint64) - proto.RegisterExtension(E_DefaultSint32) - proto.RegisterExtension(E_DefaultSint64) - proto.RegisterExtension(E_DefaultFixed32) - proto.RegisterExtension(E_DefaultFixed64) - proto.RegisterExtension(E_DefaultSfixed32) - proto.RegisterExtension(E_DefaultSfixed64) - proto.RegisterExtension(E_DefaultBool) - proto.RegisterExtension(E_DefaultString) - proto.RegisterExtension(E_DefaultBytes) - proto.RegisterExtension(E_DefaultEnum) - proto.RegisterExtension(E_X201) - proto.RegisterExtension(E_X202) - proto.RegisterExtension(E_X203) - proto.RegisterExtension(E_X204) - proto.RegisterExtension(E_X205) - proto.RegisterExtension(E_X206) - proto.RegisterExtension(E_X207) - proto.RegisterExtension(E_X208) - proto.RegisterExtension(E_X209) - proto.RegisterExtension(E_X210) - proto.RegisterExtension(E_X211) - proto.RegisterExtension(E_X212) - proto.RegisterExtension(E_X213) - proto.RegisterExtension(E_X214) - proto.RegisterExtension(E_X215) - proto.RegisterExtension(E_X216) - proto.RegisterExtension(E_X217) - proto.RegisterExtension(E_X218) - proto.RegisterExtension(E_X219) - proto.RegisterExtension(E_X220) - proto.RegisterExtension(E_X221) - proto.RegisterExtension(E_X222) - proto.RegisterExtension(E_X223) - proto.RegisterExtension(E_X224) - proto.RegisterExtension(E_X225) - proto.RegisterExtension(E_X226) - proto.RegisterExtension(E_X227) - proto.RegisterExtension(E_X228) - proto.RegisterExtension(E_X229) - proto.RegisterExtension(E_X230) - proto.RegisterExtension(E_X231) - proto.RegisterExtension(E_X232) - proto.RegisterExtension(E_X233) - proto.RegisterExtension(E_X234) - proto.RegisterExtension(E_X235) - proto.RegisterExtension(E_X236) - proto.RegisterExtension(E_X237) - proto.RegisterExtension(E_X238) - proto.RegisterExtension(E_X239) - proto.RegisterExtension(E_X240) - proto.RegisterExtension(E_X241) - proto.RegisterExtension(E_X242) - proto.RegisterExtension(E_X243) - proto.RegisterExtension(E_X244) - proto.RegisterExtension(E_X245) - proto.RegisterExtension(E_X246) - proto.RegisterExtension(E_X247) - proto.RegisterExtension(E_X248) - proto.RegisterExtension(E_X249) - proto.RegisterExtension(E_X250) -} - -func init() { proto.RegisterFile("test_proto/test.proto", fileDescriptor_test_74787bfc6550f8a7) } - -var fileDescriptor_test_74787bfc6550f8a7 = []byte{ - // 4680 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x5b, 0xd9, 0x73, 0x1b, 0x47, - 0x7a, 0xd7, 0x0c, 0xee, 0x0f, 0x20, 0x31, 0x6c, 0xd1, 0x12, 0x44, 0x59, 0xd2, 0x08, 0x6b, 0xaf, - 0x61, 0xc9, 0xa2, 0x48, 0x60, 0x08, 0x49, 0x70, 0xec, 0xb2, 0x0e, 0x82, 0x62, 0x49, 0x24, 0xe4, - 0x21, 0x6d, 0x67, 0x95, 0x07, 0x14, 0x48, 0x0c, 0x40, 0xac, 0x80, 0x19, 0x18, 0x18, 0x44, 0x64, - 0x52, 0xa9, 0xf2, 0x63, 0xaa, 0xf2, 0x94, 0x4d, 0x52, 0x95, 0xf7, 0xbc, 0xe4, 0x25, 0xd7, 0x43, - 0xf2, 0x37, 0xc4, 0xd7, 0x5e, 0xde, 0x2b, 0xc9, 0x26, 0x9b, 0xfb, 0xce, 0xe6, 0xde, 0x23, 0x2f, - 0x4e, 0xf5, 0xd7, 0x3d, 0x33, 0x3d, 0x03, 0xa8, 0x45, 0x3e, 0x71, 0xa6, 0xfb, 0xf7, 0xfd, 0xfa, - 0xfa, 0xf5, 0xf7, 0xf5, 0xd7, 0x18, 0xc2, 0x0b, 0xae, 0x35, 0x76, 0x9b, 0xc3,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f, 0xf7, 0x1d, 0xcb, 0xc5, 0x1a, 0x1a, 0xa5, 0x52, 0x35, - 0x35, 0xad, 0x14, 0x53, 0x90, 0x58, 0x1f, 0x0c, 0xdd, 0xa3, 0xe2, 0x2f, 0x41, 0x96, 0x83, 0x1e, - 0xf6, 0xc6, 0x2e, 0xb9, 0x05, 0xa9, 0x01, 0x1f, 0xaf, 0x82, 0x67, 0xd1, 0xb0, 0xac, 0x03, 0xa4, - 0xf7, 0x6c, 0x7a, 0xf8, 0xa5, 0x0a, 0xa4, 0x04, 0xf7, 0xce, 0x3d, 0x8f, 0x2a, 0x7a, 0x1e, 0xe6, - 0xa3, 0x62, 0x82, 0x8f, 0x2a, 0x6e, 0x41, 0x8a, 0x05, 0xe6, 0x31, 0x1e, 0x37, 0x58, 0xfe, 0xce, - 0x34, 0xc6, 0xc4, 0x97, 0x65, 0x65, 0xec, 0x0c, 0x75, 0x09, 0xb2, 0xb8, 0x67, 0x7c, 0x15, 0x52, - 0x6f, 0x0e, 0x58, 0xc4, 0x14, 0xff, 0x47, 0x09, 0x48, 0x7b, 0x73, 0x45, 0xce, 0x43, 0x92, 0x25, - 0xb1, 0x48, 0xe5, 0x5d, 0xea, 0x24, 0x30, 0x6d, 0x25, 0xe7, 0x21, 0xc5, 0x13, 0x55, 0x1e, 0x70, - 0xd4, 0x4a, 0xd9, 0x4c, 0xb2, 0xc4, 0xd4, 0xaf, 0xac, 0x1a, 0xe8, 0x27, 0xd9, 0x75, 0x4d, 0x92, - 0xa5, 0x9e, 0x44, 0x87, 0x8c, 0x9f, 0x6c, 0x62, 0x88, 0xe0, 0x77, 0x33, 0x69, 0x2f, 0xbb, 0x14, - 0x10, 0x55, 0x03, 0x1d, 0x28, 0xbf, 0x88, 0x49, 0xd7, 0x83, 0x73, 0x53, 0xda, 0x4b, 0x19, 0xf1, - 0x97, 0x27, 0xef, 0xd6, 0x25, 0xc5, 0x93, 0xc4, 0x00, 0x50, 0x35, 0xd0, 0x33, 0x79, 0x57, 0x2c, - 0x29, 0x9e, 0x08, 0x92, 0x4b, 0xb4, 0x8b, 0x98, 0xd8, 0xa1, 0xff, 0x09, 0xee, 0x53, 0x92, 0x2c, - 0xdd, 0x23, 0x97, 0x29, 0x03, 0xcb, 0xde, 0xd0, 0x35, 0x04, 0x97, 0x27, 0x29, 0x9e, 0xd4, 0x91, - 0xab, 0x14, 0xc2, 0xa6, 0xbf, 0x00, 0xcf, 0xb8, 0x29, 0x49, 0xf1, 0x9b, 0x12, 0xa2, 0xd3, 0x06, - 0xd1, 0x43, 0xa1, 0x57, 0x12, 0x6e, 0x45, 0x92, 0xec, 0x56, 0x84, 0x5c, 0x44, 0x3a, 0x36, 0xa8, - 0x5c, 0x70, 0x03, 0x92, 0xe2, 0x59, 0x60, 0x50, 0x8f, 0x67, 0x49, 0xff, 0xb6, 0x23, 0xc5, 0xf3, - 0x3c, 0x72, 0x93, 0xae, 0x17, 0x55, 0x78, 0x61, 0x1e, 0x7d, 0xf1, 0x92, 0x28, 0x3d, 0x6f, 0x55, - 0x99, 0x2b, 0xae, 0x31, 0x37, 0x66, 0x26, 0xea, 0xb8, 0x23, 0x96, 0xa8, 0xe5, 0xa3, 0x9e, 0xdd, - 0x29, 0xe4, 0x71, 0x2e, 0x62, 0x3d, 0xbb, 0x63, 0x26, 0xea, 0xb4, 0x84, 0xa9, 0x60, 0x9b, 0xd6, - 0x69, 0x58, 0x17, 0xbf, 0xc6, 0x2a, 0x69, 0x11, 0x29, 0x40, 0xa2, 0xde, 0xdc, 0x6e, 0xd9, 0x85, - 0x05, 0x66, 0x67, 0xb7, 0x6c, 0x33, 0x5e, 0xdf, 0x6e, 0xd9, 0xe4, 0x55, 0x88, 0x8d, 0x27, 0x7b, - 0x05, 0x32, 0xfd, 0xb3, 0xe0, 0xce, 0x64, 0xcf, 0xeb, 0x8c, 0x49, 0x31, 0xe4, 0x3c, 0xa4, 0xc7, - 0xee, 0xa8, 0xf9, 0x0b, 0xd6, 0xc8, 0x29, 0x9c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3, 0xf0, 0xbc, 0x33, 0x49, 0x46, 0x38, 0x93, 0x2c, 0xfd, 0x2c, 0xe4, - 0x23, 0xc3, 0x16, 0xcd, 0x09, 0x33, 0xbf, 0x2e, 0x9a, 0x67, 0xcb, 0xe7, 0x42, 0xdf, 0x68, 0x88, - 0x4b, 0x2f, 0x32, 0xbf, 0x09, 0x5a, 0x74, 0x0a, 0x44, 0xea, 0xb4, 0x24, 0xa1, 0x41, 0xfb, 0xd7, - 0x61, 0x2e, 0x34, 0x68, 0xd1, 0x38, 0xf3, 0x9c, 0x61, 0x15, 0x7f, 0x25, 0x01, 0x89, 0x86, 0x6d, - 0x39, 0x1d, 0x72, 0x36, 0x1c, 0x3b, 0xef, 0x9f, 0xf2, 0xe2, 0xe6, 0xb9, 0x48, 0xdc, 0xbc, 0x7f, - 0xca, 0x8f, 0x9a, 0xe7, 0x22, 0x51, 0xd3, 0xab, 0xaa, 0x1a, 0xe4, 0xc2, 0x54, 0xcc, 0xbc, 0x7f, - 0x4a, 0x08, 0x98, 0x17, 0xa6, 0x02, 0x66, 0x50, 0x5d, 0x35, 0xa8, 0x83, 0x0d, 0x47, 0xcb, 0xfb, - 0xa7, 0x82, 0x48, 0x79, 0x3e, 0x1a, 0x29, 0xfd, 0xca, 0xaa, 0xc1, 0xba, 0x24, 0x44, 0x49, 0xec, - 0x12, 0x8b, 0x8f, 0xe7, 0xa3, 0xf1, 0x11, 0xed, 0x78, 0x64, 0x3c, 0x1f, 0x8d, 0x8c, 0x58, 0xc9, - 0x23, 0xe1, 0xb9, 0x48, 0x24, 0x44, 0x52, 0x16, 0x02, 0xcf, 0x47, 0x43, 0x20, 0xb3, 0x13, 0x7a, - 0x2a, 0xc6, 0x3f, 0xbf, 0xb2, 0x6a, 0x10, 0x23, 0x12, 0xfc, 0x64, 0x89, 0x08, 0xae, 0x06, 0x86, - 0x81, 0x2a, 0x9d, 0x38, 0xef, 0x80, 0x9a, 0x97, 0x7e, 0xc2, 0x82, 0x33, 0xea,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1, 0x3e, 0xbb, 0x15, 0x63, 0x26, 0xaf, 0xb5, 0xad, 0xce, 0x1b, 0x1d, 0xc7, - 0x09, 0x96, 0x94, 0x39, 0xb4, 0x46, 0xb0, 0x7b, 0x8e, 0xe1, 0xcd, 0xbe, 0xab, 0xe0, 0x25, 0x5a, - 0x8e, 0x53, 0xa3, 0x85, 0xbf, 0x8f, 0x98, 0x6b, 0xb3, 0x83, 0x31, 0x3f, 0xdf, 0xaf, 0x7d, 0x4f, - 0x39, 0x99, 0x63, 0xab, 0xc5, 0x1a, 0xdb, 0xeb, 0xfe, 0xe4, 0x60, 0xc9, 0x5b, 0x10, 0x3f, 0x2c, - 0xaf, 0xac, 0x86, 0x8f, 0x78, 0xe2, 0x1d, 0x32, 0x73, 0x67, 0xd9, 0xf2, 0x42, 0xe8, 0xb2, 0x7d, - 0x30, 0x74, 0x8f, 0x4c, 0xb4, 0xe4, 0x0c, 0x65, 0x09, 0xc3, 0x47, 0x52, 0x86, 0x32, 0x67, 0xa8, - 0x48, 0x18, 0x3e, 0x96, 0x32, 0x54, 0x38, 0x83, 0x21, 0x61, 0xf8, 0x44, 0xca, 0x60, 0x70, 0x86, - 0x35, 0x09, 0xc3, 0xa7, 0x52, 0x86, 0x35, 0xce, 0x50, 0x95, 0x30, 0x7c, 0x55, 0xca, 0x50, 0xe5, - 0x0c, 0x37, 0x24, 0x0c, 0x5f, 0x93, 0x32, 0xdc, 0xe0, 0x0c, 0x37, 0x25, 0x0c, 0x5f, 0x97, 0x32, - 0xdc, 0xe4, 0x0c, 0xb7, 0x24, 0x0c, 0xdf, 0x90, 0x32, 0xdc, 0x62, 0x0c, 0xab, 0x2b, 0x12, 0x86, - 0x6f, 0xca, 0x18, 0x56, 0x57, 0x38, 0x83, 0x4c, 0x93, 0x9f, 0x49, 0x19, 0xb8, 0x26, 0x57, 0x65, - 0x9a, 0xfc, 0x96, 0x94, 0x81, 0x6b, 0x72, 0x55, 0xa6, 0xc9, 0x6f, 0x4b, 0x19, 0xb8, 0x26, 0x57, - 0x65, 0x9a, 0xfc, 0x8e, 0x94, 0x81, 0x6b, 0x72, 0x55, 0xa6, 0xc9, 0xef, 0x4a, 0x19, 0xb8, 0x26, - 0x57, 0x65, 0x9a, 0xfc, 0x9e, 0x94, 0x81, 0x6b, 0x72, 0x55, 0xa6, 0xc9, 0x3f, 0x91, 0x32, 0x70, - 0x4d, 0xae, 0xca, 0x34, 0xf9, 0xa7, 0x52, 0x06, 0xae, 0xc9, 0x55, 0x99, 0x26, 0xff, 0x4c, 0xca, - 0xc0, 0x35, 0x59, 0x96, 0x69, 0xf2, 0xfb, 0x32, 0x86, 0x32, 0xd7, 0x64, 0x59, 0xa6, 0xc9, 0x3f, - 0x97, 0x32, 0x70, 0x4d, 0x96, 0x65, 0x9a, 0xfc, 0x0b, 0x29, 0x03, 0xd7, 0x64, 0x59, 0xa6, 0xc9, - 0x1f, 0x48, 0x19, 0xb8, 0x26, 0xcb, 0x32, 0x4d, 0xfe, 0xa5, 0x94, 0x81, 0x6b, 0xb2, 0x2c, 0xd3, - 0xe4, 0x5f, 0x49, 0x19, 0xb8, 0x26, 0xcb, 0x32, 0x4d, 0xfe, 0xb5, 0x94, 0x81, 0x6b, 0xb2, 0x2c, - 0xd3, 0xe4, 0xdf, 0x48, 0x19, 0xb8, 0x26, 0xcb, 0x32, 0x4d, 0xfe, 0xad, 0x94, 0x81, 0x6b, 0xb2, - 0x2c, 0xd3, 0xe4, 0xdf, 0x49, 0x19, 0xb8, 0x26, 0x2b, 0x32, 0x4d, 0xfe, 0xbd, 0x8c, 0xa1, 0xc2, - 0x35, 0x59, 0x91, 0x69, 0xf2, 0x1f, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26, 0xff, 0x51, 0xca, - 0xc0, 0x35, 0x59, 0x91, 0x69, 0xf2, 0x9f, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26, 0xff, 0x59, - 0xca, 0xc0, 0x35, 0x59, 0x91, 0x69, 0xf2, 0x5f, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26, 0xff, - 0x55, 0xca, 0xc0, 0x35, 0x59, 0x91, 0x69, 0xf2, 0xdf, 0xa4, 0x0c, 0x5c, 0x93, 0x15, 0x99, 0x26, - 0x7f, 0x28, 0x65, 0xe0, 0x9a, 0xac, 0xc8, 0x34, 0xf9, 0xef, 0x52, 0x06, 0xae, 0x49, 0x43, 0xa6, - 0xc9, 0xff, 0x90, 0x31, 0x18, 0x5c, 0x93, 0x86, 0x4c, 0x93, 0xff, 0x29, 0x65, 0xe0, 0x9a, 0x34, - 0x64, 0x9a, 0xfc, 0x2f, 0x29, 0x03, 0xd7, 0xa4, 0x21, 0xd3, 0xe4, 0x7f, 0x4b, 0x19, 0xb8, 0x26, - 0x0d, 0x99, 0x26, 0xff, 0x47, 0xca, 0xc0, 0x35, 0x69, 0xc8, 0x34, 0xf9, 0xbf, 0x52, 0x06, 0xae, - 0x49, 0x43, 0xa6, 0xc9, 0x1f, 0x49, 0x19, 0xb8, 0x26, 0x0d, 0x99, 0x26, 0x7f, 0x2c, 0x65, 0xe0, - 0x9a, 0x34, 0x64, 0x9a, 0xfc, 0x89, 0x94, 0x81, 0x6b, 0xd2, 0x90, 0x69, 0xf2, 0xa7, 0x52, 0x06, - 0xae, 0xc9, 0x35, 0x99, 0x26, 0xff, 0x4f, 0xc6, 0xb0, 0xb6, 0x72, 0xe7, 0xda, 0xe3, 0xab, 0xdd, - 0x9e, 0x7b, 0x30, 0xd9, 0x5b, 0xde, 0x77, 0x06, 0xd7, 0xbb, 0x4e, 0xbf, 0x65, 0x77, 0xaf, 0x23, - 0x6c, 0x6f, 0xd2, 0xb9, 0x1e, 0xfc, 0xeb, 0x35, 0x33, 0xfd, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x46, 0xc7, 0xb3, 0x38, 0x92, 0x3d, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/proto/test_proto/test.proto b/vendor/github.com/golang/protobuf/proto/test_proto/test.proto deleted file mode 100644 index 22068a9..0000000 --- a/vendor/github.com/golang/protobuf/proto/test_proto/test.proto +++ /dev/null @@ -1,562 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// A feature-rich test file for the protocol compiler and libraries. - -syntax = "proto2"; - -option go_package = "github.com/golang/protobuf/proto/test_proto"; - -package test_proto; - -enum FOO { FOO1 = 1; }; - -message GoEnum { - required FOO foo = 1; -} - -message GoTestField { - required string Label = 1; - required string Type = 2; -} - -message GoTest { - // An enum, for completeness. - enum KIND { - VOID = 0; - - // Basic types - BOOL = 1; - BYTES = 2; - FINGERPRINT = 3; - FLOAT = 4; - INT = 5; - STRING = 6; - TIME = 7; - - // Groupings - TUPLE = 8; - ARRAY = 9; - MAP = 10; - - // Table types - TABLE = 11; - - // Functions - FUNCTION = 12; // last tag - }; - - // Some typical parameters - required KIND Kind = 1; - optional string Table = 2; - optional int32 Param = 3; - - // Required, repeated and optional foreign fields. - required GoTestField RequiredField = 4; - repeated GoTestField RepeatedField = 5; - optional GoTestField OptionalField = 6; - - // Required fields of all basic types - required bool F_Bool_required = 10; - required int32 F_Int32_required = 11; - required int64 F_Int64_required = 12; - required fixed32 F_Fixed32_required = 13; - required fixed64 F_Fixed64_required = 14; - required uint32 F_Uint32_required = 15; - required uint64 F_Uint64_required = 16; - required float F_Float_required = 17; - required double F_Double_required = 18; - required string F_String_required = 19; - required bytes F_Bytes_required = 101; - required sint32 F_Sint32_required = 102; - required sint64 F_Sint64_required = 103; - required sfixed32 F_Sfixed32_required = 104; - required sfixed64 F_Sfixed64_required = 105; - - // Repeated fields of all basic types - repeated bool F_Bool_repeated = 20; - repeated int32 F_Int32_repeated = 21; - repeated int64 F_Int64_repeated = 22; - repeated fixed32 F_Fixed32_repeated = 23; - repeated fixed64 F_Fixed64_repeated = 24; - repeated uint32 F_Uint32_repeated = 25; - repeated uint64 F_Uint64_repeated = 26; - repeated float F_Float_repeated = 27; - repeated double F_Double_repeated = 28; - repeated string F_String_repeated = 29; - repeated bytes F_Bytes_repeated = 201; - repeated sint32 F_Sint32_repeated = 202; - repeated sint64 F_Sint64_repeated = 203; - repeated sfixed32 F_Sfixed32_repeated = 204; - repeated sfixed64 F_Sfixed64_repeated = 205; - - // Optional fields of all basic types - optional bool F_Bool_optional = 30; - optional int32 F_Int32_optional = 31; - optional int64 F_Int64_optional = 32; - optional fixed32 F_Fixed32_optional = 33; - optional fixed64 F_Fixed64_optional = 34; - optional uint32 F_Uint32_optional = 35; - optional uint64 F_Uint64_optional = 36; - optional float F_Float_optional = 37; - optional double F_Double_optional = 38; - optional string F_String_optional = 39; - optional bytes F_Bytes_optional = 301; - optional sint32 F_Sint32_optional = 302; - optional sint64 F_Sint64_optional = 303; - optional sfixed32 F_Sfixed32_optional = 304; - optional sfixed64 F_Sfixed64_optional = 305; - - // Default-valued fields of all basic types - optional bool F_Bool_defaulted = 40 [default=true]; - optional int32 F_Int32_defaulted = 41 [default=32]; - optional int64 F_Int64_defaulted = 42 [default=64]; - optional fixed32 F_Fixed32_defaulted = 43 [default=320]; - optional fixed64 F_Fixed64_defaulted = 44 [default=640]; - optional uint32 F_Uint32_defaulted = 45 [default=3200]; - optional uint64 F_Uint64_defaulted = 46 [default=6400]; - optional float F_Float_defaulted = 47 [default=314159.]; - optional double F_Double_defaulted = 48 [default=271828.]; - optional string F_String_defaulted = 49 [default="hello, \"world!\"\n"]; - optional bytes F_Bytes_defaulted = 401 [default="Bignose"]; - optional sint32 F_Sint32_defaulted = 402 [default = -32]; - optional sint64 F_Sint64_defaulted = 403 [default = -64]; - optional sfixed32 F_Sfixed32_defaulted = 404 [default = -32]; - optional sfixed64 F_Sfixed64_defaulted = 405 [default = -64]; - - // Packed repeated fields (no string or bytes). - repeated bool F_Bool_repeated_packed = 50 [packed=true]; - repeated int32 F_Int32_repeated_packed = 51 [packed=true]; - repeated int64 F_Int64_repeated_packed = 52 [packed=true]; - repeated fixed32 F_Fixed32_repeated_packed = 53 [packed=true]; - repeated fixed64 F_Fixed64_repeated_packed = 54 [packed=true]; - repeated uint32 F_Uint32_repeated_packed = 55 [packed=true]; - repeated uint64 F_Uint64_repeated_packed = 56 [packed=true]; - repeated float F_Float_repeated_packed = 57 [packed=true]; - repeated double F_Double_repeated_packed = 58 [packed=true]; - repeated sint32 F_Sint32_repeated_packed = 502 [packed=true]; - repeated sint64 F_Sint64_repeated_packed = 503 [packed=true]; - repeated sfixed32 F_Sfixed32_repeated_packed = 504 [packed=true]; - repeated sfixed64 F_Sfixed64_repeated_packed = 505 [packed=true]; - - // Required, repeated, and optional groups. - required group RequiredGroup = 70 { - required string RequiredField = 71; - }; - - repeated group RepeatedGroup = 80 { - required string RequiredField = 81; - }; - - optional group OptionalGroup = 90 { - required string RequiredField = 91; - }; -} - -// For testing a group containing a required field. -message GoTestRequiredGroupField { - required group Group = 1 { - required int32 Field = 2; - }; -} - -// For testing skipping of unrecognized fields. -// Numbers are all big, larger than tag numbers in GoTestField, -// the message used in the corresponding test. -message GoSkipTest { - required int32 skip_int32 = 11; - required fixed32 skip_fixed32 = 12; - required fixed64 skip_fixed64 = 13; - required string skip_string = 14; - required group SkipGroup = 15 { - required int32 group_int32 = 16; - required string group_string = 17; - } -} - -// For testing packed/non-packed decoder switching. -// A serialized instance of one should be deserializable as the other. -message NonPackedTest { - repeated int32 a = 1; -} - -message PackedTest { - repeated int32 b = 1 [packed=true]; -} - -message MaxTag { - // Maximum possible tag number. - optional string last_field = 536870911; -} - -message OldMessage { - message Nested { - optional string name = 1; - } - optional Nested nested = 1; - - optional int32 num = 2; -} - -// NewMessage is wire compatible with OldMessage; -// imagine it as a future version. -message NewMessage { - message Nested { - optional string name = 1; - optional string food_group = 2; - } - optional Nested nested = 1; - - // This is an int32 in OldMessage. - optional int64 num = 2; -} - -// Smaller tests for ASCII formatting. - -message InnerMessage { - required string host = 1; - optional int32 port = 2 [default=4000]; - optional bool connected = 3; -} - -message OtherMessage { - optional int64 key = 1; - optional bytes value = 2; - optional float weight = 3; - optional InnerMessage inner = 4; - - extensions 100 to max; -} - -message RequiredInnerMessage { - required InnerMessage leo_finally_won_an_oscar = 1; -} - -message MyMessage { - required int32 count = 1; - optional string name = 2; - optional string quote = 3; - repeated string pet = 4; - optional InnerMessage inner = 5; - repeated OtherMessage others = 6; - optional RequiredInnerMessage we_must_go_deeper = 13; - repeated InnerMessage rep_inner = 12; - - enum Color { - RED = 0; - GREEN = 1; - BLUE = 2; - }; - optional Color bikeshed = 7; - - optional group SomeGroup = 8 { - optional int32 group_field = 9; - } - - // This field becomes [][]byte in the generated code. - repeated bytes rep_bytes = 10; - - optional double bigfloat = 11; - - extensions 100 to max; -} - -message Ext { - extend MyMessage { - optional Ext more = 103; - optional string text = 104; - optional int32 number = 105; - } - - optional string data = 1; - map map_field = 2; -} - -extend MyMessage { - repeated string greeting = 106; - // leave field 200 unregistered for testing -} - -message ComplexExtension { - optional int32 first = 1; - optional int32 second = 2; - repeated int32 third = 3; -} - -extend OtherMessage { - optional ComplexExtension complex = 200; - repeated ComplexExtension r_complex = 201; -} - -message DefaultsMessage { - enum DefaultsEnum { - ZERO = 0; - ONE = 1; - TWO = 2; - }; - extensions 100 to max; -} - -extend DefaultsMessage { - optional double no_default_double = 101; - optional float no_default_float = 102; - optional int32 no_default_int32 = 103; - optional int64 no_default_int64 = 104; - optional uint32 no_default_uint32 = 105; - optional uint64 no_default_uint64 = 106; - optional sint32 no_default_sint32 = 107; - optional sint64 no_default_sint64 = 108; - optional fixed32 no_default_fixed32 = 109; - optional fixed64 no_default_fixed64 = 110; - optional sfixed32 no_default_sfixed32 = 111; - optional sfixed64 no_default_sfixed64 = 112; - optional bool no_default_bool = 113; - optional string no_default_string = 114; - optional bytes no_default_bytes = 115; - optional DefaultsMessage.DefaultsEnum no_default_enum = 116; - - optional double default_double = 201 [default = 3.1415]; - optional float default_float = 202 [default = 3.14]; - optional int32 default_int32 = 203 [default = 42]; - optional int64 default_int64 = 204 [default = 43]; - optional uint32 default_uint32 = 205 [default = 44]; - optional uint64 default_uint64 = 206 [default = 45]; - optional sint32 default_sint32 = 207 [default = 46]; - optional sint64 default_sint64 = 208 [default = 47]; - optional fixed32 default_fixed32 = 209 [default = 48]; - optional fixed64 default_fixed64 = 210 [default = 49]; - optional sfixed32 default_sfixed32 = 211 [default = 50]; - optional sfixed64 default_sfixed64 = 212 [default = 51]; - optional bool default_bool = 213 [default = true]; - optional string default_string = 214 [default = "Hello, string,def=foo"]; - optional bytes default_bytes = 215 [default = "Hello, bytes"]; - optional DefaultsMessage.DefaultsEnum default_enum = 216 [default = ONE]; -} - -message MyMessageSet { - option message_set_wire_format = true; - extensions 100 to max; -} - -message Empty { -} - -extend MyMessageSet { - optional Empty x201 = 201; - optional Empty x202 = 202; - optional Empty x203 = 203; - optional Empty x204 = 204; - optional Empty x205 = 205; - optional Empty x206 = 206; - optional Empty x207 = 207; - optional Empty x208 = 208; - optional Empty x209 = 209; - optional Empty x210 = 210; - optional Empty x211 = 211; - optional Empty x212 = 212; - optional Empty x213 = 213; - optional Empty x214 = 214; - optional Empty x215 = 215; - optional Empty x216 = 216; - optional Empty x217 = 217; - optional Empty x218 = 218; - optional Empty x219 = 219; - optional Empty x220 = 220; - optional Empty x221 = 221; - optional Empty x222 = 222; - optional Empty x223 = 223; - optional Empty x224 = 224; - optional Empty x225 = 225; - optional Empty x226 = 226; - optional Empty x227 = 227; - optional Empty x228 = 228; - optional Empty x229 = 229; - optional Empty x230 = 230; - optional Empty x231 = 231; - optional Empty x232 = 232; - optional Empty x233 = 233; - optional Empty x234 = 234; - optional Empty x235 = 235; - optional Empty x236 = 236; - optional Empty x237 = 237; - optional Empty x238 = 238; - optional Empty x239 = 239; - optional Empty x240 = 240; - optional Empty x241 = 241; - optional Empty x242 = 242; - optional Empty x243 = 243; - optional Empty x244 = 244; - optional Empty x245 = 245; - optional Empty x246 = 246; - optional Empty x247 = 247; - optional Empty x248 = 248; - optional Empty x249 = 249; - optional Empty x250 = 250; -} - -message MessageList { - repeated group Message = 1 { - required string name = 2; - required int32 count = 3; - } -} - -message Strings { - optional string string_field = 1; - optional bytes bytes_field = 2; -} - -message Defaults { - enum Color { - RED = 0; - GREEN = 1; - BLUE = 2; - } - - // Default-valued fields of all basic types. - // Same as GoTest, but copied here to make testing easier. - optional bool F_Bool = 1 [default=true]; - optional int32 F_Int32 = 2 [default=32]; - optional int64 F_Int64 = 3 [default=64]; - optional fixed32 F_Fixed32 = 4 [default=320]; - optional fixed64 F_Fixed64 = 5 [default=640]; - optional uint32 F_Uint32 = 6 [default=3200]; - optional uint64 F_Uint64 = 7 [default=6400]; - optional float F_Float = 8 [default=314159.]; - optional double F_Double = 9 [default=271828.]; - optional string F_String = 10 [default="hello, \"world!\"\n"]; - optional bytes F_Bytes = 11 [default="Bignose"]; - optional sint32 F_Sint32 = 12 [default=-32]; - optional sint64 F_Sint64 = 13 [default=-64]; - optional Color F_Enum = 14 [default=GREEN]; - - // More fields with crazy defaults. - optional float F_Pinf = 15 [default=inf]; - optional float F_Ninf = 16 [default=-inf]; - optional float F_Nan = 17 [default=nan]; - - // Sub-message. - optional SubDefaults sub = 18; - - // Redundant but explicit defaults. - optional string str_zero = 19 [default=""]; -} - -message SubDefaults { - optional int64 n = 1 [default=7]; -} - -message RepeatedEnum { - enum Color { - RED = 1; - } - repeated Color color = 1; -} - -message MoreRepeated { - repeated bool bools = 1; - repeated bool bools_packed = 2 [packed=true]; - repeated int32 ints = 3; - repeated int32 ints_packed = 4 [packed=true]; - repeated int64 int64s_packed = 7 [packed=true]; - repeated string strings = 5; - repeated fixed32 fixeds = 6; -} - -// GroupOld and GroupNew have the same wire format. -// GroupNew has a new field inside a group. - -message GroupOld { - optional group G = 101 { - optional int32 x = 2; - } -} - -message GroupNew { - optional group G = 101 { - optional int32 x = 2; - optional int32 y = 3; - } -} - -message FloatingPoint { - required double f = 1; - optional bool exact = 2; -} - -message MessageWithMap { - map name_mapping = 1; - map msg_mapping = 2; - map byte_mapping = 3; - map str_to_str = 4; -} - -message Oneof { - oneof union { - bool F_Bool = 1; - int32 F_Int32 = 2; - int64 F_Int64 = 3; - fixed32 F_Fixed32 = 4; - fixed64 F_Fixed64 = 5; - uint32 F_Uint32 = 6; - uint64 F_Uint64 = 7; - float F_Float = 8; - double F_Double = 9; - string F_String = 10; - bytes F_Bytes = 11; - sint32 F_Sint32 = 12; - sint64 F_Sint64 = 13; - MyMessage.Color F_Enum = 14; - GoTestField F_Message = 15; - group F_Group = 16 { - optional int32 x = 17; - } - int32 F_Largest_Tag = 536870911; - } - - oneof tormato { - int32 value = 100; - } -} - -message Communique { - optional bool make_me_cry = 1; - - // This is a oneof, called "union". - oneof union { - int32 number = 5; - string name = 6; - bytes data = 7; - double temp_c = 8; - MyMessage.Color col = 9; - Strings msg = 10; - } -} diff --git a/vendor/github.com/golang/protobuf/proto/text_parser_test.go b/vendor/github.com/golang/protobuf/proto/text_parser_test.go deleted file mode 100644 index a819808..0000000 --- a/vendor/github.com/golang/protobuf/proto/text_parser_test.go +++ /dev/null @@ -1,706 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto_test - -import ( - "fmt" - "math" - "testing" - - . "github.com/golang/protobuf/proto" - proto3pb "github.com/golang/protobuf/proto/proto3_proto" - . "github.com/golang/protobuf/proto/test_proto" -) - -type UnmarshalTextTest struct { - in string - err string // if "", no error expected - out *MyMessage -} - -func buildExtStructTest(text string) UnmarshalTextTest { - msg := &MyMessage{ - Count: Int32(42), - } - SetExtension(msg, E_Ext_More, &Ext{ - Data: String("Hello, world!"), - }) - return UnmarshalTextTest{in: text, out: msg} -} - -func buildExtDataTest(text string) UnmarshalTextTest { - msg := &MyMessage{ - Count: Int32(42), - } - SetExtension(msg, E_Ext_Text, String("Hello, world!")) - SetExtension(msg, E_Ext_Number, Int32(1729)) - return UnmarshalTextTest{in: text, out: msg} -} - -func buildExtRepStringTest(text string) UnmarshalTextTest { - msg := &MyMessage{ - Count: Int32(42), - } - if err := SetExtension(msg, E_Greeting, []string{"bula", "hola"}); err != nil { - panic(err) - } - return UnmarshalTextTest{in: text, out: msg} -} - -var unMarshalTextTests = []UnmarshalTextTest{ - // Basic - { - in: " count:42\n name:\"Dave\" ", - out: &MyMessage{ - Count: Int32(42), - Name: String("Dave"), - }, - }, - - // Empty quoted string - { - in: `count:42 name:""`, - out: &MyMessage{ - Count: Int32(42), - Name: String(""), - }, - }, - - // Quoted string concatenation with double quotes - { - in: `count:42 name: "My name is "` + "\n" + `"elsewhere"`, - out: &MyMessage{ - Count: Int32(42), - Name: String("My name is elsewhere"), - }, - }, - - // Quoted string concatenation with single quotes - { - in: "count:42 name: 'My name is '\n'elsewhere'", - out: &MyMessage{ - Count: Int32(42), - Name: String("My name is elsewhere"), - }, - }, - - // Quoted string concatenations with mixed quotes - { - in: "count:42 name: 'My name is '\n\"elsewhere\"", - out: &MyMessage{ - Count: Int32(42), - Name: String("My name is elsewhere"), - }, - }, - { - in: "count:42 name: \"My name is \"\n'elsewhere'", - out: &MyMessage{ - Count: Int32(42), - Name: String("My name is elsewhere"), - }, - }, - - // Quoted string with escaped apostrophe - { - in: `count:42 name: "HOLIDAY - New Year\'s Day"`, - out: &MyMessage{ - Count: Int32(42), - Name: String("HOLIDAY - New Year's Day"), - }, - }, - - // Quoted string with single quote - { - in: `count:42 name: 'Roger "The Ramster" Ramjet'`, - out: &MyMessage{ - Count: Int32(42), - Name: String(`Roger "The Ramster" Ramjet`), - }, - }, - - // Quoted string with all the accepted special characters from the C++ test - { - in: `count:42 name: ` + "\"\\\"A string with \\' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and multiple spaces\"", - out: &MyMessage{ - Count: Int32(42), - Name: String("\"A string with ' characters \n and \r newlines and \t tabs and \001 slashes \\ and multiple spaces"), - }, - }, - - // Quoted string with quoted backslash - { - in: `count:42 name: "\\'xyz"`, - out: &MyMessage{ - Count: Int32(42), - Name: String(`\'xyz`), - }, - }, - - // Quoted string with UTF-8 bytes. - { - in: "count:42 name: '\303\277\302\201\x00\xAB\xCD\xEF'", - out: &MyMessage{ - Count: Int32(42), - Name: String("\303\277\302\201\x00\xAB\xCD\xEF"), - }, - }, - - // Quoted string with unicode escapes. - { - in: `count: 42 name: "\u0047\U00000047\uffff\U0010ffff"`, - out: &MyMessage{ - Count: Int32(42), - Name: String("GG\uffff\U0010ffff"), - }, - }, - - // Bad quoted string - { - in: `inner: < host: "\0" >` + "\n", - err: `line 1.15: invalid quoted string "\0": \0 requires 2 following digits`, - }, - - // Bad \u escape - { - in: `count: 42 name: "\u000"`, - err: `line 1.16: invalid quoted string "\u000": \u requires 4 following digits`, - }, - - // Bad \U escape - { - in: `count: 42 name: "\U0000000"`, - err: `line 1.16: invalid quoted string "\U0000000": \U requires 8 following digits`, - }, - - // Bad \U escape - { - in: `count: 42 name: "\xxx"`, - err: `line 1.16: invalid quoted string "\xxx": \xxx contains non-hexadecimal digits`, - }, - - // Number too large for int64 - { - in: "count: 1 others { key: 123456789012345678901 }", - err: "line 1.23: invalid int64: 123456789012345678901", - }, - - // Number too large for int32 - { - in: "count: 1234567890123", - err: "line 1.7: invalid int32: 1234567890123", - }, - - // Number in hexadecimal - { - in: "count: 0x2beef", - out: &MyMessage{ - Count: Int32(0x2beef), - }, - }, - - // Number in octal - { - in: "count: 024601", - out: &MyMessage{ - Count: Int32(024601), - }, - }, - - // Floating point number with "f" suffix - { - in: "count: 4 others:< weight: 17.0f >", - out: &MyMessage{ - Count: Int32(4), - Others: []*OtherMessage{ - { - Weight: Float32(17), - }, - }, - }, - }, - - // Floating point positive infinity - { - in: "count: 4 bigfloat: inf", - out: &MyMessage{ - Count: Int32(4), - Bigfloat: Float64(math.Inf(1)), - }, - }, - - // Floating point negative infinity - { - in: "count: 4 bigfloat: -inf", - out: &MyMessage{ - Count: Int32(4), - Bigfloat: Float64(math.Inf(-1)), - }, - }, - - // Number too large for float32 - { - in: "others:< weight: 12345678901234567890123456789012345678901234567890 >", - err: "line 1.17: invalid float32: 12345678901234567890123456789012345678901234567890", - }, - - // Number posing as a quoted string - { - in: `inner: < host: 12 >` + "\n", - err: `line 1.15: invalid string: 12`, - }, - - // Quoted string posing as int32 - { - in: `count: "12"`, - err: `line 1.7: invalid int32: "12"`, - }, - - // Quoted string posing a float32 - { - in: `others:< weight: "17.4" >`, - err: `line 1.17: invalid float32: "17.4"`, - }, - - // unclosed bracket doesn't cause infinite loop - { - in: `[`, - err: `line 1.0: unclosed type_url or extension name`, - }, - - // Enum - { - in: `count:42 bikeshed: BLUE`, - out: &MyMessage{ - Count: Int32(42), - Bikeshed: MyMessage_BLUE.Enum(), - }, - }, - - // Repeated field - { - in: `count:42 pet: "horsey" pet:"bunny"`, - out: &MyMessage{ - Count: Int32(42), - Pet: []string{"horsey", "bunny"}, - }, - }, - - // Repeated field with list notation - { - in: `count:42 pet: ["horsey", "bunny"]`, - out: &MyMessage{ - Count: Int32(42), - Pet: []string{"horsey", "bunny"}, - }, - }, - - // Repeated message with/without colon and <>/{} - { - in: `count:42 others:{} others{} others:<> others:{}`, - out: &MyMessage{ - Count: Int32(42), - Others: []*OtherMessage{ - {}, - {}, - {}, - {}, - }, - }, - }, - - // Missing colon for inner message - { - in: `count:42 inner < host: "cauchy.syd" >`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("cauchy.syd"), - }, - }, - }, - - // Missing colon for string field - { - in: `name "Dave"`, - err: `line 1.5: expected ':', found "\"Dave\""`, - }, - - // Missing colon for int32 field - { - in: `count 42`, - err: `line 1.6: expected ':', found "42"`, - }, - - // Missing required field - { - in: `name: "Pawel"`, - err: fmt.Sprintf(`proto: required field "%T.count" not set`, MyMessage{}), - out: &MyMessage{ - Name: String("Pawel"), - }, - }, - - // Missing required field in a required submessage - { - in: `count: 42 we_must_go_deeper < leo_finally_won_an_oscar <> >`, - err: fmt.Sprintf(`proto: required field "%T.host" not set`, InnerMessage{}), - out: &MyMessage{ - Count: Int32(42), - WeMustGoDeeper: &RequiredInnerMessage{LeoFinallyWonAnOscar: &InnerMessage{}}, - }, - }, - - // Repeated non-repeated field - { - in: `name: "Rob" name: "Russ"`, - err: `line 1.12: non-repeated field "name" was repeated`, - }, - - // Group - { - in: `count: 17 SomeGroup { group_field: 12 }`, - out: &MyMessage{ - Count: Int32(17), - Somegroup: &MyMessage_SomeGroup{ - GroupField: Int32(12), - }, - }, - }, - - // Semicolon between fields - { - in: `count:3;name:"Calvin"`, - out: &MyMessage{ - Count: Int32(3), - Name: String("Calvin"), - }, - }, - // Comma between fields - { - in: `count:4,name:"Ezekiel"`, - out: &MyMessage{ - Count: Int32(4), - Name: String("Ezekiel"), - }, - }, - - // Boolean false - { - in: `count:42 inner { host: "example.com" connected: false }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(false), - }, - }, - }, - // Boolean true - { - in: `count:42 inner { host: "example.com" connected: true }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(true), - }, - }, - }, - // Boolean 0 - { - in: `count:42 inner { host: "example.com" connected: 0 }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(false), - }, - }, - }, - // Boolean 1 - { - in: `count:42 inner { host: "example.com" connected: 1 }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(true), - }, - }, - }, - // Boolean f - { - in: `count:42 inner { host: "example.com" connected: f }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(false), - }, - }, - }, - // Boolean t - { - in: `count:42 inner { host: "example.com" connected: t }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(true), - }, - }, - }, - // Boolean False - { - in: `count:42 inner { host: "example.com" connected: False }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(false), - }, - }, - }, - // Boolean True - { - in: `count:42 inner { host: "example.com" connected: True }`, - out: &MyMessage{ - Count: Int32(42), - Inner: &InnerMessage{ - Host: String("example.com"), - Connected: Bool(true), - }, - }, - }, - - // Extension - buildExtStructTest(`count: 42 [test_proto.Ext.more]:`), - buildExtStructTest(`count: 42 [test_proto.Ext.more] {data:"Hello, world!"}`), - buildExtDataTest(`count: 42 [test_proto.Ext.text]:"Hello, world!" [test_proto.Ext.number]:1729`), - buildExtRepStringTest(`count: 42 [test_proto.greeting]:"bula" [test_proto.greeting]:"hola"`), - - // Big all-in-one - { - in: "count:42 # Meaning\n" + - `name:"Dave" ` + - `quote:"\"I didn't want to go.\"" ` + - `pet:"bunny" ` + - `pet:"kitty" ` + - `pet:"horsey" ` + - `inner:<` + - ` host:"footrest.syd" ` + - ` port:7001 ` + - ` connected:true ` + - `> ` + - `others:<` + - ` key:3735928559 ` + - ` value:"\x01A\a\f" ` + - `> ` + - `others:<` + - " weight:58.9 # Atomic weight of Co\n" + - ` inner:<` + - ` host:"lesha.mtv" ` + - ` port:8002 ` + - ` >` + - `>`, - out: &MyMessage{ - Count: Int32(42), - Name: String("Dave"), - Quote: String(`"I didn't want to go."`), - Pet: []string{"bunny", "kitty", "horsey"}, - Inner: &InnerMessage{ - Host: String("footrest.syd"), - Port: Int32(7001), - Connected: Bool(true), - }, - Others: []*OtherMessage{ - { - Key: Int64(3735928559), - Value: []byte{0x1, 'A', '\a', '\f'}, - }, - { - Weight: Float32(58.9), - Inner: &InnerMessage{ - Host: String("lesha.mtv"), - Port: Int32(8002), - }, - }, - }, - }, - }, -} - -func TestUnmarshalText(t *testing.T) { - for i, test := range unMarshalTextTests { - pb := new(MyMessage) - err := UnmarshalText(test.in, pb) - if test.err == "" { - // We don't expect failure. - if err != nil { - t.Errorf("Test %d: Unexpected error: %v", i, err) - } else if !Equal(pb, test.out) { - t.Errorf("Test %d: Incorrect populated \nHave: %v\nWant: %v", - i, pb, test.out) - } - } else { - // We do expect failure. - if err == nil { - t.Errorf("Test %d: Didn't get expected error: %v", i, test.err) - } else if err.Error() != test.err { - t.Errorf("Test %d: Incorrect error.\nHave: %v\nWant: %v", - i, err.Error(), test.err) - } else if _, ok := err.(*RequiredNotSetError); ok && test.out != nil && !Equal(pb, test.out) { - t.Errorf("Test %d: Incorrect populated \nHave: %v\nWant: %v", - i, pb, test.out) - } - } - } -} - -func TestUnmarshalTextCustomMessage(t *testing.T) { - msg := &textMessage{} - if err := UnmarshalText("custom", msg); err != nil { - t.Errorf("Unexpected error from custom unmarshal: %v", err) - } - if UnmarshalText("not custom", msg) == nil { - t.Errorf("Didn't get expected error from custom unmarshal") - } -} - -// Regression test; this caused a panic. -func TestRepeatedEnum(t *testing.T) { - pb := new(RepeatedEnum) - if err := UnmarshalText("color: RED", pb); err != nil { - t.Fatal(err) - } - exp := &RepeatedEnum{ - Color: []RepeatedEnum_Color{RepeatedEnum_RED}, - } - if !Equal(pb, exp) { - t.Errorf("Incorrect populated \nHave: %v\nWant: %v", pb, exp) - } -} - -func TestProto3TextParsing(t *testing.T) { - m := new(proto3pb.Message) - const in = `name: "Wallace" true_scotsman: true` - want := &proto3pb.Message{ - Name: "Wallace", - TrueScotsman: true, - } - if err := UnmarshalText(in, m); err != nil { - t.Fatal(err) - } - if !Equal(m, want) { - t.Errorf("\n got %v\nwant %v", m, want) - } -} - -func TestMapParsing(t *testing.T) { - m := new(MessageWithMap) - const in = `name_mapping: name_mapping:` + - `msg_mapping:,>` + // separating commas are okay - `msg_mapping>` + // no colon after "value" - `msg_mapping:>` + // omitted key - `msg_mapping:` + // omitted value - `byte_mapping:` + - `byte_mapping:<>` // omitted key and value - want := &MessageWithMap{ - NameMapping: map[int32]string{ - 1: "Beatles", - 1234: "Feist", - }, - MsgMapping: map[int64]*FloatingPoint{ - -4: {F: Float64(2.0)}, - -2: {F: Float64(4.0)}, - 0: {F: Float64(5.0)}, - 1: nil, - }, - ByteMapping: map[bool][]byte{ - false: nil, - true: []byte("so be it"), - }, - } - if err := UnmarshalText(in, m); err != nil { - t.Fatal(err) - } - if !Equal(m, want) { - t.Errorf("\n got %v\nwant %v", m, want) - } -} - -func TestOneofParsing(t *testing.T) { - const in = `name:"Shrek"` - m := new(Communique) - want := &Communique{Union: &Communique_Name{"Shrek"}} - if err := UnmarshalText(in, m); err != nil { - t.Fatal(err) - } - if !Equal(m, want) { - t.Errorf("\n got %v\nwant %v", m, want) - } - - const inOverwrite = `name:"Shrek" number:42` - m = new(Communique) - testErr := "line 1.13: field 'number' would overwrite already parsed oneof 'Union'" - if err := UnmarshalText(inOverwrite, m); err == nil { - t.Errorf("TestOneofParsing: Didn't get expected error: %v", testErr) - } else if err.Error() != testErr { - t.Errorf("TestOneofParsing: Incorrect error.\nHave: %v\nWant: %v", - err.Error(), testErr) - } - -} - -var benchInput string - -func init() { - benchInput = "count: 4\n" - for i := 0; i < 1000; i++ { - benchInput += "pet: \"fido\"\n" - } - - // Check it is valid input. - pb := new(MyMessage) - err := UnmarshalText(benchInput, pb) - if err != nil { - panic("Bad benchmark input: " + err.Error()) - } -} - -func BenchmarkUnmarshalText(b *testing.B) { - pb := new(MyMessage) - for i := 0; i < b.N; i++ { - UnmarshalText(benchInput, pb) - } - b.SetBytes(int64(len(benchInput))) -} diff --git a/vendor/github.com/golang/protobuf/proto/text_test.go b/vendor/github.com/golang/protobuf/proto/text_test.go deleted file mode 100644 index 3c8b033..0000000 --- a/vendor/github.com/golang/protobuf/proto/text_test.go +++ /dev/null @@ -1,518 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package proto_test - -import ( - "bytes" - "errors" - "io/ioutil" - "math" - "strings" - "sync" - "testing" - - "github.com/golang/protobuf/proto" - - proto3pb "github.com/golang/protobuf/proto/proto3_proto" - pb "github.com/golang/protobuf/proto/test_proto" - anypb "github.com/golang/protobuf/ptypes/any" -) - -// textMessage implements the methods that allow it to marshal and unmarshal -// itself as text. -type textMessage struct { -} - -func (*textMessage) MarshalText() ([]byte, error) { - return []byte("custom"), nil -} - -func (*textMessage) UnmarshalText(bytes []byte) error { - if string(bytes) != "custom" { - return errors.New("expected 'custom'") - } - return nil -} - -func (*textMessage) Reset() {} -func (*textMessage) String() string { return "" } -func (*textMessage) ProtoMessage() {} - -func newTestMessage() *pb.MyMessage { - msg := &pb.MyMessage{ - Count: proto.Int32(42), - Name: proto.String("Dave"), - Quote: proto.String(`"I didn't want to go."`), - Pet: []string{"bunny", "kitty", "horsey"}, - Inner: &pb.InnerMessage{ - Host: proto.String("footrest.syd"), - Port: proto.Int32(7001), - Connected: proto.Bool(true), - }, - Others: []*pb.OtherMessage{ - { - Key: proto.Int64(0xdeadbeef), - Value: []byte{1, 65, 7, 12}, - }, - { - Weight: proto.Float32(6.022), - Inner: &pb.InnerMessage{ - Host: proto.String("lesha.mtv"), - Port: proto.Int32(8002), - }, - }, - }, - Bikeshed: pb.MyMessage_BLUE.Enum(), - Somegroup: &pb.MyMessage_SomeGroup{ - GroupField: proto.Int32(8), - }, - // One normally wouldn't do this. - // This is an undeclared tag 13, as a varint (wire type 0) with value 4. - XXX_unrecognized: []byte{13<<3 | 0, 4}, - } - ext := &pb.Ext{ - Data: proto.String("Big gobs for big rats"), - } - if err := proto.SetExtension(msg, pb.E_Ext_More, ext); err != nil { - panic(err) - } - greetings := []string{"adg", "easy", "cow"} - if err := proto.SetExtension(msg, pb.E_Greeting, greetings); err != nil { - panic(err) - } - - // Add an unknown extension. We marshal a pb.Ext, and fake the ID. - b, err := proto.Marshal(&pb.Ext{Data: proto.String("3G skiing")}) - if err != nil { - panic(err) - } - b = append(proto.EncodeVarint(201<<3|proto.WireBytes), b...) - proto.SetRawExtension(msg, 201, b) - - // Extensions can be plain fields, too, so let's test that. - b = append(proto.EncodeVarint(202<<3|proto.WireVarint), 19) - proto.SetRawExtension(msg, 202, b) - - return msg -} - -const text = `count: 42 -name: "Dave" -quote: "\"I didn't want to go.\"" -pet: "bunny" -pet: "kitty" -pet: "horsey" -inner: < - host: "footrest.syd" - port: 7001 - connected: true -> -others: < - key: 3735928559 - value: "\001A\007\014" -> -others: < - weight: 6.022 - inner: < - host: "lesha.mtv" - port: 8002 - > -> -bikeshed: BLUE -SomeGroup { - group_field: 8 -} -/* 2 unknown bytes */ -13: 4 -[test_proto.Ext.more]: < - data: "Big gobs for big rats" -> -[test_proto.greeting]: "adg" -[test_proto.greeting]: "easy" -[test_proto.greeting]: "cow" -/* 13 unknown bytes */ -201: "\t3G skiing" -/* 3 unknown bytes */ -202: 19 -` - -func TestMarshalText(t *testing.T) { - buf := new(bytes.Buffer) - if err := proto.MarshalText(buf, newTestMessage()); err != nil { - t.Fatalf("proto.MarshalText: %v", err) - } - s := buf.String() - if s != text { - t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", s, text) - } -} - -func TestMarshalTextCustomMessage(t *testing.T) { - buf := new(bytes.Buffer) - if err := proto.MarshalText(buf, &textMessage{}); err != nil { - t.Fatalf("proto.MarshalText: %v", err) - } - s := buf.String() - if s != "custom" { - t.Errorf("Got %q, expected %q", s, "custom") - } -} -func TestMarshalTextNil(t *testing.T) { - want := "" - tests := []proto.Message{nil, (*pb.MyMessage)(nil)} - for i, test := range tests { - buf := new(bytes.Buffer) - if err := proto.MarshalText(buf, test); err != nil { - t.Fatal(err) - } - if got := buf.String(); got != want { - t.Errorf("%d: got %q want %q", i, got, want) - } - } -} - -func TestMarshalTextUnknownEnum(t *testing.T) { - // The Color enum only specifies values 0-2. - m := &pb.MyMessage{Bikeshed: pb.MyMessage_Color(3).Enum()} - got := m.String() - const want = `bikeshed:3 ` - if got != want { - t.Errorf("\n got %q\nwant %q", got, want) - } -} - -func TestTextOneof(t *testing.T) { - tests := []struct { - m proto.Message - want string - }{ - // zero message - {&pb.Communique{}, ``}, - // scalar field - {&pb.Communique{Union: &pb.Communique_Number{4}}, `number:4`}, - // message field - {&pb.Communique{Union: &pb.Communique_Msg{ - &pb.Strings{StringField: proto.String("why hello!")}, - }}, `msg:`}, - // bad oneof (should not panic) - {&pb.Communique{Union: &pb.Communique_Msg{nil}}, `msg:/* nil */`}, - } - for _, test := range tests { - got := strings.TrimSpace(test.m.String()) - if got != test.want { - t.Errorf("\n got %s\nwant %s", got, test.want) - } - } -} - -func BenchmarkMarshalTextBuffered(b *testing.B) { - buf := new(bytes.Buffer) - m := newTestMessage() - for i := 0; i < b.N; i++ { - buf.Reset() - proto.MarshalText(buf, m) - } -} - -func BenchmarkMarshalTextUnbuffered(b *testing.B) { - w := ioutil.Discard - m := newTestMessage() - for i := 0; i < b.N; i++ { - proto.MarshalText(w, m) - } -} - -func compact(src string) string { - // s/[ \n]+/ /g; s/ $//; - dst := make([]byte, len(src)) - space, comment := false, false - j := 0 - for i := 0; i < len(src); i++ { - if strings.HasPrefix(src[i:], "/*") { - comment = true - i++ - continue - } - if comment && strings.HasPrefix(src[i:], "*/") { - comment = false - i++ - continue - } - if comment { - continue - } - c := src[i] - if c == ' ' || c == '\n' { - space = true - continue - } - if j > 0 && (dst[j-1] == ':' || dst[j-1] == '<' || dst[j-1] == '{') { - space = false - } - if c == '{' { - space = false - } - if space { - dst[j] = ' ' - j++ - space = false - } - dst[j] = c - j++ - } - if space { - dst[j] = ' ' - j++ - } - return string(dst[0:j]) -} - -var compactText = compact(text) - -func TestCompactText(t *testing.T) { - s := proto.CompactTextString(newTestMessage()) - if s != compactText { - t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v\n===\n", s, compactText) - } -} - -func TestStringEscaping(t *testing.T) { - testCases := []struct { - in *pb.Strings - out string - }{ - { - // Test data from C++ test (TextFormatTest.StringEscape). - // Single divergence: we don't escape apostrophes. - &pb.Strings{StringField: proto.String("\"A string with ' characters \n and \r newlines and \t tabs and \001 slashes \\ and multiple spaces")}, - "string_field: \"\\\"A string with ' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and multiple spaces\"\n", - }, - { - // Test data from the same C++ test. - &pb.Strings{StringField: proto.String("\350\260\267\346\255\214")}, - "string_field: \"\\350\\260\\267\\346\\255\\214\"\n", - }, - { - // Some UTF-8. - &pb.Strings{StringField: proto.String("\x00\x01\xff\x81")}, - `string_field: "\000\001\377\201"` + "\n", - }, - } - - for i, tc := range testCases { - var buf bytes.Buffer - if err := proto.MarshalText(&buf, tc.in); err != nil { - t.Errorf("proto.MarsalText: %v", err) - continue - } - s := buf.String() - if s != tc.out { - t.Errorf("#%d: Got:\n%s\nExpected:\n%s\n", i, s, tc.out) - continue - } - - // Check round-trip. - pb := new(pb.Strings) - if err := proto.UnmarshalText(s, pb); err != nil { - t.Errorf("#%d: UnmarshalText: %v", i, err) - continue - } - if !proto.Equal(pb, tc.in) { - t.Errorf("#%d: Round-trip failed:\nstart: %v\n end: %v", i, tc.in, pb) - } - } -} - -// A limitedWriter accepts some output before it fails. -// This is a proxy for something like a nearly-full or imminently-failing disk, -// or a network connection that is about to die. -type limitedWriter struct { - b bytes.Buffer - limit int -} - -var outOfSpace = errors.New("proto: insufficient space") - -func (w *limitedWriter) Write(p []byte) (n int, err error) { - var avail = w.limit - w.b.Len() - if avail <= 0 { - return 0, outOfSpace - } - if len(p) <= avail { - return w.b.Write(p) - } - n, _ = w.b.Write(p[:avail]) - return n, outOfSpace -} - -func TestMarshalTextFailing(t *testing.T) { - // Try lots of different sizes to exercise more error code-paths. - for lim := 0; lim < len(text); lim++ { - buf := new(limitedWriter) - buf.limit = lim - err := proto.MarshalText(buf, newTestMessage()) - // We expect a certain error, but also some partial results in the buffer. - if err != outOfSpace { - t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", err, outOfSpace) - } - s := buf.b.String() - x := text[:buf.limit] - if s != x { - t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", s, x) - } - } -} - -func TestFloats(t *testing.T) { - tests := []struct { - f float64 - want string - }{ - {0, "0"}, - {4.7, "4.7"}, - {math.Inf(1), "inf"}, - {math.Inf(-1), "-inf"}, - {math.NaN(), "nan"}, - } - for _, test := range tests { - msg := &pb.FloatingPoint{F: &test.f} - got := strings.TrimSpace(msg.String()) - want := `f:` + test.want - if got != want { - t.Errorf("f=%f: got %q, want %q", test.f, got, want) - } - } -} - -func TestRepeatedNilText(t *testing.T) { - m := &pb.MessageList{ - Message: []*pb.MessageList_Message{ - nil, - &pb.MessageList_Message{ - Name: proto.String("Horse"), - }, - nil, - }, - } - want := `Message -Message { - name: "Horse" -} -Message -` - if s := proto.MarshalTextString(m); s != want { - t.Errorf(" got: %s\nwant: %s", s, want) - } -} - -func TestProto3Text(t *testing.T) { - tests := []struct { - m proto.Message - want string - }{ - // zero message - {&proto3pb.Message{}, ``}, - // zero message except for an empty byte slice - {&proto3pb.Message{Data: []byte{}}, ``}, - // trivial case - {&proto3pb.Message{Name: "Rob", HeightInCm: 175}, `name:"Rob" height_in_cm:175`}, - // empty map - {&pb.MessageWithMap{}, ``}, - // non-empty map; map format is the same as a repeated struct, - // and they are sorted by key (numerically for numeric keys). - { - &pb.MessageWithMap{NameMapping: map[int32]string{ - -1: "Negatory", - 7: "Lucky", - 1234: "Feist", - 6345789: "Otis", - }}, - `name_mapping: ` + - `name_mapping: ` + - `name_mapping: ` + - `name_mapping:`, - }, - // map with nil value; not well-defined, but we shouldn't crash - { - &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{7: nil}}, - `msg_mapping:`, - }, - } - for _, test := range tests { - got := strings.TrimSpace(test.m.String()) - if got != test.want { - t.Errorf("\n got %s\nwant %s", got, test.want) - } - } -} - -func TestRacyMarshal(t *testing.T) { - // This test should be run with the race detector. - - any := &pb.MyMessage{Count: proto.Int32(47), Name: proto.String("David")} - proto.SetExtension(any, pb.E_Ext_Text, proto.String("bar")) - b, err := proto.Marshal(any) - if err != nil { - panic(err) - } - m := &proto3pb.Message{ - Name: "David", - ResultCount: 47, - Anything: &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any), Value: b}, - } - - wantText := proto.MarshalTextString(m) - wantBytes, err := proto.Marshal(m) - if err != nil { - t.Fatalf("proto.Marshal error: %v", err) - } - - var wg sync.WaitGroup - defer wg.Wait() - wg.Add(20) - for i := 0; i < 10; i++ { - go func() { - defer wg.Done() - got := proto.MarshalTextString(m) - if got != wantText { - t.Errorf("proto.MarshalTextString = %q, want %q", got, wantText) - } - }() - go func() { - defer wg.Done() - got, err := proto.Marshal(m) - if !bytes.Equal(got, wantBytes) || err != nil { - t.Errorf("proto.Marshal = (%x, %v), want (%x, nil)", got, err, wantBytes) - } - }() - } -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go deleted file mode 100644 index e855b1f..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go +++ /dev/null @@ -1,2812 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/descriptor.proto - -package descriptor // import "github.com/golang/protobuf/protoc-gen-go/descriptor" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type FieldDescriptorProto_Type int32 - -const ( - // 0 is reserved for errors. - // Order is weird for historical reasons. - FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1 - FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2 - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3 - FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4 - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5 - FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6 - FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7 - FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 - FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 - FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 - // New in version 2. - FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12 - FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13 - FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14 - FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15 - FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16 - FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17 - FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 -) - -var FieldDescriptorProto_Type_name = map[int32]string{ - 1: "TYPE_DOUBLE", - 2: "TYPE_FLOAT", - 3: "TYPE_INT64", - 4: "TYPE_UINT64", - 5: "TYPE_INT32", - 6: "TYPE_FIXED64", - 7: "TYPE_FIXED32", - 8: "TYPE_BOOL", - 9: "TYPE_STRING", - 10: "TYPE_GROUP", - 11: "TYPE_MESSAGE", - 12: "TYPE_BYTES", - 13: "TYPE_UINT32", - 14: "TYPE_ENUM", - 15: "TYPE_SFIXED32", - 16: "TYPE_SFIXED64", - 17: "TYPE_SINT32", - 18: "TYPE_SINT64", -} -var FieldDescriptorProto_Type_value = map[string]int32{ - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18, -} - -func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { - p := new(FieldDescriptorProto_Type) - *p = x - return p -} -func (x FieldDescriptorProto_Type) String() string { - return proto.EnumName(FieldDescriptorProto_Type_name, int32(x)) -} -func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type") - if err != nil { - return err - } - *x = FieldDescriptorProto_Type(value) - return nil -} -func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4, 0} -} - -type FieldDescriptorProto_Label int32 - -const ( - // 0 is reserved for errors - FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 - FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 - FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 -) - -var FieldDescriptorProto_Label_name = map[int32]string{ - 1: "LABEL_OPTIONAL", - 2: "LABEL_REQUIRED", - 3: "LABEL_REPEATED", -} -var FieldDescriptorProto_Label_value = map[string]int32{ - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3, -} - -func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { - p := new(FieldDescriptorProto_Label) - *p = x - return p -} -func (x FieldDescriptorProto_Label) String() string { - return proto.EnumName(FieldDescriptorProto_Label_name, int32(x)) -} -func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label") - if err != nil { - return err - } - *x = FieldDescriptorProto_Label(value) - return nil -} -func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4, 1} -} - -// Generated classes can be optimized for speed or code size. -type FileOptions_OptimizeMode int32 - -const ( - FileOptions_SPEED FileOptions_OptimizeMode = 1 - // etc. - FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2 - FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 -) - -var FileOptions_OptimizeMode_name = map[int32]string{ - 1: "SPEED", - 2: "CODE_SIZE", - 3: "LITE_RUNTIME", -} -var FileOptions_OptimizeMode_value = map[string]int32{ - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3, -} - -func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { - p := new(FileOptions_OptimizeMode) - *p = x - return p -} -func (x FileOptions_OptimizeMode) String() string { - return proto.EnumName(FileOptions_OptimizeMode_name, int32(x)) -} -func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode") - if err != nil { - return err - } - *x = FileOptions_OptimizeMode(value) - return nil -} -func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{10, 0} -} - -type FieldOptions_CType int32 - -const ( - // Default mode. - FieldOptions_STRING FieldOptions_CType = 0 - FieldOptions_CORD FieldOptions_CType = 1 - FieldOptions_STRING_PIECE FieldOptions_CType = 2 -) - -var FieldOptions_CType_name = map[int32]string{ - 0: "STRING", - 1: "CORD", - 2: "STRING_PIECE", -} -var FieldOptions_CType_value = map[string]int32{ - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2, -} - -func (x FieldOptions_CType) Enum() *FieldOptions_CType { - p := new(FieldOptions_CType) - *p = x - return p -} -func (x FieldOptions_CType) String() string { - return proto.EnumName(FieldOptions_CType_name, int32(x)) -} -func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType") - if err != nil { - return err - } - *x = FieldOptions_CType(value) - return nil -} -func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12, 0} -} - -type FieldOptions_JSType int32 - -const ( - // Use the default type. - FieldOptions_JS_NORMAL FieldOptions_JSType = 0 - // Use JavaScript strings. - FieldOptions_JS_STRING FieldOptions_JSType = 1 - // Use JavaScript numbers. - FieldOptions_JS_NUMBER FieldOptions_JSType = 2 -) - -var FieldOptions_JSType_name = map[int32]string{ - 0: "JS_NORMAL", - 1: "JS_STRING", - 2: "JS_NUMBER", -} -var FieldOptions_JSType_value = map[string]int32{ - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2, -} - -func (x FieldOptions_JSType) Enum() *FieldOptions_JSType { - p := new(FieldOptions_JSType) - *p = x - return p -} -func (x FieldOptions_JSType) String() string { - return proto.EnumName(FieldOptions_JSType_name, int32(x)) -} -func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType") - if err != nil { - return err - } - *x = FieldOptions_JSType(value) - return nil -} -func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12, 1} -} - -// Is this method side-effect-free (or safe in HTTP parlance), or idempotent, -// or neither? HTTP based RPC implementation may choose GET verb for safe -// methods, and PUT verb for idempotent methods instead of the default POST. -type MethodOptions_IdempotencyLevel int32 - -const ( - MethodOptions_IDEMPOTENCY_UNKNOWN MethodOptions_IdempotencyLevel = 0 - MethodOptions_NO_SIDE_EFFECTS MethodOptions_IdempotencyLevel = 1 - MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2 -) - -var MethodOptions_IdempotencyLevel_name = map[int32]string{ - 0: "IDEMPOTENCY_UNKNOWN", - 1: "NO_SIDE_EFFECTS", - 2: "IDEMPOTENT", -} -var MethodOptions_IdempotencyLevel_value = map[string]int32{ - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2, -} - -func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel { - p := new(MethodOptions_IdempotencyLevel) - *p = x - return p -} -func (x MethodOptions_IdempotencyLevel) String() string { - return proto.EnumName(MethodOptions_IdempotencyLevel_name, int32(x)) -} -func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel") - if err != nil { - return err - } - *x = MethodOptions_IdempotencyLevel(value) - return nil -} -func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{17, 0} -} - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -type FileDescriptorSet struct { - File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} } -func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) } -func (*FileDescriptorSet) ProtoMessage() {} -func (*FileDescriptorSet) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{0} -} -func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b) -} -func (m *FileDescriptorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileDescriptorSet.Marshal(b, m, deterministic) -} -func (dst *FileDescriptorSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileDescriptorSet.Merge(dst, src) -} -func (m *FileDescriptorSet) XXX_Size() int { - return xxx_messageInfo_FileDescriptorSet.Size(m) -} -func (m *FileDescriptorSet) XXX_DiscardUnknown() { - xxx_messageInfo_FileDescriptorSet.DiscardUnknown(m) -} - -var xxx_messageInfo_FileDescriptorSet proto.InternalMessageInfo - -func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto { - if m != nil { - return m.File - } - return nil -} - -// Describes a complete .proto file. -type FileDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` - // Names of files imported by this file. - Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` - // Indexes of the public imported files in the dependency list above. - PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"` - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` - // All top-level definitions in this file. - MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` - EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` - Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` - Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` - Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"` - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} } -func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*FileDescriptorProto) ProtoMessage() {} -func (*FileDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{1} -} -func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b) -} -func (m *FileDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileDescriptorProto.Marshal(b, m, deterministic) -} -func (dst *FileDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileDescriptorProto.Merge(dst, src) -} -func (m *FileDescriptorProto) XXX_Size() int { - return xxx_messageInfo_FileDescriptorProto.Size(m) -} -func (m *FileDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_FileDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_FileDescriptorProto proto.InternalMessageInfo - -func (m *FileDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FileDescriptorProto) GetPackage() string { - if m != nil && m.Package != nil { - return *m.Package - } - return "" -} - -func (m *FileDescriptorProto) GetDependency() []string { - if m != nil { - return m.Dependency - } - return nil -} - -func (m *FileDescriptorProto) GetPublicDependency() []int32 { - if m != nil { - return m.PublicDependency - } - return nil -} - -func (m *FileDescriptorProto) GetWeakDependency() []int32 { - if m != nil { - return m.WeakDependency - } - return nil -} - -func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto { - if m != nil { - return m.MessageType - } - return nil -} - -func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto { - if m != nil { - return m.EnumType - } - return nil -} - -func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto { - if m != nil { - return m.Service - } - return nil -} - -func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto { - if m != nil { - return m.Extension - } - return nil -} - -func (m *FileDescriptorProto) GetOptions() *FileOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo { - if m != nil { - return m.SourceCodeInfo - } - return nil -} - -func (m *FileDescriptorProto) GetSyntax() string { - if m != nil && m.Syntax != nil { - return *m.Syntax - } - return "" -} - -// Describes a message type. -type DescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` - Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"` - NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"` - EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` - ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"` - OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"` - Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"` - ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescriptorProto) Reset() { *m = DescriptorProto{} } -func (m *DescriptorProto) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto) ProtoMessage() {} -func (*DescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2} -} -func (m *DescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescriptorProto.Unmarshal(m, b) -} -func (m *DescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescriptorProto.Marshal(b, m, deterministic) -} -func (dst *DescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto.Merge(dst, src) -} -func (m *DescriptorProto) XXX_Size() int { - return xxx_messageInfo_DescriptorProto.Size(m) -} -func (m *DescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_DescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_DescriptorProto proto.InternalMessageInfo - -func (m *DescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *DescriptorProto) GetField() []*FieldDescriptorProto { - if m != nil { - return m.Field - } - return nil -} - -func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto { - if m != nil { - return m.Extension - } - return nil -} - -func (m *DescriptorProto) GetNestedType() []*DescriptorProto { - if m != nil { - return m.NestedType - } - return nil -} - -func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto { - if m != nil { - return m.EnumType - } - return nil -} - -func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange { - if m != nil { - return m.ExtensionRange - } - return nil -} - -func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto { - if m != nil { - return m.OneofDecl - } - return nil -} - -func (m *DescriptorProto) GetOptions() *MessageOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange { - if m != nil { - return m.ReservedRange - } - return nil -} - -func (m *DescriptorProto) GetReservedName() []string { - if m != nil { - return m.ReservedName - } - return nil -} - -type DescriptorProto_ExtensionRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} } -func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto_ExtensionRange) ProtoMessage() {} -func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2, 0} -} -func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b) -} -func (m *DescriptorProto_ExtensionRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescriptorProto_ExtensionRange.Marshal(b, m, deterministic) -} -func (dst *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(dst, src) -} -func (m *DescriptorProto_ExtensionRange) XXX_Size() int { - return xxx_messageInfo_DescriptorProto_ExtensionRange.Size(m) -} -func (m *DescriptorProto_ExtensionRange) XXX_DiscardUnknown() { - xxx_messageInfo_DescriptorProto_ExtensionRange.DiscardUnknown(m) -} - -var xxx_messageInfo_DescriptorProto_ExtensionRange proto.InternalMessageInfo - -func (m *DescriptorProto_ExtensionRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *DescriptorProto_ExtensionRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -func (m *DescriptorProto_ExtensionRange) GetOptions() *ExtensionRangeOptions { - if m != nil { - return m.Options - } - return nil -} - -// Range of reserved tag numbers. Reserved tag numbers may not be used by -// fields or extension ranges in the same message. Reserved ranges may -// not overlap. -type DescriptorProto_ReservedRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} } -func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto_ReservedRange) ProtoMessage() {} -func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{2, 1} -} -func (m *DescriptorProto_ReservedRange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DescriptorProto_ReservedRange.Unmarshal(m, b) -} -func (m *DescriptorProto_ReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DescriptorProto_ReservedRange.Marshal(b, m, deterministic) -} -func (dst *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescriptorProto_ReservedRange.Merge(dst, src) -} -func (m *DescriptorProto_ReservedRange) XXX_Size() int { - return xxx_messageInfo_DescriptorProto_ReservedRange.Size(m) -} -func (m *DescriptorProto_ReservedRange) XXX_DiscardUnknown() { - xxx_messageInfo_DescriptorProto_ReservedRange.DiscardUnknown(m) -} - -var xxx_messageInfo_DescriptorProto_ReservedRange proto.InternalMessageInfo - -func (m *DescriptorProto_ReservedRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *DescriptorProto_ReservedRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -type ExtensionRangeOptions struct { - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtensionRangeOptions) Reset() { *m = ExtensionRangeOptions{} } -func (m *ExtensionRangeOptions) String() string { return proto.CompactTextString(m) } -func (*ExtensionRangeOptions) ProtoMessage() {} -func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{3} -} - -var extRange_ExtensionRangeOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*ExtensionRangeOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_ExtensionRangeOptions -} -func (m *ExtensionRangeOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionRangeOptions.Unmarshal(m, b) -} -func (m *ExtensionRangeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionRangeOptions.Marshal(b, m, deterministic) -} -func (dst *ExtensionRangeOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionRangeOptions.Merge(dst, src) -} -func (m *ExtensionRangeOptions) XXX_Size() int { - return xxx_messageInfo_ExtensionRangeOptions.Size(m) -} -func (m *ExtensionRangeOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionRangeOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtensionRangeOptions proto.InternalMessageInfo - -func (m *ExtensionRangeOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -// Describes a field within a message. -type FieldDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` - Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"` - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"` - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"` - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"` - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"` - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"` - Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} } -func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*FieldDescriptorProto) ProtoMessage() {} -func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{4} -} -func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b) -} -func (m *FieldDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldDescriptorProto.Marshal(b, m, deterministic) -} -func (dst *FieldDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldDescriptorProto.Merge(dst, src) -} -func (m *FieldDescriptorProto) XXX_Size() int { - return xxx_messageInfo_FieldDescriptorProto.Size(m) -} -func (m *FieldDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_FieldDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldDescriptorProto proto.InternalMessageInfo - -func (m *FieldDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FieldDescriptorProto) GetNumber() int32 { - if m != nil && m.Number != nil { - return *m.Number - } - return 0 -} - -func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label { - if m != nil && m.Label != nil { - return *m.Label - } - return FieldDescriptorProto_LABEL_OPTIONAL -} - -func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return FieldDescriptorProto_TYPE_DOUBLE -} - -func (m *FieldDescriptorProto) GetTypeName() string { - if m != nil && m.TypeName != nil { - return *m.TypeName - } - return "" -} - -func (m *FieldDescriptorProto) GetExtendee() string { - if m != nil && m.Extendee != nil { - return *m.Extendee - } - return "" -} - -func (m *FieldDescriptorProto) GetDefaultValue() string { - if m != nil && m.DefaultValue != nil { - return *m.DefaultValue - } - return "" -} - -func (m *FieldDescriptorProto) GetOneofIndex() int32 { - if m != nil && m.OneofIndex != nil { - return *m.OneofIndex - } - return 0 -} - -func (m *FieldDescriptorProto) GetJsonName() string { - if m != nil && m.JsonName != nil { - return *m.JsonName - } - return "" -} - -func (m *FieldDescriptorProto) GetOptions() *FieldOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a oneof. -type OneofDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} } -func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*OneofDescriptorProto) ProtoMessage() {} -func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{5} -} -func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b) -} -func (m *OneofDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OneofDescriptorProto.Marshal(b, m, deterministic) -} -func (dst *OneofDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_OneofDescriptorProto.Merge(dst, src) -} -func (m *OneofDescriptorProto) XXX_Size() int { - return xxx_messageInfo_OneofDescriptorProto.Size(m) -} -func (m *OneofDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_OneofDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_OneofDescriptorProto proto.InternalMessageInfo - -func (m *OneofDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *OneofDescriptorProto) GetOptions() *OneofOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes an enum type. -type EnumDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` - Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} } -func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*EnumDescriptorProto) ProtoMessage() {} -func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{6} -} -func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b) -} -func (m *EnumDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumDescriptorProto.Marshal(b, m, deterministic) -} -func (dst *EnumDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumDescriptorProto.Merge(dst, src) -} -func (m *EnumDescriptorProto) XXX_Size() int { - return xxx_messageInfo_EnumDescriptorProto.Size(m) -} -func (m *EnumDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_EnumDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumDescriptorProto proto.InternalMessageInfo - -func (m *EnumDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto { - if m != nil { - return m.Value - } - return nil -} - -func (m *EnumDescriptorProto) GetOptions() *EnumOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *EnumDescriptorProto) GetReservedRange() []*EnumDescriptorProto_EnumReservedRange { - if m != nil { - return m.ReservedRange - } - return nil -} - -func (m *EnumDescriptorProto) GetReservedName() []string { - if m != nil { - return m.ReservedName - } - return nil -} - -// Range of reserved numeric values. Reserved values may not be used by -// entries in the same enum. Reserved ranges may not overlap. -// -// Note that this is distinct from DescriptorProto.ReservedRange in that it -// is inclusive such that it can appropriately represent the entire int32 -// domain. -type EnumDescriptorProto_EnumReservedRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumDescriptorProto_EnumReservedRange) Reset() { *m = EnumDescriptorProto_EnumReservedRange{} } -func (m *EnumDescriptorProto_EnumReservedRange) String() string { return proto.CompactTextString(m) } -func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {} -func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{6, 0} -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Unmarshal(m, b) -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Marshal(b, m, deterministic) -} -func (dst *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(dst, src) -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_Size() int { - return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Size(m) -} -func (m *EnumDescriptorProto_EnumReservedRange) XXX_DiscardUnknown() { - xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumDescriptorProto_EnumReservedRange proto.InternalMessageInfo - -func (m *EnumDescriptorProto_EnumReservedRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -// Describes a value within an enum. -type EnumValueDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` - Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} } -func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*EnumValueDescriptorProto) ProtoMessage() {} -func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{7} -} -func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b) -} -func (m *EnumValueDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumValueDescriptorProto.Marshal(b, m, deterministic) -} -func (dst *EnumValueDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumValueDescriptorProto.Merge(dst, src) -} -func (m *EnumValueDescriptorProto) XXX_Size() int { - return xxx_messageInfo_EnumValueDescriptorProto.Size(m) -} -func (m *EnumValueDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_EnumValueDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumValueDescriptorProto proto.InternalMessageInfo - -func (m *EnumValueDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *EnumValueDescriptorProto) GetNumber() int32 { - if m != nil && m.Number != nil { - return *m.Number - } - return 0 -} - -func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a service. -type ServiceDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"` - Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} } -func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*ServiceDescriptorProto) ProtoMessage() {} -func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{8} -} -func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b) -} -func (m *ServiceDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServiceDescriptorProto.Marshal(b, m, deterministic) -} -func (dst *ServiceDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceDescriptorProto.Merge(dst, src) -} -func (m *ServiceDescriptorProto) XXX_Size() int { - return xxx_messageInfo_ServiceDescriptorProto.Size(m) -} -func (m *ServiceDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceDescriptorProto proto.InternalMessageInfo - -func (m *ServiceDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto { - if m != nil { - return m.Method - } - return nil -} - -func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a method of a service. -type MethodDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"` - OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"` - Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` - // Identifies if client streams multiple client messages - ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"` - // Identifies if server streams multiple server messages - ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} } -func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*MethodDescriptorProto) ProtoMessage() {} -func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{9} -} -func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b) -} -func (m *MethodDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MethodDescriptorProto.Marshal(b, m, deterministic) -} -func (dst *MethodDescriptorProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_MethodDescriptorProto.Merge(dst, src) -} -func (m *MethodDescriptorProto) XXX_Size() int { - return xxx_messageInfo_MethodDescriptorProto.Size(m) -} -func (m *MethodDescriptorProto) XXX_DiscardUnknown() { - xxx_messageInfo_MethodDescriptorProto.DiscardUnknown(m) -} - -var xxx_messageInfo_MethodDescriptorProto proto.InternalMessageInfo - -const Default_MethodDescriptorProto_ClientStreaming bool = false -const Default_MethodDescriptorProto_ServerStreaming bool = false - -func (m *MethodDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *MethodDescriptorProto) GetInputType() string { - if m != nil && m.InputType != nil { - return *m.InputType - } - return "" -} - -func (m *MethodDescriptorProto) GetOutputType() string { - if m != nil && m.OutputType != nil { - return *m.OutputType - } - return "" -} - -func (m *MethodDescriptorProto) GetOptions() *MethodOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *MethodDescriptorProto) GetClientStreaming() bool { - if m != nil && m.ClientStreaming != nil { - return *m.ClientStreaming - } - return Default_MethodDescriptorProto_ClientStreaming -} - -func (m *MethodDescriptorProto) GetServerStreaming() bool { - if m != nil && m.ServerStreaming != nil { - return *m.ServerStreaming - } - return Default_MethodDescriptorProto_ServerStreaming -} - -type FileOptions struct { - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"` - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"` - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"` - // This option does nothing. - JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // Deprecated: Do not use. - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` - OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"` - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"` - JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"` - PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"` - PhpGenericServices *bool `protobuf:"varint,42,opt,name=php_generic_services,json=phpGenericServices,def=0" json:"php_generic_services,omitempty"` - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"` - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"` - // Namespace for generated classes; defaults to the package. - CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"` - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"` - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"` - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"` - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileOptions) Reset() { *m = FileOptions{} } -func (m *FileOptions) String() string { return proto.CompactTextString(m) } -func (*FileOptions) ProtoMessage() {} -func (*FileOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{10} -} - -var extRange_FileOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_FileOptions -} -func (m *FileOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileOptions.Unmarshal(m, b) -} -func (m *FileOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileOptions.Marshal(b, m, deterministic) -} -func (dst *FileOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileOptions.Merge(dst, src) -} -func (m *FileOptions) XXX_Size() int { - return xxx_messageInfo_FileOptions.Size(m) -} -func (m *FileOptions) XXX_DiscardUnknown() { - xxx_messageInfo_FileOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_FileOptions proto.InternalMessageInfo - -const Default_FileOptions_JavaMultipleFiles bool = false -const Default_FileOptions_JavaStringCheckUtf8 bool = false -const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED -const Default_FileOptions_CcGenericServices bool = false -const Default_FileOptions_JavaGenericServices bool = false -const Default_FileOptions_PyGenericServices bool = false -const Default_FileOptions_PhpGenericServices bool = false -const Default_FileOptions_Deprecated bool = false -const Default_FileOptions_CcEnableArenas bool = false - -func (m *FileOptions) GetJavaPackage() string { - if m != nil && m.JavaPackage != nil { - return *m.JavaPackage - } - return "" -} - -func (m *FileOptions) GetJavaOuterClassname() string { - if m != nil && m.JavaOuterClassname != nil { - return *m.JavaOuterClassname - } - return "" -} - -func (m *FileOptions) GetJavaMultipleFiles() bool { - if m != nil && m.JavaMultipleFiles != nil { - return *m.JavaMultipleFiles - } - return Default_FileOptions_JavaMultipleFiles -} - -// Deprecated: Do not use. -func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool { - if m != nil && m.JavaGenerateEqualsAndHash != nil { - return *m.JavaGenerateEqualsAndHash - } - return false -} - -func (m *FileOptions) GetJavaStringCheckUtf8() bool { - if m != nil && m.JavaStringCheckUtf8 != nil { - return *m.JavaStringCheckUtf8 - } - return Default_FileOptions_JavaStringCheckUtf8 -} - -func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode { - if m != nil && m.OptimizeFor != nil { - return *m.OptimizeFor - } - return Default_FileOptions_OptimizeFor -} - -func (m *FileOptions) GetGoPackage() string { - if m != nil && m.GoPackage != nil { - return *m.GoPackage - } - return "" -} - -func (m *FileOptions) GetCcGenericServices() bool { - if m != nil && m.CcGenericServices != nil { - return *m.CcGenericServices - } - return Default_FileOptions_CcGenericServices -} - -func (m *FileOptions) GetJavaGenericServices() bool { - if m != nil && m.JavaGenericServices != nil { - return *m.JavaGenericServices - } - return Default_FileOptions_JavaGenericServices -} - -func (m *FileOptions) GetPyGenericServices() bool { - if m != nil && m.PyGenericServices != nil { - return *m.PyGenericServices - } - return Default_FileOptions_PyGenericServices -} - -func (m *FileOptions) GetPhpGenericServices() bool { - if m != nil && m.PhpGenericServices != nil { - return *m.PhpGenericServices - } - return Default_FileOptions_PhpGenericServices -} - -func (m *FileOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_FileOptions_Deprecated -} - -func (m *FileOptions) GetCcEnableArenas() bool { - if m != nil && m.CcEnableArenas != nil { - return *m.CcEnableArenas - } - return Default_FileOptions_CcEnableArenas -} - -func (m *FileOptions) GetObjcClassPrefix() string { - if m != nil && m.ObjcClassPrefix != nil { - return *m.ObjcClassPrefix - } - return "" -} - -func (m *FileOptions) GetCsharpNamespace() string { - if m != nil && m.CsharpNamespace != nil { - return *m.CsharpNamespace - } - return "" -} - -func (m *FileOptions) GetSwiftPrefix() string { - if m != nil && m.SwiftPrefix != nil { - return *m.SwiftPrefix - } - return "" -} - -func (m *FileOptions) GetPhpClassPrefix() string { - if m != nil && m.PhpClassPrefix != nil { - return *m.PhpClassPrefix - } - return "" -} - -func (m *FileOptions) GetPhpNamespace() string { - if m != nil && m.PhpNamespace != nil { - return *m.PhpNamespace - } - return "" -} - -func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type MessageOptions struct { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"` - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"` - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementions still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageOptions) Reset() { *m = MessageOptions{} } -func (m *MessageOptions) String() string { return proto.CompactTextString(m) } -func (*MessageOptions) ProtoMessage() {} -func (*MessageOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{11} -} - -var extRange_MessageOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MessageOptions -} -func (m *MessageOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageOptions.Unmarshal(m, b) -} -func (m *MessageOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageOptions.Marshal(b, m, deterministic) -} -func (dst *MessageOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageOptions.Merge(dst, src) -} -func (m *MessageOptions) XXX_Size() int { - return xxx_messageInfo_MessageOptions.Size(m) -} -func (m *MessageOptions) XXX_DiscardUnknown() { - xxx_messageInfo_MessageOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageOptions proto.InternalMessageInfo - -const Default_MessageOptions_MessageSetWireFormat bool = false -const Default_MessageOptions_NoStandardDescriptorAccessor bool = false -const Default_MessageOptions_Deprecated bool = false - -func (m *MessageOptions) GetMessageSetWireFormat() bool { - if m != nil && m.MessageSetWireFormat != nil { - return *m.MessageSetWireFormat - } - return Default_MessageOptions_MessageSetWireFormat -} - -func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool { - if m != nil && m.NoStandardDescriptorAccessor != nil { - return *m.NoStandardDescriptorAccessor - } - return Default_MessageOptions_NoStandardDescriptorAccessor -} - -func (m *MessageOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_MessageOptions_Deprecated -} - -func (m *MessageOptions) GetMapEntry() bool { - if m != nil && m.MapEntry != nil { - return *m.MapEntry - } - return false -} - -func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type FieldOptions struct { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"` - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"` - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"` - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // For Google-internal migration only. Do not use. - Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldOptions) Reset() { *m = FieldOptions{} } -func (m *FieldOptions) String() string { return proto.CompactTextString(m) } -func (*FieldOptions) ProtoMessage() {} -func (*FieldOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{12} -} - -var extRange_FieldOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_FieldOptions -} -func (m *FieldOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldOptions.Unmarshal(m, b) -} -func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic) -} -func (dst *FieldOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldOptions.Merge(dst, src) -} -func (m *FieldOptions) XXX_Size() int { - return xxx_messageInfo_FieldOptions.Size(m) -} -func (m *FieldOptions) XXX_DiscardUnknown() { - xxx_messageInfo_FieldOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldOptions proto.InternalMessageInfo - -const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING -const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL -const Default_FieldOptions_Lazy bool = false -const Default_FieldOptions_Deprecated bool = false -const Default_FieldOptions_Weak bool = false - -func (m *FieldOptions) GetCtype() FieldOptions_CType { - if m != nil && m.Ctype != nil { - return *m.Ctype - } - return Default_FieldOptions_Ctype -} - -func (m *FieldOptions) GetPacked() bool { - if m != nil && m.Packed != nil { - return *m.Packed - } - return false -} - -func (m *FieldOptions) GetJstype() FieldOptions_JSType { - if m != nil && m.Jstype != nil { - return *m.Jstype - } - return Default_FieldOptions_Jstype -} - -func (m *FieldOptions) GetLazy() bool { - if m != nil && m.Lazy != nil { - return *m.Lazy - } - return Default_FieldOptions_Lazy -} - -func (m *FieldOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_FieldOptions_Deprecated -} - -func (m *FieldOptions) GetWeak() bool { - if m != nil && m.Weak != nil { - return *m.Weak - } - return Default_FieldOptions_Weak -} - -func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type OneofOptions struct { - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OneofOptions) Reset() { *m = OneofOptions{} } -func (m *OneofOptions) String() string { return proto.CompactTextString(m) } -func (*OneofOptions) ProtoMessage() {} -func (*OneofOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{13} -} - -var extRange_OneofOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_OneofOptions -} -func (m *OneofOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OneofOptions.Unmarshal(m, b) -} -func (m *OneofOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OneofOptions.Marshal(b, m, deterministic) -} -func (dst *OneofOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_OneofOptions.Merge(dst, src) -} -func (m *OneofOptions) XXX_Size() int { - return xxx_messageInfo_OneofOptions.Size(m) -} -func (m *OneofOptions) XXX_DiscardUnknown() { - xxx_messageInfo_OneofOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_OneofOptions proto.InternalMessageInfo - -func (m *OneofOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type EnumOptions struct { - // Set this option to true to allow mapping different tag names to the same - // value. - AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"` - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumOptions) Reset() { *m = EnumOptions{} } -func (m *EnumOptions) String() string { return proto.CompactTextString(m) } -func (*EnumOptions) ProtoMessage() {} -func (*EnumOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{14} -} - -var extRange_EnumOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_EnumOptions -} -func (m *EnumOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumOptions.Unmarshal(m, b) -} -func (m *EnumOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumOptions.Marshal(b, m, deterministic) -} -func (dst *EnumOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumOptions.Merge(dst, src) -} -func (m *EnumOptions) XXX_Size() int { - return xxx_messageInfo_EnumOptions.Size(m) -} -func (m *EnumOptions) XXX_DiscardUnknown() { - xxx_messageInfo_EnumOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumOptions proto.InternalMessageInfo - -const Default_EnumOptions_Deprecated bool = false - -func (m *EnumOptions) GetAllowAlias() bool { - if m != nil && m.AllowAlias != nil { - return *m.AllowAlias - } - return false -} - -func (m *EnumOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_EnumOptions_Deprecated -} - -func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type EnumValueOptions struct { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} } -func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) } -func (*EnumValueOptions) ProtoMessage() {} -func (*EnumValueOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{15} -} - -var extRange_EnumValueOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_EnumValueOptions -} -func (m *EnumValueOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnumValueOptions.Unmarshal(m, b) -} -func (m *EnumValueOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnumValueOptions.Marshal(b, m, deterministic) -} -func (dst *EnumValueOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnumValueOptions.Merge(dst, src) -} -func (m *EnumValueOptions) XXX_Size() int { - return xxx_messageInfo_EnumValueOptions.Size(m) -} -func (m *EnumValueOptions) XXX_DiscardUnknown() { - xxx_messageInfo_EnumValueOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_EnumValueOptions proto.InternalMessageInfo - -const Default_EnumValueOptions_Deprecated bool = false - -func (m *EnumValueOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_EnumValueOptions_Deprecated -} - -func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type ServiceOptions struct { - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServiceOptions) Reset() { *m = ServiceOptions{} } -func (m *ServiceOptions) String() string { return proto.CompactTextString(m) } -func (*ServiceOptions) ProtoMessage() {} -func (*ServiceOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{16} -} - -var extRange_ServiceOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_ServiceOptions -} -func (m *ServiceOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServiceOptions.Unmarshal(m, b) -} -func (m *ServiceOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServiceOptions.Marshal(b, m, deterministic) -} -func (dst *ServiceOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceOptions.Merge(dst, src) -} -func (m *ServiceOptions) XXX_Size() int { - return xxx_messageInfo_ServiceOptions.Size(m) -} -func (m *ServiceOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceOptions proto.InternalMessageInfo - -const Default_ServiceOptions_Deprecated bool = false - -func (m *ServiceOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_ServiceOptions_Deprecated -} - -func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type MethodOptions struct { - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MethodOptions) Reset() { *m = MethodOptions{} } -func (m *MethodOptions) String() string { return proto.CompactTextString(m) } -func (*MethodOptions) ProtoMessage() {} -func (*MethodOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{17} -} - -var extRange_MethodOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MethodOptions -} -func (m *MethodOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MethodOptions.Unmarshal(m, b) -} -func (m *MethodOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MethodOptions.Marshal(b, m, deterministic) -} -func (dst *MethodOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MethodOptions.Merge(dst, src) -} -func (m *MethodOptions) XXX_Size() int { - return xxx_messageInfo_MethodOptions.Size(m) -} -func (m *MethodOptions) XXX_DiscardUnknown() { - xxx_messageInfo_MethodOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_MethodOptions proto.InternalMessageInfo - -const Default_MethodOptions_Deprecated bool = false -const Default_MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel = MethodOptions_IDEMPOTENCY_UNKNOWN - -func (m *MethodOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_MethodOptions_Deprecated -} - -func (m *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel { - if m != nil && m.IdempotencyLevel != nil { - return *m.IdempotencyLevel - } - return Default_MethodOptions_IdempotencyLevel -} - -func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -type UninterpretedOption struct { - Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"` - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"` - PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"` - NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"` - DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` - StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` - AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} } -func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) } -func (*UninterpretedOption) ProtoMessage() {} -func (*UninterpretedOption) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{18} -} -func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b) -} -func (m *UninterpretedOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UninterpretedOption.Marshal(b, m, deterministic) -} -func (dst *UninterpretedOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_UninterpretedOption.Merge(dst, src) -} -func (m *UninterpretedOption) XXX_Size() int { - return xxx_messageInfo_UninterpretedOption.Size(m) -} -func (m *UninterpretedOption) XXX_DiscardUnknown() { - xxx_messageInfo_UninterpretedOption.DiscardUnknown(m) -} - -var xxx_messageInfo_UninterpretedOption proto.InternalMessageInfo - -func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart { - if m != nil { - return m.Name - } - return nil -} - -func (m *UninterpretedOption) GetIdentifierValue() string { - if m != nil && m.IdentifierValue != nil { - return *m.IdentifierValue - } - return "" -} - -func (m *UninterpretedOption) GetPositiveIntValue() uint64 { - if m != nil && m.PositiveIntValue != nil { - return *m.PositiveIntValue - } - return 0 -} - -func (m *UninterpretedOption) GetNegativeIntValue() int64 { - if m != nil && m.NegativeIntValue != nil { - return *m.NegativeIntValue - } - return 0 -} - -func (m *UninterpretedOption) GetDoubleValue() float64 { - if m != nil && m.DoubleValue != nil { - return *m.DoubleValue - } - return 0 -} - -func (m *UninterpretedOption) GetStringValue() []byte { - if m != nil { - return m.StringValue - } - return nil -} - -func (m *UninterpretedOption) GetAggregateValue() string { - if m != nil && m.AggregateValue != nil { - return *m.AggregateValue - } - return "" -} - -// The name of the uninterpreted option. Each string represents a segment in -// a dot-separated name. is_extension is true iff a segment represents an -// extension (denoted with parentheses in options specs in .proto files). -// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents -// "foo.(bar.baz).qux". -type UninterpretedOption_NamePart struct { - NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"` - IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} } -func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) } -func (*UninterpretedOption_NamePart) ProtoMessage() {} -func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{18, 0} -} -func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b) -} -func (m *UninterpretedOption_NamePart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UninterpretedOption_NamePart.Marshal(b, m, deterministic) -} -func (dst *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) { - xxx_messageInfo_UninterpretedOption_NamePart.Merge(dst, src) -} -func (m *UninterpretedOption_NamePart) XXX_Size() int { - return xxx_messageInfo_UninterpretedOption_NamePart.Size(m) -} -func (m *UninterpretedOption_NamePart) XXX_DiscardUnknown() { - xxx_messageInfo_UninterpretedOption_NamePart.DiscardUnknown(m) -} - -var xxx_messageInfo_UninterpretedOption_NamePart proto.InternalMessageInfo - -func (m *UninterpretedOption_NamePart) GetNamePart() string { - if m != nil && m.NamePart != nil { - return *m.NamePart - } - return "" -} - -func (m *UninterpretedOption_NamePart) GetIsExtension() bool { - if m != nil && m.IsExtension != nil { - return *m.IsExtension - } - return false -} - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -type SourceCodeInfo struct { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} } -func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) } -func (*SourceCodeInfo) ProtoMessage() {} -func (*SourceCodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{19} -} -func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b) -} -func (m *SourceCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SourceCodeInfo.Marshal(b, m, deterministic) -} -func (dst *SourceCodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceCodeInfo.Merge(dst, src) -} -func (m *SourceCodeInfo) XXX_Size() int { - return xxx_messageInfo_SourceCodeInfo.Size(m) -} -func (m *SourceCodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_SourceCodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_SourceCodeInfo proto.InternalMessageInfo - -func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { - if m != nil { - return m.Location - } - return nil -} - -type SourceCodeInfo_Location struct { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"` - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"` - TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"` - LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} } -func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) } -func (*SourceCodeInfo_Location) ProtoMessage() {} -func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{19, 0} -} -func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b) -} -func (m *SourceCodeInfo_Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SourceCodeInfo_Location.Marshal(b, m, deterministic) -} -func (dst *SourceCodeInfo_Location) XXX_Merge(src proto.Message) { - xxx_messageInfo_SourceCodeInfo_Location.Merge(dst, src) -} -func (m *SourceCodeInfo_Location) XXX_Size() int { - return xxx_messageInfo_SourceCodeInfo_Location.Size(m) -} -func (m *SourceCodeInfo_Location) XXX_DiscardUnknown() { - xxx_messageInfo_SourceCodeInfo_Location.DiscardUnknown(m) -} - -var xxx_messageInfo_SourceCodeInfo_Location proto.InternalMessageInfo - -func (m *SourceCodeInfo_Location) GetPath() []int32 { - if m != nil { - return m.Path - } - return nil -} - -func (m *SourceCodeInfo_Location) GetSpan() []int32 { - if m != nil { - return m.Span - } - return nil -} - -func (m *SourceCodeInfo_Location) GetLeadingComments() string { - if m != nil && m.LeadingComments != nil { - return *m.LeadingComments - } - return "" -} - -func (m *SourceCodeInfo_Location) GetTrailingComments() string { - if m != nil && m.TrailingComments != nil { - return *m.TrailingComments - } - return "" -} - -func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string { - if m != nil { - return m.LeadingDetachedComments - } - return nil -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -type GeneratedCodeInfo struct { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} } -func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) } -func (*GeneratedCodeInfo) ProtoMessage() {} -func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{20} -} -func (m *GeneratedCodeInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GeneratedCodeInfo.Unmarshal(m, b) -} -func (m *GeneratedCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GeneratedCodeInfo.Marshal(b, m, deterministic) -} -func (dst *GeneratedCodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneratedCodeInfo.Merge(dst, src) -} -func (m *GeneratedCodeInfo) XXX_Size() int { - return xxx_messageInfo_GeneratedCodeInfo.Size(m) -} -func (m *GeneratedCodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_GeneratedCodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_GeneratedCodeInfo proto.InternalMessageInfo - -func (m *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation { - if m != nil { - return m.Annotation - } - return nil -} - -type GeneratedCodeInfo_Annotation struct { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` - // Identifies the filesystem path to the original source .proto. - SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"` - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"` - // Identifies the ending offset in bytes in the generated code that - // relates to the identified offset. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_Annotation{} } -func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) } -func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} -func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_4df4cb5f42392df6, []int{20, 0} -} -func (m *GeneratedCodeInfo_Annotation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GeneratedCodeInfo_Annotation.Unmarshal(m, b) -} -func (m *GeneratedCodeInfo_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GeneratedCodeInfo_Annotation.Marshal(b, m, deterministic) -} -func (dst *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(dst, src) -} -func (m *GeneratedCodeInfo_Annotation) XXX_Size() int { - return xxx_messageInfo_GeneratedCodeInfo_Annotation.Size(m) -} -func (m *GeneratedCodeInfo_Annotation) XXX_DiscardUnknown() { - xxx_messageInfo_GeneratedCodeInfo_Annotation.DiscardUnknown(m) -} - -var xxx_messageInfo_GeneratedCodeInfo_Annotation proto.InternalMessageInfo - -func (m *GeneratedCodeInfo_Annotation) GetPath() []int32 { - if m != nil { - return m.Path - } - return nil -} - -func (m *GeneratedCodeInfo_Annotation) GetSourceFile() string { - if m != nil && m.SourceFile != nil { - return *m.SourceFile - } - return "" -} - -func (m *GeneratedCodeInfo_Annotation) GetBegin() int32 { - if m != nil && m.Begin != nil { - return *m.Begin - } - return 0 -} - -func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -func init() { - proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet") - proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto") - proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto") - proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange") - proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange") - proto.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions") - proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto") - proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto") - proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto") - proto.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange") - proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto") - proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto") - proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto") - proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions") - proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions") - proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions") - proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions") - proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions") - proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions") - proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions") - proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions") - proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption") - proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart") - proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo") - proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location") - proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo") - proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation") - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) - proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) - proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) - proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value) - proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value) -} - -func init() { - proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_descriptor_4df4cb5f42392df6) -} - -var fileDescriptor_descriptor_4df4cb5f42392df6 = []byte{ - // 2555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xdd, 0x6e, 0x1b, 0xc7, - 0xf5, 0xcf, 0xf2, 0x4b, 0xe4, 0x21, 0x45, 0x8d, 0x46, 0x8a, 0xbd, 0x56, 0x3e, 0x2c, 0x33, 0x1f, - 0x96, 0x9d, 0x7f, 0xa8, 0xc0, 0xb1, 0x1d, 0x47, 0xfe, 0x23, 0x2d, 0x45, 0xae, 0x15, 0xaa, 0x12, - 0xc9, 0x2e, 0xa9, 0xe6, 0x03, 0x28, 0x16, 0xa3, 0xdd, 0x21, 0xb9, 0xf6, 0x72, 0x77, 0xb3, 0xbb, - 0xb4, 0xad, 0xa0, 0x17, 0x06, 0x7a, 0xd5, 0xab, 0xde, 0x16, 0x45, 0xd1, 0x8b, 0xde, 0x04, 0xe8, - 0x03, 0x14, 0xc8, 0x5d, 0x9f, 0xa0, 0x40, 0xde, 0xa0, 0x68, 0x0b, 0xb4, 0x8f, 0xd0, 0xcb, 0x62, - 0x66, 0x76, 0x97, 0xbb, 0x24, 0x15, 0x2b, 0x01, 0xe2, 0x5c, 0x91, 0xf3, 0x9b, 0xdf, 0x39, 0x73, - 0xe6, 0xcc, 0x99, 0x33, 0x67, 0x66, 0x61, 0x7b, 0xe4, 0x38, 0x23, 0x8b, 0xee, 0xba, 0x9e, 0x13, - 0x38, 0xa7, 0xd3, 0xe1, 0xae, 0x41, 0x7d, 0xdd, 0x33, 0xdd, 0xc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0x82, 0x9c, - 0x4b, 0x82, 0x31, 0x57, 0x97, 0xdf, 0xcf, 0x20, 0x49, 0xe5, 0x6d, 0x86, 0xfb, 0x2e, 0xb1, 0x79, - 0x08, 0x84, 0x38, 0x6b, 0xb3, 0x75, 0xb5, 0x28, 0x31, 0xf8, 0xe5, 0xc4, 0x99, 0x4c, 0xa8, 0x1d, - 0xf8, 0xd1, 0xba, 0x86, 0x78, 0x33, 0x84, 0xf1, 0x3b, 0xb0, 0x1e, 0x78, 0xc4, 0xb4, 0x52, 0xdc, - 0x1c, 0xe7, 0xa2, 0xa8, 0x23, 0x26, 0xef, 0xc1, 0x95, 0x48, 0xaf, 0x41, 0x03, 0xa2, 0x8f, 0xa9, - 0x31, 0x13, 0x2a, 0xf0, 0x47, 0x88, 0xcb, 0x21, 0xa1, 0x15, 0xf6, 0x47, 0xb2, 0xb5, 0x6f, 0x24, - 0x58, 0x8f, 0xae, 0x53, 0x46, 0xec, 0xac, 0x63, 0x00, 0x62, 0xdb, 0x4e, 0x90, 0x74, 0xd7, 0x62, - 0x28, 0x2f, 0xc8, 0xd5, 0x1b, 0xb1, 0x90, 0x9a, 0x50, 0xb0, 0x35, 0x01, 0x98, 0xf5, 0x9c, 0xeb, - 0xb6, 0xab, 0x50, 0x0e, 0x3f, 0xf0, 0xf0, 0xaf, 0x84, 0xe2, 0x02, 0x0e, 0x02, 0x62, 0xf7, 0x2e, - 0xbc, 0x09, 0xf9, 0x53, 0x3a, 0x32, 0xed, 0xf0, 0xd9, 0x56, 0x34, 0xa2, 0x67, 0x92, 0x5c, 0xfc, - 0x4c, 0xb2, 0xff, 0x5b, 0x09, 0x36, 0x74, 0x67, 0x32, 0x6f, 0xef, 0x3e, 0x9a, 0x7b, 0x05, 0xf0, - 0x3f, 0x96, 0x3e, 0xff, 0x68, 0x64, 0x06, 0xe3, 0xe9, 0x69, 0x5d, 0x77, 0x26, 0xbb, 0x23, 0xc7, - 0x22, 0xf6, 0x68, 0xf6, 0x99, 0x93, 0xff, 0xd1, 0xdf, 0x1d, 0x51, 0xfb, 0xdd, 0x91, 0x93, 0xf8, - 0xe8, 0x79, 0x7f, 0xf6, 0xf7, 0xbf, 0x92, 0xf4, 0xa7, 0x4c, 0xf6, 0xa0, 0xb7, 0xff, 0xe7, 0xcc, - 0xd6, 0x81, 0x18, 0xae, 0x17, 0xb9, 0x47, 0xa5, 0x43, 0x8b, 0xea, 0x6c, 0xca, 0xff, 0x0b, 0x00, - 0x00, 0xff, 0xff, 0x1a, 0x28, 0x25, 0x79, 0x42, 0x1d, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto deleted file mode 100644 index 8697a50..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto +++ /dev/null @@ -1,872 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - -syntax = "proto2"; - -package google.protobuf; -option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; -option csharp_namespace = "Google.Protobuf.Reflection"; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; - - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - optional string syntax = 12; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; - optional int32 end = 2; - - optional ExtensionRangeOptions options = 3; - } - repeated ExtensionRange extension_range = 5; - - repeated OneofDescriptorProto oneof_decl = 8; - - optional MessageOptions options = 7; - - // Range of reserved tag numbers. Reserved tag numbers may not be used by - // fields or extension ranges in the same message. Reserved ranges may - // not overlap. - message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - } - repeated ReservedRange reserved_range = 9; - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - repeated string reserved_name = 10; -} - -message ExtensionRangeOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - }; - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - optional int32 oneof_index = 9; - - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - optional string json_name = 10; - - optional FieldOptions options = 8; -} - -// Describes a oneof. -message OneofDescriptorProto { - optional string name = 1; - optional OneofOptions options = 2; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; - - // Range of reserved numeric values. Reserved values may not be used by - // entries in the same enum. Reserved ranges may not overlap. - // - // Note that this is distinct from DescriptorProto.ReservedRange in that it - // is inclusive such that it can appropriately represent the entire int32 - // domain. - message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. - } - - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - repeated EnumReservedRange reserved_range = 4; - - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - repeated string reserved_name = 5; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; - - // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default=false]; - // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default=false]; -} - - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Objective-C plugin) and your project website (if available) -- there's no -// need to explain how you intend to use them. Usually you only need one -// extension number. You can declare multiple options with only one extension -// number by putting them in a sub-message. See the Custom Options section of -// the docs for examples: -// https://developers.google.com/protocol-buffers/docs/proto#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - optional string java_outer_classname = 8; - - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; - - // This option does nothing. - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default=false]; - - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default=SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - optional string go_package = 11; - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; - optional bool php_generic_services = 42 [default=false]; - - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default=false]; - - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default=false]; - - - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - optional string objc_class_prefix = 36; - - // Namespace for generated classes; defaults to the package. - optional string csharp_namespace = 37; - - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - optional string swift_prefix = 39; - - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - optional string php_class_prefix = 40; - - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - optional string php_namespace = 41; - - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. - // See the documentation for the "Options" section above. - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; - - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default=false]; - - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementions still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - optional bool map_entry = 7; - - reserved 8; // javalite_serializable - reserved 9; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - optional bool packed = 2; - - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - optional JSType jstype = 6 [default = JS_NORMAL]; - enum JSType { - // Use the default type. - JS_NORMAL = 0; - - // Use JavaScript strings. - JS_STRING = 1; - - // Use JavaScript numbers. - JS_NUMBER = 2; - } - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - optional bool lazy = 5 [default=false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default=false]; - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; - - reserved 4; // removed jtype -} - -message OneofOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to true to allow mapping different tag names to the same - // value. - optional bool allow_alias = 2; - - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - optional bool deprecated = 3 [default=false]; - - reserved 5; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - optional bool deprecated = 33 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default=false]; - - // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - // or neither? HTTP based RPC implementation may choose GET verb for safe - // methods, and PUT verb for idempotent methods instead of the default POST. - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects - } - optional IdempotencyLevel idempotency_level = - 34 [default=IDEMPOTENCY_UNKNOWN]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -message GeneratedCodeInfo { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - repeated Annotation annotation = 1; - message Annotation { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed=true]; - - // Identifies the filesystem path to the original source .proto. - optional string source_file = 2; - - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - optional int32 begin = 3; - - // Identifies the ending offset in bytes in the generated code that - // relates to the identified offset. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - optional int32 end = 4; - } -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.pb.go deleted file mode 100644 index 6ebae9d..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.pb.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// deprecated/deprecated.proto is a deprecated file. - -package deprecated // import "github.com/golang/protobuf/protoc-gen-go/testdata/deprecated" - -/* -package deprecated contains only deprecated messages and services. -*/ - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// DeprecatedEnum contains deprecated values. -type DeprecatedEnum int32 // Deprecated: Do not use. -const ( - // DEPRECATED is the iota value of this enum. - DeprecatedEnum_DEPRECATED DeprecatedEnum = 0 // Deprecated: Do not use. -) - -var DeprecatedEnum_name = map[int32]string{ - 0: "DEPRECATED", -} -var DeprecatedEnum_value = map[string]int32{ - "DEPRECATED": 0, -} - -func (x DeprecatedEnum) String() string { - return proto.EnumName(DeprecatedEnum_name, int32(x)) -} -func (DeprecatedEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_deprecated_9e1889ba21817fad, []int{0} -} - -// DeprecatedRequest is a request to DeprecatedCall. -// -// Deprecated: Do not use. -type DeprecatedRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeprecatedRequest) Reset() { *m = DeprecatedRequest{} } -func (m *DeprecatedRequest) String() string { return proto.CompactTextString(m) } -func (*DeprecatedRequest) ProtoMessage() {} -func (*DeprecatedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_deprecated_9e1889ba21817fad, []int{0} -} -func (m *DeprecatedRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeprecatedRequest.Unmarshal(m, b) -} -func (m *DeprecatedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeprecatedRequest.Marshal(b, m, deterministic) -} -func (dst *DeprecatedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeprecatedRequest.Merge(dst, src) -} -func (m *DeprecatedRequest) XXX_Size() int { - return xxx_messageInfo_DeprecatedRequest.Size(m) -} -func (m *DeprecatedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeprecatedRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeprecatedRequest proto.InternalMessageInfo - -// Deprecated: Do not use. -type DeprecatedResponse struct { - // DeprecatedField contains a DeprecatedEnum. - DeprecatedField DeprecatedEnum `protobuf:"varint,1,opt,name=deprecated_field,json=deprecatedField,enum=deprecated.DeprecatedEnum" json:"deprecated_field,omitempty"` // Deprecated: Do not use. - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeprecatedResponse) Reset() { *m = DeprecatedResponse{} } -func (m *DeprecatedResponse) String() string { return proto.CompactTextString(m) } -func (*DeprecatedResponse) ProtoMessage() {} -func (*DeprecatedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_deprecated_9e1889ba21817fad, []int{1} -} -func (m *DeprecatedResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeprecatedResponse.Unmarshal(m, b) -} -func (m *DeprecatedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeprecatedResponse.Marshal(b, m, deterministic) -} -func (dst *DeprecatedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeprecatedResponse.Merge(dst, src) -} -func (m *DeprecatedResponse) XXX_Size() int { - return xxx_messageInfo_DeprecatedResponse.Size(m) -} -func (m *DeprecatedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeprecatedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeprecatedResponse proto.InternalMessageInfo - -// Deprecated: Do not use. -func (m *DeprecatedResponse) GetDeprecatedField() DeprecatedEnum { - if m != nil { - return m.DeprecatedField - } - return DeprecatedEnum_DEPRECATED -} - -func init() { - proto.RegisterType((*DeprecatedRequest)(nil), "deprecated.DeprecatedRequest") - proto.RegisterType((*DeprecatedResponse)(nil), "deprecated.DeprecatedResponse") - proto.RegisterEnum("deprecated.DeprecatedEnum", DeprecatedEnum_name, DeprecatedEnum_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for DeprecatedService service - -// Deprecated: Do not use. -type DeprecatedServiceClient interface { - // DeprecatedCall takes a DeprecatedRequest and returns a DeprecatedResponse. - DeprecatedCall(ctx context.Context, in *DeprecatedRequest, opts ...grpc.CallOption) (*DeprecatedResponse, error) -} - -type deprecatedServiceClient struct { - cc *grpc.ClientConn -} - -// Deprecated: Do not use. -func NewDeprecatedServiceClient(cc *grpc.ClientConn) DeprecatedServiceClient { - return &deprecatedServiceClient{cc} -} - -// Deprecated: Do not use. -func (c *deprecatedServiceClient) DeprecatedCall(ctx context.Context, in *DeprecatedRequest, opts ...grpc.CallOption) (*DeprecatedResponse, error) { - out := new(DeprecatedResponse) - err := grpc.Invoke(ctx, "/deprecated.DeprecatedService/DeprecatedCall", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for DeprecatedService service - -// Deprecated: Do not use. -type DeprecatedServiceServer interface { - // DeprecatedCall takes a DeprecatedRequest and returns a DeprecatedResponse. - DeprecatedCall(context.Context, *DeprecatedRequest) (*DeprecatedResponse, error) -} - -// Deprecated: Do not use. -func RegisterDeprecatedServiceServer(s *grpc.Server, srv DeprecatedServiceServer) { - s.RegisterService(&_DeprecatedService_serviceDesc, srv) -} - -func _DeprecatedService_DeprecatedCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeprecatedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DeprecatedServiceServer).DeprecatedCall(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/deprecated.DeprecatedService/DeprecatedCall", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DeprecatedServiceServer).DeprecatedCall(ctx, req.(*DeprecatedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _DeprecatedService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "deprecated.DeprecatedService", - HandlerType: (*DeprecatedServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "DeprecatedCall", - Handler: _DeprecatedService_DeprecatedCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "deprecated/deprecated.proto", -} - -func init() { - proto.RegisterFile("deprecated/deprecated.proto", fileDescriptor_deprecated_9e1889ba21817fad) -} - -var fileDescriptor_deprecated_9e1889ba21817fad = []byte{ - // 248 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x49, 0x2d, 0x28, - 0x4a, 0x4d, 0x4e, 0x2c, 0x49, 0x4d, 0xd1, 0x47, 0x30, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, - 0xb8, 0x10, 0x22, 0x4a, 0xe2, 0x5c, 0x82, 0x2e, 0x70, 0x5e, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, - 0x89, 0x15, 0x93, 0x04, 0xa3, 0x52, 0x32, 0x97, 0x10, 0xb2, 0x44, 0x71, 0x41, 0x7e, 0x5e, 0x71, - 0xaa, 0x90, 0x27, 0x97, 0x00, 0x42, 0x73, 0x7c, 0x5a, 0x66, 0x6a, 0x4e, 0x8a, 0x04, 0xa3, 0x02, - 0xa3, 0x06, 0x9f, 0x91, 0x94, 0x1e, 0x92, 0x3d, 0x08, 0x9d, 0xae, 0x79, 0xa5, 0xb9, 0x4e, 0x4c, - 0x12, 0x8c, 0x41, 0xfc, 0x08, 0x69, 0x37, 0x90, 0x36, 0x90, 0x25, 0x5a, 0x1a, 0x5c, 0x7c, 0xa8, - 0x4a, 0x85, 0x84, 0xb8, 0xb8, 0x5c, 0x5c, 0x03, 0x82, 0x5c, 0x9d, 0x1d, 0x43, 0x5c, 0x5d, 0x04, - 0x18, 0xa4, 0x98, 0x38, 0x18, 0xa5, 0x98, 0x24, 0x18, 0x8d, 0xf2, 0x90, 0xdd, 0x19, 0x9c, 0x5a, - 0x54, 0x96, 0x99, 0x9c, 0x2a, 0x14, 0x82, 0xac, 0xdd, 0x39, 0x31, 0x27, 0x47, 0x48, 0x16, 0xbb, - 0x2b, 0xa0, 0x1e, 0x93, 0x92, 0xc3, 0x25, 0x0d, 0xf1, 0x9e, 0x12, 0x73, 0x07, 0x13, 0xa3, 0x14, - 0x88, 0x70, 0x72, 0x8c, 0xb2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, - 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x07, 0x07, 0x5f, 0x52, 0x69, 0x1a, 0x84, 0x91, 0xac, - 0x9b, 0x9e, 0x9a, 0xa7, 0x9b, 0x9e, 0xaf, 0x5f, 0x92, 0x5a, 0x5c, 0x92, 0x92, 0x58, 0x92, 0x88, - 0x14, 0xd2, 0x3b, 0x18, 0x19, 0x93, 0xd8, 0xc0, 0xaa, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x0e, 0xf5, 0x6c, 0x87, 0x8c, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.proto deleted file mode 100644 index b314166..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/deprecated/deprecated.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -// package deprecated contains only deprecated messages and services. -package deprecated; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/deprecated"; - -option deprecated = true; // file-level deprecation - -// DeprecatedRequest is a request to DeprecatedCall. -message DeprecatedRequest { - option deprecated = true; -} - -message DeprecatedResponse { - // comment for DeprecatedResponse is omitted to guarantee deprecation - // message doesn't append unnecessary comments. - option deprecated = true; - // DeprecatedField contains a DeprecatedEnum. - DeprecatedEnum deprecated_field = 1 [deprecated=true]; -} - -// DeprecatedEnum contains deprecated values. -enum DeprecatedEnum { - option deprecated = true; - // DEPRECATED is the iota value of this enum. - DEPRECATED = 0 [deprecated=true]; -} - -// DeprecatedService is for making DeprecatedCalls -service DeprecatedService { - option deprecated = true; - - // DeprecatedCall takes a DeprecatedRequest and returns a DeprecatedResponse. - rpc DeprecatedCall(DeprecatedRequest) returns (DeprecatedResponse) { - option deprecated = true; - } -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.pb.go deleted file mode 100644 index a08e8ed..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.pb.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: extension_base/extension_base.proto - -package extension_base // import "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type BaseMessage struct { - Height *int32 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BaseMessage) Reset() { *m = BaseMessage{} } -func (m *BaseMessage) String() string { return proto.CompactTextString(m) } -func (*BaseMessage) ProtoMessage() {} -func (*BaseMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_base_41d3c712c9fc37fc, []int{0} -} - -var extRange_BaseMessage = []proto.ExtensionRange{ - {Start: 4, End: 9}, - {Start: 16, End: 536870911}, -} - -func (*BaseMessage) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_BaseMessage -} -func (m *BaseMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BaseMessage.Unmarshal(m, b) -} -func (m *BaseMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BaseMessage.Marshal(b, m, deterministic) -} -func (dst *BaseMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseMessage.Merge(dst, src) -} -func (m *BaseMessage) XXX_Size() int { - return xxx_messageInfo_BaseMessage.Size(m) -} -func (m *BaseMessage) XXX_DiscardUnknown() { - xxx_messageInfo_BaseMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_BaseMessage proto.InternalMessageInfo - -func (m *BaseMessage) GetHeight() int32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -// Another message that may be extended, using message_set_wire_format. -type OldStyleMessage struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `protobuf_messageset:"1" json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OldStyleMessage) Reset() { *m = OldStyleMessage{} } -func (m *OldStyleMessage) String() string { return proto.CompactTextString(m) } -func (*OldStyleMessage) ProtoMessage() {} -func (*OldStyleMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_base_41d3c712c9fc37fc, []int{1} -} - -func (m *OldStyleMessage) MarshalJSON() ([]byte, error) { - return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions) -} -func (m *OldStyleMessage) UnmarshalJSON(buf []byte) error { - return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions) -} - -var extRange_OldStyleMessage = []proto.ExtensionRange{ - {Start: 100, End: 2147483646}, -} - -func (*OldStyleMessage) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_OldStyleMessage -} -func (m *OldStyleMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OldStyleMessage.Unmarshal(m, b) -} -func (m *OldStyleMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OldStyleMessage.Marshal(b, m, deterministic) -} -func (dst *OldStyleMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_OldStyleMessage.Merge(dst, src) -} -func (m *OldStyleMessage) XXX_Size() int { - return xxx_messageInfo_OldStyleMessage.Size(m) -} -func (m *OldStyleMessage) XXX_DiscardUnknown() { - xxx_messageInfo_OldStyleMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_OldStyleMessage proto.InternalMessageInfo - -func init() { - proto.RegisterType((*BaseMessage)(nil), "extension_base.BaseMessage") - proto.RegisterType((*OldStyleMessage)(nil), "extension_base.OldStyleMessage") -} - -func init() { - proto.RegisterFile("extension_base/extension_base.proto", fileDescriptor_extension_base_41d3c712c9fc37fc) -} - -var fileDescriptor_extension_base_41d3c712c9fc37fc = []byte{ - // 179 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xad, 0x28, 0x49, - 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0x8b, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x47, 0xe5, 0xea, 0x15, 0x14, - 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0xa1, 0x8a, 0x2a, 0x99, 0x72, 0x71, 0x3b, 0x25, 0x16, 0xa7, 0xfa, - 0xa6, 0x16, 0x17, 0x27, 0xa6, 0xa7, 0x0a, 0x89, 0x71, 0xb1, 0x65, 0xa4, 0x66, 0xa6, 0x67, 0x94, - 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x06, 0x41, 0x79, 0x5a, 0x2c, 0x1c, 0x2c, 0x02, 0x5c, 0x5a, - 0x1c, 0x1c, 0x02, 0x02, 0x0d, 0x0d, 0x0d, 0x0d, 0x4c, 0x4a, 0xf2, 0x5c, 0xfc, 0xfe, 0x39, 0x29, - 0xc1, 0x25, 0x95, 0x39, 0x30, 0xad, 0x5a, 0x1c, 0x1c, 0x29, 0x02, 0xff, 0xff, 0xff, 0xff, 0xcf, - 0x6e, 0xc5, 0xc4, 0xc1, 0xe8, 0xe4, 0x14, 0xe5, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, - 0x9c, 0x9f, 0xab, 0x9f, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x0f, 0x76, 0x42, 0x52, 0x69, 0x1a, - 0x84, 0x91, 0xac, 0x9b, 0x9e, 0x9a, 0xa7, 0x9b, 0x9e, 0xaf, 0x5f, 0x92, 0x5a, 0x5c, 0x92, 0x92, - 0x58, 0x92, 0x88, 0xe6, 0x62, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x7f, 0xb7, 0x2a, 0xd1, - 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.proto deleted file mode 100644 index 0ba74de..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base/extension_base.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -package extension_base; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base"; - -message BaseMessage { - optional int32 height = 1; - extensions 4 to 9; - extensions 16 to max; -} - -// Another message that may be extended, using message_set_wire_format. -message OldStyleMessage { - option message_set_wire_format = true; - extensions 100 to max; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.pb.go deleted file mode 100644 index b373216..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.pb.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: extension_extra/extension_extra.proto - -package extension_extra // import "github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type ExtraMessage struct { - Width *int32 `protobuf:"varint,1,opt,name=width" json:"width,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtraMessage) Reset() { *m = ExtraMessage{} } -func (m *ExtraMessage) String() string { return proto.CompactTextString(m) } -func (*ExtraMessage) ProtoMessage() {} -func (*ExtraMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_extra_83adf2410f49f816, []int{0} -} -func (m *ExtraMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtraMessage.Unmarshal(m, b) -} -func (m *ExtraMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtraMessage.Marshal(b, m, deterministic) -} -func (dst *ExtraMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtraMessage.Merge(dst, src) -} -func (m *ExtraMessage) XXX_Size() int { - return xxx_messageInfo_ExtraMessage.Size(m) -} -func (m *ExtraMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ExtraMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtraMessage proto.InternalMessageInfo - -func (m *ExtraMessage) GetWidth() int32 { - if m != nil && m.Width != nil { - return *m.Width - } - return 0 -} - -func init() { - proto.RegisterType((*ExtraMessage)(nil), "extension_extra.ExtraMessage") -} - -func init() { - proto.RegisterFile("extension_extra/extension_extra.proto", fileDescriptor_extension_extra_83adf2410f49f816) -} - -var fileDescriptor_extension_extra_83adf2410f49f816 = []byte{ - // 133 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xad, 0x28, 0x49, - 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0x8b, 0x4f, 0xad, 0x28, 0x29, 0x4a, 0xd4, 0x47, 0xe3, 0xeb, 0x15, - 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0xa3, 0x09, 0x2b, 0xa9, 0x70, 0xf1, 0xb8, 0x82, 0x18, 0xbe, - 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0x22, 0x5c, 0xac, 0xe5, 0x99, 0x29, 0x25, 0x19, 0x12, - 0x8c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x93, 0x73, 0x94, 0x63, 0x7a, 0x66, 0x49, 0x46, - 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x4e, 0x62, 0x5e, 0xba, 0x3e, 0xd8, 0xc4, - 0xa4, 0xd2, 0x34, 0x08, 0x23, 0x59, 0x37, 0x3d, 0x35, 0x4f, 0x37, 0x3d, 0x5f, 0xbf, 0x24, 0xb5, - 0xb8, 0x24, 0x25, 0xb1, 0x04, 0xc3, 0x05, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xec, 0xe3, - 0xb7, 0xa3, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.proto deleted file mode 100644 index 1dd03e7..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra/extension_extra.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2011 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -package extension_extra; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra"; - -message ExtraMessage { - optional int32 width = 1; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go deleted file mode 100644 index 0524729..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go +++ /dev/null @@ -1,206 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Test that we can use protocol buffers that use extensions. - -package testdata - -import ( - "bytes" - "regexp" - "testing" - - "github.com/golang/protobuf/proto" - base "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base" - user "github.com/golang/protobuf/protoc-gen-go/testdata/extension_user" -) - -func TestSingleFieldExtension(t *testing.T) { - bm := &base.BaseMessage{ - Height: proto.Int32(178), - } - - // Use extension within scope of another type. - vol := proto.Uint32(11) - err := proto.SetExtension(bm, user.E_LoudMessage_Volume, vol) - if err != nil { - t.Fatal("Failed setting extension:", err) - } - buf, err := proto.Marshal(bm) - if err != nil { - t.Fatal("Failed encoding message with extension:", err) - } - bm_new := new(base.BaseMessage) - if err := proto.Unmarshal(buf, bm_new); err != nil { - t.Fatal("Failed decoding message with extension:", err) - } - if !proto.HasExtension(bm_new, user.E_LoudMessage_Volume) { - t.Fatal("Decoded message didn't contain extension.") - } - vol_out, err := proto.GetExtension(bm_new, user.E_LoudMessage_Volume) - if err != nil { - t.Fatal("Failed getting extension:", err) - } - if v := vol_out.(*uint32); *v != *vol { - t.Errorf("vol_out = %v, expected %v", *v, *vol) - } - proto.ClearExtension(bm_new, user.E_LoudMessage_Volume) - if proto.HasExtension(bm_new, user.E_LoudMessage_Volume) { - t.Fatal("Failed clearing extension.") - } -} - -func TestMessageExtension(t *testing.T) { - bm := &base.BaseMessage{ - Height: proto.Int32(179), - } - - // Use extension that is itself a message. - um := &user.UserMessage{ - Name: proto.String("Dave"), - Rank: proto.String("Major"), - } - err := proto.SetExtension(bm, user.E_LoginMessage_UserMessage, um) - if err != nil { - t.Fatal("Failed setting extension:", err) - } - buf, err := proto.Marshal(bm) - if err != nil { - t.Fatal("Failed encoding message with extension:", err) - } - bm_new := new(base.BaseMessage) - if err := proto.Unmarshal(buf, bm_new); err != nil { - t.Fatal("Failed decoding message with extension:", err) - } - if !proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) { - t.Fatal("Decoded message didn't contain extension.") - } - um_out, err := proto.GetExtension(bm_new, user.E_LoginMessage_UserMessage) - if err != nil { - t.Fatal("Failed getting extension:", err) - } - if n := um_out.(*user.UserMessage).Name; *n != *um.Name { - t.Errorf("um_out.Name = %q, expected %q", *n, *um.Name) - } - if r := um_out.(*user.UserMessage).Rank; *r != *um.Rank { - t.Errorf("um_out.Rank = %q, expected %q", *r, *um.Rank) - } - proto.ClearExtension(bm_new, user.E_LoginMessage_UserMessage) - if proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) { - t.Fatal("Failed clearing extension.") - } -} - -func TestTopLevelExtension(t *testing.T) { - bm := &base.BaseMessage{ - Height: proto.Int32(179), - } - - width := proto.Int32(17) - err := proto.SetExtension(bm, user.E_Width, width) - if err != nil { - t.Fatal("Failed setting extension:", err) - } - buf, err := proto.Marshal(bm) - if err != nil { - t.Fatal("Failed encoding message with extension:", err) - } - bm_new := new(base.BaseMessage) - if err := proto.Unmarshal(buf, bm_new); err != nil { - t.Fatal("Failed decoding message with extension:", err) - } - if !proto.HasExtension(bm_new, user.E_Width) { - t.Fatal("Decoded message didn't contain extension.") - } - width_out, err := proto.GetExtension(bm_new, user.E_Width) - if err != nil { - t.Fatal("Failed getting extension:", err) - } - if w := width_out.(*int32); *w != *width { - t.Errorf("width_out = %v, expected %v", *w, *width) - } - proto.ClearExtension(bm_new, user.E_Width) - if proto.HasExtension(bm_new, user.E_Width) { - t.Fatal("Failed clearing extension.") - } -} - -func TestMessageSetWireFormat(t *testing.T) { - osm := new(base.OldStyleMessage) - osp := &user.OldStyleParcel{ - Name: proto.String("Dave"), - Height: proto.Int32(178), - } - - err := proto.SetExtension(osm, user.E_OldStyleParcel_MessageSetExtension, osp) - if err != nil { - t.Fatal("Failed setting extension:", err) - } - - buf, err := proto.Marshal(osm) - if err != nil { - t.Fatal("Failed encoding message:", err) - } - - // Data generated from Python implementation. - expected := []byte{ - 11, 16, 209, 15, 26, 9, 10, 4, 68, 97, 118, 101, 16, 178, 1, 12, - } - - if !bytes.Equal(expected, buf) { - t.Errorf("Encoding mismatch.\nwant %+v\n got %+v", expected, buf) - } - - // Check that it is restored correctly. - osm = new(base.OldStyleMessage) - if err := proto.Unmarshal(buf, osm); err != nil { - t.Fatal("Failed decoding message:", err) - } - osp_out, err := proto.GetExtension(osm, user.E_OldStyleParcel_MessageSetExtension) - if err != nil { - t.Fatal("Failed getting extension:", err) - } - osp = osp_out.(*user.OldStyleParcel) - if *osp.Name != "Dave" || *osp.Height != 178 { - t.Errorf("Retrieved extension from decoded message is not correct: %+v", osp) - } -} - -func main() { - // simpler than rigging up gotest - testing.Main(regexp.MatchString, []testing.InternalTest{ - {"TestSingleFieldExtension", TestSingleFieldExtension}, - {"TestMessageExtension", TestMessageExtension}, - {"TestTopLevelExtension", TestTopLevelExtension}, - }, - []testing.InternalBenchmark{}, - []testing.InternalExample{}) -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.pb.go deleted file mode 100644 index c718792..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.pb.go +++ /dev/null @@ -1,401 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: extension_user/extension_user.proto - -package extension_user // import "github.com/golang/protobuf/protoc-gen-go/testdata/extension_user" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import extension_base "github.com/golang/protobuf/protoc-gen-go/testdata/extension_base" -import extension_extra "github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type UserMessage struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Rank *string `protobuf:"bytes,2,opt,name=rank" json:"rank,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserMessage) Reset() { *m = UserMessage{} } -func (m *UserMessage) String() string { return proto.CompactTextString(m) } -func (*UserMessage) ProtoMessage() {} -func (*UserMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{0} -} -func (m *UserMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserMessage.Unmarshal(m, b) -} -func (m *UserMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserMessage.Marshal(b, m, deterministic) -} -func (dst *UserMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserMessage.Merge(dst, src) -} -func (m *UserMessage) XXX_Size() int { - return xxx_messageInfo_UserMessage.Size(m) -} -func (m *UserMessage) XXX_DiscardUnknown() { - xxx_messageInfo_UserMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_UserMessage proto.InternalMessageInfo - -func (m *UserMessage) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *UserMessage) GetRank() string { - if m != nil && m.Rank != nil { - return *m.Rank - } - return "" -} - -// Extend inside the scope of another type -type LoudMessage struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LoudMessage) Reset() { *m = LoudMessage{} } -func (m *LoudMessage) String() string { return proto.CompactTextString(m) } -func (*LoudMessage) ProtoMessage() {} -func (*LoudMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{1} -} - -var extRange_LoudMessage = []proto.ExtensionRange{ - {Start: 100, End: 536870911}, -} - -func (*LoudMessage) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_LoudMessage -} -func (m *LoudMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LoudMessage.Unmarshal(m, b) -} -func (m *LoudMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LoudMessage.Marshal(b, m, deterministic) -} -func (dst *LoudMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_LoudMessage.Merge(dst, src) -} -func (m *LoudMessage) XXX_Size() int { - return xxx_messageInfo_LoudMessage.Size(m) -} -func (m *LoudMessage) XXX_DiscardUnknown() { - xxx_messageInfo_LoudMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_LoudMessage proto.InternalMessageInfo - -var E_LoudMessage_Volume = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.BaseMessage)(nil), - ExtensionType: (*uint32)(nil), - Field: 8, - Name: "extension_user.LoudMessage.volume", - Tag: "varint,8,opt,name=volume", - Filename: "extension_user/extension_user.proto", -} - -// Extend inside the scope of another type, using a message. -type LoginMessage struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LoginMessage) Reset() { *m = LoginMessage{} } -func (m *LoginMessage) String() string { return proto.CompactTextString(m) } -func (*LoginMessage) ProtoMessage() {} -func (*LoginMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{2} -} -func (m *LoginMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LoginMessage.Unmarshal(m, b) -} -func (m *LoginMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LoginMessage.Marshal(b, m, deterministic) -} -func (dst *LoginMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_LoginMessage.Merge(dst, src) -} -func (m *LoginMessage) XXX_Size() int { - return xxx_messageInfo_LoginMessage.Size(m) -} -func (m *LoginMessage) XXX_DiscardUnknown() { - xxx_messageInfo_LoginMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_LoginMessage proto.InternalMessageInfo - -var E_LoginMessage_UserMessage = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.BaseMessage)(nil), - ExtensionType: (*UserMessage)(nil), - Field: 16, - Name: "extension_user.LoginMessage.user_message", - Tag: "bytes,16,opt,name=user_message,json=userMessage", - Filename: "extension_user/extension_user.proto", -} - -type Detail struct { - Color *string `protobuf:"bytes,1,opt,name=color" json:"color,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Detail) Reset() { *m = Detail{} } -func (m *Detail) String() string { return proto.CompactTextString(m) } -func (*Detail) ProtoMessage() {} -func (*Detail) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{3} -} -func (m *Detail) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Detail.Unmarshal(m, b) -} -func (m *Detail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Detail.Marshal(b, m, deterministic) -} -func (dst *Detail) XXX_Merge(src proto.Message) { - xxx_messageInfo_Detail.Merge(dst, src) -} -func (m *Detail) XXX_Size() int { - return xxx_messageInfo_Detail.Size(m) -} -func (m *Detail) XXX_DiscardUnknown() { - xxx_messageInfo_Detail.DiscardUnknown(m) -} - -var xxx_messageInfo_Detail proto.InternalMessageInfo - -func (m *Detail) GetColor() string { - if m != nil && m.Color != nil { - return *m.Color - } - return "" -} - -// An extension of an extension -type Announcement struct { - Words *string `protobuf:"bytes,1,opt,name=words" json:"words,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Announcement) Reset() { *m = Announcement{} } -func (m *Announcement) String() string { return proto.CompactTextString(m) } -func (*Announcement) ProtoMessage() {} -func (*Announcement) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{4} -} -func (m *Announcement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Announcement.Unmarshal(m, b) -} -func (m *Announcement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Announcement.Marshal(b, m, deterministic) -} -func (dst *Announcement) XXX_Merge(src proto.Message) { - xxx_messageInfo_Announcement.Merge(dst, src) -} -func (m *Announcement) XXX_Size() int { - return xxx_messageInfo_Announcement.Size(m) -} -func (m *Announcement) XXX_DiscardUnknown() { - xxx_messageInfo_Announcement.DiscardUnknown(m) -} - -var xxx_messageInfo_Announcement proto.InternalMessageInfo - -func (m *Announcement) GetWords() string { - if m != nil && m.Words != nil { - return *m.Words - } - return "" -} - -var E_Announcement_LoudExt = &proto.ExtensionDesc{ - ExtendedType: (*LoudMessage)(nil), - ExtensionType: (*Announcement)(nil), - Field: 100, - Name: "extension_user.Announcement.loud_ext", - Tag: "bytes,100,opt,name=loud_ext,json=loudExt", - Filename: "extension_user/extension_user.proto", -} - -// Something that can be put in a message set. -type OldStyleParcel struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Height *int32 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OldStyleParcel) Reset() { *m = OldStyleParcel{} } -func (m *OldStyleParcel) String() string { return proto.CompactTextString(m) } -func (*OldStyleParcel) ProtoMessage() {} -func (*OldStyleParcel) Descriptor() ([]byte, []int) { - return fileDescriptor_extension_user_af41b5e0bdfb7846, []int{5} -} -func (m *OldStyleParcel) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OldStyleParcel.Unmarshal(m, b) -} -func (m *OldStyleParcel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OldStyleParcel.Marshal(b, m, deterministic) -} -func (dst *OldStyleParcel) XXX_Merge(src proto.Message) { - xxx_messageInfo_OldStyleParcel.Merge(dst, src) -} -func (m *OldStyleParcel) XXX_Size() int { - return xxx_messageInfo_OldStyleParcel.Size(m) -} -func (m *OldStyleParcel) XXX_DiscardUnknown() { - xxx_messageInfo_OldStyleParcel.DiscardUnknown(m) -} - -var xxx_messageInfo_OldStyleParcel proto.InternalMessageInfo - -func (m *OldStyleParcel) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *OldStyleParcel) GetHeight() int32 { - if m != nil && m.Height != nil { - return *m.Height - } - return 0 -} - -var E_OldStyleParcel_MessageSetExtension = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.OldStyleMessage)(nil), - ExtensionType: (*OldStyleParcel)(nil), - Field: 2001, - Name: "extension_user.OldStyleParcel", - Tag: "bytes,2001,opt,name=message_set_extension,json=messageSetExtension", - Filename: "extension_user/extension_user.proto", -} - -var E_UserMessage = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.BaseMessage)(nil), - ExtensionType: (*UserMessage)(nil), - Field: 5, - Name: "extension_user.user_message", - Tag: "bytes,5,opt,name=user_message,json=userMessage", - Filename: "extension_user/extension_user.proto", -} - -var E_ExtraMessage = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.BaseMessage)(nil), - ExtensionType: (*extension_extra.ExtraMessage)(nil), - Field: 9, - Name: "extension_user.extra_message", - Tag: "bytes,9,opt,name=extra_message,json=extraMessage", - Filename: "extension_user/extension_user.proto", -} - -var E_Width = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.BaseMessage)(nil), - ExtensionType: (*int32)(nil), - Field: 6, - Name: "extension_user.width", - Tag: "varint,6,opt,name=width", - Filename: "extension_user/extension_user.proto", -} - -var E_Area = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.BaseMessage)(nil), - ExtensionType: (*int64)(nil), - Field: 7, - Name: "extension_user.area", - Tag: "varint,7,opt,name=area", - Filename: "extension_user/extension_user.proto", -} - -var E_Detail = &proto.ExtensionDesc{ - ExtendedType: (*extension_base.BaseMessage)(nil), - ExtensionType: ([]*Detail)(nil), - Field: 17, - Name: "extension_user.detail", - Tag: "bytes,17,rep,name=detail", - Filename: "extension_user/extension_user.proto", -} - -func init() { - proto.RegisterType((*UserMessage)(nil), "extension_user.UserMessage") - proto.RegisterType((*LoudMessage)(nil), "extension_user.LoudMessage") - proto.RegisterType((*LoginMessage)(nil), "extension_user.LoginMessage") - proto.RegisterType((*Detail)(nil), "extension_user.Detail") - proto.RegisterType((*Announcement)(nil), "extension_user.Announcement") - proto.RegisterMessageSetType((*OldStyleParcel)(nil), 2001, "extension_user.OldStyleParcel") - proto.RegisterType((*OldStyleParcel)(nil), "extension_user.OldStyleParcel") - proto.RegisterExtension(E_LoudMessage_Volume) - proto.RegisterExtension(E_LoginMessage_UserMessage) - proto.RegisterExtension(E_Announcement_LoudExt) - proto.RegisterExtension(E_OldStyleParcel_MessageSetExtension) - proto.RegisterExtension(E_UserMessage) - proto.RegisterExtension(E_ExtraMessage) - proto.RegisterExtension(E_Width) - proto.RegisterExtension(E_Area) - proto.RegisterExtension(E_Detail) -} - -func init() { - proto.RegisterFile("extension_user/extension_user.proto", fileDescriptor_extension_user_af41b5e0bdfb7846) -} - -var fileDescriptor_extension_user_af41b5e0bdfb7846 = []byte{ - // 492 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x51, 0x6f, 0x94, 0x40, - 0x10, 0x0e, 0x6d, 0x8f, 0x5e, 0x87, 0x6b, 0xad, 0xa8, 0xcd, 0xa5, 0x6a, 0x25, 0x18, 0x13, 0x62, - 0xd2, 0x23, 0x62, 0x7c, 0xe1, 0x49, 0x2f, 0xde, 0x93, 0x67, 0x34, 0x54, 0x5f, 0xf4, 0x81, 0xec, - 0xc1, 0xc8, 0x91, 0xc2, 0xae, 0xd9, 0x5d, 0xec, 0xe9, 0xd3, 0xfd, 0x26, 0xff, 0x89, 0xff, 0xc8, - 0xb0, 0x2c, 0x2d, 0x87, 0xc9, 0xc5, 0xbe, 0x90, 0xfd, 0x86, 0x6f, 0xbe, 0x99, 0xfd, 0x66, 0x00, - 0x9e, 0xe2, 0x4a, 0x22, 0x15, 0x39, 0xa3, 0x71, 0x25, 0x90, 0xfb, 0x9b, 0x70, 0xf2, 0x9d, 0x33, - 0xc9, 0xec, 0xa3, 0xcd, 0xe8, 0x69, 0x27, 0x69, 0x41, 0x04, 0xfa, 0x9b, 0xb0, 0x49, 0x3a, 0x7d, - 0x76, 0x13, 0xc5, 0x95, 0xe4, 0xc4, 0xef, 0xe1, 0x86, 0xe6, 0xbe, 0x02, 0xeb, 0xb3, 0x40, 0xfe, - 0x1e, 0x85, 0x20, 0x19, 0xda, 0x36, 0xec, 0x51, 0x52, 0xe2, 0xd8, 0x70, 0x0c, 0xef, 0x20, 0x52, - 0xe7, 0x3a, 0xc6, 0x09, 0xbd, 0x1c, 0xef, 0x34, 0xb1, 0xfa, 0xec, 0xce, 0xc1, 0x9a, 0xb3, 0x2a, - 0xd5, 0x69, 0xcf, 0x87, 0xc3, 0xf4, 0x78, 0xbd, 0x5e, 0xaf, 0x77, 0x82, 0x97, 0x60, 0xfe, 0x60, - 0x45, 0x55, 0xa2, 0xfd, 0x70, 0xd2, 0xeb, 0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, 0x4d, - 0x2b, 0x8c, 0xe1, 0x50, 0xad, 0xeb, 0xff, 0xa9, 0x1f, 0x28, 0xf5, 0xc7, 0x93, 0xfe, 0xae, 0xcf, - 0xea, 0x67, 0xab, 0x3f, 0xc2, 0x0e, 0x0a, 0x5f, 0xc0, 0xe0, 0x2a, 0x4f, 0xe5, 0x72, 0xbb, 0xb0, - 0xa9, 0x7c, 0x6e, 0x98, 0xa1, 0x0f, 0x7b, 0x84, 0x23, 0xd9, 0x9e, 0xb1, 0xef, 0x18, 0xde, 0x6e, - 0xa4, 0x88, 0xe1, 0x3b, 0x30, 0xd3, 0x66, 0xe5, 0xb6, 0xa6, 0xdc, 0x75, 0x76, 0x3d, 0x2b, 0x38, - 0xe9, 0x7b, 0xd3, 0x6c, 0x6b, 0xa4, 0x25, 0xa6, 0xd3, 0x2f, 0xaf, 0xb3, 0x5c, 0x2e, 0xab, 0xc5, - 0x24, 0x61, 0xa5, 0x9f, 0xb1, 0x82, 0xd0, 0xcc, 0x57, 0x1f, 0xf3, 0xa2, 0xfa, 0xd6, 0x1c, 0x92, - 0xf3, 0x0c, 0xe9, 0x79, 0xc6, 0x7c, 0x89, 0x42, 0xa6, 0x44, 0x92, 0xde, 0x7f, 0xe5, 0x6f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xdf, 0x18, 0x64, 0x15, 0x77, 0x04, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.proto deleted file mode 100644 index 033c186..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user/extension_user.proto +++ /dev/null @@ -1,102 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -import "extension_base/extension_base.proto"; -import "extension_extra/extension_extra.proto"; - -package extension_user; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/extension_user"; - -message UserMessage { - optional string name = 1; - optional string rank = 2; -} - -// Extend with a message -extend extension_base.BaseMessage { - optional UserMessage user_message = 5; -} - -// Extend with a foreign message -extend extension_base.BaseMessage { - optional extension_extra.ExtraMessage extra_message = 9; -} - -// Extend with some primitive types -extend extension_base.BaseMessage { - optional int32 width = 6; - optional int64 area = 7; -} - -// Extend inside the scope of another type -message LoudMessage { - extend extension_base.BaseMessage { - optional uint32 volume = 8; - } - extensions 100 to max; -} - -// Extend inside the scope of another type, using a message. -message LoginMessage { - extend extension_base.BaseMessage { - optional UserMessage user_message = 16; - } -} - -// Extend with a repeated field -extend extension_base.BaseMessage { - repeated Detail detail = 17; -} - -message Detail { - optional string color = 1; -} - -// An extension of an extension -message Announcement { - optional string words = 1; - extend LoudMessage { - optional Announcement loud_ext = 100; - } -} - -// Something that can be put in a message set. -message OldStyleParcel { - extend extension_base.OldStyleMessage { - optional OldStyleParcel message_set_extension = 2001; - } - - required string name = 1; - optional int32 height = 2; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.pb.go deleted file mode 100644 index 0bb4cbf..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.pb.go +++ /dev/null @@ -1,444 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: grpc/grpc.proto - -package testing // import "github.com/golang/protobuf/protoc-gen-go/testdata/grpc" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type SimpleRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} -func (*SimpleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_grpc_65bf3902e49ee873, []int{0} -} -func (m *SimpleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SimpleRequest.Unmarshal(m, b) -} -func (m *SimpleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SimpleRequest.Marshal(b, m, deterministic) -} -func (dst *SimpleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimpleRequest.Merge(dst, src) -} -func (m *SimpleRequest) XXX_Size() int { - return xxx_messageInfo_SimpleRequest.Size(m) -} -func (m *SimpleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SimpleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SimpleRequest proto.InternalMessageInfo - -type SimpleResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} -func (*SimpleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_grpc_65bf3902e49ee873, []int{1} -} -func (m *SimpleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SimpleResponse.Unmarshal(m, b) -} -func (m *SimpleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SimpleResponse.Marshal(b, m, deterministic) -} -func (dst *SimpleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimpleResponse.Merge(dst, src) -} -func (m *SimpleResponse) XXX_Size() int { - return xxx_messageInfo_SimpleResponse.Size(m) -} -func (m *SimpleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SimpleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SimpleResponse proto.InternalMessageInfo - -type StreamMsg struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StreamMsg) Reset() { *m = StreamMsg{} } -func (m *StreamMsg) String() string { return proto.CompactTextString(m) } -func (*StreamMsg) ProtoMessage() {} -func (*StreamMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_grpc_65bf3902e49ee873, []int{2} -} -func (m *StreamMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StreamMsg.Unmarshal(m, b) -} -func (m *StreamMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StreamMsg.Marshal(b, m, deterministic) -} -func (dst *StreamMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamMsg.Merge(dst, src) -} -func (m *StreamMsg) XXX_Size() int { - return xxx_messageInfo_StreamMsg.Size(m) -} -func (m *StreamMsg) XXX_DiscardUnknown() { - xxx_messageInfo_StreamMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamMsg proto.InternalMessageInfo - -type StreamMsg2 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StreamMsg2) Reset() { *m = StreamMsg2{} } -func (m *StreamMsg2) String() string { return proto.CompactTextString(m) } -func (*StreamMsg2) ProtoMessage() {} -func (*StreamMsg2) Descriptor() ([]byte, []int) { - return fileDescriptor_grpc_65bf3902e49ee873, []int{3} -} -func (m *StreamMsg2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StreamMsg2.Unmarshal(m, b) -} -func (m *StreamMsg2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StreamMsg2.Marshal(b, m, deterministic) -} -func (dst *StreamMsg2) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamMsg2.Merge(dst, src) -} -func (m *StreamMsg2) XXX_Size() int { - return xxx_messageInfo_StreamMsg2.Size(m) -} -func (m *StreamMsg2) XXX_DiscardUnknown() { - xxx_messageInfo_StreamMsg2.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamMsg2 proto.InternalMessageInfo - -func init() { - proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") - proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") - proto.RegisterType((*StreamMsg)(nil), "grpc.testing.StreamMsg") - proto.RegisterType((*StreamMsg2)(nil), "grpc.testing.StreamMsg2") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Test service - -type TestClient interface { - UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) - // This RPC streams from the server only. - Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error) - // This RPC streams from the client. - Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error) - // This one streams in both directions. - Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error) -} - -type testClient struct { - cc *grpc.ClientConn -} - -func NewTestClient(cc *grpc.ClientConn) TestClient { - return &testClient{cc} -} - -func (c *testClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { - out := new(SimpleResponse) - err := grpc.Invoke(ctx, "/grpc.testing.Test/UnaryCall", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testClient) Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[0], c.cc, "/grpc.testing.Test/Downstream", opts...) - if err != nil { - return nil, err - } - x := &testDownstreamClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Test_DownstreamClient interface { - Recv() (*StreamMsg, error) - grpc.ClientStream -} - -type testDownstreamClient struct { - grpc.ClientStream -} - -func (x *testDownstreamClient) Recv() (*StreamMsg, error) { - m := new(StreamMsg) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testClient) Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[1], c.cc, "/grpc.testing.Test/Upstream", opts...) - if err != nil { - return nil, err - } - x := &testUpstreamClient{stream} - return x, nil -} - -type Test_UpstreamClient interface { - Send(*StreamMsg) error - CloseAndRecv() (*SimpleResponse, error) - grpc.ClientStream -} - -type testUpstreamClient struct { - grpc.ClientStream -} - -func (x *testUpstreamClient) Send(m *StreamMsg) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testUpstreamClient) CloseAndRecv() (*SimpleResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(SimpleResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testClient) Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[2], c.cc, "/grpc.testing.Test/Bidi", opts...) - if err != nil { - return nil, err - } - x := &testBidiClient{stream} - return x, nil -} - -type Test_BidiClient interface { - Send(*StreamMsg) error - Recv() (*StreamMsg2, error) - grpc.ClientStream -} - -type testBidiClient struct { - grpc.ClientStream -} - -func (x *testBidiClient) Send(m *StreamMsg) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testBidiClient) Recv() (*StreamMsg2, error) { - m := new(StreamMsg2) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for Test service - -type TestServer interface { - UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) - // This RPC streams from the server only. - Downstream(*SimpleRequest, Test_DownstreamServer) error - // This RPC streams from the client. - Upstream(Test_UpstreamServer) error - // This one streams in both directions. - Bidi(Test_BidiServer) error -} - -func RegisterTestServer(s *grpc.Server, srv TestServer) { - s.RegisterService(&_Test_serviceDesc, srv) -} - -func _Test_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SimpleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServer).UnaryCall(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.testing.Test/UnaryCall", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServer).UnaryCall(ctx, req.(*SimpleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Test_Downstream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SimpleRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(TestServer).Downstream(m, &testDownstreamServer{stream}) -} - -type Test_DownstreamServer interface { - Send(*StreamMsg) error - grpc.ServerStream -} - -type testDownstreamServer struct { - grpc.ServerStream -} - -func (x *testDownstreamServer) Send(m *StreamMsg) error { - return x.ServerStream.SendMsg(m) -} - -func _Test_Upstream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServer).Upstream(&testUpstreamServer{stream}) -} - -type Test_UpstreamServer interface { - SendAndClose(*SimpleResponse) error - Recv() (*StreamMsg, error) - grpc.ServerStream -} - -type testUpstreamServer struct { - grpc.ServerStream -} - -func (x *testUpstreamServer) SendAndClose(m *SimpleResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testUpstreamServer) Recv() (*StreamMsg, error) { - m := new(StreamMsg) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Test_Bidi_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServer).Bidi(&testBidiServer{stream}) -} - -type Test_BidiServer interface { - Send(*StreamMsg2) error - Recv() (*StreamMsg, error) - grpc.ServerStream -} - -type testBidiServer struct { - grpc.ServerStream -} - -func (x *testBidiServer) Send(m *StreamMsg2) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testBidiServer) Recv() (*StreamMsg, error) { - m := new(StreamMsg) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Test_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.testing.Test", - HandlerType: (*TestServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UnaryCall", - Handler: _Test_UnaryCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Downstream", - Handler: _Test_Downstream_Handler, - ServerStreams: true, - }, - { - StreamName: "Upstream", - Handler: _Test_Upstream_Handler, - ClientStreams: true, - }, - { - StreamName: "Bidi", - Handler: _Test_Bidi_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "grpc/grpc.proto", -} - -func init() { proto.RegisterFile("grpc/grpc.proto", fileDescriptor_grpc_65bf3902e49ee873) } - -var fileDescriptor_grpc_65bf3902e49ee873 = []byte{ - // 244 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x2f, 0x2a, 0x48, - 0xd6, 0x07, 0x11, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x3c, 0x60, 0x76, 0x49, 0x6a, 0x71, - 0x49, 0x66, 0x5e, 0xba, 0x12, 0x3f, 0x17, 0x6f, 0x70, 0x66, 0x6e, 0x41, 0x4e, 0x6a, 0x50, 0x6a, - 0x61, 0x69, 0x6a, 0x71, 0x89, 0x92, 0x00, 0x17, 0x1f, 0x4c, 0xa0, 0xb8, 0x20, 0x3f, 0xaf, 0x38, - 0x55, 0x89, 0x9b, 0x8b, 0x33, 0xb8, 0xa4, 0x28, 0x35, 0x31, 0xd7, 0xb7, 0x38, 0x5d, 0x89, 0x87, - 0x8b, 0x0b, 0xce, 0x31, 0x32, 0x9a, 0xc1, 0xc4, 0xc5, 0x12, 0x92, 0x5a, 0x5c, 0x22, 0xe4, 0xc6, - 0xc5, 0x19, 0x9a, 0x97, 0x58, 0x54, 0xe9, 0x9c, 0x98, 0x93, 0x23, 0x24, 0xad, 0x87, 0x6c, 0x85, - 0x1e, 0x8a, 0xf9, 0x52, 0x32, 0xd8, 0x25, 0x21, 0x76, 0x09, 0xb9, 0x70, 0x71, 0xb9, 0xe4, 0x97, - 0xe7, 0x15, 0x83, 0xad, 0xc0, 0x6f, 0x90, 0x38, 0x9a, 0x24, 0xcc, 0x55, 0x06, 0x8c, 0x42, 0xce, - 0x5c, 0x1c, 0xa1, 0x05, 0x50, 0x33, 0x70, 0x29, 0xc3, 0xef, 0x10, 0x0d, 0x46, 0x21, 0x5b, 0x2e, - 0x16, 0xa7, 0xcc, 0x94, 0x4c, 0xdc, 0x06, 0x48, 0xe0, 0x90, 0x30, 0xd2, 0x60, 0x34, 0x60, 0x74, - 0x72, 0x88, 0xb2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, - 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x07, 0xc7, 0x40, 0x52, 0x69, 0x1a, 0x84, 0x91, 0xac, 0x9b, 0x9e, - 0x9a, 0xa7, 0x9b, 0x9e, 0xaf, 0x0f, 0x32, 0x22, 0x25, 0xb1, 0x24, 0x11, 0x1c, 0x4d, 0xd6, 0x50, - 0x03, 0x93, 0xd8, 0xc0, 0x8a, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0xb9, 0x95, 0x42, - 0xc2, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.proto deleted file mode 100644 index 0e5c64a..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc/grpc.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2015 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package grpc.testing; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/grpc;testing"; - -message SimpleRequest { -} - -message SimpleResponse { -} - -message StreamMsg { -} - -message StreamMsg2 { -} - -service Test { - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // This RPC streams from the server only. - rpc Downstream(SimpleRequest) returns (stream StreamMsg); - - // This RPC streams from the client. - rpc Upstream(stream StreamMsg) returns (SimpleResponse); - - // This one streams in both directions. - rpc Bidi(stream StreamMsg) returns (stream StreamMsg2); -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.pb.go deleted file mode 100644 index 5b780fd..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.pb.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: import_public/a.proto - -package import_public // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import sub "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// M from public import import_public/sub/a.proto -type M = sub.M - -// E from public import import_public/sub/a.proto -type E = sub.E - -var E_name = sub.E_name -var E_value = sub.E_value - -const E_ZERO = E(sub.E_ZERO) - -// Ignoring public import of Local from import_public/b.proto - -type Public struct { - M *sub.M `protobuf:"bytes,1,opt,name=m" json:"m,omitempty"` - E sub.E `protobuf:"varint,2,opt,name=e,enum=goproto.test.import_public.sub.E" json:"e,omitempty"` - Local *Local `protobuf:"bytes,3,opt,name=local" json:"local,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Public) Reset() { *m = Public{} } -func (m *Public) String() string { return proto.CompactTextString(m) } -func (*Public) ProtoMessage() {} -func (*Public) Descriptor() ([]byte, []int) { - return fileDescriptor_a_c0314c022b7c17d8, []int{0} -} -func (m *Public) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Public.Unmarshal(m, b) -} -func (m *Public) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Public.Marshal(b, m, deterministic) -} -func (dst *Public) XXX_Merge(src proto.Message) { - xxx_messageInfo_Public.Merge(dst, src) -} -func (m *Public) XXX_Size() int { - return xxx_messageInfo_Public.Size(m) -} -func (m *Public) XXX_DiscardUnknown() { - xxx_messageInfo_Public.DiscardUnknown(m) -} - -var xxx_messageInfo_Public proto.InternalMessageInfo - -func (m *Public) GetM() *sub.M { - if m != nil { - return m.M - } - return nil -} - -func (m *Public) GetE() sub.E { - if m != nil { - return m.E - } - return sub.E_ZERO -} - -func (m *Public) GetLocal() *Local { - if m != nil { - return m.Local - } - return nil -} - -func init() { - proto.RegisterType((*Public)(nil), "goproto.test.import_public.Public") -} - -func init() { proto.RegisterFile("import_public/a.proto", fileDescriptor_a_c0314c022b7c17d8) } - -var fileDescriptor_a_c0314c022b7c17d8 = []byte{ - // 200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x4f, 0xd4, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x92, 0x4a, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b, 0xf4, 0x50, 0xd4, 0x48, - 0x49, 0xa2, 0x6a, 0x29, 0x2e, 0x4d, 0x82, 0x69, 0x93, 0x42, 0x33, 0x2d, 0x09, 0x22, 0xac, 0xb4, - 0x98, 0x91, 0x8b, 0x2d, 0x00, 0x2c, 0x24, 0xa4, 0xcf, 0xc5, 0x98, 0x2b, 0xc1, 0xa8, 0xc0, 0xa8, - 0xc1, 0x6d, 0xa4, 0xa8, 0x87, 0xdb, 0x12, 0xbd, 0xe2, 0xd2, 0x24, 0x3d, 0xdf, 0x20, 0xc6, 0x5c, - 0x90, 0x86, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x3e, 0xc2, 0x1a, 0x5c, 0x83, 0x18, 0x53, 0x85, - 0xcc, 0xb9, 0x58, 0x73, 0xf2, 0x93, 0x13, 0x73, 0x24, 0x98, 0x09, 0xdb, 0xe2, 0x03, 0x52, 0x18, - 0x04, 0x51, 0xef, 0xe4, 0x18, 0x65, 0x9f, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, - 0xab, 0x9f, 0x9e, 0x9f, 0x93, 0x98, 0x97, 0xae, 0x0f, 0xd6, 0x9a, 0x54, 0x9a, 0x06, 0x61, 0x24, - 0xeb, 0xa6, 0xa7, 0xe6, 0xe9, 0xa6, 0xe7, 0xeb, 0x83, 0xcc, 0x4a, 0x49, 0x2c, 0x49, 0xd4, 0x47, - 0x31, 0x2f, 0x80, 0x21, 0x80, 0x31, 0x89, 0x0d, 0xac, 0xd2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0x70, 0xc5, 0xc3, 0x79, 0x5a, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.proto deleted file mode 100644 index 957ad89..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/a.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package goproto.test.import_public; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public"; - -import public "import_public/sub/a.proto"; // Different Go package. -import public "import_public/b.proto"; // Same Go package. - -message Public { - goproto.test.import_public.sub.M m = 1; - goproto.test.import_public.sub.E e = 2; - Local local = 3; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.pb.go deleted file mode 100644 index 427aa4f..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.pb.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: import_public/b.proto - -package import_public // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import sub "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Local struct { - M *sub.M `protobuf:"bytes,1,opt,name=m" json:"m,omitempty"` - E sub.E `protobuf:"varint,2,opt,name=e,enum=goproto.test.import_public.sub.E" json:"e,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Local) Reset() { *m = Local{} } -func (m *Local) String() string { return proto.CompactTextString(m) } -func (*Local) ProtoMessage() {} -func (*Local) Descriptor() ([]byte, []int) { - return fileDescriptor_b_7f20a805fad67bd0, []int{0} -} -func (m *Local) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Local.Unmarshal(m, b) -} -func (m *Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Local.Marshal(b, m, deterministic) -} -func (dst *Local) XXX_Merge(src proto.Message) { - xxx_messageInfo_Local.Merge(dst, src) -} -func (m *Local) XXX_Size() int { - return xxx_messageInfo_Local.Size(m) -} -func (m *Local) XXX_DiscardUnknown() { - xxx_messageInfo_Local.DiscardUnknown(m) -} - -var xxx_messageInfo_Local proto.InternalMessageInfo - -func (m *Local) GetM() *sub.M { - if m != nil { - return m.M - } - return nil -} - -func (m *Local) GetE() sub.E { - if m != nil { - return m.E - } - return sub.E_ZERO -} - -func init() { - proto.RegisterType((*Local)(nil), "goproto.test.import_public.Local") -} - -func init() { proto.RegisterFile("import_public/b.proto", fileDescriptor_b_7f20a805fad67bd0) } - -var fileDescriptor_b_7f20a805fad67bd0 = []byte{ - // 174 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x4f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x92, 0x4a, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b, 0xf4, 0x50, 0xd4, 0x48, - 0x49, 0xa2, 0x6a, 0x29, 0x2e, 0x4d, 0xd2, 0x4f, 0x84, 0x68, 0x53, 0xca, 0xe4, 0x62, 0xf5, 0xc9, - 0x4f, 0x4e, 0xcc, 0x11, 0xd2, 0xe7, 0x62, 0xcc, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x52, - 0xd4, 0xc3, 0x6d, 0x96, 0x5e, 0x71, 0x69, 0x92, 0x9e, 0x6f, 0x10, 0x63, 0x2e, 0x48, 0x43, 0xaa, - 0x04, 0x93, 0x02, 0xa3, 0x06, 0x1f, 0x61, 0x0d, 0xae, 0x41, 0x8c, 0xa9, 0x4e, 0x8e, 0x51, 0xf6, - 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0x39, 0x89, 0x79, - 0xe9, 0xfa, 0x60, 0x6d, 0x49, 0xa5, 0x69, 0x10, 0x46, 0xb2, 0x6e, 0x7a, 0x6a, 0x9e, 0x6e, 0x7a, - 0xbe, 0x3e, 0xc8, 0x9c, 0x94, 0xc4, 0x92, 0x44, 0x7d, 0x14, 0xb3, 0x92, 0xd8, 0xc0, 0xaa, 0x8c, - 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x2b, 0x5f, 0x8e, 0x04, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.proto deleted file mode 100644 index 1dbca3e..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/b.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package goproto.test.import_public; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public"; - -import "import_public/sub/a.proto"; - -message Local { - goproto.test.import_public.sub.M m = 1; - goproto.test.import_public.sub.E e = 2; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.pb.go deleted file mode 100644 index 4f8f6d2..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.pb.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: import_public/sub/a.proto - -package sub // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type E int32 - -const ( - E_ZERO E = 0 -) - -var E_name = map[int32]string{ - 0: "ZERO", -} -var E_value = map[string]int32{ - "ZERO": 0, -} - -func (x E) String() string { - return proto.EnumName(E_name, int32(x)) -} -func (E) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a_91ca0264a534463a, []int{0} -} - -type M struct { - // Field using a type in the same Go package, but a different source file. - M2 *M2 `protobuf:"bytes,1,opt,name=m2" json:"m2,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M) Reset() { *m = M{} } -func (m *M) String() string { return proto.CompactTextString(m) } -func (*M) ProtoMessage() {} -func (*M) Descriptor() ([]byte, []int) { - return fileDescriptor_a_91ca0264a534463a, []int{0} -} -func (m *M) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M.Unmarshal(m, b) -} -func (m *M) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M.Marshal(b, m, deterministic) -} -func (dst *M) XXX_Merge(src proto.Message) { - xxx_messageInfo_M.Merge(dst, src) -} -func (m *M) XXX_Size() int { - return xxx_messageInfo_M.Size(m) -} -func (m *M) XXX_DiscardUnknown() { - xxx_messageInfo_M.DiscardUnknown(m) -} - -var xxx_messageInfo_M proto.InternalMessageInfo - -func (m *M) GetM2() *M2 { - if m != nil { - return m.M2 - } - return nil -} - -func init() { - proto.RegisterType((*M)(nil), "goproto.test.import_public.sub.M") - proto.RegisterEnum("goproto.test.import_public.sub.E", E_name, E_value) -} - -func init() { proto.RegisterFile("import_public/sub/a.proto", fileDescriptor_a_91ca0264a534463a) } - -var fileDescriptor_a_91ca0264a534463a = []byte{ - // 172 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x2f, 0x2e, 0x4d, 0xd2, 0x4f, 0xd4, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x4b, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b, - 0xf4, 0x50, 0xd4, 0xe9, 0x15, 0x97, 0x26, 0x49, 0x61, 0xd1, 0x9a, 0x04, 0xd1, 0xaa, 0x64, 0xce, - 0xc5, 0xe8, 0x2b, 0x64, 0xc4, 0xc5, 0x94, 0x6b, 0x24, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, - 0xa4, 0x87, 0xdf, 0x30, 0x3d, 0x5f, 0xa3, 0x20, 0xa6, 0x5c, 0x23, 0x2d, 0x5e, 0x2e, 0x46, 0x57, - 0x21, 0x0e, 0x2e, 0x96, 0x28, 0xd7, 0x20, 0x7f, 0x01, 0x06, 0x27, 0xd7, 0x28, 0xe7, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0x7d, - 0xb0, 0x39, 0x49, 0xa5, 0x69, 0x10, 0x46, 0xb2, 0x6e, 0x7a, 0x6a, 0x9e, 0x6e, 0x7a, 0xbe, 0x3e, - 0xc8, 0xe0, 0x94, 0xc4, 0x92, 0x44, 0x7d, 0x0c, 0x67, 0x25, 0xb1, 0x81, 0x55, 0x1a, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x81, 0xcc, 0x07, 0x7d, 0xed, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.proto deleted file mode 100644 index 4494c81..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/a.proto +++ /dev/null @@ -1,47 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package goproto.test.import_public.sub; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub"; - -import "import_public/sub/b.proto"; - -message M { - // Field using a type in the same Go package, but a different source file. - M2 m2 = 1; -} - -enum E { - ZERO = 0; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.pb.go deleted file mode 100644 index d57a3bb..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.pb.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: import_public/sub/b.proto - -package sub // import "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type M2 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M2) Reset() { *m = M2{} } -func (m *M2) String() string { return proto.CompactTextString(m) } -func (*M2) ProtoMessage() {} -func (*M2) Descriptor() ([]byte, []int) { - return fileDescriptor_b_eba25180453d86b4, []int{0} -} -func (m *M2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M2.Unmarshal(m, b) -} -func (m *M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M2.Marshal(b, m, deterministic) -} -func (dst *M2) XXX_Merge(src proto.Message) { - xxx_messageInfo_M2.Merge(dst, src) -} -func (m *M2) XXX_Size() int { - return xxx_messageInfo_M2.Size(m) -} -func (m *M2) XXX_DiscardUnknown() { - xxx_messageInfo_M2.DiscardUnknown(m) -} - -var xxx_messageInfo_M2 proto.InternalMessageInfo - -func init() { - proto.RegisterType((*M2)(nil), "goproto.test.import_public.sub.M2") -} - -func init() { proto.RegisterFile("import_public/sub/b.proto", fileDescriptor_b_eba25180453d86b4) } - -var fileDescriptor_b_eba25180453d86b4 = []byte{ - // 127 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x89, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x4c, 0xd6, 0x2f, 0x2e, 0x4d, 0xd2, 0x4f, 0xd2, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x4b, 0xcf, 0x07, 0x33, 0xf4, 0x4a, 0x52, 0x8b, 0x4b, - 0xf4, 0x50, 0xd4, 0xe9, 0x15, 0x97, 0x26, 0x29, 0xb1, 0x70, 0x31, 0xf9, 0x1a, 0x39, 0xb9, 0x46, - 0x39, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, - 0xe6, 0xa5, 0xeb, 0x83, 0xf5, 0x25, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, 0xe9, 0xa9, 0x79, 0xba, - 0xe9, 0xf9, 0xfa, 0x20, 0x83, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0x31, 0x2c, 0x4d, 0x62, 0x03, 0xab, - 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x64, 0x42, 0xe4, 0xa8, 0x90, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.proto deleted file mode 100644 index c7299e0..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub/b.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package goproto.test.import_public.sub; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub"; - -message M2 { -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public_test.go deleted file mode 100644 index 7ef776b..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/import_public_test.go +++ /dev/null @@ -1,66 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build go1.9 - -package testdata - -import ( - "testing" - - mainpb "github.com/golang/protobuf/protoc-gen-go/testdata/import_public" - subpb "github.com/golang/protobuf/protoc-gen-go/testdata/import_public/sub" -) - -func TestImportPublicLink(t *testing.T) { - // mainpb.[ME] should be interchangable with subpb.[ME]. - var _ mainpb.M = subpb.M{} - var _ mainpb.E = subpb.E(0) - _ = &mainpb.Public{ - M: &mainpb.M{}, - E: mainpb.E_ZERO, - Local: &mainpb.Local{ - M: &mainpb.M{}, - E: mainpb.E_ZERO, - }, - } - _ = &mainpb.Public{ - M: &subpb.M{}, - E: subpb.E_ZERO, - Local: &mainpb.Local{ - M: &subpb.M{}, - E: subpb.E_ZERO, - }, - } - _ = &mainpb.M{ - M2: &subpb.M2{}, - } -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.pb.go deleted file mode 100644 index ca312d6..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.pb.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/fmt/m.proto - -package fmt // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type M struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M) Reset() { *m = M{} } -func (m *M) String() string { return proto.CompactTextString(m) } -func (*M) ProtoMessage() {} -func (*M) Descriptor() ([]byte, []int) { - return fileDescriptor_m_867dd34c461422b8, []int{0} -} -func (m *M) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M.Unmarshal(m, b) -} -func (m *M) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M.Marshal(b, m, deterministic) -} -func (dst *M) XXX_Merge(src proto.Message) { - xxx_messageInfo_M.Merge(dst, src) -} -func (m *M) XXX_Size() int { - return xxx_messageInfo_M.Size(m) -} -func (m *M) XXX_DiscardUnknown() { - xxx_messageInfo_M.DiscardUnknown(m) -} - -var xxx_messageInfo_M proto.InternalMessageInfo - -func init() { - proto.RegisterType((*M)(nil), "fmt.M") -} - -func init() { proto.RegisterFile("imports/fmt/m.proto", fileDescriptor_m_867dd34c461422b8) } - -var fileDescriptor_m_867dd34c461422b8 = []byte{ - // 109 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x4f, 0xcb, 0x2d, 0xd1, 0xcf, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x62, 0x4e, 0xcb, 0x2d, 0x51, 0x62, 0xe6, 0x62, 0xf4, 0x75, 0xb2, 0x8f, 0xb2, 0x4d, 0xcf, 0x2c, - 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x07, - 0x2b, 0x4a, 0x2a, 0x4d, 0x83, 0x30, 0x92, 0x75, 0xd3, 0x53, 0xf3, 0x74, 0xd3, 0xf3, 0xf5, 0x4b, - 0x52, 0x8b, 0x4b, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0x91, 0x8c, 0x4c, 0x62, 0x03, 0xab, 0x31, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xc9, 0xee, 0xbe, 0x68, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.proto deleted file mode 100644 index 142d8cf..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt/m.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; -package fmt; -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt"; -message M {} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go deleted file mode 100644 index 82ec35e..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_a_1/m1.proto - -package test_a_1 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type E1 int32 - -const ( - E1_E1_ZERO E1 = 0 -) - -var E1_name = map[int32]string{ - 0: "E1_ZERO", -} -var E1_value = map[string]int32{ - "E1_ZERO": 0, -} - -func (x E1) String() string { - return proto.EnumName(E1_name, int32(x)) -} -func (E1) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_m1_56a2598431d21e61, []int{0} -} - -type M1 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M1) Reset() { *m = M1{} } -func (m *M1) String() string { return proto.CompactTextString(m) } -func (*M1) ProtoMessage() {} -func (*M1) Descriptor() ([]byte, []int) { - return fileDescriptor_m1_56a2598431d21e61, []int{0} -} -func (m *M1) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M1.Unmarshal(m, b) -} -func (m *M1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M1.Marshal(b, m, deterministic) -} -func (dst *M1) XXX_Merge(src proto.Message) { - xxx_messageInfo_M1.Merge(dst, src) -} -func (m *M1) XXX_Size() int { - return xxx_messageInfo_M1.Size(m) -} -func (m *M1) XXX_DiscardUnknown() { - xxx_messageInfo_M1.DiscardUnknown(m) -} - -var xxx_messageInfo_M1 proto.InternalMessageInfo - -type M1_1 struct { - M1 *M1 `protobuf:"bytes,1,opt,name=m1" json:"m1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M1_1) Reset() { *m = M1_1{} } -func (m *M1_1) String() string { return proto.CompactTextString(m) } -func (*M1_1) ProtoMessage() {} -func (*M1_1) Descriptor() ([]byte, []int) { - return fileDescriptor_m1_56a2598431d21e61, []int{1} -} -func (m *M1_1) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M1_1.Unmarshal(m, b) -} -func (m *M1_1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M1_1.Marshal(b, m, deterministic) -} -func (dst *M1_1) XXX_Merge(src proto.Message) { - xxx_messageInfo_M1_1.Merge(dst, src) -} -func (m *M1_1) XXX_Size() int { - return xxx_messageInfo_M1_1.Size(m) -} -func (m *M1_1) XXX_DiscardUnknown() { - xxx_messageInfo_M1_1.DiscardUnknown(m) -} - -var xxx_messageInfo_M1_1 proto.InternalMessageInfo - -func (m *M1_1) GetM1() *M1 { - if m != nil { - return m.M1 - } - return nil -} - -func init() { - proto.RegisterType((*M1)(nil), "test.a.M1") - proto.RegisterType((*M1_1)(nil), "test.a.M1_1") - proto.RegisterEnum("test.a.E1", E1_name, E1_value) -} - -func init() { proto.RegisterFile("imports/test_a_1/m1.proto", fileDescriptor_m1_56a2598431d21e61) } - -var fileDescriptor_m1_56a2598431d21e61 = []byte{ - // 165 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd4, 0xcf, 0x35, 0xd4, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9, - 0x1a, 0x2a, 0x29, 0x71, 0xb1, 0xf8, 0x1a, 0xc6, 0x1b, 0x0a, 0x49, 0x71, 0x31, 0xe5, 0x1a, 0x4a, - 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x71, 0xe9, 0x41, 0x94, 0xe8, 0xf9, 0x1a, 0x06, 0x31, 0xe5, - 0x1a, 0x6a, 0x09, 0x72, 0x31, 0xb9, 0x1a, 0x0a, 0x71, 0x73, 0xb1, 0xbb, 0x1a, 0xc6, 0x47, 0xb9, - 0x06, 0xf9, 0x0b, 0x30, 0x38, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, - 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0xcd, 0x4f, 0x2a, 0x4d, 0x83, - 0x30, 0x92, 0x75, 0xd3, 0x53, 0xf3, 0x74, 0xd3, 0xf3, 0xc1, 0x4e, 0x48, 0x49, 0x2c, 0x49, 0xd4, - 0x47, 0x77, 0x53, 0x12, 0x1b, 0x58, 0xa1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xae, 0xc9, - 0xcd, 0xae, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.proto deleted file mode 100644 index da54c1e..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m1.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; -package test.a; -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1"; - -message M1 {} - -message M1_1 { - M1 m1 = 1; -} - -enum E1 { - E1_ZERO = 0; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go deleted file mode 100644 index 1b629bf..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_a_1/m2.proto - -package test_a_1 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type M2 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M2) Reset() { *m = M2{} } -func (m *M2) String() string { return proto.CompactTextString(m) } -func (*M2) ProtoMessage() {} -func (*M2) Descriptor() ([]byte, []int) { - return fileDescriptor_m2_ccd6356c045a9ac3, []int{0} -} -func (m *M2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M2.Unmarshal(m, b) -} -func (m *M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M2.Marshal(b, m, deterministic) -} -func (dst *M2) XXX_Merge(src proto.Message) { - xxx_messageInfo_M2.Merge(dst, src) -} -func (m *M2) XXX_Size() int { - return xxx_messageInfo_M2.Size(m) -} -func (m *M2) XXX_DiscardUnknown() { - xxx_messageInfo_M2.DiscardUnknown(m) -} - -var xxx_messageInfo_M2 proto.InternalMessageInfo - -func init() { - proto.RegisterType((*M2)(nil), "test.a.M2") -} - -func init() { proto.RegisterFile("imports/test_a_1/m2.proto", fileDescriptor_m2_ccd6356c045a9ac3) } - -var fileDescriptor_m2_ccd6356c045a9ac3 = []byte{ - // 114 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd4, 0xcf, 0x35, 0xd2, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9, - 0x1a, 0x39, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, - 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x15, 0x26, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, - 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0xb3, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0xd1, 0x0d, 0x4f, - 0x62, 0x03, 0x2b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xe0, 0x7e, 0xc0, 0x77, 0x00, - 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.proto deleted file mode 100644 index 49499dc..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1/m2.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; -package test.a; -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1"; -message M2 {} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go deleted file mode 100644 index e3895d2..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_a_2/m3.proto - -package test_a_2 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type M3 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M3) Reset() { *m = M3{} } -func (m *M3) String() string { return proto.CompactTextString(m) } -func (*M3) ProtoMessage() {} -func (*M3) Descriptor() ([]byte, []int) { - return fileDescriptor_m3_de310e87d08d4216, []int{0} -} -func (m *M3) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M3.Unmarshal(m, b) -} -func (m *M3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M3.Marshal(b, m, deterministic) -} -func (dst *M3) XXX_Merge(src proto.Message) { - xxx_messageInfo_M3.Merge(dst, src) -} -func (m *M3) XXX_Size() int { - return xxx_messageInfo_M3.Size(m) -} -func (m *M3) XXX_DiscardUnknown() { - xxx_messageInfo_M3.DiscardUnknown(m) -} - -var xxx_messageInfo_M3 proto.InternalMessageInfo - -func init() { - proto.RegisterType((*M3)(nil), "test.a.M3") -} - -func init() { proto.RegisterFile("imports/test_a_2/m3.proto", fileDescriptor_m3_de310e87d08d4216) } - -var fileDescriptor_m3_de310e87d08d4216 = []byte{ - // 114 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd2, 0xcf, 0x35, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9, - 0x1a, 0x3b, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, - 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x15, 0x26, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, - 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0xb3, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0xd1, 0x0d, 0x4f, - 0x62, 0x03, 0x2b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x23, 0x86, 0x27, 0x47, 0x77, 0x00, - 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.proto deleted file mode 100644 index 5e811ef..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m3.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; -package test.a; -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2"; -message M3 {} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go deleted file mode 100644 index 65a3bad..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_a_2/m4.proto - -package test_a_2 // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type M4 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M4) Reset() { *m = M4{} } -func (m *M4) String() string { return proto.CompactTextString(m) } -func (*M4) ProtoMessage() {} -func (*M4) Descriptor() ([]byte, []int) { - return fileDescriptor_m4_da12b386229f3791, []int{0} -} -func (m *M4) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M4.Unmarshal(m, b) -} -func (m *M4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M4.Marshal(b, m, deterministic) -} -func (dst *M4) XXX_Merge(src proto.Message) { - xxx_messageInfo_M4.Merge(dst, src) -} -func (m *M4) XXX_Size() int { - return xxx_messageInfo_M4.Size(m) -} -func (m *M4) XXX_DiscardUnknown() { - xxx_messageInfo_M4.DiscardUnknown(m) -} - -var xxx_messageInfo_M4 proto.InternalMessageInfo - -func init() { - proto.RegisterType((*M4)(nil), "test.a.M4") -} - -func init() { proto.RegisterFile("imports/test_a_2/m4.proto", fileDescriptor_m4_da12b386229f3791) } - -var fileDescriptor_m4_da12b386229f3791 = []byte{ - // 114 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8c, 0x37, 0xd2, 0xcf, 0x35, 0xd1, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x09, 0xe9, 0x25, 0x2a, 0xb1, 0x70, 0x31, 0xf9, - 0x9a, 0x38, 0xb9, 0x44, 0x39, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, - 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x15, 0x26, 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, - 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0xb3, 0x52, 0x12, 0x4b, 0x12, 0xf5, 0xd1, 0x0d, 0x4f, - 0x62, 0x03, 0x2b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x58, 0xcb, 0x10, 0xc8, 0x77, 0x00, - 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.proto deleted file mode 100644 index 8f8fe3e..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2/m4.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; -package test.a; -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2"; -message M4 {} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go deleted file mode 100644 index 831f414..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_b_1/m1.proto - -package beta // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type M1 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M1) Reset() { *m = M1{} } -func (m *M1) String() string { return proto.CompactTextString(m) } -func (*M1) ProtoMessage() {} -func (*M1) Descriptor() ([]byte, []int) { - return fileDescriptor_m1_aff127b054aec649, []int{0} -} -func (m *M1) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M1.Unmarshal(m, b) -} -func (m *M1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M1.Marshal(b, m, deterministic) -} -func (dst *M1) XXX_Merge(src proto.Message) { - xxx_messageInfo_M1.Merge(dst, src) -} -func (m *M1) XXX_Size() int { - return xxx_messageInfo_M1.Size(m) -} -func (m *M1) XXX_DiscardUnknown() { - xxx_messageInfo_M1.DiscardUnknown(m) -} - -var xxx_messageInfo_M1 proto.InternalMessageInfo - -func init() { - proto.RegisterType((*M1)(nil), "test.b.part1.M1") -} - -func init() { proto.RegisterFile("imports/test_b_1/m1.proto", fileDescriptor_m1_aff127b054aec649) } - -var fileDescriptor_m1_aff127b054aec649 = []byte{ - // 125 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8a, 0x37, 0xd4, 0xcf, 0x35, 0xd4, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0x09, 0xe9, 0x25, 0xe9, 0x15, 0x24, 0x16, 0x95, - 0x18, 0x2a, 0xb1, 0x70, 0x31, 0xf9, 0x1a, 0x3a, 0x79, 0x46, 0xb9, 0xa7, 0x67, 0x96, 0x64, 0x94, - 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x95, 0x27, - 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0x13, 0x53, 0x12, - 0x4b, 0x12, 0xf5, 0xd1, 0xad, 0xb0, 0x4e, 0x4a, 0x2d, 0x49, 0x4c, 0x62, 0x03, 0xab, 0x36, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xf1, 0x3b, 0x7f, 0x82, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.proto deleted file mode 100644 index 2c35ec4..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m1.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; -package test.b.part1; -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1;beta"; -message M1 {} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go deleted file mode 100644 index bc74105..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_b_1/m2.proto - -package beta // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type M2 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *M2) Reset() { *m = M2{} } -func (m *M2) String() string { return proto.CompactTextString(m) } -func (*M2) ProtoMessage() {} -func (*M2) Descriptor() ([]byte, []int) { - return fileDescriptor_m2_0c59cab35ba1b0d8, []int{0} -} -func (m *M2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_M2.Unmarshal(m, b) -} -func (m *M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_M2.Marshal(b, m, deterministic) -} -func (dst *M2) XXX_Merge(src proto.Message) { - xxx_messageInfo_M2.Merge(dst, src) -} -func (m *M2) XXX_Size() int { - return xxx_messageInfo_M2.Size(m) -} -func (m *M2) XXX_DiscardUnknown() { - xxx_messageInfo_M2.DiscardUnknown(m) -} - -var xxx_messageInfo_M2 proto.InternalMessageInfo - -func init() { - proto.RegisterType((*M2)(nil), "test.b.part2.M2") -} - -func init() { proto.RegisterFile("imports/test_b_1/m2.proto", fileDescriptor_m2_0c59cab35ba1b0d8) } - -var fileDescriptor_m2_0c59cab35ba1b0d8 = []byte{ - // 125 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x4f, 0x8a, 0x37, 0xd4, 0xcf, 0x35, 0xd2, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0x09, 0xe9, 0x25, 0xe9, 0x15, 0x24, 0x16, 0x95, - 0x18, 0x29, 0xb1, 0x70, 0x31, 0xf9, 0x1a, 0x39, 0x79, 0x46, 0xb9, 0xa7, 0x67, 0x96, 0x64, 0x94, - 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, 0xeb, 0x83, 0x95, 0x27, - 0x95, 0xa6, 0x41, 0x18, 0xc9, 0xba, 0xe9, 0xa9, 0x79, 0xba, 0xe9, 0xf9, 0x60, 0x13, 0x53, 0x12, - 0x4b, 0x12, 0xf5, 0xd1, 0xad, 0xb0, 0x4e, 0x4a, 0x2d, 0x49, 0x4c, 0x62, 0x03, 0xab, 0x36, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x44, 0x29, 0xbe, 0x6d, 0x82, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.proto deleted file mode 100644 index 13723be..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1/m2.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; -package test.b.part2; -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1;beta"; -message M2 {} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go deleted file mode 100644 index 72daffd..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_import_a1m1.proto - -package imports // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import test_a_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type A1M1 struct { - F *test_a_1.M1 `protobuf:"bytes,1,opt,name=f" json:"f,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *A1M1) Reset() { *m = A1M1{} } -func (m *A1M1) String() string { return proto.CompactTextString(m) } -func (*A1M1) ProtoMessage() {} -func (*A1M1) Descriptor() ([]byte, []int) { - return fileDescriptor_test_import_a1m1_d7f2b5c638a69f6e, []int{0} -} -func (m *A1M1) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_A1M1.Unmarshal(m, b) -} -func (m *A1M1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_A1M1.Marshal(b, m, deterministic) -} -func (dst *A1M1) XXX_Merge(src proto.Message) { - xxx_messageInfo_A1M1.Merge(dst, src) -} -func (m *A1M1) XXX_Size() int { - return xxx_messageInfo_A1M1.Size(m) -} -func (m *A1M1) XXX_DiscardUnknown() { - xxx_messageInfo_A1M1.DiscardUnknown(m) -} - -var xxx_messageInfo_A1M1 proto.InternalMessageInfo - -func (m *A1M1) GetF() *test_a_1.M1 { - if m != nil { - return m.F - } - return nil -} - -func init() { - proto.RegisterType((*A1M1)(nil), "test.A1M1") -} - -func init() { - proto.RegisterFile("imports/test_import_a1m1.proto", fileDescriptor_test_import_a1m1_d7f2b5c638a69f6e) -} - -var fileDescriptor_test_import_a1m1_d7f2b5c638a69f6e = []byte{ - // 149 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x87, 0x70, 0xe2, 0x13, 0x0d, 0x73, 0x0d, - 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x58, 0x40, 0xe2, 0x52, 0x92, 0x28, 0xaa, 0x12, 0xe3, - 0x0d, 0xf5, 0x61, 0x0a, 0x94, 0x14, 0xb8, 0x58, 0x1c, 0x0d, 0x7d, 0x0d, 0x85, 0x24, 0xb8, 0x18, - 0xd3, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xb8, 0xf4, 0x40, 0xca, 0xf4, 0x12, 0xf5, 0x7c, - 0x0d, 0x83, 0x18, 0xd3, 0x9c, 0xac, 0xa3, 0x2c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, - 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xc1, 0x9a, 0x93, 0x4a, 0xd3, 0x20, - 0x8c, 0x64, 0xdd, 0xf4, 0xd4, 0x3c, 0xdd, 0xf4, 0x7c, 0xb0, 0xf9, 0x29, 0x89, 0x25, 0x89, 0xfa, - 0x50, 0x0b, 0x93, 0xd8, 0xc0, 0xf2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x84, 0x2f, 0x18, - 0x23, 0xa8, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.proto deleted file mode 100644 index abf07f2..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m1.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package test; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports"; - -import "imports/test_a_1/m1.proto"; - -message A1M1 { - test.a.M1 f = 1; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go deleted file mode 100644 index 9e36ebd..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_import_a1m2.proto - -package imports // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import test_a_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type A1M2 struct { - F *test_a_1.M2 `protobuf:"bytes,1,opt,name=f" json:"f,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *A1M2) Reset() { *m = A1M2{} } -func (m *A1M2) String() string { return proto.CompactTextString(m) } -func (*A1M2) ProtoMessage() {} -func (*A1M2) Descriptor() ([]byte, []int) { - return fileDescriptor_test_import_a1m2_9a3281ce9464e116, []int{0} -} -func (m *A1M2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_A1M2.Unmarshal(m, b) -} -func (m *A1M2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_A1M2.Marshal(b, m, deterministic) -} -func (dst *A1M2) XXX_Merge(src proto.Message) { - xxx_messageInfo_A1M2.Merge(dst, src) -} -func (m *A1M2) XXX_Size() int { - return xxx_messageInfo_A1M2.Size(m) -} -func (m *A1M2) XXX_DiscardUnknown() { - xxx_messageInfo_A1M2.DiscardUnknown(m) -} - -var xxx_messageInfo_A1M2 proto.InternalMessageInfo - -func (m *A1M2) GetF() *test_a_1.M2 { - if m != nil { - return m.F - } - return nil -} - -func init() { - proto.RegisterType((*A1M2)(nil), "test.A1M2") -} - -func init() { - proto.RegisterFile("imports/test_import_a1m2.proto", fileDescriptor_test_import_a1m2_9a3281ce9464e116) -} - -var fileDescriptor_test_import_a1m2_9a3281ce9464e116 = []byte{ - // 149 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0xcc, 0x2d, 0xc8, - 0x2f, 0x2a, 0x29, 0xd6, 0x2f, 0x49, 0x2d, 0x2e, 0x89, 0x87, 0x70, 0xe2, 0x13, 0x0d, 0x73, 0x8d, - 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x58, 0x40, 0xe2, 0x52, 0x92, 0x28, 0xaa, 0x12, 0xe3, - 0x0d, 0xf5, 0x61, 0x0a, 0x94, 0x14, 0xb8, 0x58, 0x1c, 0x0d, 0x7d, 0x8d, 0x84, 0x24, 0xb8, 0x18, - 0xd3, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xb8, 0xf4, 0x40, 0xca, 0xf4, 0x12, 0xf5, 0x7c, - 0x8d, 0x82, 0x18, 0xd3, 0x9c, 0xac, 0xa3, 0x2c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, - 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xc1, 0x9a, 0x93, 0x4a, 0xd3, 0x20, - 0x8c, 0x64, 0xdd, 0xf4, 0xd4, 0x3c, 0xdd, 0xf4, 0x7c, 0xb0, 0xf9, 0x29, 0x89, 0x25, 0x89, 0xfa, - 0x50, 0x0b, 0x93, 0xd8, 0xc0, 0xf2, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x88, 0xfb, - 0xea, 0xa8, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.proto deleted file mode 100644 index 5c53950..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_a1m2.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package test; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports"; - -import "imports/test_a_1/m2.proto"; - -message A1M2 { - test.a.M2 f = 1; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.pb.go deleted file mode 100644 index f40e0b7..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.pb.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: imports/test_import_all.proto - -package imports // import "github.com/golang/protobuf/protoc-gen-go/testdata/imports" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import fmt1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/fmt" -import test_a_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_1" -import test_a_2 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_a_2" -import test_b_1 "github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_b_1" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type All struct { - Am1 *test_a_1.M1 `protobuf:"bytes,1,opt,name=am1" json:"am1,omitempty"` - Am2 *test_a_1.M2 `protobuf:"bytes,2,opt,name=am2" json:"am2,omitempty"` - Am3 *test_a_2.M3 `protobuf:"bytes,3,opt,name=am3" json:"am3,omitempty"` - Am4 *test_a_2.M4 `protobuf:"bytes,4,opt,name=am4" json:"am4,omitempty"` - Bm1 *test_b_1.M1 `protobuf:"bytes,5,opt,name=bm1" json:"bm1,omitempty"` - Bm2 *test_b_1.M2 `protobuf:"bytes,6,opt,name=bm2" json:"bm2,omitempty"` - Fmt *fmt1.M `protobuf:"bytes,7,opt,name=fmt" json:"fmt,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *All) Reset() { *m = All{} } -func (m *All) String() string { return proto.CompactTextString(m) } -func (*All) ProtoMessage() {} -func (*All) Descriptor() ([]byte, []int) { - return fileDescriptor_test_import_all_b41dc4592e4a4f3b, []int{0} -} -func (m *All) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_All.Unmarshal(m, b) -} -func (m *All) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_All.Marshal(b, m, deterministic) -} -func (dst *All) XXX_Merge(src proto.Message) { - xxx_messageInfo_All.Merge(dst, src) -} -func (m *All) XXX_Size() int { - return xxx_messageInfo_All.Size(m) -} -func (m *All) XXX_DiscardUnknown() { - xxx_messageInfo_All.DiscardUnknown(m) -} - -var xxx_messageInfo_All proto.InternalMessageInfo - -func (m *All) GetAm1() *test_a_1.M1 { - if m != nil { - return m.Am1 - } - return nil -} - -func (m *All) GetAm2() *test_a_1.M2 { - if m != nil { - return m.Am2 - } - return nil -} - -func (m *All) GetAm3() *test_a_2.M3 { - if m != nil { - return m.Am3 - } - return nil -} - -func (m *All) GetAm4() *test_a_2.M4 { - if m != nil { - return m.Am4 - } - return nil -} - -func (m *All) GetBm1() *test_b_1.M1 { - if m != nil { - return m.Bm1 - } - return nil -} - -func (m *All) GetBm2() *test_b_1.M2 { - if m != nil { - return m.Bm2 - } - return nil -} - -func (m *All) GetFmt() *fmt1.M { - if m != nil { - return m.Fmt - } - return nil -} - -func init() { - proto.RegisterType((*All)(nil), "test.All") -} - -func init() { - proto.RegisterFile("imports/test_import_all.proto", fileDescriptor_test_import_all_b41dc4592e4a4f3b) -} - -var fileDescriptor_test_import_all_b41dc4592e4a4f3b = []byte{ - // 258 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0xd0, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x06, 0x60, 0x15, 0x97, 0x20, 0x99, 0x05, 0x85, 0xc5, 0x20, 0x90, 0x50, 0x27, 0x96, 0xda, - 0xb2, 0x9d, 0x05, 0x31, 0xc1, 0xde, 0xa5, 0x23, 0x4b, 0x64, 0x97, 0xc6, 0x54, 0xf2, 0xd5, 0x51, - 0x7a, 0x7d, 0x5e, 0x5e, 0x05, 0xd9, 0x07, 0x12, 0x84, 0x66, 0x4b, 0xfe, 0xef, 0xb7, 0xce, 0x3e, - 0x7e, 0xbf, 0x83, 0x3e, 0x0d, 0x78, 0x50, 0xb8, 0x3d, 0x60, 0x4b, 0x3f, 0xad, 0x8b, 0x51, 0xf6, - 0x43, 0xc2, 0x54, 0xcf, 0x73, 0x7c, 0x7b, 0xf3, 0xa7, 0xe4, 0x5a, 0xad, 0x40, 0x53, 0xe1, 0x14, - 0x99, 0x09, 0x32, 0x0a, 0xec, 0x34, 0x35, 0x27, 0xc9, 0x4f, 0xcf, 0xf2, 0xbf, 0x67, 0x5d, 0xff, - 0x50, 0x07, 0xa8, 0x80, 0xc2, 0xc5, 0xe7, 0x8c, 0xb3, 0x97, 0x18, 0xeb, 0x3b, 0xce, 0x1c, 0x68, - 0x31, 0x7b, 0x98, 0x3d, 0x5e, 0x1a, 0x2e, 0xf3, 0x69, 0xe9, 0xe4, 0x4a, 0xaf, 0x73, 0x4c, 0x6a, - 0xc4, 0xd9, 0x48, 0x4d, 0x56, 0x43, 0x6a, 0x05, 0x1b, 0xa9, 0xcd, 0x6a, 0x49, 0x1b, 0x31, 0x1f, - 0x69, 0x93, 0xb5, 0xa9, 0x17, 0x9c, 0x79, 0xd0, 0xe2, 0xbc, 0xe8, 0x15, 0xa9, 0x97, 0xbd, 0x1b, - 0x50, 0x97, 0xe9, 0x1e, 0x34, 0x75, 0x8c, 0xa8, 0xfe, 0x77, 0x4c, 0xb9, 0x83, 0x07, 0x53, 0x0b, - 0xce, 0x3a, 0x40, 0x71, 0x51, 0x3a, 0x95, 0xec, 0x00, 0xe5, 0x6a, 0x9d, 0xa3, 0xd7, 0xe7, 0xb7, - 0xa7, 0xb0, 0xc3, 0x8f, 0xa3, 0x97, 0x9b, 0x04, 0x2a, 0xa4, 0xe8, 0xf6, 0x41, 0x95, 0xc7, 0xfb, - 0x63, 0x47, 0x1f, 0x9b, 0x65, 0xd8, 0xee, 0x97, 0x21, 0x95, 0xa5, 0xbd, 0x3b, 0x74, 0xea, 0x7b, - 0x55, 0xbe, 0x2a, 0x6e, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x95, 0x39, 0xa3, 0x82, 0x03, 0x02, - 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.proto deleted file mode 100644 index 582d722..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imports/test_import_all.proto +++ /dev/null @@ -1,58 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2018 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package test; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/imports"; - -// test_a_1/m*.proto are in the same Go package and proto package. -// test_a_*/*.proto are in different Go packages, but the same proto package. -// test_b_1/*.proto are in the same Go package, but different proto packages. -// fmt/m.proto has a package name which conflicts with "fmt". -import "imports/test_a_1/m1.proto"; -import "imports/test_a_1/m2.proto"; -import "imports/test_a_2/m3.proto"; -import "imports/test_a_2/m4.proto"; -import "imports/test_b_1/m1.proto"; -import "imports/test_b_1/m2.proto"; -import "imports/fmt/m.proto"; - -message All { - test.a.M1 am1 = 1; - test.a.M2 am2 = 2; - test.a.M3 am3 = 3; - test.a.M4 am4 = 4; - test.b.part1.M1 bm1 = 5; - test.b.part2.M2 bm2 = 6; - fmt.M fmt = 7; -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go deleted file mode 100644 index 7ec1f2d..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go +++ /dev/null @@ -1,48 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// A simple binary to link together the protocol buffers in this test. - -package testdata - -import ( - "testing" - - importspb "github.com/golang/protobuf/protoc-gen-go/testdata/imports" - multipb "github.com/golang/protobuf/protoc-gen-go/testdata/multi" - mytestpb "github.com/golang/protobuf/protoc-gen-go/testdata/my_test" -) - -func TestLink(t *testing.T) { - _ = &multipb.Multi1{} - _ = &mytestpb.Request{} - _ = &importspb.All{} -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.pb.go deleted file mode 100644 index da0fdf8..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.pb.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: multi/multi1.proto - -package multitest // import "github.com/golang/protobuf/protoc-gen-go/testdata/multi" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Multi1 struct { - Multi2 *Multi2 `protobuf:"bytes,1,req,name=multi2" json:"multi2,omitempty"` - Color *Multi2_Color `protobuf:"varint,2,opt,name=color,enum=multitest.Multi2_Color" json:"color,omitempty"` - HatType *Multi3_HatType `protobuf:"varint,3,opt,name=hat_type,json=hatType,enum=multitest.Multi3_HatType" json:"hat_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Multi1) Reset() { *m = Multi1{} } -func (m *Multi1) String() string { return proto.CompactTextString(m) } -func (*Multi1) ProtoMessage() {} -func (*Multi1) Descriptor() ([]byte, []int) { - return fileDescriptor_multi1_08e50c6822e808b8, []int{0} -} -func (m *Multi1) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Multi1.Unmarshal(m, b) -} -func (m *Multi1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Multi1.Marshal(b, m, deterministic) -} -func (dst *Multi1) XXX_Merge(src proto.Message) { - xxx_messageInfo_Multi1.Merge(dst, src) -} -func (m *Multi1) XXX_Size() int { - return xxx_messageInfo_Multi1.Size(m) -} -func (m *Multi1) XXX_DiscardUnknown() { - xxx_messageInfo_Multi1.DiscardUnknown(m) -} - -var xxx_messageInfo_Multi1 proto.InternalMessageInfo - -func (m *Multi1) GetMulti2() *Multi2 { - if m != nil { - return m.Multi2 - } - return nil -} - -func (m *Multi1) GetColor() Multi2_Color { - if m != nil && m.Color != nil { - return *m.Color - } - return Multi2_BLUE -} - -func (m *Multi1) GetHatType() Multi3_HatType { - if m != nil && m.HatType != nil { - return *m.HatType - } - return Multi3_FEDORA -} - -func init() { - proto.RegisterType((*Multi1)(nil), "multitest.Multi1") -} - -func init() { proto.RegisterFile("multi/multi1.proto", fileDescriptor_multi1_08e50c6822e808b8) } - -var fileDescriptor_multi1_08e50c6822e808b8 = []byte{ - // 200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2d, 0xcd, 0x29, - 0xc9, 0xd4, 0x07, 0x93, 0x86, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x60, 0x5e, 0x49, - 0x6a, 0x71, 0x89, 0x14, 0xb2, 0xb4, 0x11, 0x44, 0x1a, 0x45, 0xcc, 0x18, 0x22, 0xa6, 0x34, 0x83, - 0x91, 0x8b, 0xcd, 0x17, 0x6c, 0x86, 0x90, 0x26, 0x17, 0x1b, 0x44, 0xb9, 0x04, 0xa3, 0x02, 0x93, - 0x06, 0xb7, 0x91, 0xa0, 0x1e, 0xdc, 0x38, 0x3d, 0xb0, 0x12, 0xa3, 0x20, 0xa8, 0x02, 0x21, 0x5d, - 0x2e, 0xd6, 0xe4, 0xfc, 0x9c, 0xfc, 0x22, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x3e, 0x23, 0x71, 0x0c, - 0x95, 0x7a, 0xce, 0x20, 0xe9, 0x20, 0x88, 0x2a, 0x21, 0x13, 0x2e, 0x8e, 0x8c, 0xc4, 0x92, 0xf8, - 0x92, 0xca, 0x82, 0x54, 0x09, 0x66, 0xb0, 0x0e, 0x49, 0x74, 0x1d, 0xc6, 0x7a, 0x1e, 0x89, 0x25, - 0x21, 0x95, 0x05, 0xa9, 0x41, 0xec, 0x19, 0x10, 0x86, 0x93, 0x73, 0x94, 0x63, 0x7a, 0x66, 0x49, - 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x4e, 0x62, 0x5e, 0xba, 0x3e, 0xd8, - 0xd5, 0x49, 0xa5, 0x69, 0x10, 0x46, 0xb2, 0x6e, 0x7a, 0x6a, 0x9e, 0x6e, 0x7a, 0xbe, 0x3e, 0xc8, - 0xa0, 0x94, 0xc4, 0x92, 0x44, 0x88, 0xe7, 0xac, 0xe1, 0x86, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x60, 0x7d, 0xfc, 0x9f, 0x27, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto deleted file mode 100644 index d3a3204..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto +++ /dev/null @@ -1,46 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -import "multi/multi2.proto"; -import "multi/multi3.proto"; - -package multitest; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/multi;multitest"; - -message Multi1 { - required Multi2 multi2 = 1; - optional Multi2.Color color = 2; - optional Multi3.HatType hat_type = 3; -} - diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.pb.go deleted file mode 100644 index b66ce79..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.pb.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: multi/multi2.proto - -package multitest // import "github.com/golang/protobuf/protoc-gen-go/testdata/multi" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Multi2_Color int32 - -const ( - Multi2_BLUE Multi2_Color = 1 - Multi2_GREEN Multi2_Color = 2 - Multi2_RED Multi2_Color = 3 -) - -var Multi2_Color_name = map[int32]string{ - 1: "BLUE", - 2: "GREEN", - 3: "RED", -} -var Multi2_Color_value = map[string]int32{ - "BLUE": 1, - "GREEN": 2, - "RED": 3, -} - -func (x Multi2_Color) Enum() *Multi2_Color { - p := new(Multi2_Color) - *p = x - return p -} -func (x Multi2_Color) String() string { - return proto.EnumName(Multi2_Color_name, int32(x)) -} -func (x *Multi2_Color) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Multi2_Color_value, data, "Multi2_Color") - if err != nil { - return err - } - *x = Multi2_Color(value) - return nil -} -func (Multi2_Color) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_multi2_c47490ad66d93e67, []int{0, 0} -} - -type Multi2 struct { - RequiredValue *int32 `protobuf:"varint,1,req,name=required_value,json=requiredValue" json:"required_value,omitempty"` - Color *Multi2_Color `protobuf:"varint,2,opt,name=color,enum=multitest.Multi2_Color" json:"color,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Multi2) Reset() { *m = Multi2{} } -func (m *Multi2) String() string { return proto.CompactTextString(m) } -func (*Multi2) ProtoMessage() {} -func (*Multi2) Descriptor() ([]byte, []int) { - return fileDescriptor_multi2_c47490ad66d93e67, []int{0} -} -func (m *Multi2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Multi2.Unmarshal(m, b) -} -func (m *Multi2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Multi2.Marshal(b, m, deterministic) -} -func (dst *Multi2) XXX_Merge(src proto.Message) { - xxx_messageInfo_Multi2.Merge(dst, src) -} -func (m *Multi2) XXX_Size() int { - return xxx_messageInfo_Multi2.Size(m) -} -func (m *Multi2) XXX_DiscardUnknown() { - xxx_messageInfo_Multi2.DiscardUnknown(m) -} - -var xxx_messageInfo_Multi2 proto.InternalMessageInfo - -func (m *Multi2) GetRequiredValue() int32 { - if m != nil && m.RequiredValue != nil { - return *m.RequiredValue - } - return 0 -} - -func (m *Multi2) GetColor() Multi2_Color { - if m != nil && m.Color != nil { - return *m.Color - } - return Multi2_BLUE -} - -func init() { - proto.RegisterType((*Multi2)(nil), "multitest.Multi2") - proto.RegisterEnum("multitest.Multi2_Color", Multi2_Color_name, Multi2_Color_value) -} - -func init() { proto.RegisterFile("multi/multi2.proto", fileDescriptor_multi2_c47490ad66d93e67) } - -var fileDescriptor_multi2_c47490ad66d93e67 = []byte{ - // 202 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2d, 0xcd, 0x29, - 0xc9, 0xd4, 0x07, 0x93, 0x46, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x60, 0x5e, 0x49, - 0x6a, 0x71, 0x89, 0x52, 0x2b, 0x23, 0x17, 0x9b, 0x2f, 0x58, 0x4e, 0x48, 0x95, 0x8b, 0xaf, 0x28, - 0xb5, 0xb0, 0x34, 0xb3, 0x28, 0x35, 0x25, 0xbe, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x51, 0x81, - 0x49, 0x83, 0x35, 0x88, 0x17, 0x26, 0x1a, 0x06, 0x12, 0x14, 0xd2, 0xe5, 0x62, 0x4d, 0xce, 0xcf, - 0xc9, 0x2f, 0x92, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x33, 0x12, 0xd7, 0x83, 0x1b, 0xa6, 0x07, 0x31, - 0x48, 0xcf, 0x19, 0x24, 0x1d, 0x04, 0x51, 0xa5, 0xa4, 0xca, 0xc5, 0x0a, 0xe6, 0x0b, 0x71, 0x70, - 0xb1, 0x38, 0xf9, 0x84, 0xba, 0x0a, 0x30, 0x0a, 0x71, 0x72, 0xb1, 0xba, 0x07, 0xb9, 0xba, 0xfa, - 0x09, 0x30, 0x09, 0xb1, 0x73, 0x31, 0x07, 0xb9, 0xba, 0x08, 0x30, 0x3b, 0x39, 0x47, 0x39, 0xa6, - 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, - 0xeb, 0x83, 0x5d, 0x9b, 0x54, 0x9a, 0x06, 0x61, 0x24, 0xeb, 0xa6, 0xa7, 0xe6, 0xe9, 0xa6, 0xe7, - 0xeb, 0x83, 0xec, 0x4a, 0x49, 0x2c, 0x49, 0x84, 0x78, 0xca, 0x1a, 0x6e, 0x3f, 0x20, 0x00, 0x00, - 0xff, 0xff, 0x49, 0x3b, 0x52, 0x44, 0xec, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto deleted file mode 100644 index ec5b431..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -package multitest; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/multi;multitest"; - -message Multi2 { - required int32 required_value = 1; - - enum Color { - BLUE = 1; - GREEN = 2; - RED = 3; - }; - optional Color color = 2; -} - diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.pb.go deleted file mode 100644 index f03c350..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.pb.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: multi/multi3.proto - -package multitest // import "github.com/golang/protobuf/protoc-gen-go/testdata/multi" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Multi3_HatType int32 - -const ( - Multi3_FEDORA Multi3_HatType = 1 - Multi3_FEZ Multi3_HatType = 2 -) - -var Multi3_HatType_name = map[int32]string{ - 1: "FEDORA", - 2: "FEZ", -} -var Multi3_HatType_value = map[string]int32{ - "FEDORA": 1, - "FEZ": 2, -} - -func (x Multi3_HatType) Enum() *Multi3_HatType { - p := new(Multi3_HatType) - *p = x - return p -} -func (x Multi3_HatType) String() string { - return proto.EnumName(Multi3_HatType_name, int32(x)) -} -func (x *Multi3_HatType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Multi3_HatType_value, data, "Multi3_HatType") - if err != nil { - return err - } - *x = Multi3_HatType(value) - return nil -} -func (Multi3_HatType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_multi3_d55a72b4628b7875, []int{0, 0} -} - -type Multi3 struct { - HatType *Multi3_HatType `protobuf:"varint,1,opt,name=hat_type,json=hatType,enum=multitest.Multi3_HatType" json:"hat_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Multi3) Reset() { *m = Multi3{} } -func (m *Multi3) String() string { return proto.CompactTextString(m) } -func (*Multi3) ProtoMessage() {} -func (*Multi3) Descriptor() ([]byte, []int) { - return fileDescriptor_multi3_d55a72b4628b7875, []int{0} -} -func (m *Multi3) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Multi3.Unmarshal(m, b) -} -func (m *Multi3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Multi3.Marshal(b, m, deterministic) -} -func (dst *Multi3) XXX_Merge(src proto.Message) { - xxx_messageInfo_Multi3.Merge(dst, src) -} -func (m *Multi3) XXX_Size() int { - return xxx_messageInfo_Multi3.Size(m) -} -func (m *Multi3) XXX_DiscardUnknown() { - xxx_messageInfo_Multi3.DiscardUnknown(m) -} - -var xxx_messageInfo_Multi3 proto.InternalMessageInfo - -func (m *Multi3) GetHatType() Multi3_HatType { - if m != nil && m.HatType != nil { - return *m.HatType - } - return Multi3_FEDORA -} - -func init() { - proto.RegisterType((*Multi3)(nil), "multitest.Multi3") - proto.RegisterEnum("multitest.Multi3_HatType", Multi3_HatType_name, Multi3_HatType_value) -} - -func init() { proto.RegisterFile("multi/multi3.proto", fileDescriptor_multi3_d55a72b4628b7875) } - -var fileDescriptor_multi3_d55a72b4628b7875 = []byte{ - // 170 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2d, 0xcd, 0x29, - 0xc9, 0xd4, 0x07, 0x93, 0xc6, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x60, 0x5e, 0x49, - 0x6a, 0x71, 0x89, 0x52, 0x1c, 0x17, 0x9b, 0x2f, 0x58, 0x4a, 0xc8, 0x84, 0x8b, 0x23, 0x23, 0xb1, - 0x24, 0xbe, 0xa4, 0xb2, 0x20, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xcf, 0x48, 0x52, 0x0f, 0xae, - 0x4e, 0x0f, 0xa2, 0x48, 0xcf, 0x23, 0xb1, 0x24, 0xa4, 0xb2, 0x20, 0x35, 0x88, 0x3d, 0x03, 0xc2, - 0x50, 0x92, 0xe3, 0x62, 0x87, 0x8a, 0x09, 0x71, 0x71, 0xb1, 0xb9, 0xb9, 0xba, 0xf8, 0x07, 0x39, - 0x0a, 0x30, 0x0a, 0xb1, 0x73, 0x31, 0xbb, 0xb9, 0x46, 0x09, 0x30, 0x39, 0x39, 0x47, 0x39, 0xa6, - 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5, - 0xeb, 0x83, 0x5d, 0x91, 0x54, 0x9a, 0x06, 0x61, 0x24, 0xeb, 0xa6, 0xa7, 0xe6, 0xe9, 0xa6, 0xe7, - 0xeb, 0x83, 0x2c, 0x4a, 0x49, 0x2c, 0x49, 0x84, 0x38, 0xd6, 0x1a, 0x6e, 0x39, 0x20, 0x00, 0x00, - 0xff, 0xff, 0xd5, 0xa4, 0x1a, 0x0e, 0xc4, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto deleted file mode 100644 index 8690b88..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -package multitest; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/multi;multitest"; - -message Multi3 { - enum HatType { - FEDORA = 1; - FEZ = 2; - }; - optional HatType hat_type = 1; -} - diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go deleted file mode 100644 index 8cf6a69..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go +++ /dev/null @@ -1,1174 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: my_test/test.proto - -package test // import "github.com/golang/protobuf/protoc-gen-go/testdata/my_test" - -/* -This package holds interesting messages. -*/ - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/golang/protobuf/protoc-gen-go/testdata/multi" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type HatType int32 - -const ( - // deliberately skipping 0 - HatType_FEDORA HatType = 1 - HatType_FEZ HatType = 2 -) - -var HatType_name = map[int32]string{ - 1: "FEDORA", - 2: "FEZ", -} -var HatType_value = map[string]int32{ - "FEDORA": 1, - "FEZ": 2, -} - -func (x HatType) Enum() *HatType { - p := new(HatType) - *p = x - return p -} -func (x HatType) String() string { - return proto.EnumName(HatType_name, int32(x)) -} -func (x *HatType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(HatType_value, data, "HatType") - if err != nil { - return err - } - *x = HatType(value) - return nil -} -func (HatType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{0} -} - -// This enum represents days of the week. -type Days int32 - -const ( - Days_MONDAY Days = 1 - Days_TUESDAY Days = 2 - Days_LUNDI Days = 1 -) - -var Days_name = map[int32]string{ - 1: "MONDAY", - 2: "TUESDAY", - // Duplicate value: 1: "LUNDI", -} -var Days_value = map[string]int32{ - "MONDAY": 1, - "TUESDAY": 2, - "LUNDI": 1, -} - -func (x Days) Enum() *Days { - p := new(Days) - *p = x - return p -} -func (x Days) String() string { - return proto.EnumName(Days_name, int32(x)) -} -func (x *Days) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Days_value, data, "Days") - if err != nil { - return err - } - *x = Days(value) - return nil -} -func (Days) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{1} -} - -type Request_Color int32 - -const ( - Request_RED Request_Color = 0 - Request_GREEN Request_Color = 1 - Request_BLUE Request_Color = 2 -) - -var Request_Color_name = map[int32]string{ - 0: "RED", - 1: "GREEN", - 2: "BLUE", -} -var Request_Color_value = map[string]int32{ - "RED": 0, - "GREEN": 1, - "BLUE": 2, -} - -func (x Request_Color) Enum() *Request_Color { - p := new(Request_Color) - *p = x - return p -} -func (x Request_Color) String() string { - return proto.EnumName(Request_Color_name, int32(x)) -} -func (x *Request_Color) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Request_Color_value, data, "Request_Color") - if err != nil { - return err - } - *x = Request_Color(value) - return nil -} -func (Request_Color) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{0, 0} -} - -type Reply_Entry_Game int32 - -const ( - Reply_Entry_FOOTBALL Reply_Entry_Game = 1 - Reply_Entry_TENNIS Reply_Entry_Game = 2 -) - -var Reply_Entry_Game_name = map[int32]string{ - 1: "FOOTBALL", - 2: "TENNIS", -} -var Reply_Entry_Game_value = map[string]int32{ - "FOOTBALL": 1, - "TENNIS": 2, -} - -func (x Reply_Entry_Game) Enum() *Reply_Entry_Game { - p := new(Reply_Entry_Game) - *p = x - return p -} -func (x Reply_Entry_Game) String() string { - return proto.EnumName(Reply_Entry_Game_name, int32(x)) -} -func (x *Reply_Entry_Game) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Reply_Entry_Game_value, data, "Reply_Entry_Game") - if err != nil { - return err - } - *x = Reply_Entry_Game(value) - return nil -} -func (Reply_Entry_Game) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{1, 0, 0} -} - -// This is a message that might be sent somewhere. -type Request struct { - Key []int64 `protobuf:"varint,1,rep,name=key" json:"key,omitempty"` - // optional imp.ImportedMessage imported_message = 2; - Hue *Request_Color `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"` - Hat *HatType `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"` - // optional imp.ImportedMessage.Owner owner = 6; - Deadline *float32 `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"` - Somegroup *Request_SomeGroup `protobuf:"group,8,opt,name=SomeGroup,json=somegroup" json:"somegroup,omitempty"` - // This is a map field. It will generate map[int32]string. - NameMapping map[int32]string `protobuf:"bytes,14,rep,name=name_mapping,json=nameMapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // This is a map field whose value type is a message. - MsgMapping map[int64]*Reply `protobuf:"bytes,15,rep,name=msg_mapping,json=msgMapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Reset_ *int32 `protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"` - // This field should not conflict with any getters. - GetKey_ *string `protobuf:"bytes,16,opt,name=get_key,json=getKey" json:"get_key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{0} -} -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (dst *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(dst, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -const Default_Request_Hat HatType = HatType_FEDORA - -var Default_Request_Deadline float32 = float32(math.Inf(1)) - -func (m *Request) GetKey() []int64 { - if m != nil { - return m.Key - } - return nil -} - -func (m *Request) GetHue() Request_Color { - if m != nil && m.Hue != nil { - return *m.Hue - } - return Request_RED -} - -func (m *Request) GetHat() HatType { - if m != nil && m.Hat != nil { - return *m.Hat - } - return Default_Request_Hat -} - -func (m *Request) GetDeadline() float32 { - if m != nil && m.Deadline != nil { - return *m.Deadline - } - return Default_Request_Deadline -} - -func (m *Request) GetSomegroup() *Request_SomeGroup { - if m != nil { - return m.Somegroup - } - return nil -} - -func (m *Request) GetNameMapping() map[int32]string { - if m != nil { - return m.NameMapping - } - return nil -} - -func (m *Request) GetMsgMapping() map[int64]*Reply { - if m != nil { - return m.MsgMapping - } - return nil -} - -func (m *Request) GetReset_() int32 { - if m != nil && m.Reset_ != nil { - return *m.Reset_ - } - return 0 -} - -func (m *Request) GetGetKey_() string { - if m != nil && m.GetKey_ != nil { - return *m.GetKey_ - } - return "" -} - -type Request_SomeGroup struct { - GroupField *int32 `protobuf:"varint,9,opt,name=group_field,json=groupField" json:"group_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request_SomeGroup) Reset() { *m = Request_SomeGroup{} } -func (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) } -func (*Request_SomeGroup) ProtoMessage() {} -func (*Request_SomeGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{0, 0} -} -func (m *Request_SomeGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request_SomeGroup.Unmarshal(m, b) -} -func (m *Request_SomeGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request_SomeGroup.Marshal(b, m, deterministic) -} -func (dst *Request_SomeGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request_SomeGroup.Merge(dst, src) -} -func (m *Request_SomeGroup) XXX_Size() int { - return xxx_messageInfo_Request_SomeGroup.Size(m) -} -func (m *Request_SomeGroup) XXX_DiscardUnknown() { - xxx_messageInfo_Request_SomeGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_Request_SomeGroup proto.InternalMessageInfo - -func (m *Request_SomeGroup) GetGroupField() int32 { - if m != nil && m.GroupField != nil { - return *m.GroupField - } - return 0 -} - -type Reply struct { - Found []*Reply_Entry `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"` - CompactKeys []int32 `protobuf:"varint,2,rep,packed,name=compact_keys,json=compactKeys" json:"compact_keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Reply) Reset() { *m = Reply{} } -func (m *Reply) String() string { return proto.CompactTextString(m) } -func (*Reply) ProtoMessage() {} -func (*Reply) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{1} -} - -var extRange_Reply = []proto.ExtensionRange{ - {Start: 100, End: 536870911}, -} - -func (*Reply) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_Reply -} -func (m *Reply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Reply.Unmarshal(m, b) -} -func (m *Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Reply.Marshal(b, m, deterministic) -} -func (dst *Reply) XXX_Merge(src proto.Message) { - xxx_messageInfo_Reply.Merge(dst, src) -} -func (m *Reply) XXX_Size() int { - return xxx_messageInfo_Reply.Size(m) -} -func (m *Reply) XXX_DiscardUnknown() { - xxx_messageInfo_Reply.DiscardUnknown(m) -} - -var xxx_messageInfo_Reply proto.InternalMessageInfo - -func (m *Reply) GetFound() []*Reply_Entry { - if m != nil { - return m.Found - } - return nil -} - -func (m *Reply) GetCompactKeys() []int32 { - if m != nil { - return m.CompactKeys - } - return nil -} - -type Reply_Entry struct { - KeyThatNeeds_1234Camel_CasIng *int64 `protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng,json=keyThatNeeds1234camelCasIng" json:"key_that_needs_1234camel_CasIng,omitempty"` - Value *int64 `protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"` - XMyFieldName_2 *int64 `protobuf:"varint,3,opt,name=_my_field_name_2,json=MyFieldName2" json:"_my_field_name_2,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Reply_Entry) Reset() { *m = Reply_Entry{} } -func (m *Reply_Entry) String() string { return proto.CompactTextString(m) } -func (*Reply_Entry) ProtoMessage() {} -func (*Reply_Entry) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{1, 0} -} -func (m *Reply_Entry) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Reply_Entry.Unmarshal(m, b) -} -func (m *Reply_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Reply_Entry.Marshal(b, m, deterministic) -} -func (dst *Reply_Entry) XXX_Merge(src proto.Message) { - xxx_messageInfo_Reply_Entry.Merge(dst, src) -} -func (m *Reply_Entry) XXX_Size() int { - return xxx_messageInfo_Reply_Entry.Size(m) -} -func (m *Reply_Entry) XXX_DiscardUnknown() { - xxx_messageInfo_Reply_Entry.DiscardUnknown(m) -} - -var xxx_messageInfo_Reply_Entry proto.InternalMessageInfo - -const Default_Reply_Entry_Value int64 = 7 - -func (m *Reply_Entry) GetKeyThatNeeds_1234Camel_CasIng() int64 { - if m != nil && m.KeyThatNeeds_1234Camel_CasIng != nil { - return *m.KeyThatNeeds_1234Camel_CasIng - } - return 0 -} - -func (m *Reply_Entry) GetValue() int64 { - if m != nil && m.Value != nil { - return *m.Value - } - return Default_Reply_Entry_Value -} - -func (m *Reply_Entry) GetXMyFieldName_2() int64 { - if m != nil && m.XMyFieldName_2 != nil { - return *m.XMyFieldName_2 - } - return 0 -} - -type OtherBase struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OtherBase) Reset() { *m = OtherBase{} } -func (m *OtherBase) String() string { return proto.CompactTextString(m) } -func (*OtherBase) ProtoMessage() {} -func (*OtherBase) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{2} -} - -var extRange_OtherBase = []proto.ExtensionRange{ - {Start: 100, End: 536870911}, -} - -func (*OtherBase) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_OtherBase -} -func (m *OtherBase) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OtherBase.Unmarshal(m, b) -} -func (m *OtherBase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OtherBase.Marshal(b, m, deterministic) -} -func (dst *OtherBase) XXX_Merge(src proto.Message) { - xxx_messageInfo_OtherBase.Merge(dst, src) -} -func (m *OtherBase) XXX_Size() int { - return xxx_messageInfo_OtherBase.Size(m) -} -func (m *OtherBase) XXX_DiscardUnknown() { - xxx_messageInfo_OtherBase.DiscardUnknown(m) -} - -var xxx_messageInfo_OtherBase proto.InternalMessageInfo - -func (m *OtherBase) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type ReplyExtensions struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReplyExtensions) Reset() { *m = ReplyExtensions{} } -func (m *ReplyExtensions) String() string { return proto.CompactTextString(m) } -func (*ReplyExtensions) ProtoMessage() {} -func (*ReplyExtensions) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{3} -} -func (m *ReplyExtensions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReplyExtensions.Unmarshal(m, b) -} -func (m *ReplyExtensions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReplyExtensions.Marshal(b, m, deterministic) -} -func (dst *ReplyExtensions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReplyExtensions.Merge(dst, src) -} -func (m *ReplyExtensions) XXX_Size() int { - return xxx_messageInfo_ReplyExtensions.Size(m) -} -func (m *ReplyExtensions) XXX_DiscardUnknown() { - xxx_messageInfo_ReplyExtensions.DiscardUnknown(m) -} - -var xxx_messageInfo_ReplyExtensions proto.InternalMessageInfo - -var E_ReplyExtensions_Time = &proto.ExtensionDesc{ - ExtendedType: (*Reply)(nil), - ExtensionType: (*float64)(nil), - Field: 101, - Name: "my.test.ReplyExtensions.time", - Tag: "fixed64,101,opt,name=time", - Filename: "my_test/test.proto", -} - -var E_ReplyExtensions_Carrot = &proto.ExtensionDesc{ - ExtendedType: (*Reply)(nil), - ExtensionType: (*ReplyExtensions)(nil), - Field: 105, - Name: "my.test.ReplyExtensions.carrot", - Tag: "bytes,105,opt,name=carrot", - Filename: "my_test/test.proto", -} - -var E_ReplyExtensions_Donut = &proto.ExtensionDesc{ - ExtendedType: (*OtherBase)(nil), - ExtensionType: (*ReplyExtensions)(nil), - Field: 101, - Name: "my.test.ReplyExtensions.donut", - Tag: "bytes,101,opt,name=donut", - Filename: "my_test/test.proto", -} - -type OtherReplyExtensions struct { - Key *int32 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OtherReplyExtensions) Reset() { *m = OtherReplyExtensions{} } -func (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) } -func (*OtherReplyExtensions) ProtoMessage() {} -func (*OtherReplyExtensions) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{4} -} -func (m *OtherReplyExtensions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OtherReplyExtensions.Unmarshal(m, b) -} -func (m *OtherReplyExtensions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OtherReplyExtensions.Marshal(b, m, deterministic) -} -func (dst *OtherReplyExtensions) XXX_Merge(src proto.Message) { - xxx_messageInfo_OtherReplyExtensions.Merge(dst, src) -} -func (m *OtherReplyExtensions) XXX_Size() int { - return xxx_messageInfo_OtherReplyExtensions.Size(m) -} -func (m *OtherReplyExtensions) XXX_DiscardUnknown() { - xxx_messageInfo_OtherReplyExtensions.DiscardUnknown(m) -} - -var xxx_messageInfo_OtherReplyExtensions proto.InternalMessageInfo - -func (m *OtherReplyExtensions) GetKey() int32 { - if m != nil && m.Key != nil { - return *m.Key - } - return 0 -} - -type OldReply struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - proto.XXX_InternalExtensions `protobuf_messageset:"1" json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OldReply) Reset() { *m = OldReply{} } -func (m *OldReply) String() string { return proto.CompactTextString(m) } -func (*OldReply) ProtoMessage() {} -func (*OldReply) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{5} -} - -func (m *OldReply) MarshalJSON() ([]byte, error) { - return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions) -} -func (m *OldReply) UnmarshalJSON(buf []byte) error { - return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions) -} - -var extRange_OldReply = []proto.ExtensionRange{ - {Start: 100, End: 2147483646}, -} - -func (*OldReply) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_OldReply -} -func (m *OldReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OldReply.Unmarshal(m, b) -} -func (m *OldReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OldReply.Marshal(b, m, deterministic) -} -func (dst *OldReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_OldReply.Merge(dst, src) -} -func (m *OldReply) XXX_Size() int { - return xxx_messageInfo_OldReply.Size(m) -} -func (m *OldReply) XXX_DiscardUnknown() { - xxx_messageInfo_OldReply.DiscardUnknown(m) -} - -var xxx_messageInfo_OldReply proto.InternalMessageInfo - -type Communique struct { - MakeMeCry *bool `protobuf:"varint,1,opt,name=make_me_cry,json=makeMeCry" json:"make_me_cry,omitempty"` - // This is a oneof, called "union". - // - // Types that are valid to be assigned to Union: - // *Communique_Number - // *Communique_Name - // *Communique_Data - // *Communique_TempC - // *Communique_Height - // *Communique_Today - // *Communique_Maybe - // *Communique_Delta_ - // *Communique_Msg - // *Communique_Somegroup - Union isCommunique_Union `protobuf_oneof:"union"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Communique) Reset() { *m = Communique{} } -func (m *Communique) String() string { return proto.CompactTextString(m) } -func (*Communique) ProtoMessage() {} -func (*Communique) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{6} -} -func (m *Communique) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Communique.Unmarshal(m, b) -} -func (m *Communique) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Communique.Marshal(b, m, deterministic) -} -func (dst *Communique) XXX_Merge(src proto.Message) { - xxx_messageInfo_Communique.Merge(dst, src) -} -func (m *Communique) XXX_Size() int { - return xxx_messageInfo_Communique.Size(m) -} -func (m *Communique) XXX_DiscardUnknown() { - xxx_messageInfo_Communique.DiscardUnknown(m) -} - -var xxx_messageInfo_Communique proto.InternalMessageInfo - -type isCommunique_Union interface { - isCommunique_Union() -} - -type Communique_Number struct { - Number int32 `protobuf:"varint,5,opt,name=number,oneof"` -} -type Communique_Name struct { - Name string `protobuf:"bytes,6,opt,name=name,oneof"` -} -type Communique_Data struct { - Data []byte `protobuf:"bytes,7,opt,name=data,oneof"` -} -type Communique_TempC struct { - TempC float64 `protobuf:"fixed64,8,opt,name=temp_c,json=tempC,oneof"` -} -type Communique_Height struct { - Height float32 `protobuf:"fixed32,9,opt,name=height,oneof"` -} -type Communique_Today struct { - Today Days `protobuf:"varint,10,opt,name=today,enum=my.test.Days,oneof"` -} -type Communique_Maybe struct { - Maybe bool `protobuf:"varint,11,opt,name=maybe,oneof"` -} -type Communique_Delta_ struct { - Delta int32 `protobuf:"zigzag32,12,opt,name=delta,oneof"` -} -type Communique_Msg struct { - Msg *Reply `protobuf:"bytes,16,opt,name=msg,oneof"` -} -type Communique_Somegroup struct { - Somegroup *Communique_SomeGroup `protobuf:"group,14,opt,name=SomeGroup,json=somegroup,oneof"` -} - -func (*Communique_Number) isCommunique_Union() {} -func (*Communique_Name) isCommunique_Union() {} -func (*Communique_Data) isCommunique_Union() {} -func (*Communique_TempC) isCommunique_Union() {} -func (*Communique_Height) isCommunique_Union() {} -func (*Communique_Today) isCommunique_Union() {} -func (*Communique_Maybe) isCommunique_Union() {} -func (*Communique_Delta_) isCommunique_Union() {} -func (*Communique_Msg) isCommunique_Union() {} -func (*Communique_Somegroup) isCommunique_Union() {} - -func (m *Communique) GetUnion() isCommunique_Union { - if m != nil { - return m.Union - } - return nil -} - -func (m *Communique) GetMakeMeCry() bool { - if m != nil && m.MakeMeCry != nil { - return *m.MakeMeCry - } - return false -} - -func (m *Communique) GetNumber() int32 { - if x, ok := m.GetUnion().(*Communique_Number); ok { - return x.Number - } - return 0 -} - -func (m *Communique) GetName() string { - if x, ok := m.GetUnion().(*Communique_Name); ok { - return x.Name - } - return "" -} - -func (m *Communique) GetData() []byte { - if x, ok := m.GetUnion().(*Communique_Data); ok { - return x.Data - } - return nil -} - -func (m *Communique) GetTempC() float64 { - if x, ok := m.GetUnion().(*Communique_TempC); ok { - return x.TempC - } - return 0 -} - -func (m *Communique) GetHeight() float32 { - if x, ok := m.GetUnion().(*Communique_Height); ok { - return x.Height - } - return 0 -} - -func (m *Communique) GetToday() Days { - if x, ok := m.GetUnion().(*Communique_Today); ok { - return x.Today - } - return Days_MONDAY -} - -func (m *Communique) GetMaybe() bool { - if x, ok := m.GetUnion().(*Communique_Maybe); ok { - return x.Maybe - } - return false -} - -func (m *Communique) GetDelta() int32 { - if x, ok := m.GetUnion().(*Communique_Delta_); ok { - return x.Delta - } - return 0 -} - -func (m *Communique) GetMsg() *Reply { - if x, ok := m.GetUnion().(*Communique_Msg); ok { - return x.Msg - } - return nil -} - -func (m *Communique) GetSomegroup() *Communique_SomeGroup { - if x, ok := m.GetUnion().(*Communique_Somegroup); ok { - return x.Somegroup - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Communique) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, _Communique_OneofSizer, []interface{}{ - (*Communique_Number)(nil), - (*Communique_Name)(nil), - (*Communique_Data)(nil), - (*Communique_TempC)(nil), - (*Communique_Height)(nil), - (*Communique_Today)(nil), - (*Communique_Maybe)(nil), - (*Communique_Delta_)(nil), - (*Communique_Msg)(nil), - (*Communique_Somegroup)(nil), - } -} - -func _Communique_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Communique) - // union - switch x := m.Union.(type) { - case *Communique_Number: - b.EncodeVarint(5<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.Number)) - case *Communique_Name: - b.EncodeVarint(6<<3 | proto.WireBytes) - b.EncodeStringBytes(x.Name) - case *Communique_Data: - b.EncodeVarint(7<<3 | proto.WireBytes) - b.EncodeRawBytes(x.Data) - case *Communique_TempC: - b.EncodeVarint(8<<3 | proto.WireFixed64) - b.EncodeFixed64(math.Float64bits(x.TempC)) - case *Communique_Height: - b.EncodeVarint(9<<3 | proto.WireFixed32) - b.EncodeFixed32(uint64(math.Float32bits(x.Height))) - case *Communique_Today: - b.EncodeVarint(10<<3 | proto.WireVarint) - b.EncodeVarint(uint64(x.Today)) - case *Communique_Maybe: - t := uint64(0) - if x.Maybe { - t = 1 - } - b.EncodeVarint(11<<3 | proto.WireVarint) - b.EncodeVarint(t) - case *Communique_Delta_: - b.EncodeVarint(12<<3 | proto.WireVarint) - b.EncodeZigzag32(uint64(x.Delta)) - case *Communique_Msg: - b.EncodeVarint(16<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Msg); err != nil { - return err - } - case *Communique_Somegroup: - b.EncodeVarint(14<<3 | proto.WireStartGroup) - if err := b.Marshal(x.Somegroup); err != nil { - return err - } - b.EncodeVarint(14<<3 | proto.WireEndGroup) - case nil: - default: - return fmt.Errorf("Communique.Union has unexpected type %T", x) - } - return nil -} - -func _Communique_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Communique) - switch tag { - case 5: // union.number - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Communique_Number{int32(x)} - return true, err - case 6: // union.name - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Union = &Communique_Name{x} - return true, err - case 7: // union.data - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeRawBytes(true) - m.Union = &Communique_Data{x} - return true, err - case 8: // union.temp_c - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Union = &Communique_TempC{math.Float64frombits(x)} - return true, err - case 9: // union.height - if wire != proto.WireFixed32 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed32() - m.Union = &Communique_Height{math.Float32frombits(uint32(x))} - return true, err - case 10: // union.today - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Communique_Today{Days(x)} - return true, err - case 11: // union.maybe - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Union = &Communique_Maybe{x != 0} - return true, err - case 12: // union.delta - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeZigzag32() - m.Union = &Communique_Delta_{int32(x)} - return true, err - case 16: // union.msg - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Reply) - err := b.DecodeMessage(msg) - m.Union = &Communique_Msg{msg} - return true, err - case 14: // union.somegroup - if wire != proto.WireStartGroup { - return true, proto.ErrInternalBadWireType - } - msg := new(Communique_SomeGroup) - err := b.DecodeGroup(msg) - m.Union = &Communique_Somegroup{msg} - return true, err - default: - return false, nil - } -} - -func _Communique_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Communique) - // union - switch x := m.Union.(type) { - case *Communique_Number: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Number)) - case *Communique_Name: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Name))) - n += len(x.Name) - case *Communique_Data: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Data))) - n += len(x.Data) - case *Communique_TempC: - n += 1 // tag and wire - n += 8 - case *Communique_Height: - n += 1 // tag and wire - n += 4 - case *Communique_Today: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Today)) - case *Communique_Maybe: - n += 1 // tag and wire - n += 1 - case *Communique_Delta_: - n += 1 // tag and wire - n += proto.SizeVarint(uint64((uint32(x.Delta) << 1) ^ uint32((int32(x.Delta) >> 31)))) - case *Communique_Msg: - s := proto.Size(x.Msg) - n += 2 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Communique_Somegroup: - n += 1 // tag and wire - n += proto.Size(x.Somegroup) - n += 1 // tag and wire - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type Communique_SomeGroup struct { - Member *string `protobuf:"bytes,15,opt,name=member" json:"member,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Communique_SomeGroup) Reset() { *m = Communique_SomeGroup{} } -func (m *Communique_SomeGroup) String() string { return proto.CompactTextString(m) } -func (*Communique_SomeGroup) ProtoMessage() {} -func (*Communique_SomeGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{6, 0} -} -func (m *Communique_SomeGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Communique_SomeGroup.Unmarshal(m, b) -} -func (m *Communique_SomeGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Communique_SomeGroup.Marshal(b, m, deterministic) -} -func (dst *Communique_SomeGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_Communique_SomeGroup.Merge(dst, src) -} -func (m *Communique_SomeGroup) XXX_Size() int { - return xxx_messageInfo_Communique_SomeGroup.Size(m) -} -func (m *Communique_SomeGroup) XXX_DiscardUnknown() { - xxx_messageInfo_Communique_SomeGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_Communique_SomeGroup proto.InternalMessageInfo - -func (m *Communique_SomeGroup) GetMember() string { - if m != nil && m.Member != nil { - return *m.Member - } - return "" -} - -type Communique_Delta struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Communique_Delta) Reset() { *m = Communique_Delta{} } -func (m *Communique_Delta) String() string { return proto.CompactTextString(m) } -func (*Communique_Delta) ProtoMessage() {} -func (*Communique_Delta) Descriptor() ([]byte, []int) { - return fileDescriptor_test_2309d445eee26af7, []int{6, 1} -} -func (m *Communique_Delta) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Communique_Delta.Unmarshal(m, b) -} -func (m *Communique_Delta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Communique_Delta.Marshal(b, m, deterministic) -} -func (dst *Communique_Delta) XXX_Merge(src proto.Message) { - xxx_messageInfo_Communique_Delta.Merge(dst, src) -} -func (m *Communique_Delta) XXX_Size() int { - return xxx_messageInfo_Communique_Delta.Size(m) -} -func (m *Communique_Delta) XXX_DiscardUnknown() { - xxx_messageInfo_Communique_Delta.DiscardUnknown(m) -} - -var xxx_messageInfo_Communique_Delta proto.InternalMessageInfo - -var E_Tag = &proto.ExtensionDesc{ - ExtendedType: (*Reply)(nil), - ExtensionType: (*string)(nil), - Field: 103, - Name: "my.test.tag", - Tag: "bytes,103,opt,name=tag", - Filename: "my_test/test.proto", -} - -var E_Donut = &proto.ExtensionDesc{ - ExtendedType: (*Reply)(nil), - ExtensionType: (*OtherReplyExtensions)(nil), - Field: 106, - Name: "my.test.donut", - Tag: "bytes,106,opt,name=donut", - Filename: "my_test/test.proto", -} - -func init() { - proto.RegisterType((*Request)(nil), "my.test.Request") - proto.RegisterMapType((map[int64]*Reply)(nil), "my.test.Request.MsgMappingEntry") - proto.RegisterMapType((map[int32]string)(nil), "my.test.Request.NameMappingEntry") - proto.RegisterType((*Request_SomeGroup)(nil), "my.test.Request.SomeGroup") - proto.RegisterType((*Reply)(nil), "my.test.Reply") - proto.RegisterType((*Reply_Entry)(nil), "my.test.Reply.Entry") - proto.RegisterType((*OtherBase)(nil), "my.test.OtherBase") - proto.RegisterType((*ReplyExtensions)(nil), "my.test.ReplyExtensions") - proto.RegisterType((*OtherReplyExtensions)(nil), "my.test.OtherReplyExtensions") - proto.RegisterType((*OldReply)(nil), "my.test.OldReply") - proto.RegisterType((*Communique)(nil), "my.test.Communique") - proto.RegisterType((*Communique_SomeGroup)(nil), "my.test.Communique.SomeGroup") - proto.RegisterType((*Communique_Delta)(nil), "my.test.Communique.Delta") - proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value) - proto.RegisterEnum("my.test.Days", Days_name, Days_value) - proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value) - proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value) - proto.RegisterExtension(E_ReplyExtensions_Time) - proto.RegisterExtension(E_ReplyExtensions_Carrot) - proto.RegisterExtension(E_ReplyExtensions_Donut) - proto.RegisterExtension(E_Tag) - proto.RegisterExtension(E_Donut) -} - -func init() { proto.RegisterFile("my_test/test.proto", fileDescriptor_test_2309d445eee26af7) } - -var fileDescriptor_test_2309d445eee26af7 = []byte{ - // 1033 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0xce, 0xd8, 0x71, 0x7e, 0x4e, 0x42, 0x6b, 0x46, 0x55, 0x6b, 0x05, 0xed, 0xd6, 0x04, 0x8a, - 0x4c, 0xc5, 0xa6, 0xda, 0x80, 0xc4, 0x2a, 0x88, 0xd5, 0x36, 0x3f, 0x6d, 0xaa, 0x6d, 0x12, 0x69, - 0xda, 0x5e, 0xb0, 0x37, 0xd6, 0x34, 0x9e, 0x3a, 0xa6, 0x19, 0x3b, 0x6b, 0x8f, 0x11, 0xbe, 0xeb, - 0x53, 0xc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, - 0x76, 0xdf, 0x7d, 0x78, 0xeb, 0x07, 0x62, 0x96, 0xde, 0xb6, 0xa6, 0x11, 0x3f, 0xf1, 0xa3, 0x39, - 0x0d, 0xfd, 0x13, 0x75, 0x39, 0xde, 0xa6, 0x77, 0xf9, 0xcb, 0xf4, 0x95, 0xcf, 0xc2, 0x57, 0x7e, - 0xa4, 0x6e, 0x55, 0xb9, 0x0f, 0x27, 0xcb, 0x6b, 0xf6, 0x27, 0xf9, 0xf8, 0x37, 0x00, 0x00, 0xff, - 0xff, 0x12, 0xd5, 0x46, 0x00, 0x75, 0x07, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto deleted file mode 100644 index 1ef3fd0..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto +++ /dev/null @@ -1,158 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2010 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; - -// This package holds interesting messages. -package my.test; // dotted package name - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/my_test;test"; - -//import "imp.proto"; -import "multi/multi1.proto"; // unused import - -enum HatType { - // deliberately skipping 0 - FEDORA = 1; - FEZ = 2; -} - -// This enum represents days of the week. -enum Days { - option allow_alias = true; - - MONDAY = 1; - TUESDAY = 2; - LUNDI = 1; // same value as MONDAY -} - -// This is a message that might be sent somewhere. -message Request { - enum Color { - RED = 0; - GREEN = 1; - BLUE = 2; - } - repeated int64 key = 1; -// optional imp.ImportedMessage imported_message = 2; - optional Color hue = 3; // no default - optional HatType hat = 4 [default=FEDORA]; -// optional imp.ImportedMessage.Owner owner = 6; - optional float deadline = 7 [default=inf]; - optional group SomeGroup = 8 { - optional int32 group_field = 9; - } - - // These foreign types are in imp2.proto, - // which is publicly imported by imp.proto. -// optional imp.PubliclyImportedMessage pub = 10; -// optional imp.PubliclyImportedEnum pub_enum = 13 [default=HAIR]; - - - // This is a map field. It will generate map[int32]string. - map name_mapping = 14; - // This is a map field whose value type is a message. - map msg_mapping = 15; - - optional int32 reset = 12; - // This field should not conflict with any getters. - optional string get_key = 16; -} - -message Reply { - message Entry { - required int64 key_that_needs_1234camel_CasIng = 1; - optional int64 value = 2 [default=7]; - optional int64 _my_field_name_2 = 3; - enum Game { - FOOTBALL = 1; - TENNIS = 2; - } - } - repeated Entry found = 1; - repeated int32 compact_keys = 2 [packed=true]; - extensions 100 to max; -} - -message OtherBase { - optional string name = 1; - extensions 100 to max; -} - -message ReplyExtensions { - extend Reply { - optional double time = 101; - optional ReplyExtensions carrot = 105; - } - extend OtherBase { - optional ReplyExtensions donut = 101; - } -} - -message OtherReplyExtensions { - optional int32 key = 1; -} - -// top-level extension -extend Reply { - optional string tag = 103; - optional OtherReplyExtensions donut = 106; -// optional imp.ImportedMessage elephant = 107; // extend with message from another file. -} - -message OldReply { - // Extensions will be encoded in MessageSet wire format. - option message_set_wire_format = true; - extensions 100 to max; -} - -message Communique { - optional bool make_me_cry = 1; - - // This is a oneof, called "union". - oneof union { - int32 number = 5; - string name = 6; - bytes data = 7; - double temp_c = 8; - float height = 9; - Days today = 10; - bool maybe = 11; - sint32 delta = 12; // name will conflict with Delta below - Reply msg = 16; // requires two bytes to encode field tag - group SomeGroup = 14 { - optional string member = 15; - } - } - - message Delta {} -} - diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.pb.go deleted file mode 100644 index 3b0ad84..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.pb.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: proto3/proto3.proto - -package proto3 // import "github.com/golang/protobuf/protoc-gen-go/testdata/proto3" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Request_Flavour int32 - -const ( - Request_SWEET Request_Flavour = 0 - Request_SOUR Request_Flavour = 1 - Request_UMAMI Request_Flavour = 2 - Request_GOPHERLICIOUS Request_Flavour = 3 -) - -var Request_Flavour_name = map[int32]string{ - 0: "SWEET", - 1: "SOUR", - 2: "UMAMI", - 3: "GOPHERLICIOUS", -} -var Request_Flavour_value = map[string]int32{ - "SWEET": 0, - "SOUR": 1, - "UMAMI": 2, - "GOPHERLICIOUS": 3, -} - -func (x Request_Flavour) String() string { - return proto.EnumName(Request_Flavour_name, int32(x)) -} -func (Request_Flavour) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_proto3_a752e09251f17e01, []int{0, 0} -} - -type Request struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Key []int64 `protobuf:"varint,2,rep,packed,name=key" json:"key,omitempty"` - Taste Request_Flavour `protobuf:"varint,3,opt,name=taste,enum=proto3.Request_Flavour" json:"taste,omitempty"` - Book *Book `protobuf:"bytes,4,opt,name=book" json:"book,omitempty"` - Unpacked []int64 `protobuf:"varint,5,rep,name=unpacked" json:"unpacked,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_proto3_a752e09251f17e01, []int{0} -} -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (dst *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(dst, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -func (m *Request) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Request) GetKey() []int64 { - if m != nil { - return m.Key - } - return nil -} - -func (m *Request) GetTaste() Request_Flavour { - if m != nil { - return m.Taste - } - return Request_SWEET -} - -func (m *Request) GetBook() *Book { - if m != nil { - return m.Book - } - return nil -} - -func (m *Request) GetUnpacked() []int64 { - if m != nil { - return m.Unpacked - } - return nil -} - -type Book struct { - Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` - RawData []byte `protobuf:"bytes,2,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Book) Reset() { *m = Book{} } -func (m *Book) String() string { return proto.CompactTextString(m) } -func (*Book) ProtoMessage() {} -func (*Book) Descriptor() ([]byte, []int) { - return fileDescriptor_proto3_a752e09251f17e01, []int{1} -} -func (m *Book) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Book.Unmarshal(m, b) -} -func (m *Book) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Book.Marshal(b, m, deterministic) -} -func (dst *Book) XXX_Merge(src proto.Message) { - xxx_messageInfo_Book.Merge(dst, src) -} -func (m *Book) XXX_Size() int { - return xxx_messageInfo_Book.Size(m) -} -func (m *Book) XXX_DiscardUnknown() { - xxx_messageInfo_Book.DiscardUnknown(m) -} - -var xxx_messageInfo_Book proto.InternalMessageInfo - -func (m *Book) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *Book) GetRawData() []byte { - if m != nil { - return m.RawData - } - return nil -} - -func init() { - proto.RegisterType((*Request)(nil), "proto3.Request") - proto.RegisterType((*Book)(nil), "proto3.Book") - proto.RegisterEnum("proto3.Request_Flavour", Request_Flavour_name, Request_Flavour_value) -} - -func init() { proto.RegisterFile("proto3/proto3.proto", fileDescriptor_proto3_a752e09251f17e01) } - -var fileDescriptor_proto3_a752e09251f17e01 = []byte{ - // 306 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00,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69, 0x0d, 0x1b, 0xe0, 0x4d, - 0xc6, 0x53, 0x41, 0x49, 0x71, 0x9c, 0x8e, 0xae, 0x47, 0x43, 0xea, 0xe0, 0x01, 0xec, 0xdd, 0x8f, - 0x9f, 0x1e, 0x06, 0xe2, 0x71, 0x78, 0x33, 0x1c, 0x4f, 0x27, 0xd4, 0x6d, 0x9f, 0x83, 0x57, 0x64, - 0xe1, 0x11, 0xf8, 0x66, 0x61, 0x96, 0xbb, 0xdf, 0xd9, 0x05, 0x4f, 0xa0, 0x91, 0xc9, 0xed, 0xdb, - 0x5c, 0x1a, 0xc9, 0x1c, 0x4e, 0x82, 0x96, 0xa8, 0x67, 0x72, 0x7b, 0x2b, 0x8d, 0xec, 0x5f, 0xbe, - 0x5e, 0xc4, 0x0b, 0xf3, 0x91, 0x47, 0xe1, 0x4c, 0xaf, 0xba, 0xb1, 0x5e, 0xca, 0x34, 0xb6, 0x1d, - 0x46, 0xf9, 0xbb, 0x15, 0xb3, 0x4e, 0xac, 0xd2, 0x4e, 0xac, 0xbb, 0x46, 0x6d, 0x4c, 0xc1, 0xa8, - 0x3a, 0x8e, 0xaa, 0x76, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xec, 0x71, 0xee, 0xdb, 0x7b, 0x01, - 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.proto deleted file mode 100644 index 79954e4..0000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3/proto3.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2014 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package proto3; - -option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/proto3"; - -message Request { - enum Flavour { - SWEET = 0; - SOUR = 1; - UMAMI = 2; - GOPHERLICIOUS = 3; - } - string name = 1; - repeated int64 key = 2; - Flavour taste = 3; - Book book = 4; - repeated int64 unpacked = 5 [packed=false]; -} - -message Book { - string title = 1; - bytes raw_data = 2; -} diff --git a/vendor/github.com/golang/protobuf/ptypes/any_test.go b/vendor/github.com/golang/protobuf/ptypes/any_test.go deleted file mode 100644 index ed675b4..0000000 --- a/vendor/github.com/golang/protobuf/ptypes/any_test.go +++ /dev/null @@ -1,113 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package ptypes - -import ( - "testing" - - "github.com/golang/protobuf/proto" - pb "github.com/golang/protobuf/protoc-gen-go/descriptor" - "github.com/golang/protobuf/ptypes/any" -) - -func TestMarshalUnmarshal(t *testing.T) { - orig := &any.Any{Value: []byte("test")} - - packed, err := MarshalAny(orig) - if err != nil { - t.Errorf("MarshalAny(%+v): got: _, %v exp: _, nil", orig, err) - } - - unpacked := &any.Any{} - err = UnmarshalAny(packed, unpacked) - if err != nil || !proto.Equal(unpacked, orig) { - t.Errorf("got: %v, %+v; want nil, %+v", err, unpacked, orig) - } -} - -func TestIs(t *testing.T) { - a, err := MarshalAny(&pb.FileDescriptorProto{}) - if err != nil { - t.Fatal(err) - } - if Is(a, &pb.DescriptorProto{}) { - t.Error("FileDescriptorProto is not a DescriptorProto, but Is says it is") - } - if !Is(a, &pb.FileDescriptorProto{}) { - t.Error("FileDescriptorProto is indeed a FileDescriptorProto, but Is says it is not") - } -} - -func TestIsDifferentUrlPrefixes(t *testing.T) { - m := &pb.FileDescriptorProto{} - a := &any.Any{TypeUrl: "foo/bar/" + proto.MessageName(m)} - if !Is(a, m) { - t.Errorf("message with type url %q didn't satisfy Is for type %q", a.TypeUrl, proto.MessageName(m)) - } -} - -func TestUnmarshalDynamic(t *testing.T) { - want := &pb.FileDescriptorProto{Name: proto.String("foo")} - a, err := MarshalAny(want) - if err != nil { - t.Fatal(err) - } - var got DynamicAny - if err := UnmarshalAny(a, &got); err != nil { - t.Fatal(err) - } - if !proto.Equal(got.Message, want) { - t.Errorf("invalid result from UnmarshalAny, got %q want %q", got.Message, want) - } -} - -func TestEmpty(t *testing.T) { - want := &pb.FileDescriptorProto{} - a, err := MarshalAny(want) - if err != nil { - t.Fatal(err) - } - got, err := Empty(a) - if err != nil { - t.Fatal(err) - } - if !proto.Equal(got, want) { - t.Errorf("unequal empty message, got %q, want %q", got, want) - } - - // that's a valid type_url for a message which shouldn't be linked into this - // test binary. We want an error. - a.TypeUrl = "type.googleapis.com/google.protobuf.FieldMask" - if _, err := Empty(a); err == nil { - t.Errorf("got no error for an attempt to create a message of type %q, which shouldn't be linked in", a.TypeUrl) - } -} diff --git a/vendor/github.com/golang/protobuf/ptypes/duration_test.go b/vendor/github.com/golang/protobuf/ptypes/duration_test.go deleted file mode 100644 index e00491a..0000000 --- a/vendor/github.com/golang/protobuf/ptypes/duration_test.go +++ /dev/null @@ -1,121 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package ptypes - -import ( - "math" - "testing" - "time" - - "github.com/golang/protobuf/proto" - durpb "github.com/golang/protobuf/ptypes/duration" -) - -const ( - minGoSeconds = math.MinInt64 / int64(1e9) - maxGoSeconds = math.MaxInt64 / int64(1e9) -) - -var durationTests = []struct { - proto *durpb.Duration - isValid bool - inRange bool - dur time.Duration -}{ - // The zero duration. - {&durpb.Duration{Seconds: 0, Nanos: 0}, true, true, 0}, - // Some ordinary non-zero durations. - {&durpb.Duration{Seconds: 100, Nanos: 0}, true, true, 100 * time.Second}, - {&durpb.Duration{Seconds: -100, Nanos: 0}, true, true, -100 * time.Second}, - {&durpb.Duration{Seconds: 100, Nanos: 987}, true, true, 100*time.Second + 987}, - {&durpb.Duration{Seconds: -100, Nanos: -987}, true, true, -(100*time.Second + 987)}, - // The largest duration representable in Go. - {&durpb.Duration{Seconds: maxGoSeconds, Nanos: int32(math.MaxInt64 - 1e9*maxGoSeconds)}, true, true, math.MaxInt64}, - // The smallest duration representable in Go. - {&durpb.Duration{Seconds: minGoSeconds, Nanos: int32(math.MinInt64 - 1e9*minGoSeconds)}, true, true, math.MinInt64}, - {nil, false, false, 0}, - {&durpb.Duration{Seconds: -100, Nanos: 987}, false, false, 0}, - {&durpb.Duration{Seconds: 100, Nanos: -987}, false, false, 0}, - {&durpb.Duration{Seconds: math.MinInt64, Nanos: 0}, false, false, 0}, - {&durpb.Duration{Seconds: math.MaxInt64, Nanos: 0}, false, false, 0}, - // The largest valid duration. - {&durpb.Duration{Seconds: maxSeconds, Nanos: 1e9 - 1}, true, false, 0}, - // The smallest valid duration. - {&durpb.Duration{Seconds: minSeconds, Nanos: -(1e9 - 1)}, true, false, 0}, - // The smallest invalid duration above the valid range. - {&durpb.Duration{Seconds: maxSeconds + 1, Nanos: 0}, false, false, 0}, - // The largest invalid duration below the valid range. - {&durpb.Duration{Seconds: minSeconds - 1, Nanos: -(1e9 - 1)}, false, false, 0}, - // One nanosecond past the largest duration representable in Go. - {&durpb.Duration{Seconds: maxGoSeconds, Nanos: int32(math.MaxInt64-1e9*maxGoSeconds) + 1}, true, false, 0}, - // One nanosecond past the smallest duration representable in Go. - {&durpb.Duration{Seconds: minGoSeconds, Nanos: int32(math.MinInt64-1e9*minGoSeconds) - 1}, true, false, 0}, - // One second past the largest duration representable in Go. - {&durpb.Duration{Seconds: maxGoSeconds + 1, Nanos: int32(math.MaxInt64 - 1e9*maxGoSeconds)}, true, false, 0}, - // One second past the smallest duration representable in Go. - {&durpb.Duration{Seconds: minGoSeconds - 1, Nanos: int32(math.MinInt64 - 1e9*minGoSeconds)}, true, false, 0}, -} - -func TestValidateDuration(t *testing.T) { - for _, test := range durationTests { - err := validateDuration(test.proto) - gotValid := (err == nil) - if gotValid != test.isValid { - t.Errorf("validateDuration(%v) = %t, want %t", test.proto, gotValid, test.isValid) - } - } -} - -func TestDuration(t *testing.T) { - for _, test := range durationTests { - got, err := Duration(test.proto) - gotOK := (err == nil) - wantOK := test.isValid && test.inRange - if gotOK != wantOK { - t.Errorf("Duration(%v) ok = %t, want %t", test.proto, gotOK, wantOK) - } - if err == nil && got != test.dur { - t.Errorf("Duration(%v) = %v, want %v", test.proto, got, test.dur) - } - } -} - -func TestDurationProto(t *testing.T) { - for _, test := range durationTests { - if test.isValid && test.inRange { - got := DurationProto(test.dur) - if !proto.Equal(got, test.proto) { - t.Errorf("DurationProto(%v) = %v, want %v", test.dur, got, test.proto) - } - } - } -} diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp_test.go b/vendor/github.com/golang/protobuf/ptypes/timestamp_test.go deleted file mode 100644 index 6e3c969..0000000 --- a/vendor/github.com/golang/protobuf/ptypes/timestamp_test.go +++ /dev/null @@ -1,153 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2016 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package ptypes - -import ( - "math" - "testing" - "time" - - "github.com/golang/protobuf/proto" - tspb "github.com/golang/protobuf/ptypes/timestamp" -) - -var tests = []struct { - ts *tspb.Timestamp - valid bool - t time.Time -}{ - // The timestamp representing the Unix epoch date. - {&tspb.Timestamp{Seconds: 0, Nanos: 0}, true, utcDate(1970, 1, 1)}, - // The smallest representable timestamp. - {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: math.MinInt32}, false, - time.Unix(math.MinInt64, math.MinInt32).UTC()}, - // The smallest representable timestamp with non-negative nanos. - {&tspb.Timestamp{Seconds: math.MinInt64, Nanos: 0}, false, time.Unix(math.MinInt64, 0).UTC()}, - // The earliest valid timestamp. - {&tspb.Timestamp{Seconds: minValidSeconds, Nanos: 0}, true, utcDate(1, 1, 1)}, - //"0001-01-01T00:00:00Z"}, - // The largest representable timestamp. - {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: math.MaxInt32}, false, - time.Unix(math.MaxInt64, math.MaxInt32).UTC()}, - // The largest representable timestamp with nanos in range. - {&tspb.Timestamp{Seconds: math.MaxInt64, Nanos: 1e9 - 1}, false, - time.Unix(math.MaxInt64, 1e9-1).UTC()}, - // The largest valid timestamp. - {&tspb.Timestamp{Seconds: maxValidSeconds - 1, Nanos: 1e9 - 1}, true, - time.Date(9999, 12, 31, 23, 59, 59, 1e9-1, time.UTC)}, - // The smallest invalid timestamp that is larger than the valid range. - {&tspb.Timestamp{Seconds: maxValidSeconds, Nanos: 0}, false, time.Unix(maxValidSeconds, 0).UTC()}, - // A date before the epoch. - {&tspb.Timestamp{Seconds: -281836800, Nanos: 0}, true, utcDate(1961, 1, 26)}, - // A date after the epoch. - {&tspb.Timestamp{Seconds: 1296000000, Nanos: 0}, true, utcDate(2011, 1, 26)}, - // A date after the epoch, in the middle of the day. - {&tspb.Timestamp{Seconds: 1296012345, Nanos: 940483}, true, - time.Date(2011, 1, 26, 3, 25, 45, 940483, time.UTC)}, -} - -func TestValidateTimestamp(t *testing.T) { - for _, s := range tests { - got := validateTimestamp(s.ts) - if (got == nil) != s.valid { - t.Errorf("validateTimestamp(%v) = %v, want %v", s.ts, got, s.valid) - } - } -} - -func TestTimestamp(t *testing.T) { - for _, s := range tests { - got, err := Timestamp(s.ts) - if (err == nil) != s.valid { - t.Errorf("Timestamp(%v) error = %v, but valid = %t", s.ts, err, s.valid) - } else if s.valid && got != s.t { - t.Errorf("Timestamp(%v) = %v, want %v", s.ts, got, s.t) - } - } - // Special case: a nil Timestamp is an error, but returns the 0 Unix time. - got, err := Timestamp(nil) - want := time.Unix(0, 0).UTC() - if got != want { - t.Errorf("Timestamp(nil) = %v, want %v", got, want) - } - if err == nil { - t.Errorf("Timestamp(nil) error = nil, expected error") - } -} - -func TestTimestampProto(t *testing.T) { - for _, s := range tests { - got, err := TimestampProto(s.t) - if (err == nil) != s.valid { - t.Errorf("TimestampProto(%v) error = %v, but valid = %t", s.t, err, s.valid) - } else if s.valid && !proto.Equal(got, s.ts) { - t.Errorf("TimestampProto(%v) = %v, want %v", s.t, got, s.ts) - } - } - // No corresponding special case here: no time.Time results in a nil Timestamp. -} - -func TestTimestampString(t *testing.T) { - for _, test := range []struct { - ts *tspb.Timestamp - want string - }{ - // Not much testing needed because presumably time.Format is - // well-tested. - {&tspb.Timestamp{Seconds: 0, Nanos: 0}, "1970-01-01T00:00:00Z"}, - {&tspb.Timestamp{Seconds: minValidSeconds - 1, Nanos: 0}, "(timestamp: seconds:-62135596801 before 0001-01-01)"}, - } { - got := TimestampString(test.ts) - if got != test.want { - t.Errorf("TimestampString(%v) = %q, want %q", test.ts, got, test.want) - } - } -} - -func utcDate(year, month, day int) time.Time { - return time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.UTC) -} - -func TestTimestampNow(t *testing.T) { - // Bracket the expected time. - before := time.Now() - ts := TimestampNow() - after := time.Now() - - tm, err := Timestamp(ts) - if err != nil { - t.Errorf("between %v and %v\nTimestampNow() = %v\nwhich is invalid (%v)", before, after, ts, err) - } - if tm.Before(before) || tm.After(after) { - t.Errorf("between %v and %v\nTimestamp(TimestampNow()) = %v", before, after, tm) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/asn1/asn1_test.go b/vendor/github.com/google/certificate-transparency-go/asn1/asn1_test.go deleted file mode 100644 index 7a566d5..0000000 --- a/vendor/github.com/google/certificate-transparency-go/asn1/asn1_test.go +++ /dev/null @@ -1,1173 +0,0 @@ -// Copyright 2009 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. - -package asn1 - -import ( - "bytes" - "fmt" - "math" - "math/big" - "reflect" - "strings" - "testing" - "time" -) - -type boolTest struct { - in []byte - ok bool - out bool -} - -var boolTestData = []boolTest{ - {[]byte{0x00}, true, false}, - {[]byte{0xff}, true, true}, - {[]byte{0x00, 0x00}, false, false}, - {[]byte{0xff, 0xff}, false, false}, - {[]byte{0x01}, false, false}, -} - -func TestParseBool(t *testing.T) { - for i, test := range boolTestData { - ret, err := parseBool(test.in, "fieldname") - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) - } - if test.ok && ret != test.out { - t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) - } - } -} - -type int64Test struct { - in []byte - ok bool - out int64 -} - -var int64TestData = []int64Test{ - {[]byte{0x00}, true, 0}, - {[]byte{0x7f}, true, 127}, - {[]byte{0x00, 0x80}, true, 128}, - {[]byte{0x01, 0x00}, true, 256}, - {[]byte{0x80}, true, -128}, - {[]byte{0xff, 0x7f}, true, -129}, - {[]byte{0xff}, true, -1}, - {[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, true, -9223372036854775808}, - {[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, false, 0}, - {[]byte{}, false, 0}, - {[]byte{0x00, 0x7f}, false, 0}, - {[]byte{0xff, 0xf0}, false, 0}, -} - -func TestParseInt64(t *testing.T) { - for i, test := range int64TestData { - ret, err := parseInt64(test.in, "fieldname") - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) - } - if test.ok && ret != test.out { - t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) - } - } -} - -type int32Test struct { - in []byte - ok bool - out int32 -} - -var int32TestData = []int32Test{ - {[]byte{0x00}, true, 0}, - {[]byte{0x7f}, true, 127}, - {[]byte{0x00, 0x80}, true, 128}, - {[]byte{0x01, 0x00}, true, 256}, - {[]byte{0x80}, true, -128}, - {[]byte{0xff, 0x7f}, true, -129}, - {[]byte{0xff}, true, -1}, - {[]byte{0x80, 0x00, 0x00, 0x00}, true, -2147483648}, - {[]byte{0x80, 0x00, 0x00, 0x00, 0x00}, false, 0}, - {[]byte{}, false, 0}, - {[]byte{0x00, 0x7f}, false, 0}, - {[]byte{0xff, 0xf0}, false, 0}, -} - -func TestParseInt32(t *testing.T) { - for i, test := range int32TestData { - ret, err := parseInt32(test.in, "fieldname") - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) - } - if test.ok && int32(ret) != test.out { - t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) - } - } -} - -var bigIntTests = []struct { - in []byte - ok bool - base10 string -}{ - {[]byte{0xff}, true, "-1"}, - {[]byte{0x00}, true, "0"}, - {[]byte{0x01}, true, "1"}, - {[]byte{0x00, 0xff}, true, "255"}, - {[]byte{0xff, 0x00}, true, "-256"}, - {[]byte{0x01, 0x00}, true, "256"}, - {[]byte{}, false, ""}, - {[]byte{0x00, 0x7f}, false, ""}, - {[]byte{0xff, 0xf0}, false, ""}, -} - -func TestParseBigInt(t *testing.T) { - for i, test := range bigIntTests { - ret, err := parseBigInt(test.in, "fieldname") - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) - } - if test.ok { - if ret.String() != test.base10 { - t.Errorf("#%d: bad result from %x, got %s want %s", i, test.in, ret.String(), test.base10) - } - e, err := makeBigInt(ret, "fieldname") - if err != nil { - t.Errorf("%d: err=%q", i, err) - continue - } - result := make([]byte, e.Len()) - e.Encode(result) - if !bytes.Equal(result, test.in) { - t.Errorf("#%d: got %x from marshaling %s, want %x", i, result, ret, test.in) - } - } - } -} - -type bitStringTest struct { - in []byte - ok bool - out []byte - bitLength int -} - -var bitStringTestData = []bitStringTest{ - {[]byte{}, false, []byte{}, 0}, - {[]byte{0x00}, true, []byte{}, 0}, - {[]byte{0x07, 0x00}, true, []byte{0x00}, 1}, - {[]byte{0x07, 0x01}, false, []byte{}, 0}, - {[]byte{0x07, 0x40}, false, []byte{}, 0}, - {[]byte{0x08, 0x00}, false, []byte{}, 0}, -} - -func TestBitString(t *testing.T) { - for i, test := range bitStringTestData { - ret, err := parseBitString(test.in, "fieldname") - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) - } - if err == nil { - if test.bitLength != ret.BitLength || !bytes.Equal(ret.Bytes, test.out) { - t.Errorf("#%d: Bad result: %v (expected %v %v)", i, ret, test.out, test.bitLength) - } - } - } -} - -func TestBitStringAt(t *testing.T) { - bs := BitString{[]byte{0x82, 0x40}, 16} - if bs.At(0) != 1 { - t.Error("#1: Failed") - } - if bs.At(1) != 0 { - t.Error("#2: Failed") - } - if bs.At(6) != 1 { - t.Error("#3: Failed") - } - if bs.At(9) != 1 { - t.Error("#4: Failed") - } - if bs.At(-1) != 0 { - t.Error("#5: Failed") - } - if bs.At(17) != 0 { - t.Error("#6: Failed") - } -} - -type bitStringRightAlignTest struct { - in []byte - inlen int - out []byte -} - -var bitStringRightAlignTests = []bitStringRightAlignTest{ - {[]byte{0x80}, 1, []byte{0x01}}, - {[]byte{0x80, 0x80}, 9, []byte{0x01, 0x01}}, - {[]byte{}, 0, []byte{}}, - {[]byte{0xce}, 8, []byte{0xce}}, - {[]byte{0xce, 0x47}, 16, []byte{0xce, 0x47}}, - {[]byte{0x34, 0x50}, 12, []byte{0x03, 0x45}}, -} - -func TestBitStringRightAlign(t *testing.T) { - for i, test := range bitStringRightAlignTests { - bs := BitString{test.in, test.inlen} - out := bs.RightAlign() - if !bytes.Equal(out, test.out) { - t.Errorf("#%d got: %x want: %x", i, out, test.out) - } - } -} - -type objectIdentifierTest struct { - in []byte - ok bool - out []int -} - -var objectIdentifierTestData = []objectIdentifierTest{ - {[]byte{}, false, []int{}}, - {[]byte{85}, true, []int{2, 5}}, - {[]byte{85, 0x02}, true, []int{2, 5, 2}}, - {[]byte{85, 0x02, 0xc0, 0x00}, true, []int{2, 5, 2, 0x2000}}, - {[]byte{0x81, 0x34, 0x03}, true, []int{2, 100, 3}}, - {[]byte{85, 0x02, 0xc0, 0x80, 0x80, 0x80, 0x80}, false, []int{}}, -} - -func TestObjectIdentifier(t *testing.T) { - for i, test := range objectIdentifierTestData { - ret, err := parseObjectIdentifier(test.in, "fieldname") - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) - } - if err == nil { - if !reflect.DeepEqual(test.out, ret) { - t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) - } - } - } - - if s := ObjectIdentifier([]int{1, 2, 3, 4}).String(); s != "1.2.3.4" { - t.Errorf("bad ObjectIdentifier.String(). Got %s, want 1.2.3.4", s) - } -} - -type timeTest struct { - in string - ok bool - out time.Time -} - -var utcTestData = []timeTest{ - {"910506164540-0700", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", -7*60*60))}, - {"910506164540+0730", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", 7*60*60+30*60))}, - {"910506234540Z", true, time.Date(1991, 05, 06, 23, 45, 40, 0, time.UTC)}, - {"9105062345Z", true, time.Date(1991, 05, 06, 23, 45, 0, 0, time.UTC)}, - {"5105062345Z", true, time.Date(1951, 05, 06, 23, 45, 0, 0, time.UTC)}, - {"a10506234540Z", false, time.Time{}}, - {"91a506234540Z", false, time.Time{}}, - {"9105a6234540Z", false, time.Time{}}, - {"910506a34540Z", false, time.Time{}}, - {"910506334a40Z", false, time.Time{}}, - {"91050633444aZ", false, time.Time{}}, - {"910506334461Z", false, time.Time{}}, - {"910506334400Za", false, time.Time{}}, - /* These are invalid times. However, the time package normalises times - * and they were accepted in some versions. See #11134. */ - {"000100000000Z", false, time.Time{}}, - {"101302030405Z", false, time.Time{}}, - {"100002030405Z", false, time.Time{}}, - {"100100030405Z", false, time.Time{}}, - {"100132030405Z", false, time.Time{}}, - {"100231030405Z", false, time.Time{}}, - {"100102240405Z", false, time.Time{}}, - {"100102036005Z", false, time.Time{}}, - {"100102030460Z", false, time.Time{}}, - {"-100102030410Z", false, time.Time{}}, - {"10-0102030410Z", false, time.Time{}}, - {"10-0002030410Z", false, time.Time{}}, - {"1001-02030410Z", false, time.Time{}}, - {"100102-030410Z", false, time.Time{}}, - {"10010203-0410Z", false, time.Time{}}, - {"1001020304-10Z", false, time.Time{}}, -} - -func TestUTCTime(t *testing.T) { - for i, test := range utcTestData { - ret, err := parseUTCTime([]byte(test.in)) - if err != nil { - if test.ok { - t.Errorf("#%d: parseUTCTime(%q) = error %v", i, test.in, err) - } - continue - } - if !test.ok { - t.Errorf("#%d: parseUTCTime(%q) succeeded, should have failed", i, test.in) - continue - } - const format = "Jan _2 15:04:05 -0700 2006" // ignore zone name, just offset - have := ret.Format(format) - want := test.out.Format(format) - if have != want { - t.Errorf("#%d: parseUTCTime(%q) = %s, want %s", i, test.in, have, want) - } - } -} - -var generalizedTimeTestData = []timeTest{ - {"20100102030405Z", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.UTC)}, - {"20100102030405", false, time.Time{}}, - {"20100102030405+0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", 6*60*60+7*60))}, - {"20100102030405-0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", -6*60*60-7*60))}, - /* These are invalid times. However, the time package normalises times - * and they were accepted in some versions. See #11134. */ - {"00000100000000Z", false, time.Time{}}, - {"20101302030405Z", false, time.Time{}}, - {"20100002030405Z", false, time.Time{}}, - {"20100100030405Z", false, time.Time{}}, - {"20100132030405Z", false, time.Time{}}, - {"20100231030405Z", false, time.Time{}}, - {"20100102240405Z", false, time.Time{}}, - {"20100102036005Z", false, time.Time{}}, - {"20100102030460Z", false, time.Time{}}, - {"-20100102030410Z", false, time.Time{}}, - {"2010-0102030410Z", false, time.Time{}}, - {"2010-0002030410Z", false, time.Time{}}, - {"201001-02030410Z", false, time.Time{}}, - {"20100102-030410Z", false, time.Time{}}, - {"2010010203-0410Z", false, time.Time{}}, - {"201001020304-10Z", false, time.Time{}}, -} - -func TestGeneralizedTime(t *testing.T) { - for i, test := range generalizedTimeTestData { - ret, err := parseGeneralizedTime([]byte(test.in)) - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) - } - if err == nil { - if !reflect.DeepEqual(test.out, ret) { - t.Errorf("#%d: Bad result: %q → %v (expected %v)", i, test.in, ret, test.out) - } - } - } -} - -type tagAndLengthTest struct { - in []byte - ok bool - out tagAndLength -} - -var tagAndLengthData = []tagAndLengthTest{ - {[]byte{0x80, 0x01}, true, tagAndLength{2, 0, 1, false}}, - {[]byte{0xa0, 0x01}, true, tagAndLength{2, 0, 1, true}}, - {[]byte{0x02, 0x00}, true, tagAndLength{0, 2, 0, false}}, - {[]byte{0xfe, 0x00}, true, tagAndLength{3, 30, 0, true}}, - {[]byte{0x1f, 0x1f, 0x00}, true, tagAndLength{0, 31, 0, false}}, - {[]byte{0x1f, 0x81, 0x00, 0x00}, true, tagAndLength{0, 128, 0, false}}, - {[]byte{0x1f, 0x81, 0x80, 0x01, 0x00}, true, tagAndLength{0, 0x4001, 0, false}}, - {[]byte{0x00, 0x81, 0x80}, true, tagAndLength{0, 0, 128, false}}, - {[]byte{0x00, 0x82, 0x01, 0x00}, true, tagAndLength{0, 0, 256, false}}, - {[]byte{0x00, 0x83, 0x01, 0x00}, false, tagAndLength{}}, - {[]byte{0x1f, 0x85}, false, tagAndLength{}}, - {[]byte{0x30, 0x80}, false, tagAndLength{}}, - // Superfluous zeros in the length should be an error. - {[]byte{0xa0, 0x82, 0x00, 0xff}, false, tagAndLength{}}, - // Lengths up to the maximum size of an int should work. - {[]byte{0xa0, 0x84, 0x7f, 0xff, 0xff, 0xff}, true, tagAndLength{2, 0, 0x7fffffff, true}}, - // Lengths that would overflow an int should be rejected. - {[]byte{0xa0, 0x84, 0x80, 0x00, 0x00, 0x00}, false, tagAndLength{}}, - // Long length form may not be used for lengths that fit in short form. - {[]byte{0xa0, 0x81, 0x7f}, false, tagAndLength{}}, - // Tag numbers which would overflow int32 are rejected. (The value below is 2^31.) - {[]byte{0x1f, 0x88, 0x80, 0x80, 0x80, 0x00, 0x00}, false, tagAndLength{}}, - // Tag numbers that fit in an int32 are valid. (The value below is 2^31 - 1.) - {[]byte{0x1f, 0x87, 0xFF, 0xFF, 0xFF, 0x7F, 0x00}, true, tagAndLength{tag: math.MaxInt32}}, - // Long tag number form may not be used for tags that fit in short form. - {[]byte{0x1f, 0x1e, 0x00}, false, tagAndLength{}}, -} - -func TestParseTagAndLength(t *testing.T) { - for i, test := range tagAndLengthData { - tagAndLength, _, err := parseTagAndLength(test.in, 0, "fieldname") - if (err == nil) != test.ok { - t.Errorf("#%d: Incorrect error result (did pass? %v, expected: %v)", i, err == nil, test.ok) - } - if err == nil && !reflect.DeepEqual(test.out, tagAndLength) { - t.Errorf("#%d: Bad result: %v (expected %v)", i, tagAndLength, test.out) - } - } -} - -type parseFieldParametersTest struct { - in string - out fieldParameters -} - -func newInt(n int) *int { return &n } - -func newInt64(n int64) *int64 { return &n } - -func newString(s string) *string { return &s } - -func newBool(b bool) *bool { return &b } - -var parseFieldParametersTestData []parseFieldParametersTest = []parseFieldParametersTest{ - {"", fieldParameters{}}, - {"ia5", fieldParameters{stringType: TagIA5String}}, - {"generalized", fieldParameters{timeType: TagGeneralizedTime}}, - {"utc", fieldParameters{timeType: TagUTCTime}}, - {"printable", fieldParameters{stringType: TagPrintableString}}, - {"numeric", fieldParameters{stringType: TagNumericString}}, - {"optional", fieldParameters{optional: true}}, - {"explicit", fieldParameters{explicit: true, tag: new(int)}}, - {"application", fieldParameters{application: true, tag: new(int)}}, - {"optional,explicit", fieldParameters{optional: true, explicit: true, tag: new(int)}}, - {"default:42", fieldParameters{defaultValue: newInt64(42)}}, - {"tag:17", fieldParameters{tag: newInt(17)}}, - {"optional,explicit,default:42,tag:17", - fieldParameters{optional: true, explicit: true, defaultValue: newInt64(42), tag: newInt(17)}}, - {"optional,explicit,default:42,tag:17,rubbish1", - fieldParameters{optional: true, explicit: true, defaultValue: newInt64(42), tag: newInt(17)}}, - {"set", fieldParameters{set: true}}, -} - -func TestParseFieldParameters(t *testing.T) { - for i, test := range parseFieldParametersTestData { - f := parseFieldParameters(test.in) - if !reflect.DeepEqual(f, test.out) { - t.Errorf("#%d: Bad result: %v (expected %v)", i, f, test.out) - } - } -} - -type TestObjectIdentifierStruct struct { - OID ObjectIdentifier -} - -type TestContextSpecificTags struct { - A int `asn1:"tag:1"` -} - -type TestContextSpecificTags2 struct { - A int `asn1:"explicit,tag:1"` - B int -} - -type TestContextSpecificTags3 struct { - S string `asn1:"tag:1,utf8"` -} - -type TestElementsAfterString struct { - S string - A, B int -} - -type TestBigInt struct { - X *big.Int -} - -type TestSet struct { - Ints []int `asn1:"set"` -} - -type TestAuthKeyID struct { - ID []byte `asn1:"optional,tag:0"` - Issuer RawValue `asn1:"optional,tag:1"` - SerialNumber *big.Int `asn1:"optional,tag:2"` -} - -var unmarshalTestData = []struct { - in []byte - out interface{} -}{ - {[]byte{0x02, 0x01, 0x42}, newInt(0x42)}, - {[]byte{0x05, 0x00}, &RawValue{0, 5, false, []byte{}, []byte{0x05, 0x00}}}, - {[]byte{0x30, 0x08, 0x06, 0x06, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d}, &TestObjectIdentifierStruct{[]int{1, 2, 840, 113549}}}, - {[]byte{0x03, 0x04, 0x06, 0x6e, 0x5d, 0xc0}, &BitString{[]byte{110, 93, 192}, 18}}, - {[]byte{0x30, 0x09, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x03}, &[]int{1, 2, 3}}, - {[]byte{0x02, 0x01, 0x10}, newInt(16)}, - {[]byte{0x13, 0x04, 't', 'e', 's', 't'}, newString("test")}, - {[]byte{0x16, 0x04, 't', 'e', 's', 't'}, newString("test")}, - // Ampersand is allowed in PrintableString due to mistakes by major CAs. - {[]byte{0x13, 0x05, 't', 'e', 's', 't', '&'}, newString("test&")}, - {[]byte{0x16, 0x04, 't', 'e', 's', 't'}, &RawValue{0, 22, false, []byte("test"), []byte("\x16\x04test")}}, - {[]byte{0x04, 0x04, 1, 2, 3, 4}, &RawValue{0, 4, false, []byte{1, 2, 3, 4}, []byte{4, 4, 1, 2, 3, 4}}}, - {[]byte{0x30, 0x03, 0x81, 0x01, 0x01}, &TestContextSpecificTags{1}}, - {[]byte{0x30, 0x08, 0xa1, 0x03, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02}, &TestContextSpecificTags2{1, 2}}, - {[]byte{0x30, 0x03, 0x81, 0x01, '@'}, &TestContextSpecificTags3{"@"}}, - {[]byte{0x01, 0x01, 0x00}, newBool(false)}, - {[]byte{0x01, 0x01, 0xff}, newBool(true)}, - {[]byte{0x30, 0x0b, 0x13, 0x03, 0x66, 0x6f, 0x6f, 0x02, 0x01, 0x22, 0x02, 0x01, 0x33}, &TestElementsAfterString{"foo", 0x22, 0x33}}, - {[]byte{0x30, 0x05, 0x02, 0x03, 0x12, 0x34, 0x56}, &TestBigInt{big.NewInt(0x123456)}}, - {[]byte{0x30, 0x0b, 0x31, 0x09, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x03}, &TestSet{Ints: []int{1, 2, 3}}}, - {[]byte{0x12, 0x0b, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' '}, newString("0123456789 ")}, - {[]byte{0x30, 0x0e, 0x80, 0x04, 0x01, 0x02, 0x03, 0x04, 0x82, 0x06, 0x01, 0x22, 0x33, 0x44, 0x55, 0x66}, - &TestAuthKeyID{ID: []byte{0x01, 0x02, 0x03, 0x04}, SerialNumber: big.NewInt(0x12233445566)}}, - {[]byte{0x30, 0x12, - 0x80, 0x04, 0x01, 0x02, 0x03, 0x04, - 0x81, 0x02, 0xFF, 0xFF, - 0x82, 0x06, 0x01, 0x22, 0x33, 0x44, 0x55, 0x66}, - &TestAuthKeyID{ - ID: []byte{0x01, 0x02, 0x03, 0x04}, - Issuer: RawValue{ - Class: ClassContextSpecific, - Tag: 1, - IsCompound: false, - Bytes: []byte{0xff, 0xff}, - FullBytes: []byte{0x81, 0x02, 0xff, 0xff}, - }, - SerialNumber: big.NewInt(0x12233445566), - }}, - {[]byte{0x30, 0x06, 0x80, 0x04, 0x01, 0x02, 0x03, 0x04}, &TestAuthKeyID{ID: []byte{0x01, 0x02, 0x03, 0x04}}}, -} - -func TestUnmarshal(t *testing.T) { - for i, test := range unmarshalTestData { - pv := reflect.New(reflect.TypeOf(test.out).Elem()) - val := pv.Interface() - _, err := Unmarshal(test.in, val) - if err != nil { - t.Errorf("Unmarshal failed at index %d %v", i, err) - } - if !reflect.DeepEqual(val, test.out) { - t.Errorf("#%d:\nhave %#v\nwant %#v", i, val, test.out) - } - } -} - -type Certificate struct { - TBSCertificate TBSCertificate - SignatureAlgorithm AlgorithmIdentifier - SignatureValue BitString -} - -type TBSCertificate struct { - Version int `asn1:"optional,explicit,default:0,tag:0"` - SerialNumber RawValue - SignatureAlgorithm AlgorithmIdentifier - Issuer RDNSequence - Validity Validity - Subject RDNSequence - PublicKey PublicKeyInfo -} - -type AlgorithmIdentifier struct { - Algorithm ObjectIdentifier -} - -type RDNSequence []RelativeDistinguishedNameSET - -type RelativeDistinguishedNameSET []AttributeTypeAndValue - -type AttributeTypeAndValue struct { - Type ObjectIdentifier - Value interface{} -} - -type Validity struct { - NotBefore, NotAfter time.Time -} - -type PublicKeyInfo struct { - Algorithm AlgorithmIdentifier - PublicKey BitString -} - -func TestCertificate(t *testing.T) { - // This is a minimal, self-signed certificate that should parse correctly. - var cert Certificate - if _, err := Unmarshal(derEncodedSelfSignedCertBytes, &cert); err != nil { - t.Errorf("Unmarshal failed: %v", err) - } - if !reflect.DeepEqual(cert, derEncodedSelfSignedCert) { - t.Errorf("Bad result:\ngot: %+v\nwant: %+v", cert, derEncodedSelfSignedCert) - } -} - -func TestCertificateWithNUL(t *testing.T) { - // This is the paypal NUL-hack certificate. It should fail to parse because - // NUL isn't a permitted character in a PrintableString. - - var cert Certificate - if _, err := Unmarshal(derEncodedPaypalNULCertBytes, &cert); err == nil { - t.Error("Unmarshal succeeded, should not have") - } -} - -type rawStructTest struct { - Raw RawContent - A int -} - -func TestRawStructs(t *testing.T) { - var s rawStructTest - input := []byte{0x30, 0x03, 0x02, 0x01, 0x50} - - rest, err := Unmarshal(input, &s) - if len(rest) != 0 { - t.Errorf("incomplete parse: %x", rest) - return - } - if err != nil { - t.Error(err) - return - } - if s.A != 0x50 { - t.Errorf("bad value for A: got %d want %d", s.A, 0x50) - } - if !bytes.Equal([]byte(s.Raw), input) { - t.Errorf("bad value for Raw: got %x want %x", s.Raw, input) - } -} - -func TestCouldBeISO8859_1(t *testing.T) { - for i := 0; i < 0xff; i++ { - b := []byte("StringWithA") - b = append(b, byte(i)) - switch { - // These values are disallowed: - case i < 0x20, i >= 0x7f && i < 0xa0: - if couldBeISO8859_1(b) { - t.Fatalf("Allowed invalid value %d", i) - } - - // These values are allowed: - case i >= 0x20 && i < 0x7f, i >= 0xa0 && i <= 0xff: - if !couldBeISO8859_1(b) { - t.Fatalf("Disallowed valid value %d", i) - } - - default: - t.Fatalf("Test logic error - value %d not covered above", i) - } - } -} - -func TestCouldBeT61(t *testing.T) { - for i := 0; i < 255; i++ { - b := []byte("StringWithA") - b = append(b, byte(i)) - - if couldBeT61(b) { - switch i { - case 0x00: - fallthrough - case 0x23, 0x24, 0x5C, 0x5E, 0x60, 0x7B, 0x7D, 0x7E, 0xA5, 0xA6, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB9, 0xBA, 0xC0, 0xC9, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, - 0xDA, 0xDB, 0xDC, 0xDE, 0xDF, 0xE5, 0xFF: - t.Fatalf("Allowed string with byte %d", i) - } - } - } -} - -func TestISO8859_1ToUTF8(t *testing.T) { - b := []byte{'c', 'a', 'f', 0xE9} // 0xE9 == é in ISO8859-1, but is invalid in UTF8 - if string(b) == "café" { - t.Fatal("Sanity failure: that shouldn't have matched") - } - if iso8859_1ToUTF8(b) != "café" { - t.Fatalf("Failed to convert properly, got %v", iso8859_1ToUTF8(b)) - } -} - -type oiEqualTest struct { - first ObjectIdentifier - second ObjectIdentifier - same bool -} - -var oiEqualTests = []oiEqualTest{ - { - ObjectIdentifier{1, 2, 3}, - ObjectIdentifier{1, 2, 3}, - true, - }, - { - ObjectIdentifier{1}, - ObjectIdentifier{1, 2, 3}, - false, - }, - { - ObjectIdentifier{1, 2, 3}, - ObjectIdentifier{10, 11, 12}, - false, - }, -} - -func TestObjectIdentifierEqual(t *testing.T) { - for _, o := range oiEqualTests { - if s := o.first.Equal(o.second); s != o.same { - t.Errorf("ObjectIdentifier.Equal: got: %t want: %t", s, o.same) - } - } -} - -var derEncodedSelfSignedCert = Certificate{ - TBSCertificate: TBSCertificate{ - Version: 0, - SerialNumber: RawValue{Class: 0, Tag: 2, IsCompound: false, Bytes: []uint8{0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}, FullBytes: []byte{2, 9, 0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}}, - SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}}, - Issuer: RDNSequence{ - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}}, - }, - Validity: Validity{ - NotBefore: time.Date(2009, 10, 8, 00, 25, 53, 0, time.UTC), - NotAfter: time.Date(2010, 10, 8, 00, 25, 53, 0, time.UTC), - }, - Subject: RDNSequence{ - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}}, - RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}}, - }, - PublicKey: PublicKeyInfo{ - Algorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1}}, - PublicKey: BitString{ - Bytes: []uint8{ - 0x30, 0x48, 0x2, 0x41, 0x0, 0xcd, 0xb7, - 0x63, 0x9c, 0x32, 0x78, 0xf0, 0x6, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42, - 0x90, 0x2b, 0x59, 0x2d, 0x8c, 0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4, - 0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea, 0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2, - 0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88, 0x96, 0x57, 0x72, 0x2a, 0x4f, - 0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45, 0xdc, 0x8f, 0xde, 0xec, - 0x35, 0x7d, 0x2, 0x3, 0x1, 0x0, 0x1, - }, - BitLength: 592, - }, - }, - }, - SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}}, - SignatureValue: BitString{ - Bytes: []uint8{ - 0xa6, 0x7b, 0x6, 0xec, 0x5e, 0xce, - 0x92, 0x77, 0x2c, 0xa4, 0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c, - 0x7b, 0x45, 0x11, 0xcd, 0x40, 0xa7, 0xf6, 0x59, 0x98, 0x4, 0x2, 0xdf, 0x2b, - 0x99, 0x8b, 0xb9, 0xa4, 0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8, - 0xd9, 0x1e, 0xde, 0x14, 0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa, - 0xfa, 0x88, 0x21, 0x49, 0x4, 0x35, - }, - BitLength: 512, - }, -} - -var derEncodedSelfSignedCertBytes = []byte{ - 0x30, 0x82, 0x02, 0x18, 0x30, - 0x82, 0x01, 0xc2, 0x02, 0x09, 0x00, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, - 0x98, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, - 0x05, 0x05, 0x00, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, - 0x04, 0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, - 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43, - 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, - 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, - 0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31, - 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c, - 0x73, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, - 0x6d, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, - 0x01, 0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, - 0x30, 0x39, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35, 0x33, 0x5a, - 0x17, 0x0d, 0x31, 0x30, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35, - 0x33, 0x5a, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, - 0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, - 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43, 0x69, - 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67, - 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31, 0x1a, - 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c, 0x73, - 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, - 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, - 0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x5c, 0x30, 0x0d, 0x06, - 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, - 0x4b, 0x00, 0x30, 0x48, 0x02, 0x41, 0x00, 0xcd, 0xb7, 0x63, 0x9c, 0x32, 0x78, - 0xf0, 0x06, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42, 0x90, 0x2b, 0x59, 0x2d, 0x8c, - 0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4, 0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea, - 0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2, 0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88, - 0x96, 0x57, 0x72, 0x2a, 0x4f, 0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45, - 0xdc, 0x8f, 0xde, 0xec, 0x35, 0x7d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, - 0x03, 0x41, 0x00, 0xa6, 0x7b, 0x06, 0xec, 0x5e, 0xce, 0x92, 0x77, 0x2c, 0xa4, - 0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c, 0x7b, 0x45, 0x11, 0xcd, - 0x40, 0xa7, 0xf6, 0x59, 0x98, 0x04, 0x02, 0xdf, 0x2b, 0x99, 0x8b, 0xb9, 0xa4, - 0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8, 0xd9, 0x1e, 0xde, 0x14, - 0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa, 0xfa, 0x88, 0x21, 0x49, - 0x04, 0x35, -} - -var derEncodedPaypalNULCertBytes = []byte{ - 0x30, 0x82, 0x06, 0x44, 0x30, - 0x82, 0x05, 0xad, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x00, 0xf0, 0x9b, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, - 0x05, 0x00, 0x30, 0x82, 0x01, 0x12, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, - 0x04, 0x06, 0x13, 0x02, 0x45, 0x53, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, - 0x04, 0x08, 0x13, 0x09, 0x42, 0x61, 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, - 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x42, 0x61, - 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03, - 0x55, 0x04, 0x0a, 0x13, 0x20, 0x49, 0x50, 0x53, 0x20, 0x43, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x73, 0x2e, 0x6c, 0x2e, 0x31, 0x2e, - 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x14, 0x25, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, - 0x20, 0x43, 0x2e, 0x49, 0x2e, 0x46, 0x2e, 0x20, 0x20, 0x42, 0x2d, 0x42, 0x36, - 0x32, 0x32, 0x31, 0x30, 0x36, 0x39, 0x35, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, - 0x55, 0x04, 0x0b, 0x13, 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, - 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, - 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, - 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, - 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, - 0x01, 0x16, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, - 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x39, - 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, 0x17, 0x0d, - 0x31, 0x31, 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, - 0x30, 0x81, 0x94, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, - 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, - 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16, - 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x53, 0x61, 0x6e, 0x20, - 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x11, 0x30, 0x0f, - 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0b, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x2f, - 0x30, 0x2d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x26, 0x77, 0x77, 0x77, 0x2e, - 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x73, 0x73, - 0x6c, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x63, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, - 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd2, 0x69, - 0xfa, 0x6f, 0x3a, 0x00, 0xb4, 0x21, 0x1b, 0xc8, 0xb1, 0x02, 0xd7, 0x3f, 0x19, - 0xb2, 0xc4, 0x6d, 0xb4, 0x54, 0xf8, 0x8b, 0x8a, 0xcc, 0xdb, 0x72, 0xc2, 0x9e, - 0x3c, 0x60, 0xb9, 0xc6, 0x91, 0x3d, 0x82, 0xb7, 0x7d, 0x99, 0xff, 0xd1, 0x29, - 0x84, 0xc1, 0x73, 0x53, 0x9c, 0x82, 0xdd, 0xfc, 0x24, 0x8c, 0x77, 0xd5, 0x41, - 0xf3, 0xe8, 0x1e, 0x42, 0xa1, 0xad, 0x2d, 0x9e, 0xff, 0x5b, 0x10, 0x26, 0xce, - 0x9d, 0x57, 0x17, 0x73, 0x16, 0x23, 0x38, 0xc8, 0xd6, 0xf1, 0xba, 0xa3, 0x96, - 0x5b, 0x16, 0x67, 0x4a, 0x4f, 0x73, 0x97, 0x3a, 0x4d, 0x14, 0xa4, 0xf4, 0xe2, - 0x3f, 0x8b, 0x05, 0x83, 0x42, 0xd1, 0xd0, 0xdc, 0x2f, 0x7a, 0xe5, 0xb6, 0x10, - 0xb2, 0x11, 0xc0, 0xdc, 0x21, 0x2a, 0x90, 0xff, 0xae, 0x97, 0x71, 0x5a, 0x49, - 0x81, 0xac, 0x40, 0xf3, 0x3b, 0xb8, 0x59, 0xb2, 0x4f, 0x02, 0x03, 0x01, 0x00, - 0x01, 0xa3, 0x82, 0x03, 0x21, 0x30, 0x82, 0x03, 0x1d, 0x30, 0x09, 0x06, 0x03, - 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86, - 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x06, 0x40, - 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, - 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08, - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, - 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x61, 0x8f, 0x61, 0x34, 0x43, 0x55, 0x14, - 0x7f, 0x27, 0x09, 0xce, 0x4c, 0x8b, 0xea, 0x9b, 0x7b, 0x19, 0x25, 0xbc, 0x6e, - 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, - 0x0e, 0x07, 0x60, 0xd4, 0x39, 0xc9, 0x1b, 0x5b, 0x5d, 0x90, 0x7b, 0x23, 0xc8, - 0xd2, 0x34, 0x9d, 0x4a, 0x9a, 0x46, 0x39, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, - 0x11, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x1d, 0x12, 0x04, - 0x15, 0x30, 0x13, 0x81, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, - 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x72, 0x06, 0x09, - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x65, 0x16, 0x63, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, - 0x4f, 0x54, 0x20, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x2e, - 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x68, - 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, - 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x2f, 0x06, 0x09, 0x60, - 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x02, 0x04, 0x22, 0x16, 0x20, 0x68, - 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, - 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, - 0x32, 0x30, 0x30, 0x32, 0x2f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x86, 0xf8, 0x42, 0x01, 0x04, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, - 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, - 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, - 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x46, 0x06, 0x09, - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x03, 0x04, 0x39, 0x16, 0x37, - 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, - 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, - 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, - 0x6d, 0x6c, 0x3f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, - 0x42, 0x01, 0x07, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, - 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, - 0x72, 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, - 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3f, 0x30, 0x41, 0x06, 0x09, 0x60, 0x86, - 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, 0x04, 0x34, 0x16, 0x32, 0x68, 0x74, - 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, - 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, - 0x30, 0x30, 0x32, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4c, 0x41, - 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x30, 0x81, 0x83, 0x06, - 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x7c, 0x30, 0x7a, 0x30, 0x39, 0xa0, 0x37, 0xa0, - 0x35, 0x86, 0x33, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, - 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, - 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, - 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, - 0x72, 0x6c, 0x30, 0x3d, 0xa0, 0x3b, 0xa0, 0x39, 0x86, 0x37, 0x68, 0x74, 0x74, - 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x69, - 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, - 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, - 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, - 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, - 0x26, 0x30, 0x24, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, - 0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, - 0x73, 0x70, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, - 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x68, 0xee, 0x79, 0x97, 0x97, 0xdd, 0x3b, - 0xef, 0x16, 0x6a, 0x06, 0xf2, 0x14, 0x9a, 0x6e, 0xcd, 0x9e, 0x12, 0xf7, 0xaa, - 0x83, 0x10, 0xbd, 0xd1, 0x7c, 0x98, 0xfa, 0xc7, 0xae, 0xd4, 0x0e, 0x2c, 0x9e, - 0x38, 0x05, 0x9d, 0x52, 0x60, 0xa9, 0x99, 0x0a, 0x81, 0xb4, 0x98, 0x90, 0x1d, - 0xae, 0xbb, 0x4a, 0xd7, 0xb9, 0xdc, 0x88, 0x9e, 0x37, 0x78, 0x41, 0x5b, 0xf7, - 0x82, 0xa5, 0xf2, 0xba, 0x41, 0x25, 0x5a, 0x90, 0x1a, 0x1e, 0x45, 0x38, 0xa1, - 0x52, 0x58, 0x75, 0x94, 0x26, 0x44, 0xfb, 0x20, 0x07, 0xba, 0x44, 0xcc, 0xe5, - 0x4a, 0x2d, 0x72, 0x3f, 0x98, 0x47, 0xf6, 0x26, 0xdc, 0x05, 0x46, 0x05, 0x07, - 0x63, 0x21, 0xab, 0x46, 0x9b, 0x9c, 0x78, 0xd5, 0x54, 0x5b, 0x3d, 0x0c, 0x1e, - 0xc8, 0x64, 0x8c, 0xb5, 0x50, 0x23, 0x82, 0x6f, 0xdb, 0xb8, 0x22, 0x1c, 0x43, - 0x96, 0x07, 0xa8, 0xbb, -} - -var stringSliceTestData = [][]string{ - {"foo", "bar"}, - {"foo", "\\bar"}, - {"foo", "\"bar\""}, - {"foo", "åäö"}, -} - -func TestStringSlice(t *testing.T) { - for _, test := range stringSliceTestData { - bs, err := Marshal(test) - if err != nil { - t.Error(err) - } - - var res []string - _, err = Unmarshal(bs, &res) - if err != nil { - t.Error(err) - } - - if fmt.Sprintf("%v", res) != fmt.Sprintf("%v", test) { - t.Errorf("incorrect marshal/unmarshal; %v != %v", res, test) - } - } -} - -type explicitTaggedTimeTest struct { - Time time.Time `asn1:"explicit,tag:0"` -} - -var explicitTaggedTimeTestData = []struct { - in []byte - out explicitTaggedTimeTest -}{ - {[]byte{0x30, 0x11, 0xa0, 0xf, 0x17, 0xd, '9', '1', '0', '5', '0', '6', '1', '6', '4', '5', '4', '0', 'Z'}, - explicitTaggedTimeTest{time.Date(1991, 05, 06, 16, 45, 40, 0, time.UTC)}}, - {[]byte{0x30, 0x17, 0xa0, 0xf, 0x18, 0x13, '2', '0', '1', '0', '0', '1', '0', '2', '0', '3', '0', '4', '0', '5', '+', '0', '6', '0', '7'}, - explicitTaggedTimeTest{time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", 6*60*60+7*60))}}, -} - -func TestExplicitTaggedTime(t *testing.T) { - // Test that a time.Time will match either tagUTCTime or - // tagGeneralizedTime. - for i, test := range explicitTaggedTimeTestData { - var got explicitTaggedTimeTest - _, err := Unmarshal(test.in, &got) - if err != nil { - t.Errorf("Unmarshal failed at index %d %v", i, err) - } - if !got.Time.Equal(test.out.Time) { - t.Errorf("#%d: got %v, want %v", i, got.Time, test.out.Time) - } - } -} - -type implicitTaggedTimeTest struct { - Time time.Time `asn1:"tag:24"` -} - -func TestImplicitTaggedTime(t *testing.T) { - // An implicitly tagged time value, that happens to have an implicit - // tag equal to a GENERALIZEDTIME, should still be parsed as a UTCTime. - // (There's no "timeType" in fieldParameters to determine what type of - // time should be expected when implicitly tagged.) - der := []byte{0x30, 0x0f, 0x80 | 24, 0xd, '9', '1', '0', '5', '0', '6', '1', '6', '4', '5', '4', '0', 'Z'} - var result implicitTaggedTimeTest - if _, err := Unmarshal(der, &result); err != nil { - t.Fatalf("Error while parsing: %s", err) - } - if expected := time.Date(1991, 05, 06, 16, 45, 40, 0, time.UTC); !result.Time.Equal(expected) { - t.Errorf("Wrong result. Got %v, want %v", result.Time, expected) - } -} - -type truncatedExplicitTagTest struct { - Test int `asn1:"explicit,tag:0"` -} - -func TestTruncatedExplicitTag(t *testing.T) { - // This crashed Unmarshal in the past. See #11154. - der := []byte{ - 0x30, // SEQUENCE - 0x02, // two bytes long - 0xa0, // context-specific, tag 0 - 0x30, // 48 bytes long - } - - var result truncatedExplicitTagTest - if _, err := Unmarshal(der, &result); err == nil { - t.Error("Unmarshal returned without error") - } -} - -type invalidUTF8Test struct { - Str string `asn1:"utf8"` -} - -func TestUnmarshalInvalidUTF8(t *testing.T) { - data := []byte("0\x05\f\x03a\xc9c") - var result invalidUTF8Test - _, err := Unmarshal(data, &result) - - const expectedSubstring = "UTF" - if err == nil { - t.Fatal("Successfully unmarshaled invalid UTF-8 data") - } else if !strings.Contains(err.Error(), expectedSubstring) { - t.Fatalf("Expected error to mention %q but error was %q", expectedSubstring, err.Error()) - } -} - -func TestMarshalNilValue(t *testing.T) { - nilValueTestData := []interface{}{ - nil, - struct{ V interface{} }{}, - } - for i, test := range nilValueTestData { - if _, err := Marshal(test); err == nil { - t.Fatalf("#%d: successfully marshaled nil value", i) - } - } -} - -type unexported struct { - X int - y int -} - -type exported struct { - X int - Y int -} - -func TestUnexportedStructField(t *testing.T) { - want := StructuralError{"struct contains unexported fields", "y"} - - _, err := Marshal(unexported{X: 5, y: 1}) - if err != want { - t.Errorf("got %v, want %v", err, want) - } - - bs, err := Marshal(exported{X: 5, Y: 1}) - if err != nil { - t.Fatal(err) - } - var u unexported - _, err = Unmarshal(bs, &u) - if err != want { - t.Errorf("got %v, want %v", err, want) - } -} - -func TestNull(t *testing.T) { - marshaled, err := Marshal(NullRawValue) - if err != nil { - t.Fatal(err) - } - if !bytes.Equal(NullBytes, marshaled) { - t.Errorf("Expected Marshal of NullRawValue to yield %x, got %x", NullBytes, marshaled) - } - - unmarshaled := RawValue{} - if _, err := Unmarshal(NullBytes, &unmarshaled); err != nil { - t.Fatal(err) - } - - unmarshaled.FullBytes = NullRawValue.FullBytes - if len(unmarshaled.Bytes) == 0 { - // DeepEqual considers a nil slice and an empty slice to be different. - unmarshaled.Bytes = NullRawValue.Bytes - } - - if !reflect.DeepEqual(NullRawValue, unmarshaled) { - t.Errorf("Expected Unmarshal of NullBytes to yield %v, got %v", NullRawValue, unmarshaled) - } -} - -func TestExplicitTagRawValueStruct(t *testing.T) { - type foo struct { - A RawValue `asn1:"optional,explicit,tag:5"` - B []byte `asn1:"optional,explicit,tag:6"` - } - before := foo{B: []byte{1, 2, 3}} - derBytes, err := Marshal(before) - if err != nil { - t.Fatal(err) - } - - var after foo - if rest, err := Unmarshal(derBytes, &after); err != nil || len(rest) != 0 { - t.Fatal(err) - } - - got := fmt.Sprintf("%#v", after) - want := fmt.Sprintf("%#v", before) - if got != want { - t.Errorf("got %s, want %s (DER: %x)", got, want, derBytes) - } -} - -func TestTaggedRawValue(t *testing.T) { - type taggedRawValue struct { - A RawValue `asn1:"tag:5"` - } - type untaggedRawValue struct { - A RawValue - } - const isCompound = 0x20 - const tag = 5 - - tests := []struct { - shouldMatch bool - derBytes []byte - }{ - {false, []byte{0x30, 3, TagInteger, 1, 1}}, - {true, []byte{0x30, 3, (ClassContextSpecific << 6) | tag, 1, 1}}, - {true, []byte{0x30, 3, (ClassContextSpecific << 6) | tag | isCompound, 1, 1}}, - {false, []byte{0x30, 3, (ClassApplication << 6) | tag | isCompound, 1, 1}}, - } - - for i, test := range tests { - var tagged taggedRawValue - if _, err := Unmarshal(test.derBytes, &tagged); (err == nil) != test.shouldMatch { - t.Errorf("#%d: unexpected result parsing %x: %s", i, test.derBytes, err) - } - - // An untagged RawValue should accept anything. - var untagged untaggedRawValue - if _, err := Unmarshal(test.derBytes, &untagged); err != nil { - t.Errorf("#%d: unexpected failure parsing %x with untagged RawValue: %s", i, test.derBytes, err) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/asn1/marshal_test.go b/vendor/github.com/google/certificate-transparency-go/asn1/marshal_test.go deleted file mode 100644 index b7ba53d..0000000 --- a/vendor/github.com/google/certificate-transparency-go/asn1/marshal_test.go +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright 2009 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. - -package asn1 - -import ( - "bytes" - "encoding/hex" - "math/big" - "strings" - "testing" - "time" -) - -type intStruct struct { - A int -} - -type twoIntStruct struct { - A int - B int -} - -type bigIntStruct struct { - A *big.Int -} - -type nestedStruct struct { - A intStruct -} - -type rawContentsStruct struct { - Raw RawContent - A int -} - -type implicitTagTest struct { - A int `asn1:"implicit,tag:5"` -} - -type explicitTagTest struct { - A int `asn1:"explicit,tag:5"` -} - -type flagTest struct { - A Flag `asn1:"tag:0,optional"` -} - -type generalizedTimeTest struct { - A time.Time `asn1:"generalized"` -} - -type ia5StringTest struct { - A string `asn1:"ia5"` -} - -type printableStringTest struct { - A string `asn1:"printable"` -} - -type genericStringTest struct { - A string -} - -type optionalRawValueTest struct { - A RawValue `asn1:"optional"` -} - -type omitEmptyTest struct { - A []string `asn1:"omitempty"` -} - -type defaultTest struct { - A int `asn1:"optional,default:1"` -} - -type applicationTest struct { - A int `asn1:"application,tag:0"` - B int `asn1:"application,tag:1,explicit"` -} - -type numericStringTest struct { - A string `asn1:"numeric"` -} - -type testAuthKeyID struct { - ID []byte `asn1:"optional,tag:0"` - Issuer RawValue `asn1:"optional,tag:1"` - SerialNumber *big.Int `asn1:"optional,tag:2"` -} - -type testSET []int - -var PST = time.FixedZone("PST", -8*60*60) - -type marshalTest struct { - in interface{} - out string // hex encoded -} - -func farFuture() time.Time { - t, err := time.Parse(time.RFC3339, "2100-04-05T12:01:01Z") - if err != nil { - panic(err) - } - return t -} - -var marshalTests = []marshalTest{ - {10, "02010a"}, - {127, "02017f"}, - {128, "02020080"}, - {-128, "020180"}, - {-129, "0202ff7f"}, - {intStruct{64}, "3003020140"}, - {bigIntStruct{big.NewInt(0x123456)}, "30050203123456"}, - {twoIntStruct{64, 65}, "3006020140020141"}, - {nestedStruct{intStruct{127}}, "3005300302017f"}, - {[]byte{1, 2, 3}, "0403010203"}, - {implicitTagTest{64}, "3003850140"}, - {explicitTagTest{64}, "3005a503020140"}, - {flagTest{true}, "30028000"}, - {flagTest{false}, "3000"}, - {time.Unix(0, 0).UTC(), "170d3730303130313030303030305a"}, - {time.Unix(1258325776, 0).UTC(), "170d3039313131353232353631365a"}, - {time.Unix(1258325776, 0).In(PST), "17113039313131353134353631362d30383030"}, - {farFuture(), "180f32313030303430353132303130315a"}, - {generalizedTimeTest{time.Unix(1258325776, 0).UTC()}, "3011180f32303039313131353232353631365a"}, - {BitString{[]byte{0x80}, 1}, "03020780"}, - {BitString{[]byte{0x81, 0xf0}, 12}, "03030481f0"}, - {ObjectIdentifier([]int{1, 2, 3, 4}), "06032a0304"}, - {ObjectIdentifier([]int{1, 2, 840, 133549, 1, 1, 5}), "06092a864888932d010105"}, - {ObjectIdentifier([]int{2, 100, 3}), "0603813403"}, - {"test", "130474657374"}, - { - "" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // This is 127 times 'x' - "137f" + - "7878787878787878787878787878787878787878787878787878787878787878" + - "7878787878787878787878787878787878787878787878787878787878787878" + - "7878787878787878787878787878787878787878787878787878787878787878" + - "78787878787878787878787878787878787878787878787878787878787878", - }, - { - "" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // This is 128 times 'x' - "138180" + - "7878787878787878787878787878787878787878787878787878787878787878" + - "7878787878787878787878787878787878787878787878787878787878787878" + - "7878787878787878787878787878787878787878787878787878787878787878" + - "7878787878787878787878787878787878787878787878787878787878787878", - }, - {ia5StringTest{"test"}, "3006160474657374"}, - {optionalRawValueTest{}, "3000"}, - {printableStringTest{"test"}, "3006130474657374"}, - {printableStringTest{"test*"}, "30071305746573742a"}, - {genericStringTest{"test"}, "3006130474657374"}, - {genericStringTest{"test*"}, "30070c05746573742a"}, - {genericStringTest{"test&"}, "30070c057465737426"}, - {rawContentsStruct{nil, 64}, "3003020140"}, - {rawContentsStruct{[]byte{0x30, 3, 1, 2, 3}, 64}, "3003010203"}, - {RawValue{Tag: 1, Class: 2, IsCompound: false, Bytes: []byte{1, 2, 3}}, "8103010203"}, - {testSET([]int{10}), "310302010a"}, - {omitEmptyTest{[]string{}}, "3000"}, - {omitEmptyTest{[]string{"1"}}, "30053003130131"}, - {"Σ", "0c02cea3"}, - {defaultTest{0}, "3003020100"}, - {defaultTest{1}, "3000"}, - {defaultTest{2}, "3003020102"}, - {applicationTest{1, 2}, "30084001016103020102"}, - {numericStringTest{"1 9"}, "30051203312039"}, - {testAuthKeyID{ID: []byte{0x01, 0x02, 0x03, 0x04}, SerialNumber: big.NewInt(0x12233445566)}, "300e8004010203048206012233445566"}, - {testAuthKeyID{ID: []byte{0x01, 0x02, 0x03, 0x04}}, "3006800401020304"}, -} - -func TestMarshal(t *testing.T) { - for i, test := range marshalTests { - data, err := Marshal(test.in) - if err != nil { - t.Errorf("#%d failed: %s", i, err) - } - out, _ := hex.DecodeString(test.out) - if !bytes.Equal(out, data) { - t.Errorf("#%d got: %x want %x\n\t%q\n\t%q", i, data, out, data, out) - - } - } -} - -type marshalWithParamsTest struct { - in interface{} - params string - out string // hex encoded -} - -var marshalWithParamsTests = []marshalWithParamsTest{ - {intStruct{10}, "set", "310302010a"}, - {intStruct{10}, "application", "600302010a"}, -} - -func TestMarshalWithParams(t *testing.T) { - for i, test := range marshalWithParamsTests { - data, err := MarshalWithParams(test.in, test.params) - if err != nil { - t.Errorf("#%d failed: %s", i, err) - } - out, _ := hex.DecodeString(test.out) - if !bytes.Equal(out, data) { - t.Errorf("#%d got: %x want %x\n\t%q\n\t%q", i, data, out, data, out) - - } - } -} - -type marshalErrTest struct { - in interface{} - err string -} - -var marshalErrTests = []marshalErrTest{ - {bigIntStruct{nil}, "empty integer"}, - {numericStringTest{"a"}, "invalid character"}, - {ia5StringTest{"\xb0"}, "invalid character"}, - {printableStringTest{"!"}, "invalid character"}, -} - -func TestMarshalError(t *testing.T) { - for i, test := range marshalErrTests { - _, err := Marshal(test.in) - if err == nil { - t.Errorf("#%d should fail, but success", i) - continue - } - - if !strings.Contains(err.Error(), test.err) { - t.Errorf("#%d got: %v want %v", i, err, test.err) - } - } -} - -func TestInvalidUTF8(t *testing.T) { - _, err := Marshal(string([]byte{0xff, 0xff})) - if err == nil { - t.Errorf("invalid UTF8 string was accepted") - } -} - -func BenchmarkMarshal(b *testing.B) { - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - for _, test := range marshalTests { - Marshal(test.in) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/client/logclient_test.go b/vendor/github.com/google/certificate-transparency-go/client/logclient_test.go deleted file mode 100644 index e3ca743..0000000 --- a/vendor/github.com/google/certificate-transparency-go/client/logclient_test.go +++ /dev/null @@ -1,789 +0,0 @@ -// Copyright 2014 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client_test - -import ( - "bytes" - "context" - "encoding/base64" - "encoding/hex" - "encoding/json" - "fmt" - "math" - "net/http" - "net/http/httptest" - "reflect" - "regexp" - "strconv" - "strings" - "testing" - "time" - - ct "github.com/google/certificate-transparency-go" - "github.com/google/certificate-transparency-go/client" - "github.com/google/certificate-transparency-go/jsonclient" - "github.com/google/certificate-transparency-go/testdata" - "github.com/google/certificate-transparency-go/tls" - "github.com/google/certificate-transparency-go/x509util" -) - -func dh(s string) []byte { - b, err := hex.DecodeString(s) - if err != nil { - panic(err) - } - return b -} - -const ( - ValidSTHResponse = `{"tree_size":3721782,"timestamp":1396609800587, - "sha256_root_hash":"SxKOxksguvHPyUaKYKXoZHzXl91Q257+JQ0AUMlFfeo=", - "tree_head_signature":"BAMARjBEAiBUYO2tODlUUw4oWGiVPUHqZadRRyXs9T2rSXchA79VsQIgLASkQv3cu4XdPFCZbgFkIUefniNPCpO3LzzHX53l+wg="}` - ValidSTHResponseTreeSize = 3721782 - ValidSTHResponseTimestamp = 1396609800587 - ValidSTHResponseSHA256RootHash = "SxKOxksguvHPyUaKYKXoZHzXl91Q257+JQ0AUMlFfeo=" - ValidSTHResponseTreeHeadSignature = "BAMARjBEAiBUYO2tODlUUw4oWGiVPUHqZadRRyXs9T2rSXchA79VsQIgLASkQv3cu4XdPFCZbgFkIUefniNPCpO3LzzHX53l+wg=" - - PrecertEntryB64 = "AAAAAAFLSYHwyAABN2DieQ8zpJj5tsFJ/s/KOZOVS1NvvzatRdCoQVt5M30ABHowggR2oAMCAQICEAUyKYw5aj4l/KoZd+gntfMwDQYJKoZIhvcNAQELBQAwbTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHzAdBgNVBAsTFkZPUiBURVNUIFBVUlBPU0VTIE9OTFkxJTAjBgNVBAMTHEdlb1RydXN0IEVWIFNTTCBURVNUIENBIC0gRzQwHhcNMTUwMjAyMDAwMDAwWhcNMTYwMjI3MjM1OTU5WjCBwzETMBEGCysGAQQBgjc8AgEDEwJHQjEbMBkGCysGAQQBgjc8AgECFApDYWxpZm9ybmlhMR4wHAYLKwYBBAGCNzwCAQEMDU1vdW50YWluIFZpZXcxCzAJBgNVBAYTAkdCMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MR0wGwYDVQQKDBRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEWMBQGA1UEAwwNc2RmZWRzZi50cnVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALGdl97zn/gpxl6gmaMlcpizP/Z1RR/cVkGiIjR67kpWIB9MGkBvLxmBXYbewaYRdo59VWyOM6fxtMeNsZzOrlQOl64fBmCy7k+M/yBFuEqdoig0l0RAbs6u0LCNRv2rNUOz2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Xu0wjnhNyhqdwnfhYMnoy4idRh4lB6pz8Gf9pnlLd/DnWSV3gS+/I/mAl1dCkKby6H2V790e6IHmIK2KYm3jm+U++FIdGpBdsQTSdmiX/rAyuxMDM0adMkNBwTfQmZQCz6nGHw1QcSPZMvZpsC8SkvekzxsjF1otOrMUPNPQvtTWrVx8GlR2qfx/4xbQa1v2frNvFBCmO59goz+jnWvfTtj2NjwDZ7vlMBsPm16dbKYC840uvRoZjxqsdc3ChCZjqimFqlNG/xoPA8+dTicZzCXE9ijPIcvW6y1aa3bGw=" - AddJSONResp = `{ - "sct_version":0, - "id":"KHYaGJAn++880NYaAY12sFBXKcenQRvMvfYE9F1CYVM=", - "timestamp":1337, - "extensions":"", - "signature":"BAMARjBEAiAIc21J5ZbdKZHw5wLxCP+MhBEsV5+nfvGyakOIv6FOvAIgWYMZb6Pw///uiNM7QTg2Of1OqmK1GbeGuEl9VJN8v8c=" - }` - ProofByHashResp = ` - { - "leaf_index": 3, - "audit_path": [ - "pMumx96PIUB3TX543ljlpQ/RgZRqitRfykupIZrXq0Q=", - "5s2NQWkjmesu+Kqgp70TCwVLwq8obpHw/JyMGwN56pQ=", - "7VelXijfmGFSl62BWIsG8LRmxJGBq9XP8FxmszuT2Cg=" - ] - }` - GetRootsResp = ` - { - "certificates":[ - "MIIFLjCCAxagAwIBAgIQNgEiBHAkH6lLUWKp42Ob1DANBgkqhkiG9w0BAQ0FADAWMRQwEgYDVQQDEwtlc2lnbml0Lm9yZzAeFw0xNDA2MjAxODM3NTRaFw0zMDA2MjAxODQ3NDZaMBYxFDASBgNVBAMTC2VzaWduaXQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtylZx/zTLxRDsok14XO0Z3PvWMIY4HWro0YLgCF8dYv3tUaNkmN3ghlQvY8UcByH2LMOBGiQAcMHxgEJ53cnWRyc2DjoGhkDkiPdS2JttNEB0B/XTaGvaHwJh2CSgIBbpZpWTaqGywbe7AgJQ81L8h7tZ4E6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joJOT3MGkKko87o8z6gEifk9zCwOiHeIgclTA0ZUTxXMRI5r+nUY0frjRCWZu4uthPlE90iJM+RyjcNTwDJGu2StvLnJ8y4t5fdnwdGssncXiBQMuM7/1eMEwAOfHgTFzJ0UBC2Umztl0hul3zAPBgNVHSMECDAGgAQBAgMEMAoGCCqGSM49BAMCA0gAMEUCIQCrwywGKvyt/BwR+e7yDs78qt4sSEVJltv7Y0W6gOI5awIgQ+IAjejYivLEfqNufFRezCBWHWhbq/HHGdNQtv6EArkAAA==", - "extra_data": "RXh0cmEK", - "audit_path": [ - "pMumx96PIUB3TX543ljlpQ/RgZRqitRfykupIZrXq0Q=", - "5s2NQWkjmesu+Kqgp70TCwVLwq8obpHw/JyMGwN56pQ=", - "7VelXijfmGFSl62BWIsG8LRmxJGBq9XP8FxmszuT2Cg=" - ] - }` -) - -func b64(s string) []byte { - b, err := base64.StdEncoding.DecodeString(s) - if err != nil { - panic(err) - } - return b -} - -// serveHandlerAt returns a test HTTP server that only expects requests at the given path, and invokes -// the provided handler for that path. -func serveHandlerAt(t *testing.T, path string, handler func(http.ResponseWriter, *http.Request)) *httptest.Server { - t.Helper() - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == path { - handler(w, r) - } else { - t.Fatalf("Incorrect URL path: %s", r.URL.Path) - } - })) -} - -// serveRspAt returns a test HTTP server that returns a canned response body rsp for a given path. -func serveRspAt(t *testing.T, path, rsp string) *httptest.Server { - t.Helper() - return serveHandlerAt(t, path, func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, rsp) - }) -} - -func sctToJSON(rawSCT []byte) ([]byte, error) { - var sct ct.SignedCertificateTimestamp - _, err := tls.Unmarshal(rawSCT, &sct) - if err != nil { - return nil, fmt.Errorf("failed to tls-unmarshal test certificate proof: %v", err) - } - data, err := json.Marshal(sct) - if err != nil { - return nil, fmt.Errorf("failed to json-marshal test certificate proof: %v", err) - } - return data, nil -} - -// serveSCTAt returns a test HTTP server that returns the given SCT as a canned response for -// a given path. -func serveSCTAt(t *testing.T, path string, rawSCT []byte) *httptest.Server { - t.Helper() - return serveHandlerAt(t, path, func(w http.ResponseWriter, r *http.Request) { - data, err := sctToJSON(rawSCT) - if err != nil { - t.Fatal(err) - } - w.Write(data) - }) -} - -func TestGetEntries(t *testing.T) { - ts := serveHandlerAt(t, "/ct/v1/get-entries", func(w http.ResponseWriter, r *http.Request) { - q := r.URL.Query() - numRE := regexp.MustCompile("[0-9]+") - if !numRE.MatchString(q["start"][0]) || !numRE.MatchString(q["end"][0]) { - t.Fatalf("Invalid parameter: start=%q, end=%q", q["start"][0], q["end"][0]) - } - fmt.Fprintf(w, `{"entries":[{"leaf_input": "%s","extra_data": "%s"},{"leaf_input": "%s","extra_data": "%s"}]}`, - PrecertEntryB64, - PrecertEntryExtraDataB64, - CertEntryB64, - CertEntryExtraDataB64) - }) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - leaves, err := lc.GetEntries(context.Background(), 0, 1) - if err != nil { - t.Errorf("GetEntries(0,1)=nil,%v; want 2 leaves,nil", err) - } else if len(leaves) != 2 { - t.Errorf("GetEntries(0,1)=%d leaves,nil; want 2 leaves,nil", len(leaves)) - } -} - -func TestGetEntriesErrors(t *testing.T) { - ctx := context.Background() - var tests = []struct { - start, end int64 - rsp, want string - }{ - {start: 1, end: 2, rsp: "", want: "EOF"}, - {start: 0, end: -1, want: "end should be >= 0"}, - {start: 3, end: 2, want: "start should be <= end"}, - {start: 4, end: 5, rsp: "not-json", want: "invalid"}, - {start: 5, end: 6, rsp: `{"entries":[{"leaf_input":"bogus","extra_data":"bogus"}]}`, want: "illegal base64"}, - {start: 6, end: 7, rsp: `{"entries":[{"leaf_input":"bbbb","extra_data":"bbbb"}]}`, want: "failed to unmarshal"}, - } - - for _, test := range tests { - ts := serveRspAt(t, "/ct/v1/get-entries", test.rsp) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Errorf("Failed to create client: %v", err) - continue - } - got, err := lc.GetEntries(ctx, test.start, test.end) - if err == nil { - t.Errorf("GetEntries(%d, %d)=%+v, nil; want nil, %q", test.start, test.end, got, test.want) - } else if !strings.Contains(err.Error(), test.want) { - t.Errorf("GetEntries(%d, %d)=nil, %q; want nil, %q", test.start, test.end, err, test.want) - } - if got != nil { - t.Errorf("GetEntries(%d, %d)=%+v, _; want nil, _", test.start, test.end, got) - } - } -} - -func TestGetRawEntriesErrors(t *testing.T) { - ctx := context.Background() - var tests = []struct { - start, end int64 - rsp, want string - }{ - {start: 1, end: 2, rsp: "", want: "EOF"}, - {start: 0, end: -1, want: "end should be >= 0"}, - {start: 3, end: 2, want: "start should be <= end"}, - {start: 4, end: 5, rsp: "not-json", want: "invalid"}, - {start: 5, end: 6, rsp: `{"entries":[{"leaf_input":"bogus","extra_data":"bogus"}]}`, want: "illegal base64"}, - } - - for _, test := range tests { - ts := serveRspAt(t, "/ct/v1/get-entries", test.rsp) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Errorf("Failed to create client: %v", err) - continue - } - got, err := lc.GetRawEntries(ctx, test.start, test.end) - if err == nil { - t.Errorf("GetRawEntries(%d, %d)=%+v, nil; want nil, %q", test.start, test.end, got, test.want) - } else if !strings.Contains(err.Error(), test.want) { - t.Errorf("GetRawEntries(%d, %d)=nil, %q; want nil, %q", test.start, test.end, err, test.want) - } - if got != nil { - t.Errorf("GetRawEntries(%d, %d)=%+v, _; want nil, _", test.start, test.end, got) - } - if len(test.rsp) > 0 { - // Expect the error to include the HTTP response - if rspErr, ok := err.(client.RspError); !ok { - t.Errorf("GetRawEntries(%d, %d)=nil, .(%T); want nil, .(RspError)", test.start, test.end, err) - } else if string(rspErr.Body) != test.rsp { - t.Errorf("GetRawEntries(%d, %d)=nil, .Body=%q; want nil, .Body=%q", test.start, test.end, rspErr.Body, test.rsp) - } - } - } -} - -func TestGetSTH(t *testing.T) { - ts := serveRspAt(t, "/ct/v1/get-sth", - fmt.Sprintf(`{"tree_size": %d, "timestamp": %d, "sha256_root_hash": "%s", "tree_head_signature": "%s"}`, - ValidSTHResponseTreeSize, - int64(ValidSTHResponseTimestamp), - ValidSTHResponseSHA256RootHash, - ValidSTHResponseTreeHeadSignature)) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - sth, err := lc.GetSTH(context.Background()) - if err != nil { - t.Fatal(err) - } - if sth.TreeSize != ValidSTHResponseTreeSize { - t.Errorf("GetSTH().TreeSize=%d; want %d", sth.TreeSize, ValidSTHResponseTreeSize) - } - if sth.Timestamp != ValidSTHResponseTimestamp { - t.Errorf("GetSTH().Timestamp=%v; want %v", sth.Timestamp, ValidSTHResponseTimestamp) - } - if sth.SHA256RootHash.Base64String() != ValidSTHResponseSHA256RootHash { - t.Errorf("GetSTH().SHA256RootHash=%v; want %v", sth.SHA256RootHash.Base64String(), ValidSTHResponseSHA256RootHash) - } - wantRawSignature, err := base64.StdEncoding.DecodeString(ValidSTHResponseTreeHeadSignature) - if err != nil { - t.Fatalf("Couldn't b64 decode 'correct' STH signature: %v", err) - } - var wantDS ct.DigitallySigned - if _, err := tls.Unmarshal(wantRawSignature, &wantDS); err != nil { - t.Fatalf("Couldn't unmarshal DigitallySigned: %v", err) - } - if sth.TreeHeadSignature.Algorithm.Hash != wantDS.Algorithm.Hash { - t.Errorf("GetSTH().TreeHeadSignature.Algorithm.Hash=%v; %v", wantDS.Algorithm.Hash, sth.TreeHeadSignature.Algorithm.Hash) - } - if sth.TreeHeadSignature.Algorithm.Signature != wantDS.Algorithm.Signature { - t.Errorf("GetSTH().TreeHeadSignature.Algorithm.Signature=%v; want %v", wantDS.Algorithm.Signature, sth.TreeHeadSignature.Algorithm.Signature) - } - if bytes.Compare(sth.TreeHeadSignature.Signature, wantDS.Signature) != 0 { - t.Errorf("GetSTH().TreeHeadSignature.Signature=%v; want %v", wantDS.Signature, sth.TreeHeadSignature.Signature) - } -} - -func TestGetSTHErrors(t *testing.T) { - ctx := context.Background() - var tests = []struct { - rsp, want string - }{ - {rsp: "", want: "EOF"}, - {rsp: "not-json", want: "invalid"}, - {rsp: `{"tree_size":228163,"timestamp":1507127718502,"sha256_root_hash":"bogus","tree_head_signature":"bogus"}`, want: "illegal base64"}, - {rsp: `{"tree_size":228163,"timestamp":1507127718502,"sha256_root_hash":"bbbb","tree_head_signature":"bbbb"}`, want: "hash is invalid length"}, - {rsp: `{"tree_size":228163,"timestamp":1507127718502,"sha256_root_hash":"tncuLXiPAo711IOxjaYTwLmwbSyyE8hEcRhaOXvFb3g=","tree_head_signature":"bbbb"}`, want: "syntax error"}, - {rsp: `{"tree_size":228163,"timestamp":1507127718502,"sha256_root_hash":"tncuLXiPAo711IOxjaYTwLmwbSyyE8hEcRhaOXvFb3g=","tree_head_signature":"BAMARjBEAiAi5045/h8Yvs1mNlsYskWvuFbu2A6hO2J45KDFfOR1OwIgZ2jq8iFCwKuTbcIgsBB1ibHEupv97CeAQynK0Dw2PT8bbbb="}`, want: "trailing data"}, - } - - for _, test := range tests { - ts := serveRspAt(t, "/ct/v1/get-sth", test.rsp) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Errorf("Failed to create client: %v", err) - continue - } - got, err := lc.GetSTH(ctx) - if err == nil { - t.Errorf("GetSTH()=%+v, nil; want nil, %q", got, test.want) - } else if !strings.Contains(err.Error(), test.want) { - t.Errorf("GetSTH()=nil, %q; want nil, %q", err, test.want) - } - if got != nil { - t.Errorf("GetSTH()=%+v, _; want nil, _", got) - } - if len(test.rsp) > 0 { - // Expect the error to include the HTTP response - if rspErr, ok := err.(client.RspError); !ok { - t.Errorf("GetSTH()=nil, .(%T); want nil, .(RspError)", err) - } else if string(rspErr.Body) != test.rsp { - t.Errorf("GetSTH()=nil, .Body=%q; want nil, .Body=%q", rspErr.Body, test.rsp) - } - } - } -} - -func TestAddChainRetries(t *testing.T) { - if testing.Short() { - t.Skip("skipping retry test in short mode") - } - retryAfter := 0 * time.Second - currentFailures := 0 - failuresBeforeSuccess := 0 - hs := serveHandlerAt(t, "/ct/v1/add-chain", func(w http.ResponseWriter, r *http.Request) { - if failuresBeforeSuccess > 0 && currentFailures < failuresBeforeSuccess { - currentFailures++ - if retryAfter != 0 { - if retryAfter > 0 { - w.Header().Add("Retry-After", strconv.Itoa(int(retryAfter.Seconds()))) - } - w.WriteHeader(503) - return - } - w.WriteHeader(408) - return - } - _, err := w.Write([]byte(AddJSONResp)) - if err != nil { - return - } - }) - defer hs.Close() - - certBytes, err := base64.StdEncoding.DecodeString(SubmissionCertB64) - if err != nil { - t.Fatalf("Failed to decode chain array B64: %s", err) - } - chain := []ct.ASN1Cert{{Data: certBytes}} - - const leeway = time.Millisecond * 100 - const leewayRatio = 0.2 // 20% - - tests := []struct { - deadlineLength time.Duration // -1 indicates no deadline - expected time.Duration - retryAfter time.Duration // -1 indicates: generate 503 with no Retry-After - failuresBeforeSuccess int - success bool - }{ - { - deadlineLength: -1, - expected: 1 * time.Millisecond, - retryAfter: 0, - failuresBeforeSuccess: 0, - success: true, - }, - { - deadlineLength: -1, - expected: 7 * time.Second, // 1 + 2 + 4 - retryAfter: -1, - failuresBeforeSuccess: 3, - success: true, - }, - { - deadlineLength: 6 * time.Second, - expected: 5 * time.Second, - retryAfter: 5 * time.Second, - failuresBeforeSuccess: 1, - success: true, - }, - { - deadlineLength: 5 * time.Second, - expected: 5 * time.Second, - retryAfter: 10 * time.Second, - failuresBeforeSuccess: 1, - success: false, - }, - { - deadlineLength: 10 * time.Second, - expected: 5 * time.Second, - retryAfter: 1 * time.Second, - failuresBeforeSuccess: 5, - success: true, - }, - { - deadlineLength: 1 * time.Second, - expected: 10 * time.Millisecond, - retryAfter: 0, - failuresBeforeSuccess: 10, - success: true, - }, - } - - for i, test := range tests { - deadline := context.Background() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - if test.deadlineLength >= 0 { - var cancel context.CancelFunc - deadline, cancel = context.WithDeadline(context.Background(), time.Now().Add(test.deadlineLength)) - defer cancel() - } - retryAfter = test.retryAfter - failuresBeforeSuccess = test.failuresBeforeSuccess - currentFailures = 0 - - started := time.Now() - sct, err := lc.AddChain(deadline, chain) - took := time.Since(started) - delta := math.Abs(float64(took - test.expected)) - ratio := delta / float64(test.expected) - if delta > float64(leeway) && ratio > leewayRatio { - t.Errorf("#%d Submission took an unexpected length of time: %s, expected ~%s", i, took, test.expected) - } - if test.success && err != nil { - t.Errorf("#%d Failed to submit chain: %s", i, err) - } else if !test.success && err == nil { - t.Errorf("#%d Expected AddChain to fail", i) - } - if test.success && sct == nil { - t.Errorf("#%d Nil SCT returned", i) - } - } -} - -func TestAddChain(t *testing.T) { - hs := serveSCTAt(t, "/ct/v1/add-chain", testdata.TestCertProof) - defer hs.Close() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{PublicKey: testdata.LogPublicKeyPEM}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - - cert, err := x509util.CertificateFromPEM([]byte(testdata.TestCertPEM)) - if err != nil { - t.Fatalf("Failed to parse certificate from PEM: %v", err) - } - - // AddChain will verify the signature because the client has a public key. - chain := []ct.ASN1Cert{{Data: cert.Raw}} - _, err = lc.AddChain(context.Background(), chain) - if err != nil { - t.Errorf("AddChain()=nil,%v; want sct,nil", err) - } -} - -func TestAddPreChain(t *testing.T) { - hs := serveSCTAt(t, "/ct/v1/add-pre-chain", testdata.TestPreCertProof) - defer hs.Close() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{PublicKey: testdata.LogPublicKeyPEM}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - - cert, err := x509util.CertificateFromPEM([]byte(testdata.TestPreCertPEM)) - if err != nil { - t.Fatalf("Failed to parse pre-certificate from PEM: %v", err) - } - issuer, err := x509util.CertificateFromPEM([]byte(testdata.CACertPEM)) - if err != nil { - t.Fatalf("Failed to parse issuer certificate from PEM: %v", err) - } - - // AddPreChain will verify the signature because the client has a public key. - chain := []ct.ASN1Cert{{Data: cert.Raw}, {Data: issuer.Raw}} - _, err = lc.AddPreChain(context.Background(), chain) - if err != nil { - t.Errorf("AddPreChain()=nil,%v; want sct,nil", err) - } -} - -func TestAddJSON(t *testing.T) { - hs := serveRspAt(t, "/ct/v1/add-json", AddJSONResp) - defer hs.Close() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - - tests := []struct { - success bool - data interface{} - }{ - {true, struct{ hi string }{"bob"}}, - } - - for _, test := range tests { - sct, err := lc.AddJSON(context.Background(), test.data) - if test.success && err != nil { - t.Errorf("AddJSON(%v)=nil,%v; want sct,nil", test.data, err) - } else if !test.success && err == nil { - t.Errorf("AddJSON(%v)=sct,nil; want nil,error", test.data) - } - if test.success && sct == nil { - t.Errorf("AddJSON(%v)=nil,%v; want sct,nil", test.data, err) - } - } -} - -func TestGetSTHConsistency(t *testing.T) { - hs := serveRspAt(t, "/ct/v1/get-sth-consistency", GetSTHConsistencyResp) - defer hs.Close() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - - tests := []struct { - first uint64 - second uint64 - proof [][]byte - }{ - {1, 3, [][]byte{ - b64("IqlrapPQKtmCY1jCr8+lpCtscRyjjZAA7nyadtFPRFQ="), - b64("ytf6K2GnSRZ3Au+YkivCb7N1DygfKyZmE4aEs9OXl/8="), - }}, - } - - for _, test := range tests { - proof, err := lc.GetSTHConsistency(context.Background(), test.first, test.second) - if err != nil { - t.Errorf("GetSTHConsistency(%d, %d)=nil,%v; want proof,nil", test.first, test.second, err) - } else if !reflect.DeepEqual(proof, test.proof) { - t.Errorf("GetSTHConsistency(%d, %d)=%v,nil; want %v,nil", test.first, test.second, proof, test.proof) - } - } -} - -func TestGetSTHConsistencyErrors(t *testing.T) { - ctx := context.Background() - var tests = []struct { - first, second uint64 - rsp, want string - }{ - {first: 1, second: 2, rsp: "", want: "EOF"}, - {first: 1, second: 2, rsp: "not-json", want: "invalid"}, - {first: 1, second: 2, rsp: `{"consistency":["bogus"]}`, want: "illegal base64"}, - {first: 1, second: 2, rsp: `{"consistency":["2SyPbmCNzn9l7dhWVz1uz6nW7DB7p0EkSsfH9M+qU5E=",]}`, want: "invalid"}, - } - - for _, test := range tests { - ts := serveRspAt(t, "/ct/v1/get-sth-consistency", test.rsp) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Errorf("Failed to create client: %v", err) - continue - } - got, err := lc.GetSTHConsistency(ctx, test.first, test.second) - if err == nil { - t.Errorf("GetSTHConsistency(%d, %d)=%+v, nil; want nil, %q", test.first, test.second, got, test.want) - } else if !strings.Contains(err.Error(), test.want) { - t.Errorf("GetSTHConsistency(%d, %d)=nil, %q; want nil, %q", test.first, test.second, err, test.want) - } - if got != nil { - t.Errorf("GetSTHConsistency(%d, %d)=%+v, _; want nil, _", test.first, test.second, got) - } - if len(test.rsp) > 0 { - // Expect the error to include the HTTP response - if rspErr, ok := err.(client.RspError); !ok { - t.Errorf("GetSTHConsistency(%d, %d)=nil, .(%T); want nil, .(RspError)", test.first, test.second, err) - } else if string(rspErr.Body) != test.rsp { - t.Errorf("GetSTHConsistency(%d, %d)=nil, .Body=%q; want nil, .Body=%q", test.first, test.second, rspErr.Body, test.rsp) - } - } - } -} - -func TestGetProofByHash(t *testing.T) { - hs := serveRspAt(t, "/ct/v1/get-proof-by-hash", ProofByHashResp) - defer hs.Close() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - - tests := []struct { - hash []byte - treesize uint64 - }{ - {dh("4a9e8edbe5ce2d2da69d483edb45186675d4be37b649d40923b156a7d1277463"), 5}, - } - - for _, test := range tests { - resp, err := lc.GetProofByHash(context.Background(), test.hash, test.treesize) - if err != nil { - t.Errorf("GetProofByHash(%v, %v)=nil,%v; want proof,nil", test.hash, test.treesize, err) - } else if got := len(resp.AuditPath); got < 1 { - t.Errorf("len(GetProofByHash(%v, %v)): %v; want > 1", test.hash, test.treesize, got) - } - } -} - -func TestGetProofByHashErrors(t *testing.T) { - ctx := context.Background() - aHash := dh("4a9e8edbe5ce2d2da69d483edb45186675d4be37b649d40923b156a7d1277463") - var tests = []struct { - rsp, want string - }{ - {rsp: "", want: "EOF"}, - {rsp: "not-json", want: "invalid"}, - {rsp: `{"leaf_index": 17, "audit_path":["bogus"]}`, want: "illegal base64"}, - {rsp: `{"leaf_index": 17, "audit_path":["bbbb",]}`, want: "invalid"}, - } - - for _, test := range tests { - ts := serveRspAt(t, "/ct/v1/get-proof-by-hash", test.rsp) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Errorf("Failed to create client: %v", err) - continue - } - got, err := lc.GetProofByHash(ctx, aHash, 100) - if err == nil { - t.Errorf("GetProofByHash()=%+v, nil; want nil, %q", got, test.want) - } else if !strings.Contains(err.Error(), test.want) { - t.Errorf("GetProofByHash()=nil, %q; want nil, %q", err, test.want) - } - if got != nil { - t.Errorf("GetProofByHash()=%+v, _; want nil, _", got) - } - if len(test.rsp) > 0 { - // Expect the error to include the HTTP response - if rspErr, ok := err.(client.RspError); !ok { - t.Errorf("GetProofByHash()=nil, .(%T); want nil, .(RspError)", err) - } else if string(rspErr.Body) != test.rsp { - t.Errorf("GetProofByHash()=nil, .Body=%q; want nil, .Body=%q", rspErr.Body, test.rsp) - } - } - } -} - -func TestGetAcceptedRoots(t *testing.T) { - hs := serveRspAt(t, "/ct/v1/get-roots", GetRootsResp) - defer hs.Close() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - - certs, err := lc.GetAcceptedRoots(context.Background()) - if err != nil { - t.Errorf("GetAcceptedRoots()=nil,%q; want roots,nil", err.Error()) - } else if len(certs) < 1 { - t.Errorf("len(GetAcceptedRoots())=0; want > 1") - } -} - -func TestGetAcceptedRootsErrors(t *testing.T) { - ctx := context.Background() - var tests = []struct { - rsp, want string - }{ - {rsp: "", want: "EOF"}, - {rsp: "not-json", want: "invalid"}, - {rsp: `{"certificates":["bogus"]}`, want: "illegal base64"}, - {rsp: `{"certificates":["bbbb",]}`, want: "invalid"}, - } - - for _, test := range tests { - ts := serveRspAt(t, "/ct/v1/get-roots", test.rsp) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Errorf("Failed to create client: %v", err) - continue - } - got, err := lc.GetAcceptedRoots(ctx) - if err == nil { - t.Errorf("GetAcceptedRoots()=%+v, nil; want nil, %q", got, test.want) - } else if !strings.Contains(err.Error(), test.want) { - t.Errorf("GetAcceptedRoots()=nil, %q; want nil, %q", err, test.want) - } - if got != nil { - t.Errorf("GetAcceptedRoots()=%+v, _; want nil, _", got) - } - if len(test.rsp) > 0 { - // Expect the error to include the HTTP response - if rspErr, ok := err.(client.RspError); !ok { - t.Errorf("GetAcceptedRoots()=nil, .(%T); want nil, .(RspError)", err) - } else if string(rspErr.Body) != test.rsp { - t.Errorf("GetAcceptedRoots()=nil, .Body=%q; want nil, .Body=%q", rspErr.Body, test.rsp) - } - } - } -} - -func TestGetEntryAndProof(t *testing.T) { - hs := serveRspAt(t, "/ct/v1/get-entry-and-proof", GetEntryAndProofResp) - defer hs.Close() - lc, err := client.New(hs.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Fatalf("Failed to create client: %v", err) - } - - tests := []struct { - index uint64 - treesize uint64 - }{ - {1000, 2000}, - } - - for _, test := range tests { - resp, err := lc.GetEntryAndProof(context.Background(), test.index, test.treesize) - if err != nil { - t.Errorf("GetEntryAndProof(%v, %v)=nil,%v; want proof,nil", test.index, test.treesize, err) - } else if got := len(resp.AuditPath); got < 1 { - t.Errorf("len(GetEntryAndProof(%v, %v)): %v; want > 1", test.index, test.treesize, got) - } - } -} - -func TestGetEntryAndProofErrors(t *testing.T) { - ctx := context.Background() - var tests = []struct { - rsp, want string - }{ - {rsp: "", want: "EOF"}, - {rsp: "not-json", want: "invalid"}, - {rsp: `{"leaf_input": "bogus", "extra_data": "Z29vZAo=", "audit_path": ["Z29vZAo="]}`, want: "illegal base64"}, - {rsp: `{"leaf_input": "Z29vZAo=", "extra_data": "bogus", "audit_path": ["Z29vZAo="]}`, want: "illegal base64"}, - {rsp: `{"leaf_input": "Z29vZAo=", "extra_data": "Z29vZAo=", "audit_path": ["bogus"]}`, want: "illegal base64"}, - {rsp: `{"leaf_input": "Z29vZAo=", "extra_data": "Z29vZAo=", "audit_path": ["bbbb",]}`, want: "invalid"}, - } - - for _, test := range tests { - ts := serveRspAt(t, "/ct/v1/get-entry-and-proof", test.rsp) - defer ts.Close() - lc, err := client.New(ts.URL, &http.Client{}, jsonclient.Options{}) - if err != nil { - t.Errorf("Failed to create client: %v", err) - continue - } - got, err := lc.GetEntryAndProof(ctx, 99, 100) - if err == nil { - t.Errorf("GetEntryAndProof()=%+v, nil; want nil, %q", got, test.want) - } else if !strings.Contains(err.Error(), test.want) { - t.Errorf("GetEntryAndProof()=nil, %q; want nil, %q", err, test.want) - } - if got != nil { - t.Errorf("GetEntryAndProof()=%+v, _; want nil, _", got) - } - if len(test.rsp) > 0 { - // Expect the error to include the HTTP response - if rspErr, ok := err.(client.RspError); !ok { - t.Errorf("GetEntryAndProof()=nil, .(%T); want nil, .(RspError)", err) - } else if string(rspErr.Body) != test.rsp { - t.Errorf("GetEntryAndProof()=nil, .Body=%q; want nil, .Body=%q", rspErr.Body, test.rsp) - } - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/client/multilog_test.go b/vendor/github.com/google/certificate-transparency-go/client/multilog_test.go deleted file mode 100644 index 490c431..0000000 --- a/vendor/github.com/google/certificate-transparency-go/client/multilog_test.go +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client_test - -import ( - "context" - "encoding/pem" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" - - "github.com/golang/protobuf/ptypes" - tspb "github.com/golang/protobuf/ptypes/timestamp" - ct "github.com/google/certificate-transparency-go" - "github.com/google/certificate-transparency-go/client" - "github.com/google/certificate-transparency-go/client/configpb" - "github.com/google/certificate-transparency-go/testdata" - "github.com/google/certificate-transparency-go/x509util" -) - -func TestNewTemporalLogClient(t *testing.T) { - ts0, _ := ptypes.TimestampProto(time.Date(2010, 9, 19, 11, 00, 00, 00, time.UTC)) - ts1, _ := ptypes.TimestampProto(time.Date(2011, 9, 19, 11, 00, 00, 00, time.UTC)) - ts2, _ := ptypes.TimestampProto(time.Date(2012, 9, 19, 11, 00, 00, 00, time.UTC)) - ts2_5, _ := ptypes.TimestampProto(time.Date(2013, 3, 19, 11, 00, 00, 00, time.UTC)) - ts3, _ := ptypes.TimestampProto(time.Date(2013, 9, 19, 11, 00, 00, 00, time.UTC)) - ts4, _ := ptypes.TimestampProto(time.Date(2014, 9, 19, 11, 00, 00, 00, time.UTC)) - - tests := []struct { - cfg configpb.TemporalLogConfig - wantErr string - }{ - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: nil, NotAfterLimit: nil}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: ts4}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: nil, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: ts4}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: nil, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: nil}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: nil}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "threeA", NotAfterStart: ts2_5, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: ts4}, - }, - }, - wantErr: "previous interval ended at", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: nil}, - }, - }, - wantErr: "previous interval ended at", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: nil, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts1}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: ts4}, - }, - }, - wantErr: "inverted", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: nil}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: nil}, - }, - }, - wantErr: "no upper bound", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: nil, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: nil}, - }, - }, - wantErr: "has no lower bound", - }, - { - wantErr: "empty", - }, - { - cfg: configpb.TemporalLogConfig{Shard: []*configpb.LogShardConfig{}}, - wantErr: "empty", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts1, NotAfterLimit: ts1}, - }, - }, - wantErr: "inverted", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts2, NotAfterLimit: ts1}, - }, - }, - wantErr: "inverted", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: &tspb.Timestamp{Seconds: -1, Nanos: -1}, NotAfterLimit: ts2}, - }, - }, - wantErr: "failed to parse", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "one", NotAfterStart: ts1, NotAfterLimit: &tspb.Timestamp{Seconds: -1, Nanos: -1}}, - }, - }, - wantErr: "failed to parse", - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - { - Uri: "one", - NotAfterStart: nil, - NotAfterLimit: nil, - PublicKeyDer: []byte{0x01, 0x02}, - }, - }, - }, - wantErr: "invalid public key", - }, - } - for _, test := range tests { - _, err := client.NewTemporalLogClient(test.cfg, nil) - if err != nil { - if test.wantErr == "" { - t.Errorf("NewTemporalLogClient(%+v)=nil,%v; want _,nil", test.cfg, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("NewTemporalLogClient(%+v)=nil,%v; want _,%q", test.cfg, err, test.wantErr) - } - continue - } - if test.wantErr != "" { - t.Errorf("NewTemporalLogClient(%+v)=_, nil; want _,%q", test.cfg, test.wantErr) - } - } -} - -func TestIndexByDate(t *testing.T) { - time0 := time.Date(2010, 9, 19, 11, 00, 00, 00, time.UTC) - time1 := time.Date(2011, 9, 19, 11, 00, 00, 00, time.UTC) - time1_9 := time.Date(2012, 9, 19, 10, 59, 59, 00, time.UTC) - time2 := time.Date(2012, 9, 19, 11, 00, 00, 00, time.UTC) - time2_5 := time.Date(2013, 3, 19, 11, 00, 00, 00, time.UTC) - time3 := time.Date(2013, 9, 19, 11, 00, 00, 00, time.UTC) - time4 := time.Date(2014, 9, 19, 11, 00, 00, 00, time.UTC) - - ts0, _ := ptypes.TimestampProto(time0) - ts1, _ := ptypes.TimestampProto(time1) - ts2, _ := ptypes.TimestampProto(time2) - ts3, _ := ptypes.TimestampProto(time3) - ts4, _ := ptypes.TimestampProto(time4) - - allCfg := configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "zero", NotAfterStart: nil, NotAfterLimit: ts0}, - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: ts4}, - {Uri: "five", NotAfterStart: ts4, NotAfterLimit: nil}, - }, - } - uptoCfg := configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "zero", NotAfterStart: nil, NotAfterLimit: ts0}, - {Uri: "one", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "two", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "three", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "four", NotAfterStart: ts3, NotAfterLimit: ts4}, - }, - } - fromCfg := - configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "zero", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "one", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "two", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "three", NotAfterStart: ts3, NotAfterLimit: ts4}, - {Uri: "four", NotAfterStart: ts4, NotAfterLimit: nil}, - }, - } - boundedCfg := - configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: "zero", NotAfterStart: ts0, NotAfterLimit: ts1}, - {Uri: "one", NotAfterStart: ts1, NotAfterLimit: ts2}, - {Uri: "two", NotAfterStart: ts2, NotAfterLimit: ts3}, - {Uri: "three", NotAfterStart: ts3, NotAfterLimit: ts4}, - }, - } - - tests := []struct { - cfg configpb.TemporalLogConfig - when time.Time - want int - wantErr bool - }{ - {cfg: allCfg, when: time.Date(2000, 9, 19, 11, 00, 00, 00, time.UTC), want: 0}, - {cfg: allCfg, when: time0, want: 1}, - {cfg: allCfg, when: time1, want: 2}, - {cfg: allCfg, when: time1_9, want: 2}, - {cfg: allCfg, when: time2, want: 3}, - {cfg: allCfg, when: time2_5, want: 3}, - {cfg: allCfg, when: time3, want: 4}, - {cfg: allCfg, when: time4, want: 5}, - {cfg: allCfg, when: time.Date(2015, 9, 19, 11, 00, 00, 00, time.UTC), want: 5}, - - {cfg: uptoCfg, when: time.Date(2000, 9, 19, 11, 00, 00, 00, time.UTC), want: 0}, - {cfg: uptoCfg, when: time0, want: 1}, - {cfg: uptoCfg, when: time1, want: 2}, - {cfg: uptoCfg, when: time2, want: 3}, - {cfg: uptoCfg, when: time2_5, want: 3}, - {cfg: uptoCfg, when: time3, want: 4}, - {cfg: uptoCfg, when: time4, wantErr: true}, - {cfg: uptoCfg, when: time.Date(2015, 9, 19, 11, 00, 00, 00, time.UTC), wantErr: true}, - - {cfg: fromCfg, when: time.Date(2000, 9, 19, 11, 00, 00, 00, time.UTC), wantErr: true}, - {cfg: fromCfg, when: time0, want: 0}, - {cfg: fromCfg, when: time1, want: 1}, - {cfg: fromCfg, when: time2, want: 2}, - {cfg: fromCfg, when: time2_5, want: 2}, - {cfg: fromCfg, when: time3, want: 3}, - {cfg: fromCfg, when: time4, want: 4}, - {cfg: fromCfg, when: time.Date(2015, 9, 19, 11, 00, 00, 00, time.UTC), want: 4}, - - {cfg: boundedCfg, when: time.Date(2000, 9, 19, 11, 00, 00, 00, time.UTC), wantErr: true}, - {cfg: boundedCfg, when: time0, want: 0}, - {cfg: boundedCfg, when: time1, want: 1}, - {cfg: boundedCfg, when: time2, want: 2}, - {cfg: boundedCfg, when: time2_5, want: 2}, - {cfg: boundedCfg, when: time3, want: 3}, - {cfg: boundedCfg, when: time4, wantErr: true}, - {cfg: boundedCfg, when: time.Date(2015, 9, 19, 11, 00, 00, 00, time.UTC), wantErr: true}, - } - for _, test := range tests { - tlc, err := client.NewTemporalLogClient(test.cfg, nil) - if err != nil { - t.Errorf("NewTemporalLogClient(%+v)=nil, %v; want _,nil", test.cfg, err) - continue - } - got, err := tlc.IndexByDate(test.when) - if err != nil { - if !test.wantErr { - t.Errorf("NewTemporalLogClient(%+v).idxByDate()=%d,%v; want %d,nil", test.cfg, got, err, test.want) - } - continue - } - if test.wantErr { - t.Errorf("NewTemporalLogClient(%+v).idxByDate(%v)=%d, nil; want _, 'no log found'", test.cfg, test.when, got) - } - if got != test.want { - t.Errorf("NewTemporalLogClient(%+v).idxByDate(%v)=%d, nil; want %d, nil", test.cfg, test.when, got, test.want) - } - } -} - -func TestTemporalAddChain(t *testing.T) { - hs := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case "/ct/v1/add-chain": - data, _ := sctToJSON(testdata.TestCertProof) - w.Write(data) - case "/ct/v1/add-pre-chain": - data, _ := sctToJSON(testdata.TestPreCertProof) - w.Write(data) - default: - t.Fatalf("Incorrect URL path: %s", r.URL.Path) - } - })) - defer hs.Close() - - cert, err := x509util.CertificateFromPEM([]byte(testdata.TestCertPEM)) - if err != nil { - t.Fatalf("Failed to parse certificate from PEM: %v", err) - } - certChain := []ct.ASN1Cert{{Data: cert.Raw}} - precert, err := x509util.CertificateFromPEM([]byte(testdata.TestPreCertPEM)) - if err != nil { - t.Fatalf("Failed to parse pre-certificate from PEM: %v", err) - } - issuer, err := x509util.CertificateFromPEM([]byte(testdata.CACertPEM)) - if err != nil { - t.Fatalf("Failed to parse issuer certificate from PEM: %v", err) - } - precertChain := []ct.ASN1Cert{{Data: precert.Raw}, {Data: issuer.Raw}} - // Both have Not After = Jun 1 00:00:00 2022 GMT - ts1, _ := ptypes.TimestampProto(time.Date(2022, 5, 19, 11, 00, 00, 00, time.UTC)) - ts2, _ := ptypes.TimestampProto(time.Date(2022, 6, 19, 11, 00, 00, 00, time.UTC)) - p, _ := pem.Decode([]byte(testdata.LogPublicKeyPEM)) - if p == nil { - t.Fatalf("Failed to parse public key from PEM: %v", err) - } - - tests := []struct { - cfg configpb.TemporalLogConfig - wantErr bool - }{ - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: hs.URL, NotAfterStart: nil, NotAfterLimit: nil, PublicKeyDer: p.Bytes}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: hs.URL, NotAfterStart: nil, NotAfterLimit: ts2, PublicKeyDer: p.Bytes}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: hs.URL, NotAfterStart: ts1, NotAfterLimit: nil, PublicKeyDer: p.Bytes}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: hs.URL, NotAfterStart: ts1, NotAfterLimit: ts2, PublicKeyDer: p.Bytes}, - }, - }, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: hs.URL, NotAfterStart: nil, NotAfterLimit: ts1, PublicKeyDer: p.Bytes}, - }, - }, - wantErr: true, - }, - { - cfg: configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - {Uri: hs.URL, NotAfterStart: ts2, NotAfterLimit: nil, PublicKeyDer: p.Bytes}, - }, - }, - wantErr: true, - }, - } - - ctx := context.Background() - for _, test := range tests { - tlc, err := client.NewTemporalLogClient(test.cfg, nil) - if err != nil { - t.Errorf("NewTemporalLogClient(%+v)=nil, %v; want _,nil", test.cfg, err) - continue - } - - _, err = tlc.AddChain(ctx, certChain) - if err != nil { - if !test.wantErr { - t.Errorf("AddChain()=nil,%v; want sct,nil", err) - } - } else if test.wantErr { - t.Errorf("AddChain()=sct,nil; want nil,_") - } - - _, err = tlc.AddPreChain(ctx, precertChain) - if err != nil { - if !test.wantErr { - t.Errorf("AddPreChain()=nil,%v; want sct,nil", err) - } - } else if test.wantErr { - t.Errorf("AddPreChain()=sct,nil; want nil,_") - } - } -} - -func TestTemporalAddChainErrors(t *testing.T) { - hs := serveSCTAt(t, "/ct/v1/add-chain", testdata.TestCertProof) - defer hs.Close() - - cfg := configpb.TemporalLogConfig{ - Shard: []*configpb.LogShardConfig{ - { - Uri: hs.URL, - NotAfterStart: nil, - NotAfterLimit: nil, - }, - }, - } - - ctx := context.Background() - tlc, err := client.NewTemporalLogClient(cfg, nil) - if err != nil { - t.Fatalf("NewTemporalLogClient(%+v)=nil, %v; want _,nil", cfg, err) - } - - _, err = tlc.AddChain(ctx, nil) - if err == nil { - t.Errorf("AddChain(nil)=sct,nil; want nil, 'missing chain'") - } - _, err = tlc.AddChain(ctx, []ct.ASN1Cert{{Data: []byte{0x01, 0x02}}}) - if err == nil { - t.Errorf("AddChain(nil)=sct,nil; want nil, 'failed to parse'") - } - -} diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/Makefile b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/Makefile deleted file mode 100644 index f6b5fc1..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -all: ca - -# The following private keys are never regenerated. -SERVER_PRIVKEYS=gossiper.privkey.pem - -# Server public keys are derived from the corresponding private keys. -SERVER_PUBKEYS=$(subst .privkey,.pubkey,$(SERVER_PRIVKEYS)) - -# Build public keys from private keys -pubkeys: $(SERVER_PUBKEYS) -gossiper.pubkey.pem: gossiper.privkey.pem - openssl ec -in $< -pubout -out $@ -passin pass:$(GOSSIPER_PWD) - -ROOT_CA_PRIVKEY=gossiper.privkey.pem -ROOT_CA_PWD=hissing-sid - -ca: root-ca.cert - -# Fake Root CA -root-ca.cert: gossiper.privkey.pem root-ca.cfg - openssl req -new -x509 -config root-ca.cfg -set_serial 0x0406cafe -days 3650 -extensions v3_ca -inform pem -key gossiper.privkey.pem -passin pass:$(ROOT_CA_PWD) -out $@ -show-ca: root-ca.cert - openssl x509 -inform pem -in $< -text -noout - -# clean removes things that regenerate exactly the same. -clean: - rm -f $(SERVER_PUBKEYS) -# distclean removes things that regenerate with changes (e.g. timestamped, randomized). -distclean: clean - rm -f $(SERVER_PUBKEYS) root-ca.cert - -# The newkey target creates a fresh private key; should never be needed. -newkey: fresh.privkey.pem -fresh.privkey.pem: - openssl ecparam -genkey -name prime256v1 -noout -out $@.unencrypted - openssl ec -in $@.unencrypted -out $@ -des # Prompts for password - rm -f $@.unencrypted diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/dup-source-name.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/dup-source-name.cfg deleted file mode 100644 index 9b487cc..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/dup-source-name.cfg +++ /dev/null @@ -1,32 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d\xb9" - } -> -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source-2" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d\xb9" - } -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/goshawk.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/goshawk.cfg deleted file mode 100644 index c7825fd..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/goshawk.cfg +++ /dev/null @@ -1,17 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d\xb9" - } -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/gossiper.privkey.pem b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/gossiper.privkey.pem deleted file mode 100644 index 09336f4..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/gossiper.privkey.pem +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-CBC,559BE893ECD7A88C - -UOwSw+WlSv5LLiBZSCnR12FX13Hk1a3vavdpUde4W4qawQgJSMqLa3it8Lfadtnm -GfGVqN+gF5KFiNWxgMs2qRcbdQ03ZlMmoH8Z8jPQHXvKseJvME8tZQWPvJ15rbXh -G9Lcx7NYlm0miHPy3ras8ci58HSDqz9Z7yOdgHzPpiU= ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-dup-source-name.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-dup-source-name.cfg deleted file mode 100644 index 9ea4484..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-dup-source-name.cfg +++ /dev/null @@ -1,27 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d\xb9" - } -> -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source-2" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d\xb9" - } -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> \ No newline at end of file diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-dest-name.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-dest-name.cfg deleted file mode 100644 index 0fad377..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-dest-name.cfg +++ /dev/null @@ -1,13 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-log.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-log.cfg deleted file mode 100644 index 070e111..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-log.cfg +++ /dev/null @@ -1,7 +0,0 @@ -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-name.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-name.cfg deleted file mode 100644 index 98d5deb..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/hawk-no-source-name.cfg +++ /dev/null @@ -1,13 +0,0 @@ -source_log: < - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> \ No newline at end of file diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-private-key.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-private-key.cfg deleted file mode 100644 index 20febcc..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-private-key.cfg +++ /dev/null @@ -1,19 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gone.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-root-cert.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-root-cert.cfg deleted file mode 100644 index ee3a359..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-root-cert.cfg +++ /dev/null @@ -1,19 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CARTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-duration.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-duration.cfg deleted file mode 100644 index 1470b0c..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-duration.cfg +++ /dev/null @@ -1,20 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 10 - nanos: -20 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-pubkey.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-pubkey.cfg deleted file mode 100644 index b86bc02..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/invalid-source-pubkey.cfg +++ /dev/null @@ -1,22 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d" - } -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-log.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-log.cfg deleted file mode 100644 index a254ded..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-log.cfg +++ /dev/null @@ -1,15 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d\xb9" - } -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-name.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-name.cfg deleted file mode 100644 index 48d5338..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-dest-name.cfg +++ /dev/null @@ -1,18 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-private-key.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-private-key.cfg deleted file mode 100644 index 43ae3cd..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-private-key.cfg +++ /dev/null @@ -1,15 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-root-cert.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-root-cert.cfg deleted file mode 100644 index 2d9d74f..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-root-cert.cfg +++ /dev/null @@ -1,18 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-log.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-log.cfg deleted file mode 100644 index 972e0f7..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-log.cfg +++ /dev/null @@ -1,12 +0,0 @@ -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-name.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-name.cfg deleted file mode 100644 index 021caf3..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/no-source-name.cfg +++ /dev/null @@ -1,18 +0,0 @@ -source_log: < - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cert b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cert deleted file mode 100644 index 7a0c196..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cert +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICQTCCAeegAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP -MA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds -ZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4 -MDIyNTA4MTA1M1oXDTI4MDIyMzA4MTA1M1owaTELMAkGA1UEBhMCR0IxDzANBgNV -BAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK -BgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49 -AgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH -ccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijfTB7MB0GA1UdDgQWBBRq -6hoXslGgHhrCVJMu4jrYlksyZjAfBgNVHSMEGDAWgBRq6hoXslGgHhrCVJMu4jrY -lksyZjASBgNVHRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwICBDAVBgNVHSUE -DjAMBgorBgEEAdZ5AgQGMAoGCCqGSM49BAMCA0gAMEUCIQCQCnWTIOlC6LqkcdH0 -fWZeNo5E3AaZBb9Tkv76ET2fJAIgOeGJvfiiOIlDV41/bIOg5eTHb/fxg80TCQBe -6ia6ZS8= ------END CERTIFICATE----- diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cfg deleted file mode 100644 index 894052b..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/root-ca.cfg +++ /dev/null @@ -1,28 +0,0 @@ -# OpenSSL configuration file. - -[ req ] -# Options for the `req` tool (`man req`). -default_bits = 2048 -distinguished_name = req_distinguished_name -prompt = no -# SHA-1 is deprecated, so use SHA-2 instead. -default_md = sha256 -# Extension to add when the -x509 option is used. -x509_extensions = v3_ca -# Try to force use of PrintableString throughout -string_mask = pkix - -[ req_distinguished_name ] -C=GB -ST=London -L=London -O=Google -OU=Eng -CN=TestGossiperRoot - -[ v3_ca ] -subjectKeyIdentifier = hash -authorityKeyIdentifier = keyid:always,issuer -basicConstraints = critical, CA:true, pathlen:3 -keyUsage = critical, keyCertSign -extendedKeyUsage = 1.3.6.1.4.1.11129.2.4.6 diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/test.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/test.cfg deleted file mode 100644 index 158d732..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/test.cfg +++ /dev/null @@ -1,22 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > - public_key: { - der: "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42\x00\x04\x07\xf8\x51\xaf\xaa\x8c\x56\x83\x90\x31\xb7\x80\xe3\xd6\x1a\xf7\x2f\x36\x06\x71\xec\xdd\x3b\xbe\x7e\x36\x6f\x0d\x1c\x1c\x60\x0b\x7f\xf5\x9f\xff\xe5\x24\x49\x34\x56\xf2\x4b\x10\x5f\xbf\x08\x1f\xf9\x0e\xcf\x35\xb5\x8a\x8a\x8b\x30\x0a\x54\xb7\xbf\x1d\x4d\xb9" - } -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013hissing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/wrong-password-private-key.cfg b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/wrong-password-private-key.cfg deleted file mode 100644 index 39c7bfb..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/testdata/wrong-password-private-key.cfg +++ /dev/null @@ -1,19 +0,0 @@ -source_log: < - name: "theSourceOfAllSTHs" - url: "http://example.com/ct-source" - min_req_interval: < - seconds: 3600 - > -> -dest_log: < - name: "theDestinationOfAllSTHs" - url: "http://example.com/ct-dest" - min_req_interval: < - seconds: 60 - > -> -root_cert: "-----BEGIN CERTIFICATE-----\nMIICCzCCAbCgAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP\nMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds\nZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4\nMDIyMzEzNDUyOVoXDTI4MDIyMTEzNDUyOVowaTELMAkGA1UEBhMCR0IxDzANBgNV\nBAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK\nBgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49\nAgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH\nccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijRjBEMA0GA1UdDgQGBAQR\nEhMUMA8GA1UdIwQIMAaABBESExQwEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8B\nAf8EBAMCAgQwCgYIKoZIzj0EAwIDSQAwRgIhAICXxzQ+EulZALo8em3KujsOCpNY\n6lvLF5lqBMLS9fxwAiEAkh54N7Dq6P+3Sl/u15TA5DKhFPqgnvnB51wXGAsDhN0=\n-----END CERTIFICATE-----" -private_key: < - type_url: "type.googleapis.com/keyspb.PEMKeyFile" - value: "\n\035testdata/gossiper.privkey.pem\022\013passing-sid" -> diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext.go b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext.go deleted file mode 100644 index 8f673b9..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2018 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package x509ext holds extensions types and values for minimal gossip. -package x509ext - -import ( - "errors" - "fmt" - - "github.com/google/certificate-transparency-go" - "github.com/google/certificate-transparency-go/asn1" - "github.com/google/certificate-transparency-go/tls" - "github.com/google/certificate-transparency-go/x509" -) - -// OIDExtensionCTSTH is the OID value for an X.509 extension that holds -// a log STH value. -// TODO(drysdale): get an official OID value -var OIDExtensionCTSTH = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 5} - -// OIDExtKeyUsageCTMinimalGossip is the OID value for an extended key usage -// (EKU) that indicates a leaf certificate is used for the validation of STH -// values from public CT logs. -// TODO(drysdale): get an official OID value -var OIDExtKeyUsageCTMinimalGossip = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 6} - -// LogSTHInfo is the structure that gets TLS-encoded into the X.509 extension -// identified by OIDExtensionCTSTH. -type LogSTHInfo struct { - LogURL []byte `tls:"maxlen:255"` - Version tls.Enum `tls:"maxval:255"` - TreeSize uint64 - Timestamp uint64 - SHA256RootHash ct.SHA256Hash - TreeHeadSignature ct.DigitallySigned -} - -// LogSTHInfoFromCert retrieves the STH information embedded in a certificate. -func LogSTHInfoFromCert(cert *x509.Certificate) (*LogSTHInfo, error) { - for _, ext := range cert.Extensions { - if ext.Id.Equal(OIDExtensionCTSTH) { - var sthInfo LogSTHInfo - rest, err := tls.Unmarshal(ext.Value, &sthInfo) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal STH: %v", err) - } else if len(rest) > 0 { - return nil, fmt.Errorf("trailing data (%d bytes) after STH", len(rest)) - } - return &sthInfo, nil - } - } - return nil, errors.New("no STH extension found") -} - -// HasSTHInfo indicates whether a certificate has embedded STH information. -func HasSTHInfo(cert *x509.Certificate) bool { - for _, ext := range cert.Extensions { - if ext.Id.Equal(OIDExtensionCTSTH) { - return true - } - } - return false -} - -// STHFromCert retrieves the STH embedded in a certificate; note the returned STH -// does not have the LogID field filled in. -func STHFromCert(cert *x509.Certificate) (*ct.SignedTreeHead, error) { - sthInfo, err := LogSTHInfoFromCert(cert) - if err != nil { - return nil, err - } - return &ct.SignedTreeHead{ - Version: ct.Version(sthInfo.Version), - TreeSize: sthInfo.TreeSize, - Timestamp: sthInfo.Timestamp, - SHA256RootHash: sthInfo.SHA256RootHash, - TreeHeadSignature: sthInfo.TreeHeadSignature, - }, nil -} diff --git a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext_test.go b/vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext_test.go deleted file mode 100644 index 5c482f1..0000000 --- a/vendor/github.com/google/certificate-transparency-go/gossip/minimal/x509ext/x509ext_test.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2018 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package x509ext_test - -import ( - "encoding/hex" - "encoding/pem" - "fmt" - "strings" - "testing" - "time" - - "github.com/google/certificate-transparency-go" - "github.com/google/certificate-transparency-go/gossip/minimal/x509ext" - "github.com/google/certificate-transparency-go/tls" - "github.com/google/certificate-transparency-go/x509" - "github.com/google/certificate-transparency-go/x509/pkix" -) - -var ( - // pilotPubKeyPEM is the public key for Google's Pilot log. - pilotPubKeyPEM = []byte(`-----BEGIN PUBLIC KEY----- -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfahLEimAoz2t01p3uMziiLOl/fHT -DM0YDOhBRuiBARsV4UvxG2LdNgoIGLrtCzWE0J5APC2em4JlvR8EEEFMoA== ------END PUBLIC KEY-----`) -) - -func TestSTHFromCert(t *testing.T) { - rawPubKey, _ := pem.Decode(pilotPubKeyPEM) - pubKey, _, _, err := ct.PublicKeyFromPEM(pilotPubKeyPEM) - if err != nil { - t.Fatalf("failed to decode test pubkey data: %v", err) - } - validSTH := x509ext.LogSTHInfo{ - LogURL: []byte("http://ct.example.com/log"), - Version: 0, - TreeSize: 7834120, - Timestamp: 1519395540364, - SHA256RootHash: [...]byte{ - 0xfe, 0xc0, 0xed, 0xe1, 0xbe, 0xf1, 0xa2, 0x25, 0xc3, 0x72, 0xa6, 0x44, 0x1b, 0xa2, 0xd5, 0xdd, 0x3b, 0xbb, 0x9b, 0x7b, 0xa9, 0x79, 0xd1, 0xa7, 0x03, 0xe7, 0xfe, 0x81, 0x49, 0x75, 0x85, 0xfb, - }, - TreeHeadSignature: ct.DigitallySigned{ - Algorithm: tls.SignatureAndHashAlgorithm{Hash: tls.SHA256, Signature: tls.ECDSA}, - Signature: dehex("220164e031604aa2a0b68887ba668cefb3e0046e455d6323c3df38b8d50108895d70220146199ee1d759a029d8b37ce8701d2ca47a387bad8ac8ef1cb84b77bc0820ed"), - }, - } - sthData, err := tls.Marshal(validSTH) - if err != nil { - t.Fatalf("failed to marshal STH: %v", err) - } - - var tests = []struct { - name string - cert x509.Certificate - wantErr string - }{ - { - name: "ValidSTH", - cert: x509.Certificate{ - NotBefore: time.Now(), - NotAfter: time.Now().Add(24 * time.Hour), - PublicKey: pubKey, - RawSubjectPublicKeyInfo: rawPubKey.Bytes, - Subject: pkix.Name{ - CommonName: "Test STH holder", - }, - Extensions: []pkix.Extension{ - {Id: x509ext.OIDExtensionCTSTH, Critical: false, Value: sthData}, - }, - }, - }, - { - name: "MissingSTH", - cert: x509.Certificate{ - NotBefore: time.Now(), - NotAfter: time.Now().Add(24 * time.Hour), - Subject: pkix.Name{ - CommonName: "Test STH holder", - }, - }, - wantErr: "no STH extension found", - }, - { - name: "TrailingData", - cert: x509.Certificate{ - NotBefore: time.Now(), - NotAfter: time.Now().Add(24 * time.Hour), - Subject: pkix.Name{ - CommonName: "Test STH holder", - }, - Extensions: []pkix.Extension{ - {Id: x509ext.OIDExtensionCTSTH, Critical: false, Value: append(sthData, 0xff)}, - }, - }, - wantErr: "trailing data", - }, - { - name: "InvalidSTH", - cert: x509.Certificate{ - NotBefore: time.Now(), - NotAfter: time.Now().Add(24 * time.Hour), - Subject: pkix.Name{ - CommonName: "Test STH holder", - }, - Extensions: []pkix.Extension{ - {Id: x509ext.OIDExtensionCTSTH, Critical: false, Value: []byte{0xff}}, - }, - }, - wantErr: "failed to unmarshal", - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - got, err := x509ext.STHFromCert(&test.cert) - if err != nil { - if test.wantErr == "" { - t.Errorf("STHFromCert(%+v)=nil,%v; want _,nil", test.cert, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("STHFromCert(%+v)=nil,%v; want nil,err containing %q", test.cert, err, test.wantErr) - } - return - } - if test.wantErr != "" { - t.Errorf("STHFromCert(%+v)=_,nil; want nil,err containing %q", test.cert, test.wantErr) - } - t.Logf("retrieved STH %+v", got) - }) - } -} - -func dehex(h string) []byte { - d, err := hex.DecodeString(h) - if err != nil { - panic(fmt.Sprintf("hard-coded data %q failed to decode! %v", h, err)) - } - return d -} diff --git a/vendor/github.com/google/certificate-transparency-go/jsonclient/backoff_test.go b/vendor/github.com/google/certificate-transparency-go/jsonclient/backoff_test.go deleted file mode 100644 index 2996079..0000000 --- a/vendor/github.com/google/certificate-transparency-go/jsonclient/backoff_test.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package jsonclient - -import ( - "math" - "testing" - "time" -) - -const testLeeway = 25 * time.Microsecond - -func fuzzyTimeEquals(a, b time.Time, leeway time.Duration) bool { - diff := math.Abs(float64(a.Sub(b).Nanoseconds())) - if diff < float64(leeway.Nanoseconds()) { - return true - } - return false -} - -func fuzzyDurationEquals(a, b time.Duration, leeway time.Duration) bool { - diff := math.Abs(float64(a.Nanoseconds() - b.Nanoseconds())) - if diff < float64(leeway.Nanoseconds()) { - return true - } - return false -} - -func TestBackoff(t *testing.T) { - b := backoff{} - - // Test that the interval increases as expected - for i := uint(0); i < maxMultiplier; i++ { - n := time.Now() - interval := b.set(nil) - if interval != time.Second*(1< maxMultiplier { - t.Fatalf("backoff.multiplier=%v; want %v", b.multiplier, maxMultiplier) - } - if interval > time.Second*(1<<(maxMultiplier-1)) { - t.Fatalf("backoff.set(nil)=%v; want %v", interval, 1<<(maxMultiplier-1)*time.Second) - } - - // Test decreaseMultiplier properly decreases the multiplier - b.multiplier = 1 - b.notBefore = time.Time{} - b.decreaseMultiplier() - if b.multiplier != 0 { - t.Fatalf("backoff.multiplier=%v; want %v", b.multiplier, 0) - } - - // Test decreaseMultiplier doesn't reduce multiplier below 0 - b.decreaseMultiplier() - if b.multiplier != 0 { - t.Fatalf("backoff.multiplier=%v; want %v", b.multiplier, 0) - } -} - -func TestBackoffOverride(t *testing.T) { - b := backoff{} - for _, tc := range []struct { - notBefore time.Time - override time.Duration - expectedInterval time.Duration - }{ - { - notBefore: time.Now().Add(time.Hour), - override: time.Second * 1800, - expectedInterval: time.Hour, - }, - { - notBefore: time.Now().Add(time.Hour), - override: time.Second * 7200, - expectedInterval: 2 * time.Hour, - }, - { - notBefore: time.Time{}, - override: time.Second * 7200, - expectedInterval: 2 * time.Hour, - }, - } { - b.multiplier = 0 - b.notBefore = tc.notBefore - interval := b.set(&tc.override) - if !fuzzyDurationEquals(tc.expectedInterval, interval, testLeeway) { - t.Fatalf("backoff.set(%v)=%v; want %v", tc.override, interval, tc.expectedInterval) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/jsonclient/client_test.go b/vendor/github.com/google/certificate-transparency-go/jsonclient/client_test.go deleted file mode 100644 index d86d6f9..0000000 --- a/vendor/github.com/google/certificate-transparency-go/jsonclient/client_test.go +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package jsonclient - -import ( - "context" - "encoding/json" - "encoding/pem" - "fmt" - "net/http" - "net/http/httptest" - "reflect" - "regexp" - "strconv" - "strings" - "sync" - "testing" - "time" - - "github.com/google/certificate-transparency-go/testdata" -) - -func publicKeyPEMToDER(key string) []byte { - block, _ := pem.Decode([]byte(key)) - if block == nil { - panic("failed to decode public key PEM") - } - if block.Type != "PUBLIC KEY" { - panic("PEM does not have type 'PUBLIC KEY'") - } - return block.Bytes -} - -func TestNewJSONClient(t *testing.T) { - tests := []struct { - name string - opts Options - errstr string - }{ - { - name: "invalid PublicKey", - opts: Options{PublicKey: "bogus"}, - errstr: "no PEM block", - }, - { - name: "invalid PublicKeyDER", - opts: Options{PublicKeyDER: []byte("bogus")}, - errstr: "asn1: structure error", - }, - { - name: "RSA PublicKey", - opts: Options{PublicKey: testdata.RsaPublicKeyPEM}, - }, - { - name: "RSA PublicKeyDER", - opts: Options{PublicKeyDER: publicKeyPEMToDER(testdata.RsaPublicKeyPEM)}, - }, - { - name: "ECDSA PublicKey", - opts: Options{PublicKey: testdata.EcdsaPublicKeyPEM}, - }, - { - name: "ECDSA PublicKeyDER", - opts: Options{PublicKeyDER: publicKeyPEMToDER(testdata.EcdsaPublicKeyPEM)}, - }, - { - name: "DSA PublicKey", - opts: Options{PublicKey: testdata.DsaPublicKeyPEM}, - errstr: "Unsupported public key type", - }, - { - name: "DSA PublicKeyDER", - opts: Options{PublicKeyDER: publicKeyPEMToDER(testdata.DsaPublicKeyPEM)}, - errstr: "Unsupported public key type", - }, - { - name: "PublicKey contains trailing garbage", - opts: Options{PublicKey: testdata.RsaPublicKeyPEM + "bogus"}, - errstr: "extra data found", - }, - { - name: "PublicKeyDER contains trailing garbage", - opts: Options{PublicKeyDER: append(publicKeyPEMToDER(testdata.RsaPublicKeyPEM), []byte("deadbeef")...)}, - errstr: "trailing data", - }, - } - for _, test := range tests { - client, err := New("http://127.0.0.1", nil, test.opts) - if test.errstr != "" { - if err == nil { - t.Errorf("%v: New()=%p,nil; want error %q", test.name, client, test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("%v: New()=nil,%q; want error %q", test.name, err, test.errstr) - } - continue - } - if err != nil { - t.Errorf("%v: New()=nil,%q; want no error", test.name, err) - } else if client == nil { - t.Errorf("%v: New()=nil,nil; want client", test.name) - } - } -} - -type TestStruct struct { - TreeSize int `json:"tree_size"` - Timestamp int `json:"timestamp"` - Data string `json:"data"` -} - -type TestParams struct { - RespCode int `json:"rc"` -} - -func MockServer(t *testing.T, failCount int, retryAfter int) *httptest.Server { - t.Helper() - mu := sync.Mutex{} - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - mu.Lock() - defer mu.Unlock() - switch r.URL.Path { - case "/struct/path": - fmt.Fprintf(w, `{"tree_size": 11, "timestamp": 99}`) - case "/struct/params": - var s TestStruct - if r.Method == http.MethodGet { - s.TreeSize, _ = strconv.Atoi(r.FormValue("tree_size")) - s.Timestamp, _ = strconv.Atoi(r.FormValue("timestamp")) - s.Data = r.FormValue("data") - } else { - decoder := json.NewDecoder(r.Body) - err := decoder.Decode(&s) - if err != nil { - panic("Failed to decode: " + err.Error()) - } - defer r.Body.Close() - } - fmt.Fprintf(w, `{"tree_size": %d, "timestamp": %d, "data": "%s"}`, s.TreeSize, s.Timestamp, s.Data) - case "/error": - var params TestParams - if r.Method == http.MethodGet { - params.RespCode, _ = strconv.Atoi(r.FormValue("rc")) - } else { - decoder := json.NewDecoder(r.Body) - err := decoder.Decode(¶ms) - if err != nil { - panic("Failed to decode: " + err.Error()) - } - defer r.Body.Close() - } - http.Error(w, "error page", params.RespCode) - case "/malformed": - fmt.Fprintf(w, `{"tree_size": 11, "timestamp": 99`) // no closing } - case "/retry": - if failCount > 0 { - failCount-- - if retryAfter != 0 { - if retryAfter > 0 { - w.Header().Add("Retry-After", strconv.Itoa(retryAfter)) - } - w.WriteHeader(http.StatusServiceUnavailable) - } else { - w.WriteHeader(http.StatusRequestTimeout) - } - } else { - fmt.Fprintf(w, `{"tree_size": 11, "timestamp": 99}`) - } - case "/retry-rfc1123": - if failCount > 0 { - failCount-- - w.Header().Add("Retry-After", time.Now().Add(time.Duration(retryAfter)*time.Second).Format(time.RFC1123)) - w.WriteHeader(http.StatusServiceUnavailable) - } else { - fmt.Fprintf(w, `{"tree_size": 11, "timestamp": 99}`) - } - default: - t.Fatalf("Unhandled URL path: %s", r.URL.Path) - } - })) -} - -func TestGetAndParse(t *testing.T) { - rc := regexp.MustCompile - tests := []struct { - uri string - params map[string]string - status int - result TestStruct - errstr *regexp.Regexp - wantBody bool - }{ - {uri: "/short%", errstr: rc("invalid URL escape")}, - {uri: "/malformed", status: http.StatusOK, errstr: rc("unexpected EOF"), wantBody: true}, - {uri: "/error", params: map[string]string{"rc": "404"}, status: http.StatusNotFound, wantBody: true}, - {uri: "/error", params: map[string]string{"rc": "403"}, status: http.StatusForbidden, wantBody: true}, - {uri: "/struct/path", status: http.StatusOK, result: TestStruct{11, 99, ""}, wantBody: true}, - { - uri: "/struct/params", - status: http.StatusOK, - params: map[string]string{"tree_size": "42", "timestamp": "88", "data": "abcd"}, - result: TestStruct{42, 88, "abcd"}, - wantBody: true, - }, - } - - ts := MockServer(t, -1, 0) - defer ts.Close() - - logClient, err := New(ts.URL, &http.Client{}, Options{}) - if err != nil { - t.Fatal(err) - } - ctx := context.Background() - - for _, test := range tests { - var result TestStruct - httpRsp, body, err := logClient.GetAndParse(ctx, test.uri, test.params, &result) - if gotBody := (body != nil); gotBody != test.wantBody { - t.Errorf("GetAndParse(%q) got body? %v, want? %v", test.uri, gotBody, test.wantBody) - } - if test.errstr != nil { - if err == nil { - t.Errorf("GetAndParse(%q)=%+v,_,nil; want error matching %q", test.uri, result, test.errstr) - } else if !test.errstr.MatchString(err.Error()) { - t.Errorf("GetAndParse(%q)=nil,_,%q; want error matching %q", test.uri, err.Error(), test.errstr) - } - continue - } - if httpRsp.StatusCode != test.status { - t.Errorf("GetAndParse('%s') got status %d; want %d", test.uri, httpRsp.StatusCode, test.status) - } - if test.status == http.StatusOK { - if err != nil { - t.Errorf("GetAndParse(%q)=nil,_,%q; want %+v", test.uri, err.Error(), result) - } - if !reflect.DeepEqual(result, test.result) { - t.Errorf("GetAndParse(%q)=%+v,_,nil; want %+v", test.uri, result, test.result) - } - } - } -} - -func TestPostAndParse(t *testing.T) { - rc := regexp.MustCompile - tests := []struct { - uri string - request interface{} - status int - result TestStruct - errstr *regexp.Regexp - wantBody bool - }{ - {uri: "/short%", errstr: rc("invalid URL escape")}, - {uri: "/struct/params", request: json.Number(`invalid`), errstr: rc("invalid number literal")}, - {uri: "/malformed", status: http.StatusOK, errstr: rc("unexpected end of JSON"), wantBody: true}, - {uri: "/error", request: TestParams{RespCode: 404}, status: http.StatusNotFound, wantBody: true}, - {uri: "/error", request: TestParams{RespCode: 403}, status: http.StatusForbidden, wantBody: true}, - {uri: "/struct/path", status: http.StatusOK, result: TestStruct{11, 99, ""}, wantBody: true}, - { - uri: "/struct/params", - status: http.StatusOK, - request: TestStruct{42, 88, "abcd"}, - result: TestStruct{42, 88, "abcd"}, - wantBody: true, - }, - } - - ts := MockServer(t, -1, 0) - defer ts.Close() - - logClient, err := New(ts.URL, &http.Client{}, Options{}) - if err != nil { - t.Fatal(err) - } - ctx := context.Background() - - for _, test := range tests { - var result TestStruct - httpRsp, body, err := logClient.PostAndParse(ctx, test.uri, test.request, &result) - if gotBody := (body != nil); gotBody != test.wantBody { - t.Errorf("GetAndParse(%q) returned body %v, wanted %v", test.uri, gotBody, test.wantBody) - } - if test.errstr != nil { - if err == nil { - t.Errorf("PostAndParse(%q)=%+v,nil; want error matching %q", test.uri, result, test.errstr) - } else if !test.errstr.MatchString(err.Error()) { - t.Errorf("PostAndParse(%q)=nil,%q; want error matching %q", test.uri, err.Error(), test.errstr) - } - continue - } - if httpRsp.StatusCode != test.status { - t.Errorf("PostAndParse(%q) got status %d; want %d", test.uri, httpRsp.StatusCode, test.status) - } - if test.status == http.StatusOK { - if err != nil { - t.Errorf("PostAndParse(%q)=nil,%q; want %+v", test.uri, err.Error(), test.result) - } - if !reflect.DeepEqual(result, test.result) { - t.Errorf("PostAndParse(%q)=%+v,nil; want %+v", test.uri, result, test.result) - } - } - } -} - -// mockBackoff is not safe for concurrent usage -type mockBackoff struct { - override time.Duration -} - -func (mb *mockBackoff) set(o *time.Duration) time.Duration { - if o != nil { - mb.override = *o - } - return 0 -} -func (mb *mockBackoff) decreaseMultiplier() {} -func (mb *mockBackoff) until() time.Time { return time.Time{} } - -func TestPostAndParseWithRetry(t *testing.T) { - tests := []struct { - uri string - request interface{} - deadlineSecs int // -1 indicates no deadline - retryAfter int // -1 indicates generate 503 with no Retry-After - failCount int - errstr string - expectedBackoff time.Duration // 0 indicates no expected backoff override set - }{ - { - uri: "/error", - request: TestParams{RespCode: 418}, - deadlineSecs: -1, - retryAfter: 0, - failCount: 0, - errstr: "teapot", - expectedBackoff: 0, - }, - { - uri: "/short%", - request: nil, - deadlineSecs: 0, - retryAfter: 0, - failCount: 0, - errstr: "deadline exceeded", - expectedBackoff: 0, - }, - { - uri: "/retry", - request: nil, - deadlineSecs: -1, - retryAfter: 0, - failCount: 1, - errstr: "", - expectedBackoff: 0, - }, - { - uri: "/retry", - request: nil, - deadlineSecs: -1, - retryAfter: 5, - failCount: 1, - errstr: "", - expectedBackoff: 5 * time.Second, - }, - { - uri: "/retry-rfc1123", - request: nil, - deadlineSecs: -1, - retryAfter: 5, - failCount: 1, - errstr: "", - expectedBackoff: 5 * time.Second, - }, - } - for _, test := range tests { - ts := MockServer(t, test.failCount, test.retryAfter) - defer ts.Close() - - logClient, err := New(ts.URL, &http.Client{}, Options{}) - if err != nil { - t.Fatal(err) - } - mb := mockBackoff{} - logClient.backoff = &mb - ctx := context.Background() - if test.deadlineSecs >= 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(time.Duration(test.deadlineSecs)*time.Second)) - defer cancel() - } - - var result TestStruct - httpRsp, _, err := logClient.PostAndParseWithRetry(ctx, test.uri, test.request, &result) - if test.errstr != "" { - if err == nil { - t.Errorf("PostAndParseWithRetry()=%+v,nil; want error %q", result, test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("PostAndParseWithRetry()=nil,%q; want error %q", err.Error(), test.errstr) - } - continue - } - if err != nil { - t.Errorf("PostAndParseWithRetry()=nil,%q; want no error", err.Error()) - } else if httpRsp.StatusCode != http.StatusOK { - t.Errorf("PostAndParseWithRetry() got status %d; want OK(404)", httpRsp.StatusCode) - } - if test.expectedBackoff > 0 && !fuzzyDurationEquals(test.expectedBackoff, mb.override, time.Second) { - t.Errorf("Unexpected backoff override set: got: %s, wanted: %s", mb.override, test.expectedBackoff) - } - } -} - -func TestContextRequired(t *testing.T) { - ts := MockServer(t, -1, 0) - defer ts.Close() - - logClient, err := New(ts.URL, &http.Client{}, Options{}) - if err != nil { - t.Fatal(err) - } - var result TestStruct - _, _, err = logClient.GetAndParse(nil, "/struct/path", nil, &result) - if err == nil { - t.Errorf("GetAndParse() succeeded with empty Context") - } - _, _, err = logClient.PostAndParse(nil, "/struct/path", nil, &result) - if err == nil { - t.Errorf("PostAndParse() succeeded with empty Context") - } - _, _, err = logClient.PostAndParseWithRetry(nil, "/struct/path", nil, &result) - if err == nil { - t.Errorf("PostAndParseWithRetry() succeeded with empty Context") - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/serialization_test.go b/vendor/github.com/google/certificate-transparency-go/serialization_test.go deleted file mode 100644 index 834985d..0000000 --- a/vendor/github.com/google/certificate-transparency-go/serialization_test.go +++ /dev/null @@ -1,513 +0,0 @@ -// Copyright 2015 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ct - -import ( - "bytes" - "encoding/hex" - "encoding/pem" - "io/ioutil" - "reflect" - "strings" - "testing" - - "github.com/google/certificate-transparency-go/tls" -) - -func dh(h string) []byte { - r, err := hex.DecodeString(h) - if err != nil { - panic(err) - } - return r -} - -const ( - defaultSCTLogIDString string = "iamapublickeyshatwofivesixdigest" - defaultSCTTimestamp uint64 = 1234 - defaultSCTSignatureString string = "\x04\x03\x00\x09signature" - defaultCertifictateString string = "certificate" - defaultPrecertString string = "precert" - defaultPrecertIssuerHashString string = "iamapublickeyshatwofivesixdigest" - defaultPrecertTBSString string = "tbs" - - defaultCertificateSCTSignatureInputHexString string = - // version, 1 byte - "00" + - // signature type, 1 byte - "00" + - // timestamp, 8 bytes - "00000000000004d2" + - // entry type, 2 bytes - "0000" + - // leaf certificate length, 3 bytes - "00000b" + - // leaf certificate, 11 bytes - "6365727469666963617465" + - // extensions length, 2 bytes - "0000" + - // extensions, 0 bytes - "" - - defaultPrecertSCTSignatureInputHexString string = - // version, 1 byte - "00" + - // signature type, 1 byte - "00" + - // timestamp, 8 bytes - "00000000000004d2" + - // entry type, 2 bytes - "0001" + - // issuer key hash, 32 bytes - "69616d617075626c69636b657973686174776f66697665736978646967657374" + - // tbs certificate length, 3 bytes - "000003" + - // tbs certificate, 3 bytes - "746273" + - // extensions length, 2 bytes - "0000" + - // extensions, 0 bytes - "" - - defaultSTHSignedHexString string = - // version, 1 byte - "00" + - // signature type, 1 byte - "01" + - // timestamp, 8 bytes - "0000000000000929" + - // tree size, 8 bytes - "0000000000000006" + - // root hash, 32 bytes - "696d757374626565786163746c7974686972747974776f62797465736c6f6e67" - - defaultSCTHexString string = - // version, 1 byte - "00" + - // keyid, 32 bytes - "69616d617075626c69636b657973686174776f66697665736978646967657374" + - // timestamp, 8 bytes - "00000000000004d2" + - // extensions length, 2 bytes - "0000" + - // extensions, 0 bytes - // hash algo, sig algo, 2 bytes - "0403" + - // signature length, 2 bytes - "0009" + - // signature, 9 bytes - "7369676e6174757265" - - defaultSCTListHexString string = "0476007400380069616d617075626c69636b657973686174776f6669766573697864696765737400000000000004d20000040300097369676e617475726500380069616d617075626c69636b657973686174776f6669766573697864696765737400000000000004d20000040300097369676e6174757265" -) - -func defaultSCTLogID() LogID { - var id LogID - copy(id.KeyID[:], defaultSCTLogIDString) - return id -} - -func defaultSCTSignature() DigitallySigned { - var ds DigitallySigned - if _, err := tls.Unmarshal([]byte(defaultSCTSignatureString), &ds); err != nil { - panic(err) - } - return ds -} - -func defaultSCT() SignedCertificateTimestamp { - return SignedCertificateTimestamp{ - SCTVersion: V1, - LogID: defaultSCTLogID(), - Timestamp: defaultSCTTimestamp, - Extensions: []byte{}, - Signature: defaultSCTSignature()} -} - -func defaultCertificate() []byte { - return []byte(defaultCertifictateString) -} - -func defaultExtensions() []byte { - return []byte{} -} - -func defaultCertificateSCTSignatureInput(t *testing.T) []byte { - t.Helper() - r, err := hex.DecodeString(defaultCertificateSCTSignatureInputHexString) - if err != nil { - t.Fatalf("failed to decode defaultCertificateSCTSignatureInputHexString: %v", err) - } - return r -} - -func defaultCertificateLogEntry() LogEntry { - return LogEntry{ - Index: 1, - Leaf: MerkleTreeLeaf{ - Version: V1, - LeafType: TimestampedEntryLeafType, - TimestampedEntry: &TimestampedEntry{ - Timestamp: defaultSCTTimestamp, - EntryType: X509LogEntryType, - X509Entry: &ASN1Cert{Data: defaultCertificate()}, - }, - }, - } -} - -func defaultPrecertSCTSignatureInput(t *testing.T) []byte { - t.Helper() - r, err := hex.DecodeString(defaultPrecertSCTSignatureInputHexString) - if err != nil { - t.Fatalf("failed to decode defaultPrecertSCTSignatureInputHexString: %v", err) - } - return r -} - -func defaultPrecertTBS() []byte { - return []byte(defaultPrecertTBSString) -} - -func defaultPrecertIssuerHash() [32]byte { - var b [32]byte - copy(b[:], []byte(defaultPrecertIssuerHashString)) - return b -} - -func defaultPrecertLogEntry() LogEntry { - return LogEntry{ - Index: 1, - Leaf: MerkleTreeLeaf{ - Version: V1, - LeafType: TimestampedEntryLeafType, - TimestampedEntry: &TimestampedEntry{ - Timestamp: defaultSCTTimestamp, - EntryType: PrecertLogEntryType, - PrecertEntry: &PreCert{ - IssuerKeyHash: defaultPrecertIssuerHash(), - TBSCertificate: defaultPrecertTBS(), - }, - }, - }, - } -} - -func defaultSTH() SignedTreeHead { - var root SHA256Hash - copy(root[:], "imustbeexactlythirtytwobyteslong") - return SignedTreeHead{ - TreeSize: 6, - Timestamp: 2345, - SHA256RootHash: root, - TreeHeadSignature: DigitallySigned{ - Algorithm: tls.SignatureAndHashAlgorithm{ - Hash: tls.SHA256, - Signature: tls.ECDSA}, - Signature: []byte("tree_signature"), - }, - } -} - -////////////////////////////////////////////////////////////////////////////////// -// Tests start here: -////////////////////////////////////////////////////////////////////////////////// - -func TestSerializeV1SCTSignatureInputForCertificateKAT(t *testing.T) { - serialized, err := SerializeSCTSignatureInput(defaultSCT(), defaultCertificateLogEntry()) - if err != nil { - t.Fatalf("Failed to serialize SCT for signing: %v", err) - } - if bytes.Compare(serialized, defaultCertificateSCTSignatureInput(t)) != 0 { - t.Fatalf("Serialized certificate signature input doesn't match expected answer:\n%v\n%v", serialized, defaultCertificateSCTSignatureInput(t)) - } -} - -func TestSerializeV1SCTSignatureInputForPrecertKAT(t *testing.T) { - serialized, err := SerializeSCTSignatureInput(defaultSCT(), defaultPrecertLogEntry()) - if err != nil { - t.Fatalf("Failed to serialize SCT for signing: %v", err) - } - if bytes.Compare(serialized, defaultPrecertSCTSignatureInput(t)) != 0 { - t.Fatalf("Serialized precertificate signature input doesn't match expected answer:\n%v\n%v", serialized, defaultPrecertSCTSignatureInput(t)) - } -} - -func TestSerializeV1SCTJSONSignature(t *testing.T) { - entry := LogEntry{Leaf: *CreateJSONMerkleTreeLeaf("data", defaultSCT().Timestamp)} - expected := dh( - // version, 1 byte - "00" + - // signature type, 1 byte - "00" + - // timestamp, 8 bytes - "00000000000004d2" + - // entry type, 2 bytes - "8000" + - // tbs certificate length, 18 bytes - "000012" + - // { "data": "data" }, 3 bytes - "7b202264617461223a20226461746122207d" + - // extensions length, 2 bytes - "0000" + - // extensions, 0 bytes - "") - serialized, err := SerializeSCTSignatureInput(defaultSCT(), entry) - if err != nil { - t.Fatalf("Failed to serialize SCT for signing: %v", err) - } - if !bytes.Equal(serialized, expected) { - t.Fatalf("Serialized JSON signature :\n%x, want\n%x", serialized, expected) - } -} - -func TestSerializeV1STHSignatureKAT(t *testing.T) { - b, err := SerializeSTHSignatureInput(defaultSTH()) - if err != nil { - t.Fatalf("Failed to serialize defaultSTH: %v", err) - } - if bytes.Compare(b, mustDehex(t, defaultSTHSignedHexString)) != 0 { - t.Fatalf("defaultSTH incorrectly serialized, expected:\n%v\ngot:\n%v", mustDehex(t, defaultSTHSignedHexString), b) - } -} - -func TestMarshalDigitallySigned(t *testing.T) { - b, err := tls.Marshal( - DigitallySigned{ - Algorithm: tls.SignatureAndHashAlgorithm{ - Hash: tls.SHA512, - Signature: tls.ECDSA}, - Signature: []byte("signature")}) - if err != nil { - t.Fatalf("Failed to marshal DigitallySigned struct: %v", err) - } - if b[0] != byte(tls.SHA512) { - t.Fatalf("Expected b[0] == SHA512, but found %v", tls.HashAlgorithm(b[0])) - } - if b[1] != byte(tls.ECDSA) { - t.Fatalf("Expected b[1] == ECDSA, but found %v", tls.SignatureAlgorithm(b[1])) - } - if b[2] != 0x00 || b[3] != 0x09 { - t.Fatalf("Found incorrect length bytes, expected (0x00, 0x09) found %v", b[2:3]) - } - if string(b[4:]) != "signature" { - t.Fatalf("Found incorrect signature bytes, expected %v, found %v", []byte("signature"), b[4:]) - } -} - -func TestUnmarshalDigitallySigned(t *testing.T) { - var ds DigitallySigned - if _, err := tls.Unmarshal([]byte("\x01\x02\x00\x0aSiGnAtUrE!"), &ds); err != nil { - t.Fatalf("Failed to unmarshal DigitallySigned: %v", err) - } - if ds.Algorithm.Hash != tls.MD5 { - t.Fatalf("Expected HashAlgorithm %v, but got %v", tls.MD5, ds.Algorithm.Hash) - } - if ds.Algorithm.Signature != tls.DSA { - t.Fatalf("Expected SignatureAlgorithm %v, but got %v", tls.DSA, ds.Algorithm.Signature) - } - if string(ds.Signature) != "SiGnAtUrE!" { - t.Fatalf("Expected Signature %v, but got %v", []byte("SiGnAtUrE!"), ds.Signature) - } -} - -func TestMarshalUnmarshalSCTRoundTrip(t *testing.T) { - sctIn := defaultSCT() - b, err := tls.Marshal(sctIn) - if err != nil { - t.Fatalf("tls.Marshal(SCT)=nil,%v; want no error", err) - } - var sctOut SignedCertificateTimestamp - if _, err := tls.Unmarshal(b, &sctOut); err != nil { - t.Errorf("tls.Unmarshal(%s)=nil,%v; want %+v,nil", hex.EncodeToString(b), err, sctIn) - } else if !reflect.DeepEqual(sctIn, sctOut) { - t.Errorf("tls.Unmarshal(%s)=%v,nil; want %+v,nil", hex.EncodeToString(b), sctOut, sctIn) - } -} - -func TestMarshalSCT(t *testing.T) { - b, err := tls.Marshal(defaultSCT()) - if err != nil { - t.Errorf("tls.Marshal(defaultSCT)=nil,%v; want %s", err, defaultSCTHexString) - } else if !bytes.Equal(dh(defaultSCTHexString), b) { - t.Errorf("tls.Marshal(defaultSCT)=%s,nil; want %s", hex.EncodeToString(b), defaultSCTHexString) - } -} - -func TestUnmarshalSCT(t *testing.T) { - want := defaultSCT() - var got SignedCertificateTimestamp - if _, err := tls.Unmarshal(dh(defaultSCTHexString), &got); err != nil { - t.Errorf("tls.Unmarshal(%s)=nil,%v; want %+v,nil", defaultSCTHexString, err, want) - } else if !reflect.DeepEqual(got, want) { - t.Errorf("tls.Unmarshal(%s)=%+v,nil; want %+v,nil", defaultSCTHexString, got, want) - } -} - -func TestX509MerkleTreeLeafHash(t *testing.T) { - certFile := "./testdata/test-cert.pem" - sctFile := "./testdata/test-cert.proof" - certB, err := ioutil.ReadFile(certFile) - if err != nil { - t.Fatalf("Failed to read file %s: %v", certFile, err) - } - certDER, _ := pem.Decode(certB) - - sctB, err := ioutil.ReadFile(sctFile) - if err != nil { - t.Fatalf("Failed to read file %s: %v", sctFile, err) - } - var sct SignedCertificateTimestamp - if _, err := tls.Unmarshal(sctB, &sct); err != nil { - t.Fatalf("Failed to deserialize SCT: %v", err) - } - - leaf := CreateX509MerkleTreeLeaf(ASN1Cert{Data: certDER.Bytes}, sct.Timestamp) - b, err := tls.Marshal(*leaf) - if err != nil { - t.Fatalf("Failed to Serialize x509 leaf: %v", err) - } - - leafBytes := dh("00000000013ddb27ded900000002ce308202ca30820233a003020102020106300d06092a864886f70d01010505003055310b300906035504061302474231243022060355040a131b4365727469666963617465205472616e73706172656e6379204341310e300c0603550408130557616c65733110300e060355040713074572772057656e301e170d3132303630313030303030305a170d3232303630313030303030305a3052310b30090603550406130247423121301f060355040a13184365727469666963617465205472616e73706172656e6379310e300c0603550408130557616c65733110300e060355040713074572772057656e30819f300d06092a864886f70d010101050003818d0030818902818100b1fa37936111f8792da2081c3fe41925008531dc7f2c657bd9e1de4704160b4c9f19d54ada4470404c1c51341b8f1f7538dddd28d9aca48369fc5646ddcc7617f8168aae5b41d43331fca2dadfc804d57208949061f9eef902ca47ce88c644e000f06eeeccabdc9dd2f68a22ccb09dc76e0dbc73527765b1a37a8c676253dcc10203010001a381ac3081a9301d0603551d0e041604146a0d982a3b62c44b6d2ef4e9bb7a01aa9cb798e2307d0603551d230476307480145f9d880dc873e654d4f80dd8e6b0c124b447c355a159a4573055310b300906035504061302474231243022060355040a131b4365727469666963617465205472616e73706172656e6379204341310e300c0603550408130557616c65733110300e060355040713074572772057656e82010030090603551d1304023000300d06092a864886f70d010105050003818100171cd84aac414a9a030f22aac8f688b081b2709b848b4e5511406cd707fed028597a9faefc2eee2978d633aaac14ed3235197da87e0f71b8875f1ac9e78b281749ddedd007e3ecf50645f8cbf667256cd6a1647b5e13203bb8582de7d6696f656d1c60b95f456b7fcf338571908f1c69727d24c4fccd249295795814d1dac0e60000") - if !bytes.Equal(b, leafBytes) { - t.Errorf("CreateX509MerkleTreeLeaf(): got\n %x, want\n%x", b, sctB) - } - -} - -func TestJSONMerkleTreeLeaf(t *testing.T) { - data := `CioaINV25GV8X4a6M6Q10avSLP9PYd5N8MwWxQvWU7E2CzZ8IgYI0KnavAUSWAoIZDc1NjMzMzMSTAgEEAMaRjBEAiBQlnp6Q3di86g8M3l5gz+9qls/Cz1+KJ+tK/jpaBtUCgIgXaJ94uLsnChA1NY7ocGwKrQwPU688hwaZ5L/DboV4mQ=2` - timestamp := uint64(1469664866615) - leaf := CreateJSONMerkleTreeLeaf(data, timestamp) - b, err := tls.Marshal(*leaf) - if err != nil { - t.Fatalf("Failed to Serialize x509 leaf: %v", err) - } - leafBytes := dh("0000000001562eda313780000000c67b202264617461223a202243696f61494e563235475638583461364d365131306176534c5039505964354e384d77577851765755374532437a5a3849675949304b6e617641555357416f495a4463314e6a4d7a4d7a4d535441674545414d61526a4245416942516c6e703651336469383667384d336c35677a2b39716c735c2f437a312b4b4a2b744b5c2f6a70614274554367496758614a3934754c736e436841314e59376f6347774b72517750553638386877615a354c5c2f44626f56346d513d3222207d0000") - - if !bytes.Equal(b, leafBytes) { - t.Errorf("CreateJSONMerkleTreeLeaf(): got\n%x, want\n%x", b, leafBytes) - } -} - -func TestLogEntryFromLeaf(t *testing.T) { - const ( - // Cert example taken from entry #1 in argon2018 log - leafDER = "308204ef308202d7a00302010202070556658a503cca300d06092a864886f70d01010b0500307f310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793123302106035504030c1a4d657267652044656c617920496e7465726d6564696174652031301e170d3137303831303132343331355a170d3138303333313038333231375a3063310b3009060355040613024742310f300d06035504070c064c6f6e646f6e31283026060355040a0c1f476f6f676c65204365727469666963617465205472616e73706172656e637931193017060355040513103135303233363839393537353331363230820122300d06092a864886f70d01010105000382010f003082010a0282010100a2fb53365dfbcefea77e1d65bc40f34f7919fcae85d82d3003428199f0c893fca95ba139156fd5e9a3bd84dc6dab8e74151fde6dd25b31526c85719bbf8990f3d6b21bb7f321306f6ddc50b96e8917fa103b388a00e1e954ee0232a9f9fb2efa8c9f9196a7fe84dad1f66b5d36127c71c9dcf25a04acd7bfda7866dfb77498c63a7ae9e7d0772fe9ba938a9ff6c0209196988158e6ea055fe967dd7599ef4bd7f306ded231cca10d89b4d6de40916e615d1d4cc6032585822a650743e34735d464fc0d544d1fad8c293df22f4a55ce3fbfb55d90cdc5ab84695a5a13d46f3176f143d9d28f60dca841eac603d30cec830a62feec091c927e6c781df330f14ca10203010001a3818b30818830130603551d25040c300a06082b0601050507030130230603551d11041c301a8218666c6f776572732d746f2d7468652d776f726c642e636f6d300c0603551d130101ff04023000301f0603551d23041830168014e93c04e1802fc284132d26709ef2fd1acfaafec6301d0603551d0e041604142f3948061fe546939f5e8dbc3fe4c0a1fbaab6b7300d06092a864886f70d01010b0500038202010052a2480c754c51cfdc9f99a82a8eb7c34e5e2bdcdfdd7543fadadb578083416d34ebb87fea3c90baf97f06be5baf5c41101ad1bdd2a2f554de6a3e8cd5ff3d78354badad01032a007d2eaf03590ee5397e223b2936f0c8b59c0407079c8975ffb34eb1cfe784cf3bc45e198a601473537f1ef382e0b5311d2ddf430ade7cfd28900ec9d91c1db49a6b2fb1b9e13b94135fed978d646e048b2fa9dc36ef5821cea8ebbed38d4c2d7811e9660f23d7636b295caccdc945a010a4c364fd7e7480aa5282d28fc46ce7f4f636ef2cc57c8bb1aee5da79bc6107205d4abcd3fb09a1db023ba4e8e9f34ae36ff5b2672fc2a14af8d23d67a437b3eb507ca90f73121841ab1498ab712d18063244dc3514bfffbaf6d45acdfc5316a248589a04b79b2abbca454e2e21f9b487e21eea21565c99ebc1013b87253c91f43ac6d2d2dea7090877c2a7404bce2545662ce005dc12eb57b1efe7145af8070b5dfa86736664a644a9c0f7e7c38d715cf874b818d519927eddc69b55c781b6e0a6eef8f3e46b9e059105b7932a978704e924904dbaa9583f3dd606467f4cc41589b702f1a02d517d3cd93b55d67d0b379e2527fded951be9dfb86d473613e6d9b8399ef5174d3e03185bd3cb4ea859b465c6c49010d4119d613a60878c0e453f17cfa3ce925e10f6e0a5adb745cebe218c3c82627a120e2907eeb9ec5307664474093cbc92d65fc7" - leafCA = "308205c8308203b0a00302010202021001300d06092a864886f70d0101050500307d310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793121301f06035504030c184d657267652044656c6179204d6f6e69746f7220526f6f74301e170d3134303731373132323633305a170d3139303731363132323633305a307f310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793123302106035504030c1a4d657267652044656c617920496e7465726d656469617465203130820222300d06092a864886f70d01010105000382020f003082020a0282020100c1e874feff9aeef303bbfa63453881faaf8dc1c22c09641daf430381f33bc157bf6c4c8a8d57b1abc792859d20f2191509c597c437b14673dea5af4bea14396dd436dc620555d7953e0ede01f7ffb44f3ff7cde64ed245634e0df0aafce9c3ac5eb63d8de1d969cac8854195403a9f9d1d4c3dceedf1351edd945743bc54ab745b204fb5259fe3edf695c2cf90b886c48ff680b744fec2691b4345242b31c36f3118b727c5de5c25ec1aa30a4c2461c5119ef6bb90d816e6e44c5b9955bfa2ed3416bf6e4a53c92fafac0d1f0b8bf3d35be0d4f61ca05d28fc662dfa588fba3ee0380470c012ded9e51bbf1e7a25efa745784c49d05eaf8dcee0527361ec913126005e972cf4b863914f8361582ed24563ff9e03c52e8a9ca3264c56c186b4ec52b7e695ce42ae17ec7ae0257131e1dbf48f2dde242e6e91ea304988135a15482b05fc091355328b39e586e8dd3a4a3a14cb97eef68f9f69728c291f2195d2cce73d4ae90845b1bfc5fae040b94fc359a29511981b9966aeb56d3a7c5e48f8eca815e5be86b3d36e6a27e0e2c4dee6e30f12a7c936b8c98cad5928aca238dfc39cf9f2c5246cbbbb280cb6f99eb49bfd1d78089539072c164c7083371746dedbc4dec1cb9439073af3f2e60f8c505f067961a8c539454fc5341158eccc78532f3e39c3187c9439fc0ff88ee957131d478df063dd50b2ad3fe7a070e905e3868b0203010001a350304e301d0603551d0e04160414e93c04e1802fc284132d26709ef2fd1acfaafec6301f0603551d23041830168014f35f7b7549e37841396a20b67c6b4c5cc93d5841300c0603551d13040530030101ff300d06092a864886f70d010105050003820201000858cbd545f2e92e09906ac39f3d55c13607a651436386c6e90f128773a0eb3f4725d8af35fb7f880436b481f2cf47801825de54f13f8f5920bf3d916e753141de5e59d2debbfc3fc226721f15a16d3b7a4618ea0551639f1d2cb7b9faad1b7e070f23a6e8197c3d7549bba6553fd5db419ce399477f6a0481b90f51c9d307d82cb05cf967828a1ace65207cf86b6d16792245dcf24b4c179f91184736e7e2fcb863a4b5c89b0ac2f368390a10594b95c856e259c77564316898cf87a6817d18585fc976d681d9d510ef2ad37e8ad0e49f5bd499c9ec7fe8f43b17dffb9b7d0dfd8300c1c5389c9ea0be4370dcbf78bd3efc2308d250b866bbca031c0c49ff77a7a5420daa1f1b6a444d366653974c2d179c3009871ee6c89140fca9efdf23bd4b88c6ebaeb9286f58f3cfc21e4874f182d1ecd6058919b03b18db7b795be9cb25fc5166a945ef8e1133cd60312a3234f4649df6166407cbb5ecc838e9e118c05dee7c896a9987655ae7e349cd8166e68d34dea3b4ae892a9f2385053271e860b542be3650503974f3bb6f2688375ab28487da6751d0f2c3a35e78efe30b19d57808ebea2c4453990ad81eb96289c0f99c5080f82092bc6123a340c63a617f3bc4adc1298d88a278a693ef93688611d3b4eded0b6d023ed9f6c2ea8836483197525b1b1bce70a90c3403b094d5f412aa1141b9965ab8314c52f772deffc1008c" - rootCA = "308205cd308203b5a0030201020209009ed3ccb1d12ca272300d06092a864886f70d0101050500307d310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793121301f06035504030c184d657267652044656c6179204d6f6e69746f7220526f6f74301e170d3134303731373132303534335a170d3431313230323132303534335a307d310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793121301f06035504030c184d657267652044656c6179204d6f6e69746f7220526f6f7430820222300d06092a864886f70d01010105000382020f003082020a0282020100aa161cf2205ed81ac565483cda426a3db2e588fdb758b17b93ea8d68495d534a01ba4f6cd1c0fc0a128af79c066dc54c3f437e05ba275ee61dbf9cbdb2928183738139397b6189ae738fef2b9b609a6dd8e0b0d0e20b243db936c029cdc2220af2c0e1a5e4aa41a006af458957e2b1178d27156ef0cb717e16d54025d97f43e9916fb240fb85f7d579462fa0ac76c76256843750bf1ccdfeb76c8c47886477644d5ec3235628adf6a09c8488bfa5036de717908151a6b585f273dd9fb5332b9af76e8fbfa91eaf4311816dde27c5c44f2fd06cc2204d7147f77ba6b16a2a5fca470023614729538bee6b3cb07264713832aec161550eb501906802215223acc2564ad1f98bb5934924eb56d383fc7598be45c89d995281c0efb0d206d29a6d25a10a48fe235332379c5ca69e83599faa677dd20823f5c84a961255eca5d4871d54ca1df0774aa117b0f42cd6e9fda7e8a48a53923c5f94043353544e644b5a6562e5cef9fc2bd2fcfcce3323335cf7fe7c4d83c1b7f839c4790192d3ba9aa9f32093aa8ee7cbe708059d538dc663cca1b825331aa836754a0d13de63bf65b6e2044dcdf041f1a0c5a9c3c38fe74cf576d451c23eaa519db32ef9e039bd848a194c3b5e41a55642dc283ddbd73d1dd97ae6951de18ad89d005007fae7e88bc7a3cce8b7ccc49603a0db67c76d58a28d4b77aa7460801e34377d0c5e4606c2e25b0203010001a350304e301d0603551d0e04160414f35f7b7549e37841396a20b67c6b4c5cc93d5841301f0603551d23041830168014f35f7b7549e37841396a20b67c6b4c5cc93d5841300c0603551d13040530030101ff300d06092a864886f70d01010505000382020100771cfea34579a97520d8c2423d68ecd07891f8c7f1c38bf3cd30ea9d3637bfc5d373532ec7656558bef4950646750c6fe085c52d9ffc09e66ebfa2b067de7727cb381d2b25db58b9c2197fd5eb53e020f429b86a3b1f37a07a761a66a5b3ecd797c46695a37ff2d47c54126be6bd28a2a103357227c6b73f7f689b09b48927e6e9a52267a728a115d4bcbb477533dc28f3fc57da735a3ec54fbc36990b17febb7e46b324208c1fa7425a0cba48bdc0381ea8285215261c3c483f2fa6d1da0dba4949107189f32d728a7ff395d43430af3b8ce4be5075bcf67d66661941dc8be37340f8f9282b2d2aadd69065932ad49769f8bc7fc9e5f6e79ff392420ba78de3172778e2b67e4df18440dd561e5a7844c8efa06c0e5f5b8695fa069114a00518fb4c19f9d7855831b5eeebced14b8598daffa49f2dcf505bff6417d84b28e83599d4e0371ef64b2d82ffa068a31044f7322fee2f654ec357c9c121f3458a509728c37f5673412ad0d5e76aa6b4eb1582181a8be404d3dc35e71edd83ee388087d6147c4d86f1cacacface0104df1f4b100c2ceb1be4d1851c4f31e7c4409262185878f23cceb30790143f0d5bd80d2c0ed4260aaa312597d950aaf3c8bcfc812d9a56e8d160dd772a494743710a7e478a046d8a5d505ee6b8cc37fec09dfd4cb57c6c4d8e8ef2a22e1d9e50957852633138d722253e51ba77b0069d38812207a" - noExts = "0000" - // Precert example taken from entry #2 in argon2018 log - issuerKeyHash = "e37689003073a0c649cc656de946c03174d25c566fe3c3805b846f5236943798" - precertTBS = "0002db308202d7a0030201020207055667377e8bcc300d06092a864886f70d01010b0500307f310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793123302106035504030c1a4d657267652044656c617920496e7465726d6564696174652031301e170d3137303831303134343331365a170d3138303432363134323430315a3063310b3009060355040613024742310f300d06035504070c064c6f6e646f6e31283026060355040a0c1f476f6f676c65204365727469666963617465205472616e73706172656e637931193017060355040513103135303233373631393632313337303830820122300d06092a864886f70d01010105000382010f003082010a0282010100dea100ff02f31ae6f76f9c26525afcdd0ef6eef780d72b4b1c0ff14fc7ac021852d6f34af20713d05fea2c2e1a4b488b3849c2511cf30fcd2e61d9e7392557498a4ff600c8fdc912f05c8a583a5f2b6a3d3320c6cc10b7eed502de392d11b3c4d57fa6e3ddc69d3f73305bb6441a0359bd526272784523ae5319cffd2993abba54d26c4c1b760c8660b65161a349e415207a6fbb20d02ce13054e6ffa7776bccfd26c3e4220e0e504f102f352260aaa9864411f7eeae8f6071c9ba54b83d11af43ab58dcb6a7d9053654b98b165fb84a27c78361d957c70a064f45bf4501ef744302e497839a34222e94b3018e587c70c130208976d9f80cf6741a95abfa6b810203010001a3818b30818830130603551d25040c300a06082b0601050507030130230603551d11041c301a8218666c6f776572732d746f2d7468652d776f726c642e636f6d300c0603551d130101ff04023000301f0603551d23041830168014e93c04e1802fc284132d26709ef2fd1acfaafec6301d0603551d0e04160414df25c220250d548e08341c26cadc5effc177841c" - precertDER = "30820504308202eca0030201020207055667377e8bcc300d06092a864886f70d01010b0500307f310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793123302106035504030c1a4d657267652044656c617920496e7465726d6564696174652031301e170d3137303831303134343331365a170d3138303432363134323430315a3063310b3009060355040613024742310f300d06035504070c064c6f6e646f6e31283026060355040a0c1f476f6f676c65204365727469666963617465205472616e73706172656e637931193017060355040513103135303233373631393632313337303830820122300d06092a864886f70d01010105000382010f003082010a0282010100dea100ff02f31ae6f76f9c26525afcdd0ef6eef780d72b4b1c0ff14fc7ac021852d6f34af20713d05fea2c2e1a4b488b3849c2511cf30fcd2e61d9e7392557498a4ff600c8fdc912f05c8a583a5f2b6a3d3320c6cc10b7eed502de392d11b3c4d57fa6e3ddc69d3f73305bb6441a0359bd526272784523ae5319cffd2993abba54d26c4c1b760c8660b65161a349e415207a6fbb20d02ce13054e6ffa7776bccfd26c3e4220e0e504f102f352260aaa9864411f7eeae8f6071c9ba54b83d11af43ab58dcb6a7d9053654b98b165fb84a27c78361d957c70a064f45bf4501ef744302e497839a34222e94b3018e587c70c130208976d9f80cf6741a95abfa6b810203010001a381a030819d30130603551d25040c300a06082b0601050507030130230603551d11041c301a8218666c6f776572732d746f2d7468652d776f726c642e636f6d300c0603551d130101ff04023000301f0603551d23041830168014e93c04e1802fc284132d26709ef2fd1acfaafec6301d0603551d0e04160414df25c220250d548e08341c26cadc5effc177841c3013060a2b06010401d6790204030101ff04020500300d06092a864886f70d01010b05000382020100ae9ca16ec19bb469d08628b1296f50e3e15b362e2b18c691b11eef3af9ce655bf74e0c21c84f6091132851ba78465c3ae97a1409ee7505395d4e7e0318189029a12bf1c3ba2b6f3231c7aac13dbbfaade8d56f0fbe91d32440ad0ab816184c72392154275ead8418cc62e4e2b08de1b14acb6b27c0f36fa586feb875666f46d232a32ef022440d52cdd8bd31a42de55bfa77de8742816f086830b07eedbde545af5a2b9dd17bd49ded508589a0673f6e0d55f210818422093fd10939f0c81521ca654958e6e01b76ef8c7380bdb331e67d44ccb18a83ed04d97d463c37c7cbc592768e2373e198a1d64be3bd22d1833994706797461d05a85e779cd6e2b4b2b14e81d1eca454f29780c47a7366041ace1a48319eff3f1f04bbd471d5125774ef050e47bf664a98101b7be3337bb786b760a92be46488c6a15f72972a4b7c932c736311f0ac1d40920580329657f00e26cfb6d3b1db1eb7a95952fbcbfcbaf9d17587f03aeb9c3b403d1dccad895316658d35fe385fc5a62b60db36e3f07c4798314936aeb3f40094aee9ec1350ea8f68d1aeb41b211ecd0c9e29c5fa2d6576bcb2ad5ec8cc936e1f5a127afa0de3ae490b914adaa733f18ed9348d497e10ba4aa3008f84deec6976292dc0d3c2aa523602188916dd468b47f3d571e71fe51cd293c805d1280a53ab9f519a616d889303be461354edfc29dc3cc85d8570264cf4" - precertCA = "308205c8308203b0a00302010202021001300d06092a864886f70d0101050500307d310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793121301f06035504030c184d657267652044656c6179204d6f6e69746f7220526f6f74301e170d3134303731373132323633305a170d3139303731363132323633305a307f310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793123302106035504030c1a4d657267652044656c617920496e7465726d656469617465203130820222300d06092a864886f70d01010105000382020f003082020a0282020100c1e874feff9aeef303bbfa63453881faaf8dc1c22c09641daf430381f33bc157bf6c4c8a8d57b1abc792859d20f2191509c597c437b14673dea5af4bea14396dd436dc620555d7953e0ede01f7ffb44f3ff7cde64ed245634e0df0aafce9c3ac5eb63d8de1d969cac8854195403a9f9d1d4c3dceedf1351edd945743bc54ab745b204fb5259fe3edf695c2cf90b886c48ff680b744fec2691b4345242b31c36f3118b727c5de5c25ec1aa30a4c2461c5119ef6bb90d816e6e44c5b9955bfa2ed3416bf6e4a53c92fafac0d1f0b8bf3d35be0d4f61ca05d28fc662dfa588fba3ee0380470c012ded9e51bbf1e7a25efa745784c49d05eaf8dcee0527361ec913126005e972cf4b863914f8361582ed24563ff9e03c52e8a9ca3264c56c186b4ec52b7e695ce42ae17ec7ae0257131e1dbf48f2dde242e6e91ea304988135a15482b05fc091355328b39e586e8dd3a4a3a14cb97eef68f9f69728c291f2195d2cce73d4ae90845b1bfc5fae040b94fc359a29511981b9966aeb56d3a7c5e48f8eca815e5be86b3d36e6a27e0e2c4dee6e30f12a7c936b8c98cad5928aca238dfc39cf9f2c5246cbbbb280cb6f99eb49bfd1d78089539072c164c7083371746dedbc4dec1cb9439073af3f2e60f8c505f067961a8c539454fc5341158eccc78532f3e39c3187c9439fc0ff88ee957131d478df063dd50b2ad3fe7a070e905e3868b0203010001a350304e301d0603551d0e04160414e93c04e1802fc284132d26709ef2fd1acfaafec6301f0603551d23041830168014f35f7b7549e37841396a20b67c6b4c5cc93d5841300c0603551d13040530030101ff300d06092a864886f70d010105050003820201000858cbd545f2e92e09906ac39f3d55c13607a651436386c6e90f128773a0eb3f4725d8af35fb7f880436b481f2cf47801825de54f13f8f5920bf3d916e753141de5e59d2debbfc3fc226721f15a16d3b7a4618ea0551639f1d2cb7b9faad1b7e070f23a6e8197c3d7549bba6553fd5db419ce399477f6a0481b90f51c9d307d82cb05cf967828a1ace65207cf86b6d16792245dcf24b4c179f91184736e7e2fcb863a4b5c89b0ac2f368390a10594b95c856e259c77564316898cf87a6817d18585fc976d681d9d510ef2ad37e8ad0e49f5bd499c9ec7fe8f43b17dffb9b7d0dfd8300c1c5389c9ea0be4370dcbf78bd3efc2308d250b866bbca031c0c49ff77a7a5420daa1f1b6a444d366653974c2d179c3009871ee6c89140fca9efdf23bd4b88c6ebaeb9286f58f3cfc21e4874f182d1ecd6058919b03b18db7b795be9cb25fc5166a945ef8e1133cd60312a3234f4649df6166407cbb5ecc838e9e118c05dee7c896a9987655ae7e349cd8166e68d34dea3b4ae892a9f2385053271e860b542be3650503974f3bb6f2688375ab28487da6751d0f2c3a35e78efe30b19d57808ebea2c4453990ad81eb96289c0f99c5080f82092bc6123a340c63a617f3bc4adc1298d88a278a693ef93688611d3b4eded0b6d023ed9f6c2ea8836483197525b1b1bce70a90c3403b094d5f412aa1141b9965ab8314c52f772deffc1008c" - precertRoot = "308205cd308203b5a0030201020209009ed3ccb1d12ca272300d06092a864886f70d0101050500307d310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793121301f06035504030c184d657267652044656c6179204d6f6e69746f7220526f6f74301e170d3134303731373132303534335a170d3431313230323132303534335a307d310b3009060355040613024742310f300d06035504080c064c6f6e646f6e31173015060355040a0c0e476f6f676c6520554b204c74642e3121301f060355040b0c184365727469666963617465205472616e73706172656e63793121301f06035504030c184d657267652044656c6179204d6f6e69746f7220526f6f7430820222300d06092a864886f70d01010105000382020f003082020a0282020100aa161cf2205ed81ac565483cda426a3db2e588fdb758b17b93ea8d68495d534a01ba4f6cd1c0fc0a128af79c066dc54c3f437e05ba275ee61dbf9cbdb2928183738139397b6189ae738fef2b9b609a6dd8e0b0d0e20b243db936c029cdc2220af2c0e1a5e4aa41a006af458957e2b1178d27156ef0cb717e16d54025d97f43e9916fb240fb85f7d579462fa0ac76c76256843750bf1ccdfeb76c8c47886477644d5ec3235628adf6a09c8488bfa5036de717908151a6b585f273dd9fb5332b9af76e8fbfa91eaf4311816dde27c5c44f2fd06cc2204d7147f77ba6b16a2a5fca470023614729538bee6b3cb07264713832aec161550eb501906802215223acc2564ad1f98bb5934924eb56d383fc7598be45c89d995281c0efb0d206d29a6d25a10a48fe235332379c5ca69e83599faa677dd20823f5c84a961255eca5d4871d54ca1df0774aa117b0f42cd6e9fda7e8a48a53923c5f94043353544e644b5a6562e5cef9fc2bd2fcfcce3323335cf7fe7c4d83c1b7f839c4790192d3ba9aa9f32093aa8ee7cbe708059d538dc663cca1b825331aa836754a0d13de63bf65b6e2044dcdf041f1a0c5a9c3c38fe74cf576d451c23eaa519db32ef9e039bd848a194c3b5e41a55642dc283ddbd73d1dd97ae6951de18ad89d005007fae7e88bc7a3cce8b7ccc49603a0db67c76d58a28d4b77aa7460801e34377d0c5e4606c2e25b0203010001a350304e301d0603551d0e04160414f35f7b7549e37841396a20b67c6b4c5cc93d5841301f0603551d23041830168014f35f7b7549e37841396a20b67c6b4c5cc93d5841300c0603551d13040530030101ff300d06092a864886f70d01010505000382020100771cfea34579a97520d8c2423d68ecd07891f8c7f1c38bf3cd30ea9d3637bfc5d373532ec7656558bef4950646750c6fe085c52d9ffc09e66ebfa2b067de7727cb381d2b25db58b9c2197fd5eb53e020f429b86a3b1f37a07a761a66a5b3ecd797c46695a37ff2d47c54126be6bd28a2a103357227c6b73f7f689b09b48927e6e9a52267a728a115d4bcbb477533dc28f3fc57da735a3ec54fbc36990b17febb7e46b324208c1fa7425a0cba48bdc0381ea8285215261c3c483f2fa6d1da0dba4949107189f32d728a7ff395d43430af3b8ce4be5075bcf67d66661941dc8be37340f8f9282b2d2aadd69065932ad49769f8bc7fc9e5f6e79ff392420ba78de3172778e2b67e4df18440dd561e5a7844c8efa06c0e5f5b8695fa069114a00518fb4c19f9d7855831b5eeebced14b8598daffa49f2dcf505bff6417d84b28e83599d4e0371ef64b2d82ffa068a31044f7322fee2f654ec357c9c121f3458a509728c37f5673412ad0d5e76aa6b4eb1582181a8be404d3dc35e71edd83ee388087d6147c4d86f1cacacface0104df1f4b100c2ceb1be4d1851c4f31e7c4409262185878f23cceb30790143f0d5bd80d2c0ed4260aaa312597d950aaf3c8bcfc812d9a56e8d160dd772a494743710a7e478a046d8a5d505ee6b8cc37fec09dfd4cb57c6c4d8e8ef2a22e1d9e50957852633138d722253e51ba77b0069d38812207a" - ) - var tests = []struct { - leaf LeafEntry - wantCert bool - wantPrecert bool - wantErr string - }{ - { - leaf: LeafEntry{}, - wantErr: "failed to unmarshal", - }, - { - leaf: LeafEntry{ - // {version + leaf_type + timestamp + entry_type + len + cert + exts} - LeafInput: dh("00" + "00" + "0000015dcc2b99c8" + "0000" + "0004f3" + leafDER + noExts), - ExtraData: dh("000ba3" + "0005cc" + leafCA + "0005d1" + rootCA), - }, - wantCert: true, - }, - { - leaf: LeafEntry{ - LeafInput: dh("00" + "00" + "0000015dcc2b99c8" + "0000" + "0004f3" + leafDER + noExts + "ff"), - ExtraData: dh("000ba3" + "0005cc" + leafCA + "0005d1" + rootCA), - }, - wantErr: "trailing data", - }, - { - leaf: LeafEntry{ - LeafInput: dh("00" + "00" + "0000015dcc2b99c8" + "0000" + "0004f3" + leafDER + noExts), - ExtraData: dh("000ba3" + "0005cc" + leafCA + "0005d1" + rootCA + "00"), - }, - wantErr: "trailing data", - }, - { - leaf: LeafEntry{ - LeafInput: dh("00" + "00" + "0000015dcc2b99c8" + "0000" + "0004f3" + leafDER + noExts), - }, - wantErr: "failed to unmarshal", - }, - { - leaf: LeafEntry{ - LeafInput: dh("00" + "00" + "0000015dcc2b99c8" + "8000" + "0004f3" + leafDER + noExts), - }, - wantErr: "unknown entry type", - }, - { - leaf: LeafEntry{ - // version + leaf_type + timestamp + entry_type + key_hash + tbs + exts - LeafInput: dh("00" + "00" + "0000015dcc997890" + "0001" + issuerKeyHash + precertTBS + noExts), - ExtraData: dh("000508" + precertDER + - ("000ba3" + "0005cc" + precertCA + "0005d1" + precertRoot)), - }, - wantPrecert: true, - }, - { - leaf: LeafEntry{ - LeafInput: dh("00" + "00" + "0000015dcc997890" + "0001" + issuerKeyHash + precertTBS + noExts), - ExtraData: dh("000508" + precertDER + - ("000ba3" + "0005cc" + precertCA + "0005d1" + precertRoot) + "ff"), - }, - wantErr: "trailing data", - }, - { - leaf: LeafEntry{ - LeafInput: dh("00" + "00" + "0000015dcc997890" + "0001" + issuerKeyHash + precertTBS + noExts + "ff"), - ExtraData: dh("000508" + precertDER + - ("000ba3" + "0005cc" + precertCA + "0005d1" + precertRoot)), - }, - wantErr: "trailing data", - }, - { - leaf: LeafEntry{ - LeafInput: dh("00" + "00" + "0000015dcc997890" + "0001" + issuerKeyHash + precertTBS + noExts), - }, - wantErr: "failed to unmarshal", - }, - } - for i, test := range tests { - got, err := LogEntryFromLeaf(int64(i), &test.leaf) - if err != nil { - if test.wantErr == "" { - t.Errorf("LogEntryFromLeaf(%d) = _, %v; want _, nil", i, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("LogEntryFromLeaf(%d) = _, %v; want _, err containing %q", i, err, test.wantErr) - } - } else if test.wantErr != "" { - t.Errorf("LogEntryFromLeaf(%d) = _, nil; want _, err containing %q", i, test.wantErr) - } - if gotCert := (got != nil && got.X509Cert != nil); gotCert != test.wantCert { - t.Errorf("LogEntryFromLeaf(%d).X509Cert = %v; want %v", i, gotCert, test.wantCert) - } - if gotPrecert := (got != nil && got.Precert != nil); gotPrecert != test.wantPrecert { - t.Errorf("LogEntryFromLeaf(%d).Precert = %v; want %v", i, gotPrecert, test.wantPrecert) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/signatures_test.go b/vendor/github.com/google/certificate-transparency-go/signatures_test.go deleted file mode 100644 index 8a05a60..0000000 --- a/vendor/github.com/google/certificate-transparency-go/signatures_test.go +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright 2015 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ct - -import ( - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - "encoding/hex" - mrand "math/rand" - "testing" - - "github.com/google/certificate-transparency-go/tls" -) - -const ( - sigTestDERCertString = "308202ca30820233a003020102020102300d06092a864886f70d01010505003055310b300" + - "906035504061302474231243022060355040a131b4365727469666963617465205472616e" + - "73706172656e6379204341310e300c0603550408130557616c65733110300e06035504071" + - "3074572772057656e301e170d3132303630313030303030305a170d323230363031303030" + - "3030305a3052310b30090603550406130247423121301f060355040a13184365727469666" + - "963617465205472616e73706172656e6379310e300c0603550408130557616c6573311030" + - "0e060355040713074572772057656e30819f300d06092a864886f70d010101050003818d0" + - "030818902818100b8742267898b99ba6bfd6e6f7ada8e54337f58feb7227c46248437ba5f" + - "89b007cbe1ecb4545b38ed23fddbf6b9742cafb638157f68184776a1b38ab39318ddd7344" + - "89b4d750117cd83a220a7b52f295d1e18571469a581c23c68c57d973761d9787a091fb586" + - "4936b166535e21b427e3c6d690b2e91a87f36b7ec26f59ce53b50203010001a381ac3081a" + - "9301d0603551d0e041604141184e1187c87956dffc31dd0521ff564efbeae8d307d060355" + - "1d23047630748014a3b8d89ba2690dfb48bbbf87c1039ddce56256c6a159a4573055310b3" + - "00906035504061302474231243022060355040a131b436572746966696361746520547261" + - "6e73706172656e6379204341310e300c0603550408130557616c65733110300e060355040" + - "713074572772057656e82010030090603551d1304023000300d06092a864886f70d010105" + - "050003818100292ecf6e46c7a0bcd69051739277710385363341c0a9049637279707ae23c" + - "c5128a4bdea0d480ed0206b39e3a77a2b0c49b0271f4140ab75c1de57aba498e09459b479" + - "cf92a4d5d5dd5cbe3f0a11e25f04078df88fc388b61b867a8de46216c0e17c31fc7d8003e" + - "cc37be22292f84242ab87fb08bd4dfa3c1b9ce4d3ee6667da" - - sigTestSCTTimestamp = 1348589665525 - - sigTestCertSCTSignatureEC = "0403" + "0048" + - "3046022100d3f7690e7ee80d9988a54a3821056393e9eb0c686ad67fbae3686c888fb1a3c" + - "e022100f9a51c6065bbba7ad7116a31bea1c31dbed6a921e1df02e4b403757fae3254ae" - - sigTestEC256PrivateKeyPEM = "-----BEGIN EC PRIVATE KEY-----\n" + - "MHcCAQEEIG8QAquNnarN6Ik2cMIZtPBugh9wNRe0e309MCmDfBGuoAoGCCqGSM49\n" + - "AwEHoUQDQgAES0AfBkjr7b8b19p5Gk8plSAN16wWXZyhYsH6FMCEUK60t7pem/ck\n" + - "oPX8hupuaiJzJS0ZQ0SEoJGlFxkUFwft5g==\n" + - "-----END EC PRIVATE KEY-----\n" - - sigTestEC256PublicKeyPEM = "-----BEGIN PUBLIC KEY-----\n" + - "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES0AfBkjr7b8b19p5Gk8plSAN16wW\n" + - "XZyhYsH6FMCEUK60t7pem/ckoPX8hupuaiJzJS0ZQ0SEoJGlFxkUFwft5g==\n" + - "-----END PUBLIC KEY-----\n" - - sigTestEC256PublicKey2PEM = "-----BEGIN PUBLIC KEY-----\n" + - "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfahLEimAoz2t01p3uMziiLOl/fHT\n" + - "DM0YDOhBRuiBARsV4UvxG2LdNgoIGLrtCzWE0J5APC2em4JlvR8EEEFMoA==\n" + - "-----END PUBLIC KEY-----\n" - - sigTestRSAPrivateKeyPEM = "-----BEGIN RSA PRIVATE KEY-----\n" + - "MIIEpAIBAAKCAQEAxy7llbig9kL0wo5AyV1FhmJLvWTWxzAMwGdhG1h1CqQpaWut\n" + - "XGI9WKRDJSZ/9dr9vgvqdRX2QsnUdJbJ3cz5Z1ie/RdT/mSVO7ZEqvJS93PIHnqu\n" + - "FZXxNnIerGnQ7guC+Zm9BlQ2DIhYpnvVRRVyD/D8KT92R7qOu3JACduoMrF1synk\n" + - "nL8rb8lZvCej8tbhJ38yibMWTmkxsFS+a29Xqk8pkhgwIwvUZqcMaqZo+4/iCuKL\n" + - "bVc85V98SvbcnmsX3gqeQnyRtxlctlclcbvHmJt5U+3yF1UtcuiyZf1gjcAqnOgv\n" + - "ZZYzsodXi0KGV7NRQhTPvwH0C8In2qL+v4qWAQIDAQABAoIBAQCdyqsaNw9cx6I6\n" + - "1pLAcuF3GjvCKDZ1ybzwV3V4QlVGPtKHr0PBIhpTNJ30ulE4pWnKuoncg695LYbf\n" + - "be0xhwY1NuGMwoRJzcjjavtvKVVMry5j5vAuLYDPjwx5rcJUMk5qCb7TWrcOqp0A\n" + - "Fq3XcqvPsSsyShIbtNEJ8fKFXLwcm07bGDgOacrXieP/nL2Hh6joeAJLgnKAOtU5\n" + - "qw6fdweYGThfhdCwaBq0WSaxj6nMG3Q40bHurvdOAtU1GF2a27BGsnfKFyKlvk8+\n" + - "K7tCc4oXo4WWEUuOwu6SmB1kYIZLf258B0PFQJwN8OA3Mbek+F4Bm3DzWe1aLS5L\n" + - "wpOYxrq5AoGBAO0sGq+ic+9K81FvBBUYXiFtt9rv3nU9jZhjqpfvdqRs2KXt8ldz\n" + - "2M+JCRFHt8rLDEutK/NZuZcq3wAXS3EeMIp33QZ7Yuj5LeG9eD0asX8yq51Toua3\n" + - "gRDbiR00Vz/3BINM8JufN/sPLoUiuAV5mlOTktZ8+z7ixO4ravMB1Z9HAoGBANb+\n" + - "w+1Hre8+4JEnl3yRh1UNDmbhCc2tRxCD4QJyb9qaOl2IK1QXuDcwD8owdenwOrAi\n" + - "I5yKx7y4oKNfdSrP2wlAGS/GAEL5f+JhLtv2cNoKNxMXNRgYfJAQeMKBjINdECia\n" + - "G89lbPVCm+F3guzrO70giA4617GFSEA31rRC1BR3AoGBAKcQLiwRrsCcdxChtqp1\n" + - "Y7kAZEXgOT80gI0bh4tGrrfbxC/9kHtxqwNlb/GwJxK+PIcCELd2OHj3ReX2grnH\n" + - "nkGrdRGf0GhzPZKJuCyypN0IgEJuK42BLXUGb2sW926jPZaPl9zHJtO+OfKmJiIV\n" + - "KlQ8224i04fUjQuHoepTHHr5AoGAS8AZ4lmWFCywTRSJEG/qIfJmt6LkpF5AIraE\n" + - "qisN9BTRKbFXqtpsoq1BcvjeIt3sn7B3oalYNMtMdiOlEb+Iqlq2RRnbb72e7HFX\n" + - "ZFMRchGVVBmiMGo4QT48fjPNAV/h2Jxr3ggbetLMP4WvULCVLM7wgSsEYlzWlyHV\n" + - "eU/uj4MCgYADGpY3Q3ueB23eTTnAMtESwmAQvjTBOPKVpaV/ohHb8BdzAjwcgEUA\n" + - "wB1be/bHCrLbW09Pi3HVp0I0x0mBAYoUP2NRYKCYlhs28cu+ygB4nsy+YZPg00+E\n" + - "ByqqrQ0zuN82ytXzRFHmh2Hb2O+HOj6aJjgVuj/rR7aifIt8scSAhg==\n" + - "-----END RSA PRIVATE KEY-----\n" - - sigTestRSAPublicKeyPEM = "-----BEGIN PUBLIC KEY-----\n" + - "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxy7llbig9kL0wo5AyV1F\n" + - "hmJLvWTWxzAMwGdhG1h1CqQpaWutXGI9WKRDJSZ/9dr9vgvqdRX2QsnUdJbJ3cz5\n" + - "Z1ie/RdT/mSVO7ZEqvJS93PIHnquFZXxNnIerGnQ7guC+Zm9BlQ2DIhYpnvVRRVy\n" + - "D/D8KT92R7qOu3JACduoMrF1synknL8rb8lZvCej8tbhJ38yibMWTmkxsFS+a29X\n" + - "qk8pkhgwIwvUZqcMaqZo+4/iCuKLbVc85V98SvbcnmsX3gqeQnyRtxlctlclcbvH\n" + - "mJt5U+3yF1UtcuiyZf1gjcAqnOgvZZYzsodXi0KGV7NRQhTPvwH0C8In2qL+v4qW\n" + - "AQIDAQAB\n" + - "-----END PUBLIC KEY-----\n" - - sigTestCertSCTSignatureRSA = "0401" + "0100" + - "6bc1fecfe9052036e31278cd7eded90d000b127f2b657831baf5ecb31ee3" + - "c17497abd9562df6319928a36df0ab1a1a917b3f4530e1ca0000ae6c4a0c" + - "0efada7df83beb95da8eea98f1a27c70afa1ccaa7a0245e1db785b1c0d9f" + - "ee307e926e14bed1eac0d01c34939e659360432a9552c02b89c3ef3c44aa" + - "22fc31f2444522975ee83989dd7af1ab05b91bbf0985ca4d04245b68a683" + - "01d300f0c976ce13d58618dad1b49c0ec5cdc4352016823fc88c479ef214" + - "76c5f19923af207dbb1b2cff72d4e1e5ee77dd420b85d0f9dcc30a0f617c" + - "2d3c916eb77f167323500d1b53dc4253321a106e441af343cf2f68630873" + - "abd43ca52629c586107eb7eb85f2c3ee" - - sigTestCertSCTSignatureUnsupportedSignatureAlgorithm = "0402" + "0000" - - sigTestCertSCTSignatureUnsupportedHashAlgorithm = "0303" + "0000" - - // Some time in September 2012. - sigTestDefaultSTHTimestamp = 1348589667204 - - sigTestDefaultTreeSize = 42 - - // *Some* hash that we pretend is a valid root hash. - sigTestDefaultRootHash = "18041bd4665083001fba8c5411d2d748e8abbfdcdfd9218cb02b68a78e7d4c23" - - sigTestDefaultSTHSerialized = "000100000139fe354384000000000000002a18041bd4665083001fba8c5411d2d748e8abb" + - "fdcdfd9218cb02b68a78e7d4c23" - - sigTestDefaultSTHSignature = "0403" + "0048" + - "3046022100befd8060563763a5e49ba53e6443c13f7624fd6403178113736e16012aca983" + - "e022100f572568dbfe9a86490eb915c4ee16ad5ecd708fed35ed4e5cd1b2c3f087b4130" - - sigTestKeyIDEC = "b69d879e3f2c4402556dcda2f6b2e02ff6b6df4789c53000e14f4b125ae847aa" - - sigTestKeyIDRSA = "b853f84c71a7aa5f23905ba5340f183af927c330c7ce590ba1524981c4ec4358" -) - -func mustDehex(t *testing.T, h string) []byte { - t.Helper() - r, err := hex.DecodeString(h) - if err != nil { - t.Fatalf("Failed to decode hex string (%s): %v", h, err) - } - return r -} - -func sigTestSCTWithSignature(t *testing.T, sig, keyID string) SignedCertificateTimestamp { - t.Helper() - var ds DigitallySigned - if _, err := tls.Unmarshal(mustDehex(t, sig), &ds); err != nil { - t.Fatalf("Failed to unmarshal sigTestCertSCTSignatureEC: %v", err) - } - var id LogID - copy(id.KeyID[:], mustDehex(t, keyID)) - return SignedCertificateTimestamp{ - SCTVersion: V1, - LogID: id, - Timestamp: sigTestSCTTimestamp, - Signature: ds, - } -} - -func sigTestSCTEC(t *testing.T) SignedCertificateTimestamp { - t.Helper() - return sigTestSCTWithSignature(t, sigTestCertSCTSignatureEC, sigTestKeyIDEC) -} - -func sigTestSCTRSA(t *testing.T) SignedCertificateTimestamp { - t.Helper() - return sigTestSCTWithSignature(t, sigTestCertSCTSignatureRSA, sigTestKeyIDEC) -} - -func sigTestECPublicKey(t *testing.T) crypto.PublicKey { - t.Helper() - pk, _, _, err := PublicKeyFromPEM([]byte(sigTestEC256PublicKeyPEM)) - if err != nil { - t.Fatalf("Failed to parse sigTestEC256PublicKey: %v", err) - } - return pk -} - -func sigTestECPublicKey2(t *testing.T) crypto.PublicKey { - t.Helper() - pk, _, _, err := PublicKeyFromPEM([]byte(sigTestEC256PublicKey2PEM)) - if err != nil { - t.Fatalf("Failed to parse sigTestEC256PublicKey2: %v", err) - } - return pk -} - -func sigTestRSAPublicKey(t *testing.T) crypto.PublicKey { - t.Helper() - pk, _, _, err := PublicKeyFromPEM([]byte(sigTestRSAPublicKeyPEM)) - if err != nil { - t.Fatalf("Failed to parse sigTestRSAPublicKey: %v", err) - } - return pk -} - -func sigTestCertLogEntry(t *testing.T) LogEntry { - t.Helper() - return LogEntry{ - Index: 0, - Leaf: MerkleTreeLeaf{ - Version: V1, - LeafType: TimestampedEntryLeafType, - TimestampedEntry: &TimestampedEntry{ - Timestamp: sigTestSCTTimestamp, - EntryType: X509LogEntryType, - X509Entry: &ASN1Cert{Data: mustDehex(t, sigTestDERCertString)}, - }, - }, - } -} - -func sigTestDefaultSTH(t *testing.T) SignedTreeHead { - t.Helper() - var ds DigitallySigned - if _, err := tls.Unmarshal(mustDehex(t, sigTestDefaultSTHSignature), &ds); err != nil { - t.Fatalf("Failed to unmarshal sigTestCertSCTSignatureEC: %v", err) - } - var rootHash SHA256Hash - copy(rootHash[:], mustDehex(t, sigTestDefaultRootHash)) - return SignedTreeHead{ - Version: V1, - Timestamp: sigTestDefaultSTHTimestamp, - TreeSize: sigTestDefaultTreeSize, - SHA256RootHash: rootHash, - TreeHeadSignature: ds, - } -} - -func mustCreateSignatureVerifier(t *testing.T, pk crypto.PublicKey) SignatureVerifier { - t.Helper() - sv, err := NewSignatureVerifier(pk) - if err != nil { - t.Fatalf("Failed to create SignatureVerifier: %v", err) - } - return *sv -} - -func corruptByteAt(b []byte, pos int) { - b[pos] ^= byte(mrand.Intn(255) + 1) -} - -func corruptBytes(b []byte) { - corruptByteAt(b, mrand.Intn(len(b))) -} - -func expectVerifySCTToFail(t *testing.T, sv SignatureVerifier, sct SignedCertificateTimestamp, msg string) { - t.Helper() - if err := sv.VerifySCTSignature(sct, sigTestCertLogEntry(t)); err == nil { - t.Fatal(msg) - } -} - -func TestVerifySCTSignatureEC(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - if err := v.VerifySCTSignature(sigTestSCTEC(t), sigTestCertLogEntry(t)); err != nil { - t.Fatalf("Failed to verify signature on SCT: %v", err) - } - -} - -func TestVerifySCTSignatureRSA(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestRSAPublicKey(t)) - if err := v.VerifySCTSignature(sigTestSCTRSA(t), sigTestCertLogEntry(t)); err != nil { - t.Fatalf("Failed to verify signature on SCT: %v", err) - } - -} - -func TestVerifySCTSignatureFailsForMismatchedSignatureAlgorithm(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - expectVerifySCTToFail(t, v, sigTestSCTRSA(t), "Successfully verified with mismatched signature algorithm") -} - -func TestVerifySCTSignatureFailsForUnknownSignatureAlgorithm(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - expectVerifySCTToFail(t, v, sigTestSCTWithSignature(t, sigTestCertSCTSignatureUnsupportedSignatureAlgorithm, sigTestKeyIDEC), - "Successfully verified signature with unsupported signature algorithm") -} - -func TestVerifySCTSignatureFailsForUnknownHashAlgorithm(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - expectVerifySCTToFail(t, v, sigTestSCTWithSignature(t, sigTestCertSCTSignatureUnsupportedHashAlgorithm, sigTestKeyIDEC), - "Successfully verified signature with unsupported hash algorithm") -} - -func testVerifySCTSignatureFailsForIncorrectLeafBytes(t *testing.T, sct SignedCertificateTimestamp, sv SignatureVerifier) { - t.Helper() - entry := sigTestCertLogEntry(t) - for i := range entry.Leaf.TimestampedEntry.X509Entry.Data { - old := entry.Leaf.TimestampedEntry.X509Entry.Data[i] - corruptByteAt(entry.Leaf.TimestampedEntry.X509Entry.Data, i) - if err := sv.VerifySCTSignature(sct, entry); err == nil { - t.Fatalf("Incorrectly verfied signature over corrupted leaf data, uncovered byte at %d?", i) - } - entry.Leaf.TimestampedEntry.X509Entry.Data[i] = old - } - // Ensure we were only corrupting one byte at a time, should be correct again now. - if err := sv.VerifySCTSignature(sct, entry); err != nil { - t.Fatalf("Input data appears to still be corrupt, bug? %v", err) - } -} - -func testVerifySCTSignatureFailsForIncorrectSignature(t *testing.T, sct SignedCertificateTimestamp, sv SignatureVerifier) { - t.Helper() - corruptBytes(sct.Signature.Signature) - expectVerifySCTToFail(t, sv, sct, "Incorrectly verified corrupt signature") -} - -func TestVerifySCTSignatureECFailsForIncorrectLeafBytes(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - testVerifySCTSignatureFailsForIncorrectLeafBytes(t, sigTestSCTEC(t), v) -} - -func TestVerifySCTSignatureECFailsForIncorrectTimestamp(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sct := sigTestSCTEC(t) - sct.Timestamp++ - expectVerifySCTToFail(t, v, sct, "Incorrectly verified signature with incorrect SCT timestamp.") -} - -func TestVerifySCTSignatureECFailsForIncorrectVersion(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sct := sigTestSCTEC(t) - sct.SCTVersion++ - expectVerifySCTToFail(t, v, sct, "Incorrectly verified signature with incorrect SCT Version.") -} - -func TestVerifySCTSignatureECFailsForIncorrectSignature(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - testVerifySCTSignatureFailsForIncorrectSignature(t, sigTestSCTEC(t), v) -} - -func TestVerifySCTSignatureRSAFailsForIncorrectLeafBytes(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestRSAPublicKey(t)) - testVerifySCTSignatureFailsForIncorrectLeafBytes(t, sigTestSCTRSA(t), v) -} - -func TestVerifySCTSignatureRSAFailsForIncorrectSignature(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestRSAPublicKey(t)) - testVerifySCTSignatureFailsForIncorrectSignature(t, sigTestSCTRSA(t), v) -} - -func TestVerifySCTSignatureFailsForSignatureCreatedWithDifferentAlgorithm(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestRSAPublicKey(t)) - testVerifySCTSignatureFailsForIncorrectSignature(t, sigTestSCTEC(t), v) -} - -func TestVerifySCTSignatureFailsForSignatureCreatedWithDifferentKey(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey2(t)) - testVerifySCTSignatureFailsForIncorrectSignature(t, sigTestSCTEC(t), v) -} - -func expectVerifySTHToPass(t *testing.T, v SignatureVerifier, sth SignedTreeHead) { - t.Helper() - if err := v.VerifySTHSignature(sth); err != nil { - t.Fatalf("Incorrectly failed to verify STH signature: %v", err) - } -} - -func expectVerifySTHToFail(t *testing.T, v SignatureVerifier, sth SignedTreeHead) { - t.Helper() - if err := v.VerifySTHSignature(sth); err == nil { - t.Fatal("Incorrectly verified STH signature") - } -} - -func TestVerifyValidSTH(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sth := sigTestDefaultSTH(t) - expectVerifySTHToPass(t, v, sth) -} - -func TestVerifySTHCatchesCorruptSignature(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sth := sigTestDefaultSTH(t) - corruptBytes(sth.TreeHeadSignature.Signature) - expectVerifySTHToFail(t, v, sth) -} - -func TestVerifySTHCatchesCorruptRootHash(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sth := sigTestDefaultSTH(t) - for i := range sth.SHA256RootHash { - old := sth.SHA256RootHash[i] - corruptByteAt(sth.SHA256RootHash[:], i) - expectVerifySTHToFail(t, v, sth) - sth.SHA256RootHash[i] = old - } - // ensure we were only testing one corrupt byte at a time - should be correct again now. - expectVerifySTHToPass(t, v, sth) -} - -func TestVerifySTHCatchesCorruptTimestamp(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sth := sigTestDefaultSTH(t) - sth.Timestamp++ - expectVerifySTHToFail(t, v, sth) -} - -func TestVerifySTHCatchesCorruptVersion(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sth := sigTestDefaultSTH(t) - sth.Version++ - expectVerifySTHToFail(t, v, sth) -} - -func TestVerifySTHCatchesCorruptTreeSize(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey(t)) - sth := sigTestDefaultSTH(t) - sth.TreeSize++ - expectVerifySTHToFail(t, v, sth) -} - -func TestVerifySTHFailsToVerifyForKeyWithDifferentAlgorithm(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestRSAPublicKey(t)) - sth := sigTestDefaultSTH(t) - expectVerifySTHToFail(t, v, sth) -} - -func TestVerifySTHFailsToVerifyForDifferentKey(t *testing.T) { - v := mustCreateSignatureVerifier(t, sigTestECPublicKey2(t)) - sth := sigTestDefaultSTH(t) - expectVerifySTHToFail(t, v, sth) -} - -func TestNewSignatureVerifierFailsWithUnsupportedKeyType(t *testing.T) { - var k dsa.PrivateKey - if err := dsa.GenerateParameters(&k.Parameters, rand.Reader, dsa.L1024N160); err != nil { - t.Fatalf("Failed to generate DSA key parameters: %v", err) - } - if err := dsa.GenerateKey(&k, rand.Reader); err != nil { - t.Fatalf("Failed to generate DSA key: %v", err) - } - if _, err := NewSignatureVerifier(k); err == nil { - t.Fatal("Creating a SignatureVerifier with a DSA key unexpectedly succeeded") - } -} - -func TestNewSignatureVerifierFailsWithBadKeyParametersForEC(t *testing.T) { - k, err := ecdsa.GenerateKey(elliptic.P224(), rand.Reader) - if err != nil { - t.Fatalf("Failed to generate ECDSA key on P224: %v", err) - } - if _, err := NewSignatureVerifier(k); err == nil { - t.Fatal("Incorrectly created new SignatureVerifier with EC P224 key.") - } -} - -func TestNewSignatureVerifierFailsWithBadKeyParametersForRSA(t *testing.T) { - k, err := rsa.GenerateKey(rand.Reader, 1024) - if err != nil { - t.Fatalf("Failed to generate 1024 bit RSA key: %v", err) - } - if _, err := NewSignatureVerifier(k); err == nil { - t.Fatal("Incorrectly created new SignatureVerifier with 1024 bit RSA key.") - } -} - -func TestWillAllowNonCompliantECKeyWithOverride(t *testing.T) { - AllowVerificationWithNonCompliantKeys = true - k, err := ecdsa.GenerateKey(elliptic.P224(), rand.Reader) - if err != nil { - t.Fatalf("Failed to generate EC key on P224: %v", err) - } - if _, err := NewSignatureVerifier(k.Public()); err != nil { - t.Fatalf("Incorrectly disallowed P224 EC key with override set: %v", err) - } -} - -func TestWillAllowNonCompliantRSAKeyWithOverride(t *testing.T) { - AllowVerificationWithNonCompliantKeys = true - k, err := rsa.GenerateKey(rand.Reader, 1024) - if err != nil { - t.Fatalf("Failed to generate 1024 bit RSA key: %v", err) - } - if _, err := NewSignatureVerifier(k.Public()); err != nil { - t.Fatalf("Incorrectly disallowed 1024 bit RSA key with override set: %v", err) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/testdata/argon.cfg b/vendor/github.com/google/certificate-transparency-go/testdata/argon.cfg deleted file mode 100644 index 4a1b5e9..0000000 --- a/vendor/github.com/google/certificate-transparency-go/testdata/argon.cfg +++ /dev/null @@ -1,30 +0,0 @@ -shard { - uri: "https://ct.googleapis.com/logs/argon2017" - public_key_der:"0Y0\023\006\007*\206H\316=\002\001\006\010*\206H\316=\003\001\007\003B\000\004Tm|\211\335\352\235\360\272_\364m`z7O\002%\277\034\366o\205\256\257\025\337in\355\333\251\232)\227\362\231v\036\3463F\036'\364\276p\335Y\327\272\317\376\320r\216\260W\017\2357\211b\243" - not_after_start: - not_after_limit: -} -shard { - uri: "https://ct.googleapis.com/logs/argon2018" - public_key_der:"0Y0\023\006\007*\206H\316=\002\001\006\010*\206H\316=\003\001\007\003B\000\004\322\000U\005\255\325G\264\031\273\315\225\373)\327X=x$\315\316F\235\3732\324qN`\002%^Y>\327\324\003\270mChh~\350\240e\013>nqY\2227\276\251\350\361\243+\344\331\rUh" - not_after_start: - not_after_limit: -} -shard { - uri: "https://ct.googleapis.com/logs/argon2019" - public_key_der:"0Y0\023\006\007*\206H\316=\002\001\006\010*\206H\316=\003\001\007\003B\000\004#s\020\233\341\363^\366\230ki\225\226\020x\316I\333\264\004\374q,Z\222`h%\300J\032\241\260a-\033\207\024\251\272\360\0013Y\035\0050\351B\025\347U\327*\370\264\242\272E\311F\221\207V" - not_after_start: - not_after_limit: -} -shard { - uri: "https://ct.googleapis.com/logs/argon2020" - public_key_der:"0Y0\023\006\007*\206H\316=\002\001\006\010*\206H\316=\003\001\007\003B\000\004\351LdX\373vcQ2\030c\325\262\273\355\352\377^;$n/5R\213\2645\232\255\234\025\250i \352P\030\314" - not_after_start: - not_after_limit: -} -shard { - uri: "https://ct.googleapis.com/logs/argon2021" - public_key_der:"0Y0\023\006\007*\206H\316=\002\001\006\010*\206H\316=\003\001\007\003B\000\004M\340fd\352\363d\2528\305\211-\307\330\010\331\310Dq\355\334\303\373[\257\234d\241\tf\204\035|h\247\354\304?\214\234\202\340\030\331t\024\351\264y\201\242\224Ub\363\234\013D\203\241+\311q+" - not_after_start: - not_after_limit: -} diff --git a/vendor/github.com/google/certificate-transparency-go/testdata/certs.go b/vendor/github.com/google/certificate-transparency-go/testdata/certs.go deleted file mode 100644 index ac8b556..0000000 --- a/vendor/github.com/google/certificate-transparency-go/testdata/certs.go +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package testdata - -import ( - "encoding/hex" -) - -const ( - // CACertPEM is a CA cert: - // Certificate: - // Data: - // Version: 3 (0x2) - // Serial Number: 0 (0x0) - // Signature Algorithm: sha1WithRSAEncryption - // Issuer: C=GB, O=Certificate Transparency CA, ST=Wales, L=Erw Wen - // Validity - // Not Before: Jun 1 00:00:00 2012 GMT - // Not After : Jun 1 00:00:00 2022 GMT - // Subject: C=GB, O=Certificate Transparency CA, ST=Wales, L=Erw Wen - // Subject Public Key Info: - // Public Key Algorithm: rsaEncryption - // Public-Key: (1024 bit) - // Modulus: - // 00:d5:8a:68:53:62:10:a2:71:19:93:6e:77:83:21: - // 18:1c:2a:40:13:c6:d0:7b:8c:76:eb:91:57:d3:d0: - // fb:4b:3b:51:6e:ce:cb:d1:c9:8d:91:c5:2f:74:3f: - // ab:63:5d:55:09:9c:d1:3a:ba:f3:1a:e5:41:44:24: - // 51:a7:4c:78:16:f2:24:3c:f8:48:cf:28:31:cc:e6: - // 7b:a0:4a:5a:23:81:9f:3c:ba:37:e6:24:d9:c3:bd: - // b2:99:b8:39:dd:fe:26:31:d2:cb:3a:84:fc:7b:b2: - // b5:c5:2f:cf:c1:4f:ff:40:6f:5c:d4:46:69:cb:b2: - // f7:cf:df:86:fb:6a:b9:d1:b1 - // Exponent: 65537 (0x10001) - // X509v3 extensions: - // X509v3 Subject Key Identifier: - // 5F:9D:88:0D:C8:73:E6:54:D4:F8:0D:D8:E6:B0:C1:24:B4:47:C3:55 - // X509v3 Authority Key Identifier: - // keyid:5F:9D:88:0D:C8:73:E6:54:D4:F8:0D:D8:E6:B0:C1:24:B4:47:C3:55 - // DirName:/C=GB/O=Certificate Transparency CA/ST=Wales/L=Erw Wen - // serial:00 - // - // X509v3 Basic Constraints: - // CA:TRUE - // Signature Algorithm: sha1WithRSAEncryption - // 06:08:cc:4a:6d:64:f2:20:5e:14:6c:04:b2:76:f9:2b:0e:fa: - // 94:a5:da:f2:3a:fc:38:06:60:6d:39:90:d0:a1:ea:23:3d:40: - // 29:57:69:46:3b:04:66:61:e7:fa:1d:17:99:15:20:9a:ea:2e: - // 0a:77:51:76:41:12:27:d7:c0:03:07:c7:47:0e:61:58:4f:d7: - // 33:42:24:72:7f:51:d6:90:bc:47:a9:df:35:4d:b0:f6:eb:25: - // 95:5d:e1:89:3c:4d:d5:20:2b:24:a2:f3:e4:40:d2:74:b5:4e: - // 1b:d3:76:26:9c:a9:62:89:b7:6e:ca:a4:10:90:e1:4f:3b:0a: - // 94:2e - CACertPEM = "-----BEGIN CERTIFICATE-----\n" + - "MIIC0DCCAjmgAwIBAgIBADANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJHQjEk\n" + - "MCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4wDAYDVQQIEwVX\n" + - "YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAeFw0xMjA2MDEwMDAwMDBaFw0yMjA2MDEw\n" + - "MDAwMDBaMFUxCzAJBgNVBAYTAkdCMSQwIgYDVQQKExtDZXJ0aWZpY2F0ZSBUcmFu\n" + - "c3BhcmVuY3kgQ0ExDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdFcncgV2VuMIGf\n" + - "MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVimhTYhCicRmTbneDIRgcKkATxtB7\n" + - "jHbrkVfT0PtLO1FuzsvRyY2RxS90P6tjXVUJnNE6uvMa5UFEJFGnTHgW8iQ8+EjP\n" + - "KDHM5nugSlojgZ88ujfmJNnDvbKZuDnd/iYx0ss6hPx7srXFL8/BT/9Ab1zURmnL\n" + - "svfP34b7arnRsQIDAQABo4GvMIGsMB0GA1UdDgQWBBRfnYgNyHPmVNT4DdjmsMEk\n" + - "tEfDVTB9BgNVHSMEdjB0gBRfnYgNyHPmVNT4DdjmsMEktEfDVaFZpFcwVTELMAkG\n" + - "A1UEBhMCR0IxJDAiBgNVBAoTG0NlcnRpZmljYXRlIFRyYW5zcGFyZW5jeSBDQTEO\n" + - "MAwGA1UECBMFV2FsZXMxEDAOBgNVBAcTB0VydyBXZW6CAQAwDAYDVR0TBAUwAwEB\n" + - "/zANBgkqhkiG9w0BAQUFAAOBgQAGCMxKbWTyIF4UbASydvkrDvqUpdryOvw4BmBt\n" + - "OZDQoeojPUApV2lGOwRmYef6HReZFSCa6i4Kd1F2QRIn18ADB8dHDmFYT9czQiRy\n" + - "f1HWkLxHqd81TbD26yWVXeGJPE3VICskovPkQNJ0tU4b03YmnKliibduyqQQkOFP\n" + - "OwqULg==\n" + - "-----END CERTIFICATE-----" - - // TestCertPEM is a leaf certificate signed by CACertPEM. - // Certificate: - // Data: - // Version: 3 (0x2) - // Serial Number: 6 (0x6) - // Signature Algorithm: sha1WithRSAEncryption - // Issuer: C=GB, O=Certificate Transparency CA, ST=Wales, L=Erw Wen - // Validity - // Not Before: Jun 1 00:00:00 2012 GMT - // Not After : Jun 1 00:00:00 2022 GMT - // Subject: C=GB, O=Certificate Transparency, ST=Wales, L=Erw Wen - // Subject Public Key Info: - // Public Key Algorithm: rsaEncryption - // Public-Key: (1024 bit) - // Modulus: - // 00:b1:fa:37:93:61:11:f8:79:2d:a2:08:1c:3f:e4: - // 19:25:00:85:31:dc:7f:2c:65:7b:d9:e1:de:47:04: - // 16:0b:4c:9f:19:d5:4a:da:44:70:40:4c:1c:51:34: - // 1b:8f:1f:75:38:dd:dd:28:d9:ac:a4:83:69:fc:56: - // 46:dd:cc:76:17:f8:16:8a:ae:5b:41:d4:33:31:fc: - // a2:da:df:c8:04:d5:72:08:94:90:61:f9:ee:f9:02: - // ca:47:ce:88:c6:44:e0:00:f0:6e:ee:cc:ab:dc:9d: - // d2:f6:8a:22:cc:b0:9d:c7:6e:0d:bc:73:52:77:65: - // b1:a3:7a:8c:67:62:53:dc:c1 - // Exponent: 65537 (0x10001) - // X509v3 extensions: - // X509v3 Subject Key Identifier: - // 6A:0D:98:2A:3B:62:C4:4B:6D:2E:F4:E9:BB:7A:01:AA:9C:B7:98:E2 - // X509v3 Authority Key Identifier: - // keyid:5F:9D:88:0D:C8:73:E6:54:D4:F8:0D:D8:E6:B0:C1:24:B4:47:C3:55 - // DirName:/C=GB/O=Certificate Transparency CA/ST=Wales/L=Erw Wen - // serial:00 - // - // X509v3 Basic Constraints: - // CA:FALSE - // Signature Algorithm: sha1WithRSAEncryption - // 17:1c:d8:4a:ac:41:4a:9a:03:0f:22:aa:c8:f6:88:b0:81:b2: - // 70:9b:84:8b:4e:55:11:40:6c:d7:07:fe:d0:28:59:7a:9f:ae: - // fc:2e:ee:29:78:d6:33:aa:ac:14:ed:32:35:19:7d:a8:7e:0f: - // 71:b8:87:5f:1a:c9:e7:8b:28:17:49:dd:ed:d0:07:e3:ec:f5: - // 06:45:f8:cb:f6:67:25:6c:d6:a1:64:7b:5e:13:20:3b:b8:58: - // 2d:e7:d6:69:6f:65:6d:1c:60:b9:5f:45:6b:7f:cf:33:85:71: - // 90:8f:1c:69:72:7d:24:c4:fc:cd:24:92:95:79:58:14:d1:da: - // c0:e6 - TestCertPEM = "-----BEGIN CERTIFICATE-----\n" + - "MIICyjCCAjOgAwIBAgIBBjANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJHQjEk\n" + - "MCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4wDAYDVQQIEwVX\n" + - "YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAeFw0xMjA2MDEwMDAwMDBaFw0yMjA2MDEw\n" + - "MDAwMDBaMFIxCzAJBgNVBAYTAkdCMSEwHwYDVQQKExhDZXJ0aWZpY2F0ZSBUcmFu\n" + - "c3BhcmVuY3kxDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdFcncgV2VuMIGfMA0G\n" + - "CSqGSIb3DQEBAQUAA4GNADCBiQKBgQCx+jeTYRH4eS2iCBw/5BklAIUx3H8sZXvZ\n" + - "4d5HBBYLTJ8Z1UraRHBATBxRNBuPH3U43d0o2aykg2n8VkbdzHYX+BaKrltB1DMx\n" + - "/KLa38gE1XIIlJBh+e75AspHzojGROAA8G7uzKvcndL2iiLMsJ3Hbg28c1J3ZbGj\n" + - "eoxnYlPcwQIDAQABo4GsMIGpMB0GA1UdDgQWBBRqDZgqO2LES20u9Om7egGqnLeY\n" + - "4jB9BgNVHSMEdjB0gBRfnYgNyHPmVNT4DdjmsMEktEfDVaFZpFcwVTELMAkGA1UE\n" + - "BhMCR0IxJDAiBgNVBAoTG0NlcnRpZmljYXRlIFRyYW5zcGFyZW5jeSBDQTEOMAwG\n" + - "A1UECBMFV2FsZXMxEDAOBgNVBAcTB0VydyBXZW6CAQAwCQYDVR0TBAIwADANBgkq\n" + - "hkiG9w0BAQUFAAOBgQAXHNhKrEFKmgMPIqrI9oiwgbJwm4SLTlURQGzXB/7QKFl6\n" + - "n678Lu4peNYzqqwU7TI1GX2ofg9xuIdfGsnniygXSd3t0Afj7PUGRfjL9mclbNah\n" + - "ZHteEyA7uFgt59Zpb2VtHGC5X0Vrf88zhXGQjxxpcn0kxPzNJJKVeVgU0drA5g==\n" + - "-----END CERTIFICATE-----\n" - - // TestPreCertPEM is a pre-certificate signed by CACertPEM. - // Certificate: - // Data: - // Version: 3 (0x2) - // Serial Number: 7 (0x7) - // Signature Algorithm: sha1WithRSAEncryption - // Issuer: C=GB, O=Certificate Transparency CA, ST=Wales, L=Erw Wen - // Validity - // Not Before: Jun 1 00:00:00 2012 GMT - // Not After : Jun 1 00:00:00 2022 GMT - // Subject: C=GB, O=Certificate Transparency, ST=Wales, L=Erw Wen - // Subject Public Key Info: - // Public Key Algorithm: rsaEncryption - // Public-Key: (1024 bit) - // Modulus: - // 00:be:ef:98:e7:c2:68:77:ae:38:5f:75:32:5a:0c: - // 1d:32:9b:ed:f1:8f:aa:f4:d7:96:bf:04:7e:b7:e1: - // ce:15:c9:5b:a2:f8:0e:e4:58:bd:7d:b8:6f:8a:4b: - // 25:21:91:a7:9b:d7:00:c3:8e:9c:03:89:b4:5c:d4: - // dc:9a:12:0a:b2:1e:0c:b4:1c:d0:e7:28:05:a4:10: - // cd:9c:5b:db:5d:49:27:72:6d:af:17:10:f6:01:87: - // 37:7e:a2:5b:1a:1e:39:ee:d0:b8:81:19:dc:15:4d: - // c6:8f:7d:a8:e3:0c:af:15:8a:33:e6:c9:50:9f:4a: - // 05:b0:14:09:ff:5d:d8:7e:b5 - // Exponent: 65537 (0x10001) - // X509v3 extensions: - // X509v3 Subject Key Identifier: - // 20:31:54:1A:F2:5C:05:FF:D8:65:8B:68:43:79:4F:5E:90:36:F7:B4 - // X509v3 Authority Key Identifier: - // keyid:5F:9D:88:0D:C8:73:E6:54:D4:F8:0D:D8:E6:B0:C1:24:B4:47:C3:55 - // DirName:/C=GB/O=Certificate Transparency CA/ST=Wales/L=Erw Wen - // serial:00 - // - // X509v3 Basic Constraints: - // CA:FALSE - // 1.3.6.1.4.1.11129.2.4.3: critical - // .. - // Signature Algorithm: sha1WithRSAEncryption - // 02:a1:c3:9e:01:5a:f5:4d:ff:02:3c:33:60:87:5f:ff:34:37: - // 55:2f:1f:09:01:bd:c2:54:31:5f:33:72:b7:23:fb:15:fb:ce: - // cc:4d:f4:71:a0:ce:4d:8c:54:65:5d:84:87:97:fb:28:1e:3d: - // fa:bb:46:2d:2c:68:4b:05:6f:ea:7b:63:b4:70:ff:16:6e:32: - // d4:46:06:35:b3:d2:bc:6d:a8:24:9b:26:30:e7:1f:c3:4f:08: - // f2:3d:d4:ee:22:8f:8f:74:f6:3d:78:63:11:dd:0a:58:11:40: - // 5f:90:6c:ca:2c:2d:3e:eb:fc:81:99:64:eb:d8:cf:7c:08:86: - // 3f:be - TestPreCertPEM = "-----BEGIN CERTIFICATE-----\n" + - "MIIC3zCCAkigAwIBAgIBBzANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJHQjEk\n" + - "MCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4wDAYDVQQIEwVX\n" + - "YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAeFw0xMjA2MDEwMDAwMDBaFw0yMjA2MDEw\n" + - "MDAwMDBaMFIxCzAJBgNVBAYTAkdCMSEwHwYDVQQKExhDZXJ0aWZpY2F0ZSBUcmFu\n" + - "c3BhcmVuY3kxDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdFcncgV2VuMIGfMA0G\n" + - "CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+75jnwmh3rjhfdTJaDB0ym+3xj6r015a/\n" + - "BH634c4VyVui+A7kWL19uG+KSyUhkaeb1wDDjpwDibRc1NyaEgqyHgy0HNDnKAWk\n" + - "EM2cW9tdSSdyba8XEPYBhzd+olsaHjnu0LiBGdwVTcaPfajjDK8VijPmyVCfSgWw\n" + - "FAn/Xdh+tQIDAQABo4HBMIG+MB0GA1UdDgQWBBQgMVQa8lwF/9hli2hDeU9ekDb3\n" + - "tDB9BgNVHSMEdjB0gBRfnYgNyHPmVNT4DdjmsMEktEfDVaFZpFcwVTELMAkGA1UE\n" + - "BhMCR0IxJDAiBgNVBAoTG0NlcnRpZmljYXRlIFRyYW5zcGFyZW5jeSBDQTEOMAwG\n" + - "A1UECBMFV2FsZXMxEDAOBgNVBAcTB0VydyBXZW6CAQAwCQYDVR0TBAIwADATBgor\n" + - "BgEEAdZ5AgQDAQH/BAIFADANBgkqhkiG9w0BAQUFAAOBgQACocOeAVr1Tf8CPDNg\n" + - "h1//NDdVLx8JAb3CVDFfM3K3I/sV+87MTfRxoM5NjFRlXYSHl/soHj36u0YtLGhL\n" + - "BW/qe2O0cP8WbjLURgY1s9K8bagkmyYw5x/DTwjyPdTuIo+PdPY9eGMR3QpYEUBf\n" + - "kGzKLC0+6/yBmWTr2M98CIY/vg==\n" + - "-----END CERTIFICATE-----\n" - - // TestEmbeddedCertPEM is a certificate containing an embedded SCT that - // corresponds to TestPreCertProof. - // Certificate: - // Data: - // Version: 3 (0x2) - // Serial Number: 7 (0x7) - // Signature Algorithm: sha1WithRSAEncryption - // Issuer: C = GB, O = Certificate Transparency CA, ST = Wales, L = Erw Wen - // Validity - // Not Before: Jun 1 00:00:00 2012 GMT - // Not After : Jun 1 00:00:00 2022 GMT - // Subject: C = GB, O = Certificate Transparency, ST = Wales, L = Erw Wen - // Subject Public Key Info: - // Public Key Algorithm: rsaEncryption - // Public-Key: (1024 bit) - // Modulus: - // 00:be:ef:98:e7:c2:68:77:ae:38:5f:75:32:5a:0c: - // 1d:32:9b:ed:f1:8f:aa:f4:d7:96:bf:04:7e:b7:e1: - // ce:15:c9:5b:a2:f8:0e:e4:58:bd:7d:b8:6f:8a:4b: - // 25:21:91:a7:9b:d7:00:c3:8e:9c:03:89:b4:5c:d4: - // dc:9a:12:0a:b2:1e:0c:b4:1c:d0:e7:28:05:a4:10: - // cd:9c:5b:db:5d:49:27:72:6d:af:17:10:f6:01:87: - // 37:7e:a2:5b:1a:1e:39:ee:d0:b8:81:19:dc:15:4d: - // c6:8f:7d:a8:e3:0c:af:15:8a:33:e6:c9:50:9f:4a: - // 05:b0:14:09:ff:5d:d8:7e:b5 - // Exponent: 65537 (0x10001) - // X509v3 extensions: - // X509v3 Subject Key Identifier: - // 20:31:54:1A:F2:5C:05:FF:D8:65:8B:68:43:79:4F:5E:90:36:F7:B4 - // X509v3 Authority Key Identifier: - // keyid:5F:9D:88:0D:C8:73:E6:54:D4:F8:0D:D8:E6:B0:C1:24:B4:47:C3:55 - // DirName:/C=GB/O=Certificate Transparency CA/ST=Wales/L=Erw Wen - // serial:00 - // - // X509v3 Basic Constraints: - // CA:FALSE - // CT Precertificate SCTs: - // Signed Certificate Timestamp: - // Version : v1 (0x0) - // Log ID : DF:1C:2E:C1:15:00:94:52:47:A9:61:68:32:5D:DC:5C: - // 79:59:E8:F7:C6:D3:88:FC:00:2E:0B:BD:3F:74:D7:64 - // Timestamp : Apr 5 17:04:16.275 2013 GMT - // Extensions: none - // Signature : ecdsa-with-SHA256 - // 30:45:02:20:48:2F:67:51:AF:35:DB:A6:54:36:BE:1F: - // D6:64:0F:3D:BF:9A:41:42:94:95:92:45:30:28:8F:A3: - // E5:E2:3E:06:02:21:00:E4:ED:C0:DB:3A:C5:72:B1:E2: - // F5:E8:AB:6A:68:06:53:98:7D:CF:41:02:7D:FE:FF:A1: - // 05:51:9D:89:ED:BF:08 - // Signature Algorithm: sha1WithRSAEncryption - // 8a:0c:4b:ef:09:9d:47:92:79:af:a0:a2:8e:68:9f:91:e1:c4: - // 42:1b:e2:d2:69:a2:ea:6c:a4:e8:21:5d:de:dd:ca:15:04:a1: - // 1e:7c:87:c4:b7:7e:80:f0:e9:79:03:52:68:f2:7c:a2:0e:16: - // 68:04:ae:55:6f:31:69:81:f9:6a:39:4a:b7:ab:fd:3e:25:5a: - // c0:04:45:13:fe:76:57:0c:67:95:ab:e4:70:31:33:d3:03:f8: - // 9f:3a:fa:6b:bc:fc:51:73:19:df:d9:5b:93:42:41:21:1f:63: - // 40:35:c3:d0:78:30:7a:68:c6:07:5a:2e:20:c8:9f:36:b8:91: - // 0c:a0 - TestEmbeddedCertPEM = "-----BEGIN CERTIFICATE-----\n" + - "MIIDWTCCAsKgAwIBAgIBBzANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJHQjEk\n" + - "MCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4wDAYDVQQIEwVX\n" + - "YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAeFw0xMjA2MDEwMDAwMDBaFw0yMjA2MDEw\n" + - "MDAwMDBaMFIxCzAJBgNVBAYTAkdCMSEwHwYDVQQKExhDZXJ0aWZpY2F0ZSBUcmFu\n" + - "c3BhcmVuY3kxDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdFcncgV2VuMIGfMA0G\n" + - "CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+75jnwmh3rjhfdTJaDB0ym+3xj6r015a/\n" + - "BH634c4VyVui+A7kWL19uG+KSyUhkaeb1wDDjpwDibRc1NyaEgqyHgy0HNDnKAWk\n" + - "EM2cW9tdSSdyba8XEPYBhzd+olsaHjnu0LiBGdwVTcaPfajjDK8VijPmyVCfSgWw\n" + - "FAn/Xdh+tQIDAQABo4IBOjCCATYwHQYDVR0OBBYEFCAxVBryXAX/2GWLaEN5T16Q\n" + - "Nve0MH0GA1UdIwR2MHSAFF+diA3Ic+ZU1PgN2OawwSS0R8NVoVmkVzBVMQswCQYD\n" + - "VQQGEwJHQjEkMCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4w\n" + - "DAYDVQQIEwVXYWxlczEQMA4GA1UEBxMHRXJ3IFdlboIBADAJBgNVHRMEAjAAMIGK\n" + - "BgorBgEEAdZ5AgQCBHwEegB4AHYA3xwuwRUAlFJHqWFoMl3cXHlZ6PfG04j8AC4L\n" + - "vT9012QAAAE92yffkwAABAMARzBFAiBIL2dRrzXbplQ2vh/WZA89v5pBQpSVkkUw\n" + - "KI+j5eI+BgIhAOTtwNs6xXKx4vXoq2poBlOYfc9BAn3+/6EFUZ2J7b8IMA0GCSqG\n" + - "SIb3DQEBBQUAA4GBAIoMS+8JnUeSea+goo5on5HhxEIb4tJpoupspOghXd7dyhUE\n" + - "oR58h8S3foDw6XkDUmjyfKIOFmgErlVvMWmB+Wo5Srer/T4lWsAERRP+dlcMZ5Wr\n" + - "5HAxM9MD+J86+mu8/FFzGd/ZW5NCQSEfY0A1w9B4MHpoxgdaLiDInza4kQyg\n" + - "-----END CERTIFICATE-----\n" - - // TestInvalidEmbeddedCertPEM is a certificate that contains an SCT that is - // not for the corresponding pre-certificate. The SCT embedded corresponds - // to TestInvalidProof. - // Certificate: - // Data: - // Version: 3 (0x2) - // Serial Number: 7 (0x7) - // Signature Algorithm: sha1WithRSAEncryption - // Issuer: C = GB, O = Certificate Transparency CA, ST = Wales, L = Erw Wen - // Validity - // Not Before: Jun 1 00:00:00 2012 GMT - // Not After : Jun 1 00:00:00 2022 GMT - // Subject: C = GB, O = Certificate Transparency, ST = Wales, L = Erw Wen - // Subject Public Key Info: - // Public Key Algorithm: rsaEncryption - // Public-Key: (1024 bit) - // Modulus: - // 00:be:ef:98:e7:c2:68:77:ae:38:5f:75:32:5a:0c: - // 1d:32:9b:ed:f1:8f:aa:f4:d7:96:bf:04:7e:b7:e1: - // ce:15:c9:5b:a2:f8:0e:e4:58:bd:7d:b8:6f:8a:4b: - // 25:21:91:a7:9b:d7:00:c3:8e:9c:03:89:b4:5c:d4: - // dc:9a:12:0a:b2:1e:0c:b4:1c:d0:e7:28:05:a4:10: - // cd:9c:5b:db:5d:49:27:72:6d:af:17:10:f6:01:87: - // 37:7e:a2:5b:1a:1e:39:ee:d0:b8:81:19:dc:15:4d: - // c6:8f:7d:a8:e3:0c:af:15:8a:33:e6:c9:50:9f:4a: - // 05:b0:14:09:ff:5d:d8:7e:b5 - // Exponent: 65537 (0x10001) - // X509v3 extensions: - // X509v3 Subject Key Identifier: - // 20:31:54:1A:F2:5C:05:FF:D8:65:8B:68:43:79:4F:5E:90:36:F7:B4 - // X509v3 Authority Key Identifier: - // keyid:5F:9D:88:0D:C8:73:E6:54:D4:F8:0D:D8:E6:B0:C1:24:B4:47:C3:55 - // DirName:/C=GB/O=Certificate Transparency CA/ST=Wales/L=Erw Wen - // serial:00 - // - // X509v3 Basic Constraints: - // CA:FALSE - // CT Precertificate SCTs: - // Signed Certificate Timestamp: - // Version : v1 (0x0) - // Log ID : DF:1C:2E:C1:15:00:94:52:47:A9:61:68:32:5D:DC:5C: - // 79:59:E8:F7:C6:D3:88:FC:00:2E:0B:BD:3F:74:D7:64 - // Timestamp : Apr 5 17:04:17.060 2013 GMT - // Extensions: none - // Signature : ecdsa-with-SHA256 - // 30:45:02:21:00:A6:D3:45:17:F3:39:2D:9E:C5:D2:57: - // AD:F1:C5:97:DC:45:BD:4C:D3:B7:38:56:C6:16:A9:FB: - // 99:E5:AE:75:A8:02:20:5E:26:C8:D1:C7:E2:22:FE:8C: - // DA:29:BA:EB:04:A8:34:EE:97:D3:4F:D8:17:18:F1:AA: - // E0:CD:66:F4:B8:A9:3F - // Signature Algorithm: sha1WithRSAEncryption - // af:28:89:06:38:b0:12:6f:dd:64:5d:d0:62:80:f8:10:6c:ec: - // 49:4c:f8:22:86:0a:29:d4:f1:7e:6a:a5:7c:5a:58:b2:96:cc: - // 90:c6:db:f1:22:10:4b:7f:4a:76:d6:fd:df:f2:1a:41:3a:9e: - // e7:88:7e:32:a3:c7:a2:07:3c:e6:af:ae:01:b4:1a:a2:3d:ce: - // 98:f3:ab:5e:c7:5c:e7:59:fa:7c:cc:ab:4f:fa:7a:a7:3e:7d: - // 98:38:77:c6:d0:f1:de:cd:dd:37:49:00:59:b7:91:90:b2:7f: - // 85:94:2b:7c:c8:b2:3c:bf:90:30:68:5d:21:43:c4:95:a5:39: - // 6d:9f - TestInvalidEmbeddedCertPEM = "-----BEGIN CERTIFICATE-----\n" + - "MIIDWTCCAsKgAwIBAgIBBzANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJHQjEk\n" + - "MCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4wDAYDVQQIEwVX\n" + - "YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAeFw0xMjA2MDEwMDAwMDBaFw0yMjA2MDEw\n" + - "MDAwMDBaMFIxCzAJBgNVBAYTAkdCMSEwHwYDVQQKExhDZXJ0aWZpY2F0ZSBUcmFu\n" + - "c3BhcmVuY3kxDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdFcncgV2VuMIGfMA0G\n" + - "CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+75jnwmh3rjhfdTJaDB0ym+3xj6r015a/\n" + - "BH634c4VyVui+A7kWL19uG+KSyUhkaeb1wDDjpwDibRc1NyaEgqyHgy0HNDnKAWk\n" + - "EM2cW9tdSSdyba8XEPYBhzd+olsaHjnu0LiBGdwVTcaPfajjDK8VijPmyVCfSgWw\n" + - "FAn/Xdh+tQIDAQABo4IBOjCCATYwHQYDVR0OBBYEFCAxVBryXAX/2GWLaEN5T16Q\n" + - "Nve0MH0GA1UdIwR2MHSAFF+diA3Ic+ZU1PgN2OawwSS0R8NVoVmkVzBVMQswCQYD\n" + - "VQQGEwJHQjEkMCIGA1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4w\n" + - "DAYDVQQIEwVXYWxlczEQMA4GA1UEBxMHRXJ3IFdlboIBADAJBgNVHRMEAjAAMIGK\n" + - "BgorBgEEAdZ5AgQCBHwEegB4AHYA3xwuwRUAlFJHqWFoMl3cXHlZ6PfG04j8AC4L\n" + - "vT9012QAAAE92yfipAAABAMARzBFAiEAptNFF/M5LZ7F0let8cWX3EW9TNO3OFbG\n" + - "Fqn7meWudagCIF4myNHH4iL+jNopuusEqDTul9NP2BcY8argzWb0uKk/MA0GCSqG\n" + - "SIb3DQEBBQUAA4GBAK8oiQY4sBJv3WRd0GKA+BBs7ElM+CKGCinU8X5qpXxaWLKW\n" + - "zJDG2/EiEEt/SnbW/d/yGkE6nueIfjKjx6IHPOavrgG0GqI9zpjzq17HXOdZ+nzM\n" + - "q0/6eqc+fZg4d8bQ8d7N3TdJAFm3kZCyf4WUK3zIsjy/kDBoXSFDxJWlOW2f\n" + - "-----END CERTIFICATE-----\n" -) - -var ( - // TestCertProof is a TLS-encoded ct.SignedCertificateTimestamp corresponding - // to TestCertPEM. - TestCertProof = dh("00df1c2ec11500945247a96168325ddc5c7959e8f7c6d388fc002e0bbd3f74d7" + - "640000013ddb27ded900000403004730450220606e10ae5c2d5a1b0aed49dc49" + - "37f48de71a4e9784e9c208dfbfe9ef536cf7f2022100beb29c72d7d06d61d06b" + - "db38a069469aa86fe12e18bb7cc45689a2c0187ef5a5") - - // TestPreCertProof is a TLS-encoded ct.SignedCertificateTimestamp - // corresponding to TestPreCertPEM - TestPreCertProof = dh("00df1c2ec11500945247a96168325ddc5c7959e8f7c6d388fc002e0bbd3f74d7" + - "640000013ddb27df9300000403004730450220482f6751af35dba65436be1fd6" + - "640f3dbf9a41429495924530288fa3e5e23e06022100e4edc0db3ac572b1e2f5" + - "e8ab6a680653987dcf41027dfeffa105519d89edbf08") - - // TestInvalidProof is a TLS-encoded ct.SignedCertificateTimestamp - // corresponding to the invalid SCT embedded in TestInvalidEmbeddedCertPEM. - TestInvalidProof = dh("00df1c2ec11500945247a96168325ddc5c7959e8f7c6d388fc002e0bbd3f74d7" + - "640000013ddb27e2a40000040300473045022100a6d34517f3392d9ec5d257ad" + - "f1c597dc45bd4cd3b73856c616a9fb99e5ae75a802205e26c8d1c7e222fe8cda" + - "29baeb04a834ee97d34fd81718f1aae0cd66f4b8a93f") - - // TestCertB64LeafHash is the base64-encoded leaf hash of TestCertPEM with - // TestCertProof as the corresponding SCT. - TestCertB64LeafHash = "BKZLZGMbAnDW0gQWjNJNCyS2IgweWn76YW3tFlu3AuY=" - - // TestPreCertB64LeafHash is the base64-encoded leaf hash of TestPreCertPEM - // with TestPreCertProof as the corresponding SCT. - TestPreCertB64LeafHash = "mbk+d5FDW3oNZJCbOi828rqC3hf+qhigTWVGcXEZq1U=" -) - -func dh(h string) []byte { - r, err := hex.DecodeString(h) - if err != nil { - panic(err) - } - return r -} diff --git a/vendor/github.com/google/certificate-transparency-go/testdata/gossip-root.cert b/vendor/github.com/google/certificate-transparency-go/testdata/gossip-root.cert deleted file mode 100644 index 7a0c196..0000000 --- a/vendor/github.com/google/certificate-transparency-go/testdata/gossip-root.cert +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICQTCCAeegAwIBAgIEBAbK/jAKBggqhkjOPQQDAjBpMQswCQYDVQQGEwJHQjEP -MA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDzANBgNVBAoTBkdvb2ds -ZTEMMAoGA1UECxMDRW5nMRkwFwYDVQQDExBUZXN0R29zc2lwZXJSb290MB4XDTE4 -MDIyNTA4MTA1M1oXDTI4MDIyMzA4MTA1M1owaTELMAkGA1UEBhMCR0IxDzANBgNV -BAgTBkxvbmRvbjEPMA0GA1UEBxMGTG9uZG9uMQ8wDQYDVQQKEwZHb29nbGUxDDAK -BgNVBAsTA0VuZzEZMBcGA1UEAxMQVGVzdEdvc3NpcGVyUm9vdDBZMBMGByqGSM49 -AgEGCCqGSM49AwEHA0IABOqzZufPSU6hMJOIbljkjklDvQKBGYW9VenI6i7HSiyH -ccPUuh3F3fbbe2MrLtuRCjH7nqvcELPqBJsL3IVgQJijfTB7MB0GA1UdDgQWBBRq -6hoXslGgHhrCVJMu4jrYlksyZjAfBgNVHSMEGDAWgBRq6hoXslGgHhrCVJMu4jrY -lksyZjASBgNVHRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwICBDAVBgNVHSUE -DjAMBgorBgEEAdZ5AgQGMAoGCCqGSM49BAMCA0gAMEUCIQCQCnWTIOlC6LqkcdH0 -fWZeNo5E3AaZBb9Tkv76ET2fJAIgOeGJvfiiOIlDV41/bIOg5eTHb/fxg80TCQBe -6ia6ZS8= ------END CERTIFICATE----- diff --git a/vendor/github.com/google/certificate-transparency-go/testdata/gossiper.privkey.pem b/vendor/github.com/google/certificate-transparency-go/testdata/gossiper.privkey.pem deleted file mode 100644 index 09336f4..0000000 --- a/vendor/github.com/google/certificate-transparency-go/testdata/gossiper.privkey.pem +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-CBC,559BE893ECD7A88C - -UOwSw+WlSv5LLiBZSCnR12FX13Hk1a3vavdpUde4W4qawQgJSMqLa3it8Lfadtnm -GfGVqN+gF5KFiNWxgMs2qRcbdQ03ZlMmoH8Z8jPQHXvKseJvME8tZQWPvJ15rbXh -G9Lcx7NYlm0miHPy3ras8ci58HSDqz9Z7yOdgHzPpiU= ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/google/certificate-transparency-go/testdata/keys.go b/vendor/github.com/google/certificate-transparency-go/testdata/keys.go deleted file mode 100644 index f005db3..0000000 --- a/vendor/github.com/google/certificate-transparency-go/testdata/keys.go +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package testdata holds data and utility functions needed for various Go tests. -package testdata - -import "encoding/hex" - -// Hashes of text string 'abcd' with various algorithms; check with either "sum input" or "openssl dgst - input" -const ( - // AbcdMD5 is 'abcd' hashed with MD5 - AbcdMD5 = "e2fc714c4727ee9395f324cd2e7f331f" - // AbcdSHA1 is 'abcd' hashed with SHA1 - AbcdSHA1 = "81fe8bfe87576c3ecb22426f8e57847382917acf" - // AbcdSHA224 is 'abcd' hashed with SHA224 - AbcdSHA224 = "a76654d8e3550e9a2d67a0eeb6c67b220e5885eddd3fde135806e601" - // AbcdSHA256 is 'abcd' hashed with SHA256 - AbcdSHA256 = "88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589" - // AbcdSHA384 is 'abcd' hashed with SHA384 - AbcdSHA384 = "1165b3406ff0b52a3d24721f785462ca2276c9f454a116c2b2ba20171a7905ea5a026682eb659c4d5f115c363aa3c79b" - // AbcdSHA512 is 'abcd' hashed with SHA512 - AbcdSHA512 = "d8022f2060ad6efd297ab73dcc5355c9b214054b0d1776a136a669d26a7d3b14f73aa0d0ebff19ee333368f0164b6419a96da49e3e481753e7e96b716bdccb6f" -) - -const ( - // LogPublicKeyB64 is an ECDSA key copied from test/testdata/ct-server-key-public.pem - LogPublicKeyB64 = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmXg8sUUzwBYaWrRb+V0IopzQ6o3UyEJ04r5ZrRXGdpYM8K+hB0pXrGRLI0eeWz+3skXrS0IO83AhA3GpRL6s6w==" - - // LogPublicKeyPEM is an ECDSA key copied from test/testdata/ct-server-key-public.pem - LogPublicKeyPEM = "-----BEGIN PUBLIC KEY-----\n" + - "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmXg8sUUzwBYaWrRb+V0IopzQ6o3U\n" + - "yEJ04r5ZrRXGdpYM8K+hB0pXrGRLI0eeWz+3skXrS0IO83AhA3GpRL6s6w==\n" + - "-----END PUBLIC KEY-----\n" - - // RsaPrivateKeyPEM was generated with: - // openssl genpkey -algorithm RSA -out rsa.privkey.pem -pkeyopt rsa_keygen_bits:2048 - RsaPrivateKeyPEM = "-----BEGIN PRIVATE KEY-----\n" + - "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDP8SJM5SBIbFpF\n" + - "dRAUEERo35E4iFXfT5SVAzBIqATkCpf3LfdFZgssPeliBdTtgdvT/CWC2m6aVXYZ\n" + - "eScAJOauTpGDyJ7OXj7Yhx1q6u28NuQleU3UQK5QYb7VOjeIse7oTh+THf5IK5T5\n" + - "esyh+ioybEYBXXMQetHc4YbXAq06crNT2BP+AxQ4z27xu4X5CKLwwVMa2xwMCFDC\n" + - "Y7mxQzEhFv8+HbOtM0IQMSSyh6+o0w4Yzt6i/TUOytZb1D7WHOEMpVTd1CMbXjN0\n" + - "tFZvoO0V+n0OV3oT1E5AvwujVguUJblQiapbL890/nZbBtP3xMoFLLhc7sX7N2vR\n" + - "1wLWsjOVAgMBAAECggEBAL+frUZDV86l20JqsFhs7T3f2MnKCahyg7AWciZif69O\n" + - "e+BTQa14bg9lNm8YhLIim1vs3vyJIqei3eR3mxMs7k/vI3XYKVBv1WZgjSF8QXzS\n" + - "8Mf/01MoD/sPOHby4T5dCpaVd89xMmV7lBubqHwUN1KkKJcVcPXc2Qy94C6/zrcu\n" + - "Vb7Q91ugTvvhyalWEN02M3tzHEn4cXrnMLWPmTgxb7YtTMRIbJFx2um7/W9G5D+1\n" + - "ZtKMjwt+P/yXynx3Sa555MjjJ1/LUyMSbQZoLE0SGOigz1VQnP8nFlpvXUHzktiA\n" + - "IBPBBQSsEoS8H3z6WThwY72O795/i2l5mf7EUUAa2/kCgYEA+W7tJPg69KWHKn6E\n" + - "gGZKIDTxvp3vRxjLedp7D7cu6bVPCBVIHrPQdmp/mneY6x7Air0a9gCVbh32iCrm\n" + - "UrSBCio4i6jtqtna2T1Gc0z63K3UrVQPR0Z6Swq1XDOI6/I23ibxPr12/XXWWYlA\n" + - "wkPwvewJVrjtMoP1dkAKVbyzImcCgYEA1WqS0xg7BL4iNGFPrrSme2blZOgga83x\n" + - "CtY9dnWAs0IvdxsuItCDaFVJm3oU18ohirEMzqZvbRlwMlUawpd75hCNWyVF4cRo\n" + - "+l1RvzOlC/7QXX/E+Kv7sTEUYH7hJyS46QhOtC1/ndAyObk9c2VNJmERfMwIHNm9\n" + - "BfSN8yrq1KMCgYEA94fCZPbGIvSFj4EgYv+fvhhscvrucsLDYniTuUPTlXAtLttX\n" + - "x8gwLuN/ID5hjarl7oi90bVAlZe8iOLx0M96YykFFmuc9/jcOsuZN2EEbq0/KocJ\n" + - "5nSldgT5d7dYwLWNB6bjr5x8Egm3nwEbN+4OYZt0pRA9q+zSUfg5iV4K8y8CgYA7\n" + - "S9YposTbJ3zXcuYx022iQc+gvsIrUdgUO7xuCm3M4KnRfRLPh4HLXk8KTNw3rKiv\n" + - "IUw+qo2xEW1T/sNlp7M8FANCfNOyy+CjF4ScDFxiPdVk9RgkQ5y1+b4ApaAnQRPD\n" + - "Y5SCiVW44lziHu7M/it2a2fxdbsXUQQtAGrkUltW4wKBgAPZyEGi4V2wryOswmkC\n" + - "I29TbC6ChnUOvqJfSfz536eIi41D1Ua2Y/VlAK1ud7K8ilr/M4VoRjHqbPivR1Uk\n" + - "RU7nO3cWRBuDBjgZWeAq5WFIMPbm9gRlaTECI6EFtAOI1GcHOsOBecd3PBiQNXvj\n" + - "YyGD1wSrHQwDcnxtP1rqEQDV\n" + - "-----END PRIVATE KEY-----\n" - - // RsaPublicKeyPEM was generated from above with: - // openssl rsa -pubout -in rsa.privkey.pem -out rsa.pubkey.pem - RsaPublicKeyPEM = "-----BEGIN PUBLIC KEY-----\n" + - "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz/EiTOUgSGxaRXUQFBBE\n" + - "aN+ROIhV30+UlQMwSKgE5AqX9y33RWYLLD3pYgXU7YHb0/wlgtpumlV2GXknACTm\n" + - "rk6Rg8iezl4+2IcdaurtvDbkJXlN1ECuUGG+1To3iLHu6E4fkx3+SCuU+XrMofoq\n" + - "MmxGAV1zEHrR3OGG1wKtOnKzU9gT/gMUOM9u8buF+Qii8MFTGtscDAhQwmO5sUMx\n" + - "IRb/Ph2zrTNCEDEksoevqNMOGM7eov01DsrWW9Q+1hzhDKVU3dQjG14zdLRWb6Dt\n" + - "Ffp9Dld6E9ROQL8Lo1YLlCW5UImqWy/PdP52WwbT98TKBSy4XO7F+zdr0dcC1rIz\n" + - "lQIDAQAB\n" + - "-----END PUBLIC KEY-----\n" - - // RsaSignedAbcdHex was generated with: - // echo -n "abcd" > sign.input - // openssl sha256 -sign rsa.privkey.pem -out sign.rsa sign.input - // Verify with: - // openssl sha256 -verify rsa.pubkey.pem -signature sign.rsa sign.input - RsaSignedAbcdHex = "4692f17adad62324a38a786d9b05eb7facf95c277729bc23e8d4f4fe25c0ac0e" + - "9115f14ffd4dc6c00e6b2717677e96ed4da9e2226745db5c2d14ec8b4f96959e" + - "a43ca73e3ab801d4e76b0c0599c741b9701dd0c22b20cc7a294fccce97d2eda2" + - "72448830a19b0b1075f962d3bcf65922f81f4747dde1a2883ffce12941927af6" + - "25549ea7b4f745a95f5558822af434cc7471ea5a21cce656a7667d29bff3e6f2" + - "fb3d48bbee1a60116f0dd429d5691b008482e9ec42538bcf2692e1a685e836c8" + - "49316fb3c49b58bd5a0c33f0256b09d59af08a018fe64cd31051cb9e9a1d3fde" + - "e186bd80bfe304abbbec2ac18d3bee09465cb69f2638728aba4b9886a252768a" - - // DsaPrivateKeyPEM was generated with: - // openssl dsaparam -out dsa.param.pem 2048; openssl gendsa dsa.param.pem -out dsa.privkey.pem - DsaPrivateKeyPEM = "-----BEGIN DSA PRIVATE KEY-----\n" + - "MIIDVwIBAAKCAQEA3Q72qQc0ZM2eUjvZ/XOROQTbhmjzuZdzY7kd+82n54NPeqVz\n" + - "+FWmk26INd7pUNbn/TjniN5+pC2pK+p9alFLE19bOvsY4x7Ugwrpd9sQIea3W4Q7\n" + - "H9PaEW+BooFzT/feC9TmnU0ynwoNhZB33Cr3k3PFt/69lmyrkd91wTpXrstrQurU\n" + - "h4baL5l6t2/JT3TxpKx6xe19hWqqFsBLu/j+kE2o2Aw1TVLHg4/74TJLfqAkWnCI\n" + - "u9QL0uGQnW80kRfJnT+tUJXrXMpg1HxK7CsDEW5xsAWF370Is0UPaP7jRru6FiSN\n" + - "ObcVhSqCIs+QJIWie9cRtwniwhoi4z6AfGeEYQIhAOkSzAsWja1fwB486/LCW+zv\n" + - "DJKiCGLTalimfawzHQHFAoIBAQDJvCujEZ/WeQFLlP/0zS+2DjqdaxnKj1xuXfoL\n" + - "LOocvMw06dnrQNmDu/nBQiYSfzf7zjwpnx+AVjBQssK0jXs0l7gw52FyCIztDejT\n" + - "/ybMVudwKUGudxAEjOclOSQ7XVpPd4p3UMy+E6pkJ8VRiuNFDibYTD+O3XhFTj2l\n" + - "6LqV/KcB2fWV1fUqfxax2vpcwe4clTJbJXUgJC3mYmUXv1U6z0hliDz2WMhbOyea\n" + - "1fs31zYvIMyk2wJFJl7+EbXb8BgYcQt1FE4c14fuFnincAW0So+xBZ5DtiTja4lm\n" + - "DE0OAI2hhLslSQ7rGwWt2zIKSFLtsWf78CP1wigJvWcUVhazAoIBAFAhxgtOaV8G\n" + - "FJxs6A3TtXEmmrq3i5/w3/8l7skWamcHvcwrvw37g5KQY+N+85JZszHPjmUzEq/o\n" + - "NOLjF6zq7+oRtWbOR3Mvc2hHsHg86tE/HAkBIu2G73c9UuskzGSMec4F6TyWKHvC\n" + - "26F2cvu9aA42v/8q1d/QQs3+LrtARGhyFCqnBVNSZmZj5ngR0kLGUfs/LQklpGFe\n" + - "VciXK57RxHSPo15lnKiHW9kCte7tGEg9Eber8paMz67dQDuj1yRkS5H7JXqRZjIP\n" + - "UrICWGGk1vluQsuoyI/Nu8/tL7Im24xZH6XHBm4F+aijl9XlAJiKXfkCLIaxYSdc\n" + - "4PXquTwtRLICIQCijrpD+UhidGFLPZCCLzBC239PrP7PabSVurWXHh5iYw==\n" + - "-----END DSA PRIVATE KEY-----\n" - - // DsaPrivateKeyPKCS8PEM is a copy of the private key above, encoded in PKCS#8 format. - // Generated from above with: - // openssl pkcs8 -topk8 -nocrypt -in dsa.privkey.pem -out dsa.privkey.pkcs8.pem - DsaPrivateKeyPKCS8PEM = "-----BEGIN PRIVATE KEY-----\n" + - "MIICZgIBADCCAjoGByqGSM44BAEwggItAoIBAQDdDvapBzRkzZ5SO9n9c5E5BNuG\n" + - "aPO5l3NjuR37zafng096pXP4VaaTbog13ulQ1uf9OOeI3n6kLakr6n1qUUsTX1s6\n" + - "+xjjHtSDCul32xAh5rdbhDsf09oRb4GigXNP994L1OadTTKfCg2FkHfcKveTc8W3\n" + - "/r2WbKuR33XBOleuy2tC6tSHhtovmXq3b8lPdPGkrHrF7X2FaqoWwEu7+P6QTajY\n" + - "DDVNUseDj/vhMkt+oCRacIi71AvS4ZCdbzSRF8mdP61QletcymDUfErsKwMRbnGw\n" + - "BYXfvQizRQ9o/uNGu7oWJI05txWFKoIiz5AkhaJ71xG3CeLCGiLjPoB8Z4RhAiEA\n" + - "6RLMCxaNrV/AHjzr8sJb7O8MkqIIYtNqWKZ9rDMdAcUCggEBAMm8K6MRn9Z5AUuU\n" + - "//TNL7YOOp1rGcqPXG5d+gss6hy8zDTp2etA2YO7+cFCJhJ/N/vOPCmfH4BWMFCy\n" + - "wrSNezSXuDDnYXIIjO0N6NP/JsxW53ApQa53EASM5yU5JDtdWk93indQzL4TqmQn\n" + - "xVGK40UOJthMP47deEVOPaXoupX8pwHZ9ZXV9Sp/FrHa+lzB7hyVMlsldSAkLeZi\n" + - "ZRe/VTrPSGWIPPZYyFs7J5rV+zfXNi8gzKTbAkUmXv4RtdvwGBhxC3UUThzXh+4W\n" + - "eKdwBbRKj7EFnkO2JONriWYMTQ4AjaGEuyVJDusbBa3bMgpIUu2xZ/vwI/XCKAm9\n" + - "ZxRWFrMEIwIhAKKOukP5SGJ0YUs9kIIvMELbf0+s/s9ptJW6tZceHmJj\n" + - "-----END PRIVATE KEY-----\n" - - // DsaPublicKeyPEM was generated from above with: - // openssl dsa -in dsa.privkey.pem -pubout -out dsa.pubkey.pem - DsaPublicKeyPEM = "-----BEGIN PUBLIC KEY-----\n" + - "MIIDRzCCAjoGByqGSM44BAEwggItAoIBAQDdDvapBzRkzZ5SO9n9c5E5BNuGaPO5\n" + - "l3NjuR37zafng096pXP4VaaTbog13ulQ1uf9OOeI3n6kLakr6n1qUUsTX1s6+xjj\n" + - "HtSDCul32xAh5rdbhDsf09oRb4GigXNP994L1OadTTKfCg2FkHfcKveTc8W3/r2W\n" + - "bKuR33XBOleuy2tC6tSHhtovmXq3b8lPdPGkrHrF7X2FaqoWwEu7+P6QTajYDDVN\n" + - "UseDj/vhMkt+oCRacIi71AvS4ZCdbzSRF8mdP61QletcymDUfErsKwMRbnGwBYXf\n" + - "vQizRQ9o/uNGu7oWJI05txWFKoIiz5AkhaJ71xG3CeLCGiLjPoB8Z4RhAiEA6RLM\n" + - "CxaNrV/AHjzr8sJb7O8MkqIIYtNqWKZ9rDMdAcUCggEBAMm8K6MRn9Z5AUuU//TN\n" + - "L7YOOp1rGcqPXG5d+gss6hy8zDTp2etA2YO7+cFCJhJ/N/vOPCmfH4BWMFCywrSN\n" + - "ezSXuDDnYXIIjO0N6NP/JsxW53ApQa53EASM5yU5JDtdWk93indQzL4TqmQnxVGK\n" + - "40UOJthMP47deEVOPaXoupX8pwHZ9ZXV9Sp/FrHa+lzB7hyVMlsldSAkLeZiZRe/\n" + - "VTrPSGWIPPZYyFs7J5rV+zfXNi8gzKTbAkUmXv4RtdvwGBhxC3UUThzXh+4WeKdw\n" + - "BbRKj7EFnkO2JONriWYMTQ4AjaGEuyVJDusbBa3bMgpIUu2xZ/vwI/XCKAm9ZxRW\n" + - "FrMDggEFAAKCAQBQIcYLTmlfBhScbOgN07VxJpq6t4uf8N//Je7JFmpnB73MK78N\n" + - "+4OSkGPjfvOSWbMxz45lMxKv6DTi4xes6u/qEbVmzkdzL3NoR7B4POrRPxwJASLt\n" + - "hu93PVLrJMxkjHnOBek8lih7wtuhdnL7vWgONr//KtXf0ELN/i67QERochQqpwVT\n" + - "UmZmY+Z4EdJCxlH7Py0JJaRhXlXIlyue0cR0j6NeZZyoh1vZArXu7RhIPRG3q/KW\n" + - "jM+u3UA7o9ckZEuR+yV6kWYyD1KyAlhhpNb5bkLLqMiPzbvP7S+yJtuMWR+lxwZu\n" + - "Bfmoo5fV5QCYil35AiyGsWEnXOD16rk8LUSy\n" + - "-----END PUBLIC KEY-----\n" - - // DsaSignedAbcdHex was generated with: - // echo -n "abcd" > sign.input - // openssl dgst -dss1 -sign dsa.privkey.pem -out sign.dsa sign.input - // Note that this includes randomization so will give different results each time. - // Verify with: - // openssl dgst -dss1 -verify dsa.pubkey.pem -signature sign.dsa sign.input - DsaSignedAbcdHex = "3045022100c287211dec54eab597ed5264f6fdf57faf651909914c533d42f0e3" + - "2809e9141402205f34cc4b8ca12ebdf025bf36bbe1ff7d807d4cfe951ac1329a" + - "35a39f5e971f10" - - // EcdsaPrivateKeyPEM was generated with: - // openssl ecparam -genkey -name prime256v1 -noout -out ecdsa.privkey.pem - EcdsaPrivateKeyPEM = "-----BEGIN EC PRIVATE KEY-----\n" + - "MHcCAQEEIHg0hg3vLqLVI7wv2y0cCk+kmwuwoKsMZqzqbjqP1AtjoAoGCCqGSM49\n" + - "AwEHoUQDQgAEjHs6Rw7KFt8Wd2ZcioZi7eZY5nodUXMnCWUhZzsGVsPaexqUyPSr\n" + - "9cQgrCe7MPRLJ524AO6rREqfs7FKt85++A==\n" + - "-----END EC PRIVATE KEY-----\n" - - // EcdsaPrivateKeyPKCS8PEM is a copy of the private key above, encoded in PKCS#8 format. - // Generated from above with: - // openssl pkcs8 -topk8 -nocrypt -in ecdsa.privkey.pem -out ecdsa.privkey.pkcs8.pem - EcdsaPrivateKeyPKCS8PEM = "-----BEGIN PRIVATE KEY-----\n" + - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgeDSGDe8uotUjvC/b\n" + - "LRwKT6SbC7CgqwxmrOpuOo/UC2OhRANCAASMezpHDsoW3xZ3ZlyKhmLt5ljmeh1R\n" + - "cycJZSFnOwZWw9p7GpTI9Kv1xCCsJ7sw9EsnnbgA7qtESp+zsUq3zn74\n" + - "-----END PRIVATE KEY-----\n" - - // EcdsaPublicKeyPEM was generated from above with: - // openssl ec -in ecdsa.privkey.pem -pubout -out ecdsa.pubkey.pem - EcdsaPublicKeyPEM = "-----BEGIN PUBLIC KEY-----\n" + - "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjHs6Rw7KFt8Wd2ZcioZi7eZY5nod\n" + - "UXMnCWUhZzsGVsPaexqUyPSr9cQgrCe7MPRLJ524AO6rREqfs7FKt85++A==\n" + - "-----END PUBLIC KEY-----\n" - - // EcdsaSignedAbcdHex was generated with: - // echo -n "abcd" > sign.input - // openssl dgst -sha256 -sign ecdsa.privkey.pem -out sign.ecdsa sign.input - // Note that this includes randomization so will give different results each time. - // Verify with: - // openssl dgst -sha256 -verify ecdsa.pubkey.pem -signature sign.ecdsa sign.input - EcdsaSignedAbcdHex = "304502202e0204dadf2baa35e426b66ab8cd32a9ba33421187645a9110512e3e" + - "d1b8007b022100ae83f5f993ab3af6f46bb09b4f15d07cc582b03e1353879ada" + - "ce68796fe537e5" -) - -// FromHex decodes a hex string to a byte array, and panics on error; only suitable for -// use in test code. -func FromHex(hexdata string) []byte { - data, err := hex.DecodeString(hexdata) - if err != nil { - panic("non hex data: " + err.Error()) - } - return data -} diff --git a/vendor/github.com/google/certificate-transparency-go/testdata/test-cert.pem b/vendor/github.com/google/certificate-transparency-go/testdata/test-cert.pem deleted file mode 100644 index cc3b51b..0000000 --- a/vendor/github.com/google/certificate-transparency-go/testdata/test-cert.pem +++ /dev/null @@ -1,60 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 6 (0x6) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=GB, O=Certificate Transparency CA, ST=Wales, L=Erw Wen - Validity - Not Before: Jun 1 00:00:00 2012 GMT - Not After : Jun 1 00:00:00 2022 GMT - Subject: C=GB, O=Certificate Transparency, ST=Wales, L=Erw Wen - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:b1:fa:37:93:61:11:f8:79:2d:a2:08:1c:3f:e4: - 19:25:00:85:31:dc:7f:2c:65:7b:d9:e1:de:47:04: - 16:0b:4c:9f:19:d5:4a:da:44:70:40:4c:1c:51:34: - 1b:8f:1f:75:38:dd:dd:28:d9:ac:a4:83:69:fc:56: - 46:dd:cc:76:17:f8:16:8a:ae:5b:41:d4:33:31:fc: - a2:da:df:c8:04:d5:72:08:94:90:61:f9:ee:f9:02: - ca:47:ce:88:c6:44:e0:00:f0:6e:ee:cc:ab:dc:9d: - d2:f6:8a:22:cc:b0:9d:c7:6e:0d:bc:73:52:77:65: - b1:a3:7a:8c:67:62:53:dc:c1 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - 6A:0D:98:2A:3B:62:C4:4B:6D:2E:F4:E9:BB:7A:01:AA:9C:B7:98:E2 - X509v3 Authority Key Identifier: - keyid:5F:9D:88:0D:C8:73:E6:54:D4:F8:0D:D8:E6:B0:C1:24:B4:47:C3:55 - DirName:/C=GB/O=Certificate Transparency CA/ST=Wales/L=Erw Wen - serial:00 - - X509v3 Basic Constraints: - CA:FALSE - Signature Algorithm: sha1WithRSAEncryption - 17:1c:d8:4a:ac:41:4a:9a:03:0f:22:aa:c8:f6:88:b0:81:b2: - 70:9b:84:8b:4e:55:11:40:6c:d7:07:fe:d0:28:59:7a:9f:ae: - fc:2e:ee:29:78:d6:33:aa:ac:14:ed:32:35:19:7d:a8:7e:0f: - 71:b8:87:5f:1a:c9:e7:8b:28:17:49:dd:ed:d0:07:e3:ec:f5: - 06:45:f8:cb:f6:67:25:6c:d6:a1:64:7b:5e:13:20:3b:b8:58: - 2d:e7:d6:69:6f:65:6d:1c:60:b9:5f:45:6b:7f:cf:33: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ICATE----- diff --git a/vendor/github.com/google/certificate-transparency-go/testdata/test-cert.proof b/vendor/github.com/google/certificate-transparency-go/testdata/test-cert.proof deleted file mode 100644 index b2ab9b56178bee3d79a32899a5dfc74602635f59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118 zcmV-+0Ezzq-yAN%6#$e{N2y_GGF{wUd0FW9#?y%W04@u?KXlh*0003!+b7=H000C7 z07o!I0w7>+5UyM;S{n-ON!&>{^o{2lPM3t~!U*5L>F-l)_woWE0KT%Ea@WvpVbE*a YIG|}pny7E#E*QIf#8!!-z!-k@rH2bO%>V!Z diff --git a/vendor/github.com/google/certificate-transparency-go/tls/hash_test.go b/vendor/github.com/google/certificate-transparency-go/tls/hash_test.go deleted file mode 100644 index a7445af..0000000 --- a/vendor/github.com/google/certificate-transparency-go/tls/hash_test.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tls - -import ( - "encoding/hex" - "strings" - "testing" - - "github.com/google/certificate-transparency-go/testdata" -) - -func TestGenerateHash(t *testing.T) { - var tests = []struct { - in string // hex encoded - algo HashAlgorithm - want string // hex encoded - errstr string - }{ - // Empty hash values - {"", MD5, "d41d8cd98f00b204e9800998ecf8427e", ""}, - {"", SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", ""}, - {"", SHA224, "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", ""}, - {"", SHA256, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", ""}, - {"", SHA384, "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", ""}, - {"", SHA512, "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", ""}, - {"", 999, "", "unsupported"}, - - // Hashes of "abcd". - {"61626364", MD5, testdata.AbcdMD5, ""}, - {"61626364", SHA1, testdata.AbcdSHA1, ""}, - {"61626364", SHA224, testdata.AbcdSHA224, ""}, - {"61626364", SHA256, testdata.AbcdSHA256, ""}, - {"61626364", SHA384, testdata.AbcdSHA384, ""}, - {"61626364", SHA512, testdata.AbcdSHA512, ""}, - } - for _, test := range tests { - got, _, err := generateHash(test.algo, testdata.FromHex(test.in)) - if test.errstr != "" { - if err == nil { - t.Errorf("generateHash(%s)=%s,nil; want error %q", test.in, hex.EncodeToString(got), test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("generateHash(%s)=nil,%q; want error %q", test.in, test.errstr, err.Error()) - } - continue - } - if err != nil { - t.Errorf("generateHash(%s)=nil,%q; want %s", test.in, err, test.want) - } else if hex.EncodeToString(got) != test.want { - t.Errorf("generateHash(%s)=%s,nil; want %s", test.in, hex.EncodeToString(got), test.want) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/tls/signature_test.go b/vendor/github.com/google/certificate-transparency-go/tls/signature_test.go deleted file mode 100644 index 777225e..0000000 --- a/vendor/github.com/google/certificate-transparency-go/tls/signature_test.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tls_test - -import ( - "crypto" - "encoding/pem" - mathrand "math/rand" - "reflect" - "strings" - "testing" - "time" - - "github.com/google/certificate-transparency-go/testdata" - "github.com/google/certificate-transparency-go/tls" - "github.com/google/certificate-transparency-go/x509" -) - -func TestVerifySignature(t *testing.T) { - var tests = []struct { - pubKey crypto.PublicKey - in string // hex encoded - hashAlgo tls.HashAlgorithm - sigAlgo tls.SignatureAlgorithm - errstr string - sig string // hex encoded - }{ - {PEM2PK(testdata.RsaPublicKeyPEM), "61626364", 99, tls.ECDSA, "unsupported Algorithm.Hash", "1234"}, - {PEM2PK(testdata.RsaPublicKeyPEM), "61626364", tls.SHA256, 99, "unsupported Algorithm.Signature", "1234"}, - - {PEM2PK(testdata.RsaPublicKeyPEM), "61626364", tls.SHA256, tls.DSA, "cannot verify DSA", "1234"}, - {PEM2PK(testdata.RsaPublicKeyPEM), "61626364", tls.SHA256, tls.ECDSA, "cannot verify ECDSA", "1234"}, - {PEM2PK(testdata.RsaPublicKeyPEM), "61626364", tls.SHA256, tls.RSA, "verification error", "1234"}, - {PEM2PK(testdata.RsaPublicKeyPEM), "61626364", tls.SHA256, tls.ECDSA, "cannot verify ECDSA", "1234"}, - - {PEM2PK(testdata.DsaPublicKeyPEM), "61626364", tls.SHA1, tls.RSA, "cannot verify RSA", "1234"}, - {PEM2PK(testdata.DsaPublicKeyPEM), "61626364", tls.SHA1, tls.ECDSA, "cannot verify ECDSA", "1234"}, - {PEM2PK(testdata.DsaPublicKeyPEM), "61626364", tls.SHA1, tls.DSA, "failed to unmarshal DSA signature", "1234"}, - {PEM2PK(testdata.DsaPublicKeyPEM), "61626364", tls.SHA1, tls.DSA, "failed to verify DSA signature", "3006020101020101eeff"}, - {PEM2PK(testdata.DsaPublicKeyPEM), "61626364", tls.SHA1, tls.DSA, "zero or negative values", "3006020100020181"}, - - {PEM2PK(testdata.EcdsaPublicKeyPEM), "61626364", tls.SHA256, tls.RSA, "cannot verify RSA", "1234"}, - {PEM2PK(testdata.EcdsaPublicKeyPEM), "61626364", tls.SHA256, tls.DSA, "cannot verify DSA", "1234"}, - {PEM2PK(testdata.EcdsaPublicKeyPEM), "61626364", tls.SHA256, tls.ECDSA, "failed to unmarshal ECDSA signature", "1234"}, - {PEM2PK(testdata.EcdsaPublicKeyPEM), "61626364", tls.SHA256, tls.ECDSA, "failed to verify ECDSA signature", "3006020101020101eeff"}, - {PEM2PK(testdata.EcdsaPublicKeyPEM), "61626364", tls.SHA256, tls.ECDSA, "zero or negative values", "3006020100020181"}, - - {PEM2PK(testdata.RsaPublicKeyPEM), "61626364", tls.SHA256, tls.RSA, "", testdata.RsaSignedAbcdHex}, - {PEM2PK(testdata.DsaPublicKeyPEM), "61626364", tls.SHA1, tls.DSA, "", testdata.DsaSignedAbcdHex}, - {PEM2PK(testdata.EcdsaPublicKeyPEM), "61626364", tls.SHA256, tls.ECDSA, "", testdata.EcdsaSignedAbcdHex}, - } - for _, test := range tests { - algo := tls.SignatureAndHashAlgorithm{Hash: test.hashAlgo, Signature: test.sigAlgo} - signed := tls.DigitallySigned{Algorithm: algo, Signature: testdata.FromHex(test.sig)} - - err := tls.VerifySignature(test.pubKey, testdata.FromHex(test.in), signed) - if test.errstr != "" { - if err == nil { - t.Errorf("VerifySignature(%s)=nil; want %q", test.in, test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("VerifySignature(%s)=%q; want %q", test.in, err.Error(), test.errstr) - } - continue - } - if err != nil { - t.Errorf("VerifySignature(%s)=%q; want nil", test.in, err) - } - } -} - -func TestCreateSignatureVerifySignatureRoundTrip(t *testing.T) { - var tests = []struct { - privKey crypto.PrivateKey - pubKey crypto.PublicKey - hashAlgo tls.HashAlgorithm - }{ - {PEM2PrivKey(testdata.RsaPrivateKeyPEM), PEM2PK(testdata.RsaPublicKeyPEM), tls.SHA256}, - {PEM2PrivKey(testdata.EcdsaPrivateKeyPKCS8PEM), PEM2PK(testdata.EcdsaPublicKeyPEM), tls.SHA256}, - } - seed := time.Now().UnixNano() - r := mathrand.New(mathrand.NewSource(seed)) - for _, test := range tests { - for j := 0; j < 1; j++ { - dataLen := 10 + r.Intn(100) - data := make([]byte, dataLen) - _, _ = r.Read(data) - sig, err := tls.CreateSignature(test.privKey, test.hashAlgo, data) - if err != nil { - t.Errorf("CreateSignature(%T, %v) failed with: %q", test.privKey, test.hashAlgo, err.Error()) - continue - } - - if err := tls.VerifySignature(test.pubKey, data, sig); err != nil { - t.Errorf("VerifySignature(%T, %v) failed with: %q", test.pubKey, test.hashAlgo, err) - } - } - } -} - -func TestCreateSignatureFailures(t *testing.T) { - var tests = []struct { - privKey crypto.PrivateKey - hashAlgo tls.HashAlgorithm - in string // hex encoded - errstr string - }{ - {PEM2PrivKey(testdata.EcdsaPrivateKeyPKCS8PEM), 99, "abcd", "unsupported Algorithm.Hash"}, - {nil, tls.SHA256, "abcd", "unsupported private key type"}, - } - for _, test := range tests { - if sig, err := tls.CreateSignature(test.privKey, test.hashAlgo, testdata.FromHex(test.in)); err == nil { - t.Errorf("CreateSignature(%T, %v)=%v,nil; want error %q", test.privKey, test.hashAlgo, sig, test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("CreateSignature(%T, %v)=nil,%q; want error %q", test.privKey, test.hashAlgo, err.Error(), test.errstr) - } - } -} - -func PEM2PK(s string) crypto.PublicKey { - p, _ := pem.Decode([]byte(s)) - if p == nil { - panic("no PEM block found in " + s) - } - pubKey, _ := x509.ParsePKIXPublicKey(p.Bytes) - if pubKey == nil { - panic("public key not parsed from " + s) - } - return pubKey -} -func PEM2PrivKey(s string) crypto.PrivateKey { - p, _ := pem.Decode([]byte(s)) - if p == nil { - panic("no PEM block found in " + s) - } - - // Try various different private key formats one after another. - if rsaPrivKey, err := x509.ParsePKCS1PrivateKey(p.Bytes); err == nil { - return *rsaPrivKey - } - if pkcs8Key, err := x509.ParsePKCS8PrivateKey(p.Bytes); err == nil { - if reflect.TypeOf(pkcs8Key).Kind() == reflect.Ptr { - pkcs8Key = reflect.ValueOf(pkcs8Key).Elem().Interface() - } - return pkcs8Key - } - - return nil -} diff --git a/vendor/github.com/google/certificate-transparency-go/tls/tls_test.go b/vendor/github.com/google/certificate-transparency-go/tls/tls_test.go deleted file mode 100644 index bd74a8e..0000000 --- a/vendor/github.com/google/certificate-transparency-go/tls/tls_test.go +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tls - -import ( - "bytes" - "encoding/hex" - "reflect" - "strings" - "testing" -) - -type testStruct struct { - Data []byte `tls:"minlen:2,maxlen:4"` - IntVal uint16 - Other [4]byte - Enum Enum `tls:"size:2"` -} - -type testVariant struct { - Which Enum `tls:"size:1"` - Val16 *uint16 `tls:"selector:Which,val:0"` - Val32 *uint32 `tls:"selector:Which,val:1"` -} - -type testTwoVariants struct { - Which Enum `tls:"size:1"` - Val16 *uint16 `tls:"selector:Which,val:0"` - Val32 *uint32 `tls:"selector:Which,val:1"` - Second Enum `tls:"size:1"` - Second16 *uint16 `tls:"selector:Second,val:0"` - Second32 *uint32 `tls:"selector:Second,val:1"` -} - -// Check that library users can define their own Enum types. -type aliasEnum Enum -type testAliasEnum struct { - Val aliasEnum `tls:"size:1"` - Val16 *uint16 `tls:"selector:Val,val:1"` - Val32 *uint32 `tls:"selector:Val,val:2"` -} - -type testNonByteSlice struct { - Vals []uint16 `tls:"minlen:2,maxlen:6"` -} - -type testSliceOfStructs struct { - Vals []testVariant `tls:"minlen:0,maxlen:100"` -} - -type testInnerType struct { - Val []byte `tls:"minlen:0,maxlen:65535"` -} - -type testSliceOfSlices struct { - Inners []testInnerType `tls:"minlen:0,maxlen:65535"` -} - -func TestMarshalUnmarshalRoundTrip(t *testing.T) { - thing := testStruct{Data: []byte{0x01, 0x02, 0x03}, IntVal: 42, Other: [4]byte{1, 2, 3, 4}, Enum: 17} - data, err := Marshal(thing) - if err != nil { - t.Fatalf("Failed to Marshal(%+v): %s", thing, err.Error()) - } - var other testStruct - rest, err := Unmarshal(data, &other) - if err != nil { - t.Fatalf("Failed to Unmarshal(%s)", hex.EncodeToString(data)) - } - if len(rest) > 0 { - t.Errorf("Data left over after Unmarshal(%s): %s", hex.EncodeToString(data), hex.EncodeToString(rest)) - } -} - -func TestFieldTagToFieldInfo(t *testing.T) { - var tests = []struct { - tag string - want *fieldInfo - errstr string - }{ - {"", nil, ""}, - {"bogus", nil, ""}, - {"also,bogus", nil, ""}, - {"also,bogus:99", nil, ""}, - {"maxval:1xyz", nil, ""}, - {"maxval:1", &fieldInfo{count: 1, countSet: true}, ""}, - {"maxval:255", &fieldInfo{count: 1, countSet: true}, ""}, - {"maxval:256", &fieldInfo{count: 2, countSet: true}, ""}, - {"maxval:65535", &fieldInfo{count: 2, countSet: true}, ""}, - {"maxval:65536", &fieldInfo{count: 3, countSet: true}, ""}, - {"maxval:16777215", &fieldInfo{count: 3, countSet: true}, ""}, - {"maxval:16777216", &fieldInfo{count: 4, countSet: true}, ""}, - {"maxval:16777216", &fieldInfo{count: 4, countSet: true}, ""}, - {"maxval:4294967295", &fieldInfo{count: 4, countSet: true}, ""}, - {"maxval:4294967296", &fieldInfo{count: 5, countSet: true}, ""}, - {"maxval:1099511627775", &fieldInfo{count: 5, countSet: true}, ""}, - {"maxval:1099511627776", &fieldInfo{count: 6, countSet: true}, ""}, - {"maxval:281474976710655", &fieldInfo{count: 6, countSet: true}, ""}, - {"maxval:281474976710656", &fieldInfo{count: 7, countSet: true}, ""}, - {"maxval:72057594037927935", &fieldInfo{count: 7, countSet: true}, ""}, - {"maxval:72057594037927936", &fieldInfo{count: 8, countSet: true}, ""}, - {"minlen:1x", nil, ""}, - {"maxlen:1x", nil, ""}, - {"maxlen:1", &fieldInfo{count: 1, countSet: true, maxlen: 1}, ""}, - {"maxlen:255", &fieldInfo{count: 1, countSet: true, maxlen: 255}, ""}, - {"maxlen:65535", &fieldInfo{count: 2, countSet: true, maxlen: 65535}, ""}, - {"minlen:65530,maxlen:65535", &fieldInfo{count: 2, countSet: true, minlen: 65530, maxlen: 65535}, ""}, - {"maxlen:65535,minlen:65530", &fieldInfo{count: 2, countSet: true, minlen: 65530, maxlen: 65535}, ""}, - {"minlen:65536,maxlen:65535", nil, "inverted"}, - {"maxlen:16777215", &fieldInfo{count: 3, countSet: true, maxlen: 16777215}, ""}, - {"maxlen:281474976710655", &fieldInfo{count: 6, countSet: true, maxlen: 281474976710655}, ""}, - {"maxlen:72057594037927936", &fieldInfo{count: 8, countSet: true, maxlen: 72057594037927936}, ""}, - {"size:0", nil, "unknown size"}, - {"size:1", &fieldInfo{count: 1, countSet: true}, ""}, - {"size:2", &fieldInfo{count: 2, countSet: true}, ""}, - {"size:3", &fieldInfo{count: 3, countSet: true}, ""}, - {"size:4", &fieldInfo{count: 4, countSet: true}, ""}, - {"size:5", &fieldInfo{count: 5, countSet: true}, ""}, - {"size:6", &fieldInfo{count: 6, countSet: true}, ""}, - {"size:7", &fieldInfo{count: 7, countSet: true}, ""}, - {"size:8", &fieldInfo{count: 8, countSet: true}, ""}, - {"size:9", nil, "too large"}, - {"size:1x", nil, ""}, - {"size:1,val:9", nil, "selector value"}, - {"selector:Bob,val:x9", &fieldInfo{selector: "Bob"}, ""}, - {"selector:Fred,val:1", &fieldInfo{selector: "Fred", val: 1}, ""}, - {"val:9,selector:Fred,val:1", &fieldInfo{selector: "Fred", val: 1}, ""}, - } - for _, test := range tests { - got, err := fieldTagToFieldInfo(test.tag, "") - if test.errstr != "" { - if err == nil { - t.Errorf("fieldTagToFieldInfo('%v')=%+v,nil; want error %q", test.tag, got, test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("fieldTagToFieldInfo('%v')=nil,%q; want error %q", test.tag, err.Error(), test.errstr) - } - continue - } - if err != nil { - t.Errorf("fieldTagToFieldInfo('%v')=nil,%q; want %+v", test.tag, err.Error(), test.want) - } else if !reflect.DeepEqual(got, test.want) { - t.Errorf("fieldTagToFieldInfo('%v')=%+v,nil; want %+v", test.tag, got, test.want) - } - } -} - -// Can't take the address of a numeric constant so use helper functions -func newByte(n byte) *byte { return &n } -func newUint8(n uint8) *uint8 { return &n } -func newUint16(n uint16) *uint16 { return &n } -func newUint24(n Uint24) *Uint24 { return &n } -func newUint32(n uint32) *uint32 { return &n } -func newUint64(n uint64) *uint64 { return &n } -func newInt16(n int16) *int16 { return &n } -func newEnum(n Enum) *Enum { return &n } - -func TestUnmarshalMarshalWithParamsRoundTrip(t *testing.T) { - var tests = []struct { - data string // hex encoded - params string - item interface{} - }{ - {"00", "", newUint8(0)}, - {"03", "", newByte(3)}, - {"0101", "", newUint16(0x0101)}, - {"010203", "", newUint24(0x010203)}, - {"000000", "", newUint24(0x00)}, - {"00000009", "", newUint32(0x09)}, - {"0000000901020304", "", newUint64(0x0901020304)}, - {"030405", "", &[3]byte{3, 4, 5}}, - {"03", "", &[1]byte{3}}, - {"0001", "size:2", newEnum(1)}, - {"0100000001", "size:5", newEnum(0x100000001)}, - {"12", "maxval:18", newEnum(18)}, - // Note that maxval is just used to give enum size; it's not policed - {"20", "maxval:18", newEnum(32)}, - {"020a0b", "minlen:1,maxlen:5", &[]byte{0xa, 0xb}}, - {"020a0b0101010203040011", "", &testStruct{Data: []byte{0xa, 0xb}, IntVal: 0x101, Other: [4]byte{1, 2, 3, 4}, Enum: 17}}, - {"000102", "", &testVariant{Which: 0, Val16: newUint16(0x0102)}}, - {"0101020304", "", &testVariant{Which: 1, Val32: newUint32(0x01020304)}}, - {"0001020104030201", "", &testTwoVariants{Which: 0, Val16: newUint16(0x0102), Second: 1, Second32: newUint32(0x04030201)}}, - {"06010102020303", "", &testNonByteSlice{Vals: []uint16{0x101, 0x202, 0x303}}}, - {"00", "", &testSliceOfStructs{Vals: []testVariant{}}}, - {"080001020101020304", "", - &testSliceOfStructs{ - Vals: []testVariant{ - {Which: 0, Val16: newUint16(0x0102)}, - {Which: 1, Val32: newUint32(0x01020304)}, - }, - }, - }, - {"000a00030102030003040506", "", - &testSliceOfSlices{ - Inners: []testInnerType{ - {Val: []byte{1, 2, 3}}, - {Val: []byte{4, 5, 6}}, - }, - }, - }, - {"011011", "", &testAliasEnum{Val: 1, Val16: newUint16(0x1011)}}, - {"0403", "", &SignatureAndHashAlgorithm{Hash: SHA256, Signature: ECDSA}}, - {"04030003010203", "", - &DigitallySigned{ - Algorithm: SignatureAndHashAlgorithm{Hash: SHA256, Signature: ECDSA}, - Signature: []byte{1, 2, 3}, - }, - }, - } - for _, test := range tests { - inVal := reflect.ValueOf(test.item).Elem() - pv := reflect.New(reflect.TypeOf(test.item).Elem()) - val := pv.Interface() - inData, _ := hex.DecodeString(test.data) - if _, err := UnmarshalWithParams(inData, val, test.params); err != nil { - t.Errorf("Unmarshal(%s)=nil,%q; want %+v", test.data, err.Error(), inVal) - } else if !reflect.DeepEqual(val, test.item) { - t.Errorf("Unmarshal(%s)=%+v,nil; want %+v", test.data, reflect.ValueOf(val).Elem(), inVal) - } - - if data, err := MarshalWithParams(inVal.Interface(), test.params); err != nil { - t.Errorf("Marshal(%+v)=nil,%q; want %s", inVal, err.Error(), test.data) - } else if !bytes.Equal(data, inData) { - t.Errorf("Marshal(%+v)=%s,nil; want %s", inVal, hex.EncodeToString(data), test.data) - } - } -} - -type testInvalidFieldTag struct { - Data []byte `tls:"minlen:3,maxlen:2"` -} - -type testDuplicateSelectorVal struct { - Which Enum `tls:"size:1"` - Val *uint16 `tls:"selector:Which,val:0"` - DupVal *uint32 `tls:"selector:Which"` // implicit val:0 -} - -type testMissingSelector struct { - Val *uint16 `tls:"selector:Missing,val:0"` -} - -type testChoiceNotPointer struct { - Which Enum `tls:"size:1"` - Val uint16 `tls:"selector:Which,val:0"` -} - -type nonEnumAlias uint16 - -func newNonEnumAlias(n nonEnumAlias) *nonEnumAlias { return &n } - -func TestUnmarshalWithParamsFailures(t *testing.T) { - var tests = []struct { - data string // hex encoded - params string - item interface{} - errstr string - }{ - {"", "", newUint8(0), "truncated"}, - {"0x01", "", newUint16(0x0101), "truncated"}, - {"0103", "", newUint24(0x010203), "truncated"}, - {"00", "", newUint24(0x00), "truncated"}, - {"000009", "", newUint32(0x09), "truncated"}, - {"00000901020304", "", newUint64(0x0901020304), "truncated"}, - {"0102", "", newInt16(0x0102), "unsupported type"}, // TLS encoding only supports unsigned integers - {"0607", "", &[3]byte{6, 7, 8}, "truncated array"}, - {"01010202", "", &[3]uint16{0x101, 0x202}, "unsupported array"}, - {"01", "", newEnum(1), "no field size"}, - {"00", "size:2", newEnum(0), "truncated"}, - {"00", "size:9", newEnum(0), "too large"}, - {"020a0b", "minlen:4,maxlen:8", &[]byte{0x0a, 0x0b}, "too small"}, - {"040a0b0c0d", "minlen:1,maxlen:3", &[]byte{0x0a, 0x0b, 0x0c, 0x0d}, "too large"}, - {"020a0b", "minlen:8,maxlen:6", &[]byte{0x0a, 0x0b}, "inverted"}, - {"020a", "minlen:0,maxlen:6", &[]byte{0x0a, 0x0b}, "truncated"}, - {"02", "minlen:0,maxlen:6", &[]byte{0x0a, 0x0b}, "truncated"}, - {"0001", "minlen:0,maxlen:256", &[]byte{0x0a, 0x0b}, "truncated"}, - {"020a", "minlen:0", &[]byte{0x0a, 0x0b}, "unknown size"}, - {"020a", "", &[]byte{0x0a, 0x0b}, "no field size information"}, - {"020a0b", "", &testInvalidFieldTag{}, "range inverted"}, - {"020a0b01010102030400", "", - &testStruct{Data: []byte{0xa, 0xb}, IntVal: 0x101, Other: [4]byte{1, 2, 3, 4}, Enum: 17}, "truncated"}, - {"010102", "", &testVariant{Which: 1, Val32: newUint32(0x01020304)}, "truncated"}, - {"092122", "", &testVariant{Which: 0, Val16: newUint16(0x2122)}, "unhandled value for selector"}, - {"0001020304", "", &testDuplicateSelectorVal{Which: 0, Val: newUint16(0x0102)}, "duplicate selector value"}, - {"0102", "", &testMissingSelector{Val: newUint16(1)}, "selector not seen"}, - {"000007", "", &testChoiceNotPointer{Which: 0, Val: 7}, "choice field not a pointer type"}, - {"05010102020303", "", &testNonByteSlice{Vals: []uint16{0x101, 0x202, 0x303}}, "truncated"}, - {"0101", "size:2", newNonEnumAlias(0x0102), "unsupported type"}, - {"0403010203", "", - &DigitallySigned{ - Algorithm: SignatureAndHashAlgorithm{Hash: SHA256, Signature: ECDSA}, - Signature: []byte{1, 2, 3}}, "truncated"}, - } - for _, test := range tests { - pv := reflect.New(reflect.TypeOf(test.item).Elem()) - val := pv.Interface() - in, _ := hex.DecodeString(test.data) - if _, err := UnmarshalWithParams(in, val, test.params); err == nil { - t.Errorf("Unmarshal(%s)=%+v,nil; want error %q", test.data, reflect.ValueOf(val).Elem(), test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("Unmarshal(%s)=nil,%q; want error %q", test.data, err.Error(), test.errstr) - } - } -} - -func TestMarshalWithParamsFailures(t *testing.T) { - var tests = []struct { - item interface{} - params string - errstr string - }{ - {Uint24(0x1000000), "", "overflow"}, - {int16(0x0102), "", "unsupported type"}, // All TLS ints are unsigned - {Enum(1), "", "field tag missing"}, - {Enum(256), "size:1", "too large"}, - {Enum(256), "maxval:255", "too large"}, - {Enum(2), "", "field tag missing"}, - {Enum(256), "size:9", "too large"}, - {[]byte{0xa, 0xb, 0xc, 0xd}, "minlen:1,maxlen:3", "too large"}, - {[]byte{0xa, 0xb, 0xc, 0xd}, "minlen:6,maxlen:13", "too small"}, - {[]byte{0xa, 0xb, 0xc, 0xd}, "minlen:6,maxlen:3", "inverted"}, - {[]byte{0xa, 0xb, 0xc, 0xd}, "minlen:6", "unknown size"}, - {[]byte{0xa, 0xb, 0xc, 0xd}, "", "field tag missing"}, - {[3]uint16{0x101, 0x202}, "", "unsupported array"}, - {testInvalidFieldTag{}, "", "inverted"}, - {testStruct{Data: []byte{0xa}, IntVal: 0x101, Other: [4]byte{1, 2, 3, 4}, Enum: 17}, "", "too small"}, - {testVariant{Which: 0, Val32: newUint32(0x01020304)}, "", "chosen field is nil"}, - {testVariant{Which: 0, Val16: newUint16(11), Val32: newUint32(0x01020304)}, "", "unchosen field is non-nil"}, - {testVariant{Which: 3}, "", "unhandled value for selector"}, - {testMissingSelector{Val: newUint16(1)}, "", "selector not seen"}, - {testChoiceNotPointer{Which: 0, Val: 7}, "", "choice field not a pointer"}, - {testDuplicateSelectorVal{Which: 0, Val: newUint16(1)}, "", "duplicate selector value"}, - {testNonByteSlice{Vals: []uint16{1, 2, 3, 4}}, "", "too large"}, - {testSliceOfStructs{[]testVariant{{Which: 3}}}, "", "unhandled value for selector"}, - {nonEnumAlias(0x0102), "", "unsupported type"}, - } - for _, test := range tests { - if data, err := MarshalWithParams(test.item, test.params); err == nil { - t.Errorf("Marshal(%+v)=%x,nil; want error %q", test.item, data, test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("Marshal(%+v)=nil,%q; want error %q", test.item, err.Error(), test.errstr) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/tls/types_test.go b/vendor/github.com/google/certificate-transparency-go/tls/types_test.go deleted file mode 100644 index 27f1e6c..0000000 --- a/vendor/github.com/google/certificate-transparency-go/tls/types_test.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tls - -import ( - "crypto" - "crypto/dsa" - "crypto/ecdsa" - "crypto/rsa" - "testing" -) - -func TestHashAlgorithmString(t *testing.T) { - var tests = []struct { - algo HashAlgorithm - want string - }{ - {None, "None"}, - {MD5, "MD5"}, - {SHA1, "SHA1"}, - {SHA224, "SHA224"}, - {SHA256, "SHA256"}, - {SHA384, "SHA384"}, - {SHA512, "SHA512"}, - {99, "UNKNOWN(99)"}, - } - for _, test := range tests { - if got := test.algo.String(); got != test.want { - t.Errorf("%v.String()=%q; want %q", test.algo, got, test.want) - } - } -} - -func TestSignatureAlgorithmString(t *testing.T) { - var tests = []struct { - algo SignatureAlgorithm - want string - }{ - {Anonymous, "Anonymous"}, - {RSA, "RSA"}, - {DSA, "DSA"}, - {ECDSA, "ECDSA"}, - {99, "UNKNOWN(99)"}, - } - for _, test := range tests { - if got := test.algo.String(); got != test.want { - t.Errorf("%v.String()=%q; want %q", test.algo, got, test.want) - } - } -} - -func TestDigitallySignedString(t *testing.T) { - var tests = []struct { - ds DigitallySigned - want string - }{ - { - ds: DigitallySigned{Algorithm: SignatureAndHashAlgorithm{Hash: SHA1, Signature: RSA}, Signature: []byte{0x01, 0x02}}, - want: "Signature: HashAlgo=SHA1 SignAlgo=RSA Value=0102", - }, - { - ds: DigitallySigned{Algorithm: SignatureAndHashAlgorithm{Hash: 99, Signature: 99}, Signature: []byte{0x03, 0x04}}, - want: "Signature: HashAlgo=UNKNOWN(99) SignAlgo=UNKNOWN(99) Value=0304", - }, - } - for _, test := range tests { - if got := test.ds.String(); got != test.want { - t.Errorf("%v.String()=%q; want %q", test.ds, got, test.want) - } - } -} - -func TestSignatureAlgorithm(t *testing.T) { - for _, test := range []struct { - name string - key crypto.PublicKey - want SignatureAlgorithm - }{ - {name: "ECDSA", key: new(ecdsa.PublicKey), want: ECDSA}, - {name: "RSA", key: new(rsa.PublicKey), want: RSA}, - {name: "DSA", key: new(dsa.PublicKey), want: DSA}, - {name: "Other", key: "foo", want: Anonymous}, - } { - if got := SignatureAlgorithmFromPubKey(test.key); got != test.want { - t.Errorf("%v: SignatureAlgorithm() = %v, want %v", test.name, got, test.want) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/types_test.go b/vendor/github.com/google/certificate-transparency-go/types_test.go deleted file mode 100644 index 0a75c00..0000000 --- a/vendor/github.com/google/certificate-transparency-go/types_test.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2015 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ct - -import ( - "encoding/hex" - "strings" - "testing" - - "github.com/google/certificate-transparency-go/tls" -) - -const ( - CertEntry = "000000000149a6e03abe00000006513082064d30820535a003020102020c6a5d4161f5c9b68043270b0c300d06092a864886f70d0101050500305e310b300906035504061302424531193017060355040a1310476c6f62616c5369676e206e762d7361313430320603550403132b476c6f62616c5369676e20457874656e6465642056616c69646174696f6e204341202d2047322054455354301e170d3134313131333031353830315a170d3136313131333031353830315a3082011331183016060355040f0c0f427573696e65737320456e74697479311230100603550405130936363636363636363631133011060b2b0601040182373c0201031302444531293027060b2b0601040182373c02010113186576206a7572697364696374696f6e206c6f63616c69747931263024060b2b0601040182373c02010213156576206a7572697364696374696f6e207374617465310b3009060355040613024a50310a300806035504080c0153310a300806035504070c014c311530130603550409130c657620616464726573732033310c300a060355040b0c034f5531310c300a060355040b0c034f5532310a3008060355040a0c014f3117301506035504030c0e637372636e2e73736c32342e6a7030820122300d06092a864886f70d01010105000382010f003082010a02820101008db9f0d6b359466dffe95ba43dc1a5680eedc8f3cabbc573a236a109bf6e58df816c7bb8156147ab526eceaffd0576e6e1c09ea33433e114d7e5038c697298c7957f01a7e1142320847cf234995bbe42798340cb99e6a7e2cfa950277aef6e02f4d96ddceb0af9541171b0f8f1aa4f0d02453e6e654b25a13f2aff4357cae8177d3bd21855686591a2309d9ff5dead8240304e22eafcc5508587e6b6ad1d00b53c28e5b936269afbf214b73edbdc8a48a86c1c23f3dce55fcce60502c0908bca9bdb22c16c0b34d11b4fd27e9d7bcb56c5ec0fc4d52500fb06b0af5c4112e421022b78b31030cb73e9fd92ffc65919fd8f35e604fcaf025b9c77e3e5dff749a70203010001a38202523082024e300e0603551d0f0101ff0404030205a0304c0603551d2004453043304106092b06010401a03201013034303206082b06010505070201162668747470733a2f2f7777772e676c6f62616c7369676e2e636f6d2f7265706f7369746f72792f30480603551d1f0441303f303da03ba0398637687474703a2f2f63726c2e676c6f62616c7369676e2e636f6d2f67732f67736f7267616e697a6174696f6e76616c63617467322e63726c30819c06082b0601050507010104818f30818c304a06082b06010505073002863e687474703a2f2f7365637572652e676c6f62616c7369676e2e636f6d2f6361636572742f67736f7267616e697a6174696f6e76616c63617467322e637274303e06082b060105050730018632687474703a2f2f6f637370322e676c6f62616c7369676e2e636f6d2f67736f7267616e697a6174696f6e76616c6361746732301d0603551d250416301406082b0601050507030106082b0601050507030230190603551d1104123010820e637372636e2e73736c32342e6a70301d0603551d0e041604147f834b2903e35efff651619083a2efd69a6d70f4301f0603551d23041830168014ab30a406d972d0029ab2c7d3f4241be2fca5320230818a060a2b06010401d679020402047c047a0078007600b0cc83e5a5f97d6baf7c09cc284904872ac7e88b132c6350b7c6fd26e16c6c7700000149a6dc346b00000403004730450220469f4dc0553b7832bd56633c3b9d53faaec84df414b7a05ab1b2d544d146ac3e022100ee899419fd4f95544798f7883fe093692feb4c90e84d651600f7019166a43701300d06092a864886f70d010105050003820101007dcd3e228d68cdc0734c7629fd7d40cd742d0ed1d0d9f49a643af12dcdbc61394638b7c519bb7cae530ccdc3a5037d5cdd8a4d2c01abdc834daf1993f7a22ee2c223377a94da4e68ac69a0b50d2d473ec77651e001c5f71a23cc2defe7616fd6c6491aa7f9a2bb16b930ce3f8cc37cf6a47bfb04fd4eff7db8433cc6fdb05146a4a31fe65211875f2c51129bf0729ce2dc7ce1a5afc6eaa1eb3a36296cb9e091375edfc408c727f6d54bba408da60b46c496a364c504adf47ee0496a9260fe223c8b23c14832635c3dff0dba8a0c8cdd957a77f18443b7782a9b6c7636b7d66df426350b959537e911888e45b2c0b218e50d03fdcfa7f758e8e60dd1a1996bc00000" - PrecertEntry = "00000000014b4981f0c800013760e2790f33a498f9b6c149fecfca3993954b536fbf36ad45d0a8415b79337d00047a30820476a00302010202100532298c396a3e25fcaa1977e827b5f3300d06092a864886f70d01010b0500306d310b300906035504061302555331163014060355040a130d47656f547275737420496e632e311f301d060355040b1316464f52205445535420505552504f534553204f4e4c59312530230603550403131c47656f54727573742045562053534c2054455354204341202d204734301e170d3135303230323030303030305a170d3136303232373233353935395a3081c331133011060b2b0601040182373c02010313024742311b3019060b2b0601040182373c020102140a43616c69666f726e6961311e301c060b2b0601040182373c0201010c0d4d6f756e7461696e2056696577310b30090603550406130247423113301106035504080c0a43616c69666f726e69613116301406035504070c0d4d6f756e7461696e2056696577311d301b060355040a0c1453796d616e74656320436f72706f726174696f6e3116301406035504030c0d736466656473662e747275737430820122300d06092a864886f70d01010105000382010f003082010a0282010100b19d97def39ff829c65ea099a3257298b33ff675451fdc5641a222347aee4a56201f4c1a406f2f19815d86dec1a611768e7d556c8e33a7f1b4c78db19cceae540e97ae1f0660b2ee4f8cff2045b84a9da228349744406eceaed0b08d46fdab3543b3d86ea708627a61a529b793a76adc6b776bc8d5b3d4fe21e2c4aa92cfd33b45e7412068e0683a2beffad1df2fc320b8ddbf02ffb603d2cf74798277fd9656b5acd45659b0e5d761e02dcf95c53095555a931ad5bfa9b4967c045d5f12de2d6b537cd93af2ad8b45e5540bd43279876d13e376fb649778e10dfa56165b901bd37e9dee4e46027b4c0732ca7ed64491862abaf6a24a4aaed8f49a0922ca4fb50203010001a38201d1308201cd30470603551d110440303e820d6b6a61736468662e7472757374820b73736466732e7472757374820d736466656473662e747275737482117777772e736466656473662e747275737430090603551d1304023000300e0603551d0f0101ff0404030205a0302b0603551d1f042430223020a01ea01c861a687474703a2f2f676d2e73796d63622e636f6d2f676d2e63726c3081a00603551d2004819830819530819206092b06010401f0220106308184303f06082b06010505070201163368747470733a2f2f7777772e67656f74727573742e636f6d2f7265736f75726365732f7265706f7369746f72792f6c6567616c304106082b0601050507020230350c3368747470733a2f2f7777772e67656f74727573742e636f6d2f7265736f75726365732f7265706f7369746f72792f6c6567616c301d0603551d250416301406082b0601050507030106082b06010505070302301f0603551d23041830168014b1699461abe6cb0c4ce759af5a498b1833c1e147305706082b06010505070101044b3049301f06082b060105050730018613687474703a2f2f676d2e73796d63642e636f6d302606082b06010505073002861a687474703a2f2f676d2e73796d63622e636f6d2f676d2e6372740000" -) - -func TestUnmarshalMerkleTreeLeaf(t *testing.T) { - var tests = []struct { - in string // hex string - want LogEntryType - errstr string - }{ - {CertEntry, X509LogEntryType, ""}, - {PrecertEntry, PrecertLogEntryType, ""}, - {"001234", 0, "LeafType: unhandled value"}, - } - for _, test := range tests { - inData, _ := hex.DecodeString(test.in) - var got MerkleTreeLeaf - _, err := tls.Unmarshal(inData, &got) - if test.errstr != "" { - if err == nil { - t.Errorf("tls.Unmarshal(%s, &MerkleTreeLeaf)=%+v,nil; want error %q", test.in, got, test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("tls.Unmarshal(%s, &MerkleTreeLeaf)=nil,%q; want error %q", test.in, err.Error(), test.errstr) - } - continue - } - if err != nil { - t.Errorf("tls.Unmarshal(%s, &MerkleTreeLeaf)=nil,%q; want type %v", test.in, err.Error(), test.want) - continue - } - if got.Version != V1 { - t.Errorf("tls.Unmarshal(%s, &MerkleTreeLeaf)=version=%v,nil; want version 1", test.in, got.Version) - } - if got.LeafType != TimestampedEntryLeafType { - t.Errorf("tls.Unmarshal(%s, &MerkleTreeLeaf)=LeafType=%v,nil; want LeafType=%v", test.in, got.LeafType, TimestampedEntryLeafType) - } - if got.TimestampedEntry.EntryType != test.want { - t.Errorf("tls.Unmarshal(%s, &MerkleTreeLeaf)=EntryType=%v,nil; want LeafType=%v", test.in, got.TimestampedEntry.EntryType, test.want) - } - } -} - -const ( - validRootHash = "708981e91d1487c2a9ea901ab5a8d053c1348585afcdb5e107bf60c0c1d20fc0" - longRootHash = "708981e91d1487c2a9ea901ab5a8d053c1348585afcdb5e107bf60c0c1d20fc000" - shortRootHash = "708981e91d1487c2a9ea901ab5a8d053c1348585afcdb5e107bf60c0c1d20f" - - validSignature = "040300473045022007fb5ae3cea8f076b534a01a9a19e60625c6cc70704c6c1a7c88b30d8f67d4af022100840d37b8f2f9ce134e74eefda6a0c2ad034d591b785cdc4973c4c4f5d03f0439" - longSignature = "040300473045022007fb5ae3cea8f076b534a01a9a19e60625c6cc70704c6c1a7c88b30d8f67d4af022100840d37b8f2f9ce134e74eefda6a0c2ad034d591b785cdc4973c4c4f5d03f043900" -) - -func mustHexDecode(s string) []byte { - h, err := hex.DecodeString(s) - if err != nil { - panic(err) - } - return h -} - -func TestToSignedTreeHead(t *testing.T) { - tests := []struct { - desc string - rootHash string - signature string - wantErr bool - }{ - { - desc: "success", - rootHash: validRootHash, - signature: validSignature, - }, - { - desc: "root hash too long", - rootHash: longRootHash, - signature: validSignature, - wantErr: true, - }, - { - desc: "root hash too short", - rootHash: shortRootHash, - signature: validSignature, - wantErr: true, - }, - { - desc: "signature trailing data", - rootHash: validRootHash, - signature: longSignature, - wantErr: true, - }, - } - - for _, test := range tests { - t.Run(test.desc, func(t *testing.T) { - sthResponse := &GetSTHResponse{ - TreeSize: 278437663, - Timestamp: 1527076172068, - SHA256RootHash: mustHexDecode(test.rootHash), - TreeHeadSignature: mustHexDecode(test.signature), - } - sth, err := sthResponse.ToSignedTreeHead() - if gotErr := (err != nil); gotErr != test.wantErr { - t.Errorf("GetSTHResponse.ToSignedTreeHead() = %+v, %v, want err? %t", sth, err, test.wantErr) - } - }) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/error_test.go b/vendor/github.com/google/certificate-transparency-go/x509/error_test.go deleted file mode 100644 index dcc309d..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/error_test.go +++ /dev/null @@ -1,192 +0,0 @@ -package x509_test - -import ( - "fmt" - "testing" - - "github.com/google/certificate-transparency-go/x509" -) - -func TestErrors(t *testing.T) { - var tests = []struct { - errs []x509.Error - want string - wantVerbose string - wantFatal bool - }{ - { - errs: []x509.Error{ - {Summary: "Error", Field: "a.b.c"}, - }, - want: "Error", - wantVerbose: "Error (a.b.c)", - }, - { - errs: []x509.Error{ - { - Summary: "Error", - Field: "a.b.c", - SpecRef: "RFC5280 s4.1.2.2", - SpecText: "The serial number MUST be a positive integer", - Category: x509.MalformedCertificate, - }, - }, - want: "Error", - wantVerbose: "Error (a.b.c: Certificate does not comply with MUST clause in spec: RFC5280 s4.1.2.2, 'The serial number MUST be a positive integer')", - }, - { - errs: []x509.Error{ - { - Summary: "Error", - Field: "a.b.c", - SpecRef: "RFC5280 s4.1.2.2", - SpecText: "The serial number MUST be a positive integer", - }, - }, - want: "Error", - wantVerbose: "Error (a.b.c: RFC5280 s4.1.2.2, 'The serial number MUST be a positive integer')", - }, - { - errs: []x509.Error{ - { - Summary: "Error", - Field: "a.b.c", - SpecRef: "RFC5280 s4.1.2.2", - Category: x509.MalformedCertificate, - }, - }, - want: "Error", - wantVerbose: "Error (a.b.c: Certificate does not comply with MUST clause in spec: RFC5280 s4.1.2.2)", - }, - { - errs: []x509.Error{ - { - Summary: "Error", - Field: "a.b.c", - SpecText: "The serial number MUST be a positive integer", - Category: x509.MalformedCertificate, - }, - }, - want: "Error", - wantVerbose: "Error (a.b.c: Certificate does not comply with MUST clause in spec: 'The serial number MUST be a positive integer')", - }, - { - errs: []x509.Error{ - { - Summary: "Error", - Field: "a.b.c", - SpecRef: "RFC5280 s4.1.2.2", - }, - }, - want: "Error", - wantVerbose: "Error (a.b.c: RFC5280 s4.1.2.2)", - }, - { - errs: []x509.Error{ - { - Summary: "Error", - Field: "a.b.c", - SpecText: "The serial number MUST be a positive integer", - }, - }, - want: "Error", - wantVerbose: "Error (a.b.c: 'The serial number MUST be a positive integer')", - }, - { - errs: []x509.Error{ - { - Summary: "Error", - Field: "a.b.c", - Category: x509.MalformedCertificate, - }, - }, - want: "Error", - wantVerbose: "Error (a.b.c: Certificate does not comply with MUST clause in spec)", - }, - { - errs: []x509.Error{ - {Summary: "Error"}, - }, - want: "Error", - wantVerbose: "Error", - }, - { - errs: []x509.Error{ - {Summary: "Error\nwith newline", Field: "x", Category: x509.InvalidASN1DER}, - }, - want: "Error\nwith newline", - wantVerbose: "Error\nwith newline (x: Invalid ASN.1 distinguished encoding)", - }, - { - errs: []x509.Error{ - {Summary: "Error1", Field: "a.b.c"}, - {Summary: "Error2", Field: "a.b.c.d"}, - {Summary: "Error3", Field: "x.y.z"}, - }, - want: "Errors:\n Error1\n Error2\n Error3", - wantVerbose: "Errors:\n Error1 (a.b.c)\n Error2 (a.b.c.d)\n Error3 (x.y.z)", - }, - { - errs: []x509.Error{ - {Summary: "Error1", Field: "a.b.c"}, - {Summary: "Error2", Field: "a.b.c.d", Fatal: true}, - {Summary: "Error3", Field: "x.y.z"}, - }, - want: "Errors:\n Error1\n Error2\n Error3", - wantVerbose: "Errors:\n Error1 (a.b.c)\n Error2 (a.b.c.d)\n Error3 (x.y.z)", - wantFatal: true, - }, - } - - for _, test := range tests { - errs := x509.Errors{Errs: test.errs} - if got := errs.Error(); got != test.want { - t.Errorf("Errors(%+v).Error()=%q; want %q", test.errs, got, test.want) - } - if got := errs.VerboseError(); got != test.wantVerbose { - t.Errorf("Errors(%+v).VerboseError()=%q; want %q", test.errs, got, test.wantVerbose) - } - if got := errs.Fatal(); got != test.wantFatal { - t.Errorf("Errors(%+v).Fatal()=%v; want %v", test.errs, got, test.wantFatal) - } - } -} - -func TestErrorsAppend(t *testing.T) { - var errs x509.Errors - if got, want := errs.Error(), ""; got != want { - t.Errorf("Errors().Error()=%q; want %q", got, want) - } - if got, want := errs.Empty(), true; got != want { - t.Errorf("Errors().Empty()=%t; want %t", got, want) - } - errs.Errs = append(errs.Errs, x509.Error{ - Summary: "Error", - Field: "a.b.c", - SpecRef: "RFC5280 s4.1.2.2"}) - if got, want := errs.VerboseError(), "Error (a.b.c: RFC5280 s4.1.2.2)"; got != want { - t.Errorf("Errors(%+v).Error=%q; want %q", errs, got, want) - } - if got, want := errs.Empty(), false; got != want { - t.Errorf("Errors().Empty()=%t; want %t", got, want) - } -} - -func TestErrorsFilter(t *testing.T) { - var errs x509.Errors - id := x509.ErrMaxID + 2 - errs.AddID(id, "arg1", 2, "arg3") - baseErr := errs.Error() - - errs.AddID(x509.ErrMaxID + 1) - if got, want := errs.Error(), fmt.Sprintf("Errors:\n %s\n E%03d: Unknown error ID %v: args []", baseErr, x509.ErrMaxID+1, x509.ErrMaxID+1); got != want { - t.Errorf("Errors(%+v).Error=%q; want %q", errs, got, want) - } - - errList := fmt.Sprintf("%d, %d", x509.ErrMaxID+1, x509.ErrMaxID+1) - filter := x509.ErrorFilter(errList) - errs2 := errs.Filter(filter) - if got, want := errs2.Error(), baseErr; got != want { - t.Errorf("Errors(%+v).Error=%q; want %q", errs, got, want) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/errors_test.go b/vendor/github.com/google/certificate-transparency-go/x509/errors_test.go deleted file mode 100644 index 45fa30c..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/errors_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package x509 - -import ( - "testing" -) - -func TestTemplateIDs(t *testing.T) { - for id, template := range idToError { - if template.ID != id { - t.Errorf("idToError[%v].id=%v; want %v", id, template.ID, id) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/example_test.go b/vendor/github.com/google/certificate-transparency-go/x509/example_test.go deleted file mode 100644 index 8d8d1e6..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/example_test.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2014 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. - -package x509_test - -import ( - "crypto/dsa" - "crypto/ecdsa" - "crypto/rsa" - "encoding/pem" - "fmt" - - "github.com/google/certificate-transparency-go/x509" -) - -func ExampleCertificate_Verify() { - // Verifying with a custom list of root certificates. - - const rootPEM = ` ------BEGIN CERTIFICATE----- -MIIEBDCCAuygAwIBAgIDAjppMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMTMwNDA1MTUxNTU1WhcNMTUwNDA0MTUxNTU1WjBJMQswCQYDVQQG -EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy -bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I/F8YnOIe5a/mENtzJEiaB0C1NP -VaTOgmKV7utZX8bhBYASxF6UP7xbSDj0U/ck5vuR6RXEz/RTDfRK/J9U3n2+oGtv -h8DQUB8oMANA2ghzUWx//zo8pzcGjr1LEQTrfSTe5vn8MXH7lNVg8y5Kr0LSy+rE -ahqyzFPdFUuLH8gZYR/Nnag+YyuENWllhMgZxUYi+FOVvuOAShDGKuy6lyARxzmZ -EASg8GF6lSWMTlJ14rbtCMoU/M4iarNOz0YDl5cDfsCx3nuvRTPPuj5xt970JSXC -DTWJnZ37DhF5iR43xa+OcmkCAwEAAaOB+zCB+DAfBgNVHSMEGDAWgBTAephojYn7 -qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1dvWBtrtiGrpagS8wEgYD -VR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwOgYDVR0fBDMwMTAvoC2g -K4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwPQYI -KwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwOi8vZ3RnbG9iYWwtb2NzcC5n -ZW90cnVzdC5jb20wFwYDVR0gBBAwDjAMBgorBgEEAdZ5AgUBMA0GCSqGSIb3DQEB -BQUAA4IBAQA21waAESetKhSbOHezI6B1WLuxfoNCunLaHtiONgaX4PCVOzf9G0JY -/iLIa704XtE7JW4S615ndkZAkNoUyHgN7ZVm2o6Gb4ChulYylYbc3GrKBIxbf/a/ -zG+FA1jDaFETzf3I93k9mTXwVqO94FntT0QJo544evZG0R0SnU++0ED8Vf4GXjza -HFa9llF7b1cq26KqltyMdMKVvvBulRP/F/A8rLIQjcxz++iPAsbw+zOzlTvjwsto -WHPbqCRiOwY1nQ2pM714A5AuTHhdUDqB1O6gyHA43LL5Z/qHQF1hwFGPa4NrzQU6 -yuGnBXj8ytqU0CwIPX4WecigUCAkVDNx ------END CERTIFICATE-----` - - const certPEM = ` ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgIIE31FZVaPXTUwDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE -BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl -cm5ldCBBdXRob3JpdHkgRzIwHhcNMTQwMTI5MTMyNzQzWhcNMTQwNTI5MDAwMDAw -WjBpMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN -TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEYMBYGA1UEAwwPbWFp -bC5nb29nbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfRrObuSW5T7q -5CnSEqefEmtH4CCv6+5EckuriNr1CjfVvqzwfAhopXkLrq45EQm8vkmf7W96XJhC -7ZM0dYi1/qOCAU8wggFLMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAa -BgNVHREEEzARgg9tYWlsLmdvb2dsZS5jb20wCwYDVR0PBAQDAgeAMGgGCCsGAQUF -BwEBBFwwWjArBggrBgEFBQcwAoYfaHR0cDovL3BraS5nb29nbGUuY29tL0dJQUcy -LmNydDArBggrBgEFBQcwAYYfaHR0cDovL2NsaWVudHMxLmdvb2dsZS5jb20vb2Nz -cDAdBgNVHQ4EFgQUiJxtimAuTfwb+aUtBn5UYKreKvMwDAYDVR0TAQH/BAIwADAf -BgNVHSMEGDAWgBRK3QYWG7z2aLV29YG2u2IaulqBLzAXBgNVHSAEEDAOMAwGCisG -AQQB1nkCBQEwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL3BraS5nb29nbGUuY29t -L0dJQUcyLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAH6RYHxHdcGpMpFE3oxDoFnP+ -gtuBCHan2yE2GRbJ2Cw8Lw0MmuKqHlf9RSeYfd3BXeKkj1qO6TVKwCh+0HdZk283 -TZZyzmEOyclm3UGFYe82P/iDFt+CeQ3NpmBg+GoaVCuWAARJN/KfglbLyyYygcQq -0SgeDh8dRKUiaW3HQSoYvTvdTuqzwK4CXsr3b5/dAOY8uMuG/IAR3FgwTbZ1dtoW -RvOTa8hYiU6A475WuZKyEHcwnGYe57u2I2KbMgcKjPniocj4QzgYsVAVKW3IwaOh -yE+vPxsiUkvQHdO2fojCkY8jg70jxM+gu59tPDNbw3Uh/2Ij310FgTHsnGQMyA== ------END CERTIFICATE-----` - - // First, create the set of root certificates. For this example we only - // have one. It's also possible to omit this in order to use the - // default root set of the current operating system. - roots := x509.NewCertPool() - ok := roots.AppendCertsFromPEM([]byte(rootPEM)) - if !ok { - panic("failed to parse root certificate") - } - - block, _ := pem.Decode([]byte(certPEM)) - if block == nil { - panic("failed to parse certificate PEM") - } - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - panic("failed to parse certificate: " + err.Error()) - } - - opts := x509.VerifyOptions{ - DNSName: "mail.google.com", - Roots: roots, - } - - if _, err := cert.Verify(opts); err != nil { - panic("failed to verify certificate: " + err.Error()) - } -} - -func ExampleParsePKIXPublicKey() { - const pubPEM = ` ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlRuRnThUjU8/prwYxbty -WPT9pURI3lbsKMiB6Fn/VHOKE13p4D8xgOCADpdRagdT6n4etr9atzDKUSvpMtR3 -CP5noNc97WiNCggBjVWhs7szEe8ugyqF23XwpHQ6uV1LKH50m92MbOWfCtjU9p/x -qhNpQQ1AZhqNy5Gevap5k8XzRmjSldNAFZMY7Yv3Gi+nyCwGwpVtBUwhuLzgNFK/ -yDtw2WcWmUU7NuC8Q6MWvPebxVtCfVp/iQU6q60yyt6aGOBkhAX0LpKAEhKidixY -nP9PNVBvxgu3XZ4P36gZV6+ummKdBVnc3NqwBLu5+CcdRdusmHPHd5pHf4/38Z3/ -6qU2a/fPvWzceVTEgZ47QjFMTCTmCwNt29cvi7zZeQzjtwQgn4ipN9NibRH/Ax/q -TbIzHfrJ1xa2RteWSdFjwtxi9C20HUkjXSeI4YlzQMH0fPX6KCE7aVePTOnB69I/ -a9/q96DiXZajwlpq3wFctrs1oXqBp5DVrCIj8hU2wNgB7LtQ1mCtsYz//heai0K9 -PhE4X6hiE0YmeAZjR0uHl8M/5aW9xCoJ72+12kKpWAa0SFRWLy6FejNYCYpkupVJ -yecLk/4L1W0l6jQQZnWErXZYe0PNFcmwGXy1Rep83kfBRNKRy5tvocalLlwXLdUk -AIU+2GKjyT3iMuzZxxFxPFMCAwEAAQ== ------END PUBLIC KEY-----` - - block, _ := pem.Decode([]byte(pubPEM)) - if block == nil { - panic("failed to parse PEM block containing the public key") - } - - pub, err := x509.ParsePKIXPublicKey(block.Bytes) - if err != nil { - panic("failed to parse DER encoded public key: " + err.Error()) - } - - switch pub := pub.(type) { - case *rsa.PublicKey: - fmt.Println("pub is of type RSA:", pub) - case *dsa.PublicKey: - fmt.Println("pub is of type DSA:", pub) - case *ecdsa.PublicKey: - fmt.Println("pub is of type ECDSA:", pub) - default: - panic("unknown type of public key") - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/name_constraints_test.go b/vendor/github.com/google/certificate-transparency-go/x509/name_constraints_test.go deleted file mode 100644 index 5ea3ccb..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/name_constraints_test.go +++ /dev/null @@ -1,2126 +0,0 @@ -// Copyright 2017 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. - -package x509 - -import ( - "bytes" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "encoding/hex" - "encoding/pem" - "fmt" - "io/ioutil" - "math/big" - "net" - "net/url" - "os" - "os/exec" - "strconv" - "strings" - "sync" - "testing" - "time" - - "github.com/google/certificate-transparency-go/asn1" - "github.com/google/certificate-transparency-go/x509/pkix" -) - -const ( - // testNameConstraintsAgainstOpenSSL can be set to true to run tests - // against the system OpenSSL. This is disabled by default because Go - // cannot depend on having OpenSSL installed at testing time. - testNameConstraintsAgainstOpenSSL = false - - // debugOpenSSLFailure can be set to true, when - // testNameConstraintsAgainstOpenSSL is also true, to cause - // intermediate files to be preserved for debugging. - debugOpenSSLFailure = false -) - -type nameConstraintsTest struct { - roots []constraintsSpec - intermediates [][]constraintsSpec - leaf leafSpec - requestedEKUs []ExtKeyUsage - expectedError string - noOpenSSL bool -} - -type constraintsSpec struct { - ok []string - bad []string - ekus []string -} - -type leafSpec struct { - sans []string - ekus []string -} - -var nameConstraintsTests = []nameConstraintsTest{ - // #0: dummy test for the certificate generation process itself. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #1: dummy test for the certificate generation process itself: single - // level of intermediate. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #2: dummy test for the certificate generation process itself: two - // levels of intermediates. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #3: matching DNS constraint in root - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #4: matching DNS constraint in intermediate. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:example.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #5: .example.com only matches subdomains. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - expectedError: "\"example.com\" is not permitted", - }, - - // #6: .example.com matches subdomains. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.example.com"}, - }, - }, - - // #7: .example.com matches multiple levels of subdomains - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.bar.example.com"}, - }, - }, - - // #8: specifying a permitted list of names does not exclude other name - // types - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:10.1.1.1"}, - }, - }, - - // #9: specifying a permitted list of names does not exclude other name - // types - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"ip:10.0.0.0/8"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #10: intermediates can try to permit other names, which isn't - // forbidden if the leaf doesn't mention them. I.e. name constraints - // apply to names, not constraints themselves. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:example.com", "dns:foo.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #11: intermediates cannot add permitted names that the root doesn't - // grant them. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:example.com", "dns:foo.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.com"}, - }, - expectedError: "\"foo.com\" is not permitted", - }, - - // #12: intermediates can further limit their scope if they wish. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.bar.example.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.bar.example.com"}, - }, - }, - - // #13: intermediates can further limit their scope and that limitation - // is effective - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.bar.example.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.notbar.example.com"}, - }, - expectedError: "\"foo.notbar.example.com\" is not permitted", - }, - - // #14: roots can exclude subtrees and that doesn't affect other names. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.com"}, - }, - }, - - // #15: roots exclusions are effective. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.example.com"}, - }, - expectedError: "\"foo.example.com\" is excluded", - }, - - // #16: intermediates can also exclude names and that doesn't affect - // other names. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - bad: []string{"dns:.example.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.com"}, - }, - }, - - // #17: intermediate exclusions are effective. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - bad: []string{"dns:.example.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.example.com"}, - }, - expectedError: "\"foo.example.com\" is excluded", - }, - - // #18: having an exclusion doesn't prohibit other types of names. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"dns:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.com", "ip:10.1.1.1"}, - }, - }, - - // #19: IP-based exclusions are permitted and don't affect unrelated IP - // addresses. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"ip:10.0.0.0/8"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:192.168.1.1"}, - }, - }, - - // #20: IP-based exclusions are effective - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"ip:10.0.0.0/8"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:10.0.0.1"}, - }, - expectedError: "\"10.0.0.1\" is excluded", - }, - - // #21: intermediates can further constrain IP ranges. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"ip:0.0.0.0/1"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - bad: []string{"ip:11.0.0.0/8"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:11.0.0.1"}, - }, - expectedError: "\"11.0.0.1\" is excluded", - }, - - // #22: when multiple intermediates are present, chain building can - // avoid intermediates with incompatible constraints. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.foo.com"}, - }, - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.example.com"}, - }, - noOpenSSL: true, // OpenSSL's chain building is not informed by constraints. - }, - - // #23: (same as the previous test, but in the other order in ensure - // that we don't pass it by luck.) - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:.example.com"}, - }, - constraintsSpec{ - ok: []string{"dns:.foo.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:foo.example.com"}, - }, - noOpenSSL: true, // OpenSSL's chain building is not informed by constraints. - }, - - // #24: when multiple roots are valid, chain building can avoid roots - // with incompatible constraints. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - noOpenSSL: true, // OpenSSL's chain building is not informed by constraints. - }, - - // #25: (same as the previous test, but in the other order in ensure - // that we don't pass it by luck.) - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - noOpenSSL: true, // OpenSSL's chain building is not informed by constraints. - }, - - // #26: chain building can find a valid path even with multiple levels - // of alternative intermediates and alternative roots. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - constraintsSpec{ - ok: []string{"dns:example.com"}, - }, - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - }, - []constraintsSpec{ - constraintsSpec{}, - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:bar.com"}, - }, - noOpenSSL: true, // OpenSSL's chain building is not informed by constraints. - }, - - // #27: chain building doesn't get stuck when there is no valid path. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - constraintsSpec{ - ok: []string{"dns:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - }, - []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:bar.com"}, - }, - constraintsSpec{ - ok: []string{"dns:foo.com"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:bar.com"}, - }, - expectedError: "\"bar.com\" is not permitted", - }, - - // #28: unknown name types don't cause a problem without constraints. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"unknown:"}, - }, - }, - - // #29: unknown name types are allowed even in constrained chains. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:foo.com", "dns:.foo.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"unknown:"}, - }, - }, - - // #30: without SANs, a certificate is rejected in a constrained chain. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:foo.com", "dns:.foo.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{}, - }, - expectedError: "leaf doesn't have a SAN extension", - noOpenSSL: true, // OpenSSL doesn't require SANs in this case. - }, - - // #31: IPv6 addresses work in constraints: roots can permit them as - // expected. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"ip:2000:abcd::/32"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:2000:abcd:1234::"}, - }, - }, - - // #32: IPv6 addresses work in constraints: root restrictions are - // effective. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"ip:2000:abcd::/32"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:2000:1234:abcd::"}, - }, - expectedError: "\"2000:1234:abcd::\" is not permitted", - }, - - // #33: An IPv6 permitted subtree doesn't affect DNS names. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"ip:2000:abcd::/32"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:2000:abcd::", "dns:foo.com"}, - }, - }, - - // #34: IPv6 exclusions don't affect unrelated addresses. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"ip:2000:abcd::/32"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:2000:1234::"}, - }, - }, - - // #35: IPv6 exclusions are effective. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"ip:2000:abcd::/32"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:2000:abcd::"}, - }, - expectedError: "\"2000:abcd::\" is excluded", - }, - - // #36: IPv6 constraints do not permit IPv4 addresses. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"ip:2000:abcd::/32"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:10.0.0.1"}, - }, - expectedError: "\"10.0.0.1\" is not permitted", - }, - - // #37: IPv4 constraints do not permit IPv6 addresses. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"ip:10.0.0.0/8"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:2000:abcd::"}, - }, - expectedError: "\"2000:abcd::\" is not permitted", - }, - - // #38: an exclusion of an unknown type doesn't affect other names. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"unknown:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #39: a permitted subtree of an unknown type doesn't affect other - // name types. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"unknown:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #40: exact email constraints work - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:foo@example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@example.com"}, - }, - }, - - // #41: exact email constraints are effective - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:foo@example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:bar@example.com"}, - }, - expectedError: "\"bar@example.com\" is not permitted", - }, - - // #42: email canonicalisation works. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:foo@example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:\"\\f\\o\\o\"@example.com"}, - }, - noOpenSSL: true, // OpenSSL doesn't canonicalise email addresses before matching - }, - - // #43: limiting email addresses to a host works. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@example.com"}, - }, - }, - - // #44: a leading dot matches hosts one level deep - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@sub.example.com"}, - }, - }, - - // #45: a leading dot does not match the host itself - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@example.com"}, - }, - expectedError: "\"foo@example.com\" is not permitted", - }, - - // #46: a leading dot also matches two (or more) levels deep. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:.example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@sub.sub.example.com"}, - }, - }, - - // #47: the local part of an email is case-sensitive - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:foo@example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:Foo@example.com"}, - }, - expectedError: "\"Foo@example.com\" is not permitted", - }, - - // #48: the domain part of an email is not case-sensitive - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:foo@EXAMPLE.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@example.com"}, - }, - }, - - // #49: the domain part of a DNS constraint is also not case-sensitive. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:EXAMPLE.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #50: URI constraints only cover the host part of the URI - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{ - "uri:http://example.com/bar", - "uri:http://example.com:8080/", - "uri:https://example.com/wibble#bar", - }, - }, - }, - - // #51: URIs with IPs are rejected - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:http://1.2.3.4/"}, - }, - expectedError: "URI with IP", - }, - - // #52: URIs with IPs and ports are rejected - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:http://1.2.3.4:43/"}, - }, - expectedError: "URI with IP", - }, - - // #53: URIs with IPv6 addresses are also rejected - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:http://[2006:abcd::1]/"}, - }, - expectedError: "URI with IP", - }, - - // #54: URIs with IPv6 addresses with ports are also rejected - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:http://[2006:abcd::1]:16/"}, - }, - expectedError: "URI with IP", - }, - - // #55: URI constraints are effective - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:http://bar.com/"}, - }, - expectedError: "\"http://bar.com/\" is not permitted", - }, - - // #56: URI constraints are effective - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"uri:foo.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:http://foo.com/"}, - }, - expectedError: "\"http://foo.com/\" is excluded", - }, - - // #57: URI constraints can allow subdomains - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:.foo.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:http://www.foo.com/"}, - }, - }, - - // #58: excluding an IPv4-mapped-IPv6 address doesn't affect the IPv4 - // version of that address. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"ip:::ffff:1.2.3.4/128"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:1.2.3.4"}, - }, - }, - - // #59: a URI constraint isn't matched by a URN. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:example.com"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:urn:example"}, - }, - expectedError: "URI with empty host", - }, - - // #60: excluding all IPv6 addresses doesn't exclude all IPv4 addresses - // too, even though IPv4 is mapped into the IPv6 range. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"ip:1.2.3.0/24"}, - bad: []string{"ip:::0/0"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"ip:1.2.3.4"}, - }, - }, - - // #61: omitting extended key usage in a CA certificate implies that - // any usage is ok. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth", "other"}, - }, - }, - - // #62: The “any” EKU also means that any usage is ok. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ekus: []string{"any"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth", "other"}, - }, - }, - - // #63: A specified key usage in an intermediate forbids other usages - // in the leaf. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ekus: []string{"email"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth"}, - }, - expectedError: "EKU not permitted", - }, - - // #64: A specified key usage in an intermediate forbids other usages - // in the leaf, even if we don't recognise them. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ekus: []string{"email"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"other"}, - }, - expectedError: "EKU not permitted", - }, - - // #65: trying to add extra permitted key usages in an intermediate - // (after a limitation in the root) is acceptable so long as the leaf - // certificate doesn't use them. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ekus: []string{"serverAuth"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ekus: []string{"serverAuth", "email"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth"}, - }, - }, - - // #66: EKUs in roots are ignored. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ekus: []string{"serverAuth"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ekus: []string{"serverAuth", "email"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth", "email"}, - }, - }, - - // #67: in order to support COMODO chains, SGC key usages permit - // serverAuth and clientAuth. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ekus: []string{"netscapeSGC"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth", "clientAuth"}, - }, - }, - - // #68: in order to support COMODO chains, SGC key usages permit - // serverAuth and clientAuth. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{ - ekus: []string{"msSGC"}, - }, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth", "clientAuth"}, - }, - }, - - // #69: an empty DNS constraint should allow anything. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"dns:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - }, - - // #70: an empty DNS constraint should also reject everything. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"dns:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - }, - expectedError: "\"example.com\" is excluded", - }, - - // #71: an empty email constraint should allow anything - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"email:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@example.com"}, - }, - }, - - // #72: an empty email constraint should also reject everything. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"email:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:foo@example.com"}, - }, - expectedError: "\"foo@example.com\" is excluded", - }, - - // #73: an empty URI constraint should allow anything - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - ok: []string{"uri:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:https://example.com/test"}, - }, - }, - - // #74: an empty URI constraint should also reject everything. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"uri:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"uri:https://example.com/test"}, - }, - expectedError: "\"https://example.com/test\" is excluded", - }, - - // #75: While serverAuth in a CA certificate permits clientAuth in a leaf, - // serverAuth in a leaf shouldn't permit clientAuth when requested in - // VerifyOptions. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"serverAuth"}, - }, - requestedEKUs: []ExtKeyUsage{ExtKeyUsageClientAuth}, - expectedError: "incompatible key usage", - }, - - // #76: However, MSSGC in a leaf should match a request for serverAuth. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"msSGC"}, - }, - requestedEKUs: []ExtKeyUsage{ExtKeyUsageServerAuth}, - }, - - // An invalid DNS SAN should be detected only at validation time so - // that we can process CA certificates in the wild that have invalid SANs. - // See https://github.com/golang/go/issues/23995 - - // #77: an invalid DNS or mail SAN will not be detected if name constaint - // checking is not triggered. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:this is invalid", "email:this @ is invalid"}, - }, - }, - - // #78: an invalid DNS SAN will be detected if any name constraint checking - // is triggered. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"uri:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:this is invalid"}, - }, - expectedError: "cannot parse dnsName", - }, - - // #79: an invalid email SAN will be detected if any name constraint - // checking is triggered. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{ - bad: []string{"uri:"}, - }, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"email:this @ is invalid"}, - }, - expectedError: "cannot parse rfc822Name", - }, - - // #80: if several EKUs are requested, satisfying any of them is sufficient. - nameConstraintsTest{ - roots: []constraintsSpec{ - constraintsSpec{}, - }, - intermediates: [][]constraintsSpec{ - []constraintsSpec{ - constraintsSpec{}, - }, - }, - leaf: leafSpec{ - sans: []string{"dns:example.com"}, - ekus: []string{"email"}, - }, - requestedEKUs: []ExtKeyUsage{ExtKeyUsageClientAuth, ExtKeyUsageEmailProtection}, - }, -} - -func makeConstraintsCACert(constraints constraintsSpec, name string, key *ecdsa.PrivateKey, parent *Certificate, parentKey *ecdsa.PrivateKey) (*Certificate, error) { - var serialBytes [16]byte - rand.Read(serialBytes[:]) - - template := &Certificate{ - SerialNumber: new(big.Int).SetBytes(serialBytes[:]), - Subject: pkix.Name{ - CommonName: name, - }, - NotBefore: time.Unix(1000, 0), - NotAfter: time.Unix(2000, 0), - KeyUsage: KeyUsageCertSign, - BasicConstraintsValid: true, - IsCA: true, - } - - if err := addConstraintsToTemplate(constraints, template); err != nil { - return nil, err - } - - if parent == nil { - parent = template - } - derBytes, err := CreateCertificate(rand.Reader, template, parent, &key.PublicKey, parentKey) - if err != nil { - return nil, err - } - - caCert, err := ParseCertificate(derBytes) - if err != nil { - return nil, err - } - - return caCert, nil -} - -func makeConstraintsLeafCert(leaf leafSpec, key *ecdsa.PrivateKey, parent *Certificate, parentKey *ecdsa.PrivateKey) (*Certificate, error) { - var serialBytes [16]byte - rand.Read(serialBytes[:]) - - template := &Certificate{ - SerialNumber: new(big.Int).SetBytes(serialBytes[:]), - Subject: pkix.Name{ - // Don't set a CommonName because OpenSSL (at least) will try to - // match it against name constraints. - OrganizationalUnit: []string{"Leaf"}, - }, - NotBefore: time.Unix(1000, 0), - NotAfter: time.Unix(2000, 0), - KeyUsage: KeyUsageDigitalSignature, - BasicConstraintsValid: true, - IsCA: false, - } - - for _, name := range leaf.sans { - switch { - case strings.HasPrefix(name, "dns:"): - template.DNSNames = append(template.DNSNames, name[4:]) - - case strings.HasPrefix(name, "ip:"): - ip := net.ParseIP(name[3:]) - if ip == nil { - return nil, fmt.Errorf("cannot parse IP %q", name[3:]) - } - template.IPAddresses = append(template.IPAddresses, ip) - - case strings.HasPrefix(name, "invalidip:"): - ipBytes, err := hex.DecodeString(name[10:]) - if err != nil { - return nil, fmt.Errorf("cannot parse invalid IP: %s", err) - } - template.IPAddresses = append(template.IPAddresses, net.IP(ipBytes)) - - case strings.HasPrefix(name, "email:"): - template.EmailAddresses = append(template.EmailAddresses, name[6:]) - - case strings.HasPrefix(name, "uri:"): - uri, err := url.Parse(name[4:]) - if err != nil { - return nil, fmt.Errorf("cannot parse URI %q: %s", name[4:], err) - } - template.URIs = append(template.URIs, uri) - - case strings.HasPrefix(name, "unknown:"): - // This is a special case for testing unknown - // name types. A custom SAN extension is - // injected into the certificate. - if len(leaf.sans) != 1 { - panic("when using unknown name types, it must be the sole name") - } - - template.ExtraExtensions = append(template.ExtraExtensions, pkix.Extension{ - Id: []int{2, 5, 29, 17}, - Value: []byte{ - 0x30, // SEQUENCE - 3, // three bytes - 9, // undefined GeneralName type 9 - 1, - 1, - }, - }) - - default: - return nil, fmt.Errorf("unknown name type %q", name) - } - } - - var err error - if template.ExtKeyUsage, template.UnknownExtKeyUsage, err = parseEKUs(leaf.ekus); err != nil { - return nil, err - } - - if parent == nil { - parent = template - } - - derBytes, err := CreateCertificate(rand.Reader, template, parent, &key.PublicKey, parentKey) - if err != nil { - return nil, err - } - - return ParseCertificate(derBytes) -} - -func customConstraintsExtension(typeNum int, constraint []byte, isExcluded bool) pkix.Extension { - appendConstraint := func(contents []byte, tag uint8) []byte { - contents = append(contents, tag|32 /* constructed */ |0x80 /* context-specific */) - contents = append(contents, byte(4+len(constraint)) /* length */) - contents = append(contents, 0x30 /* SEQUENCE */) - contents = append(contents, byte(2+len(constraint)) /* length */) - contents = append(contents, byte(typeNum) /* GeneralName type */) - contents = append(contents, byte(len(constraint))) - return append(contents, constraint...) - } - - var contents []byte - if !isExcluded { - contents = appendConstraint(contents, 0 /* tag 0 for permitted */) - } else { - contents = appendConstraint(contents, 1 /* tag 1 for excluded */) - } - - var value []byte - value = append(value, 0x30 /* SEQUENCE */) - value = append(value, byte(len(contents))) - value = append(value, contents...) - - return pkix.Extension{ - Id: []int{2, 5, 29, 30}, - Value: value, - } -} - -func addConstraintsToTemplate(constraints constraintsSpec, template *Certificate) error { - parse := func(constraints []string) (dnsNames []string, ips []*net.IPNet, emailAddrs []string, uriDomains []string, err error) { - for _, constraint := range constraints { - switch { - case strings.HasPrefix(constraint, "dns:"): - dnsNames = append(dnsNames, constraint[4:]) - - case strings.HasPrefix(constraint, "ip:"): - _, ipNet, err := net.ParseCIDR(constraint[3:]) - if err != nil { - return nil, nil, nil, nil, err - } - ips = append(ips, ipNet) - - case strings.HasPrefix(constraint, "email:"): - emailAddrs = append(emailAddrs, constraint[6:]) - - case strings.HasPrefix(constraint, "uri:"): - uriDomains = append(uriDomains, constraint[4:]) - - default: - return nil, nil, nil, nil, fmt.Errorf("unknown constraint %q", constraint) - } - } - - return dnsNames, ips, emailAddrs, uriDomains, err - } - - handleSpecialConstraint := func(constraint string, isExcluded bool) bool { - switch { - case constraint == "unknown:": - template.ExtraExtensions = append(template.ExtraExtensions, customConstraintsExtension(9 /* undefined GeneralName type */, []byte{1}, isExcluded)) - - default: - return false - } - - return true - } - - if len(constraints.ok) == 1 && len(constraints.bad) == 0 { - if handleSpecialConstraint(constraints.ok[0], false) { - return nil - } - } - - if len(constraints.bad) == 1 && len(constraints.ok) == 0 { - if handleSpecialConstraint(constraints.bad[0], true) { - return nil - } - } - - var err error - template.PermittedDNSDomains, template.PermittedIPRanges, template.PermittedEmailAddresses, template.PermittedURIDomains, err = parse(constraints.ok) - if err != nil { - return err - } - - template.ExcludedDNSDomains, template.ExcludedIPRanges, template.ExcludedEmailAddresses, template.ExcludedURIDomains, err = parse(constraints.bad) - if err != nil { - return err - } - - if template.ExtKeyUsage, template.UnknownExtKeyUsage, err = parseEKUs(constraints.ekus); err != nil { - return err - } - - return nil -} - -func parseEKUs(ekuStrs []string) (ekus []ExtKeyUsage, unknowns []asn1.ObjectIdentifier, err error) { - for _, s := range ekuStrs { - switch s { - case "serverAuth": - ekus = append(ekus, ExtKeyUsageServerAuth) - case "clientAuth": - ekus = append(ekus, ExtKeyUsageClientAuth) - case "email": - ekus = append(ekus, ExtKeyUsageEmailProtection) - case "netscapeSGC": - ekus = append(ekus, ExtKeyUsageNetscapeServerGatedCrypto) - case "msSGC": - ekus = append(ekus, ExtKeyUsageMicrosoftServerGatedCrypto) - case "any": - ekus = append(ekus, ExtKeyUsageAny) - case "other": - unknowns = append(unknowns, asn1.ObjectIdentifier{2, 4, 1, 2, 3}) - default: - return nil, nil, fmt.Errorf("unknown EKU %q", s) - } - } - - return -} - -func TestConstraintCases(t *testing.T) { - privateKeys := sync.Pool{ - New: func() interface{} { - priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if err != nil { - panic(err) - } - return priv - }, - } - - for i, test := range nameConstraintsTests { - rootPool := NewCertPool() - rootKey := privateKeys.Get().(*ecdsa.PrivateKey) - rootName := "Root " + strconv.Itoa(i) - - // keys keeps track of all the private keys used in a given - // test and puts them back in the privateKeys pool at the end. - keys := []*ecdsa.PrivateKey{rootKey} - - // At each level (root, intermediate(s), leaf), parent points to - // an example parent certificate and parentKey the key for the - // parent level. Since all certificates at a given level have - // the same name and public key, any parent certificate is - // sufficient to get the correct issuer name and authority - // key ID. - var parent *Certificate - parentKey := rootKey - - for _, root := range test.roots { - rootCert, err := makeConstraintsCACert(root, rootName, rootKey, nil, rootKey) - if err != nil { - t.Fatalf("#%d: failed to create root: %s", i, err) - } - - parent = rootCert - rootPool.AddCert(rootCert) - } - - intermediatePool := NewCertPool() - - for level, intermediates := range test.intermediates { - levelKey := privateKeys.Get().(*ecdsa.PrivateKey) - keys = append(keys, levelKey) - levelName := "Intermediate level " + strconv.Itoa(level) - var last *Certificate - - for _, intermediate := range intermediates { - caCert, err := makeConstraintsCACert(intermediate, levelName, levelKey, parent, parentKey) - if err != nil { - t.Fatalf("#%d: failed to create %q: %s", i, levelName, err) - } - - last = caCert - intermediatePool.AddCert(caCert) - } - - parent = last - parentKey = levelKey - } - - leafKey := privateKeys.Get().(*ecdsa.PrivateKey) - keys = append(keys, leafKey) - - leafCert, err := makeConstraintsLeafCert(test.leaf, leafKey, parent, parentKey) - if err != nil { - t.Fatalf("#%d: cannot create leaf: %s", i, err) - } - - if !test.noOpenSSL && testNameConstraintsAgainstOpenSSL { - output, err := testChainAgainstOpenSSL(leafCert, intermediatePool, rootPool) - if err == nil && len(test.expectedError) > 0 { - t.Errorf("#%d: unexpectedly succeeded against OpenSSL", i) - if debugOpenSSLFailure { - return - } - } - - if err != nil { - if _, ok := err.(*exec.ExitError); !ok { - t.Errorf("#%d: OpenSSL failed to run: %s", i, err) - } else if len(test.expectedError) == 0 { - t.Errorf("#%d: OpenSSL unexpectedly failed: %q", i, output) - if debugOpenSSLFailure { - return - } - } - } - } - - verifyOpts := VerifyOptions{ - Roots: rootPool, - Intermediates: intermediatePool, - CurrentTime: time.Unix(1500, 0), - KeyUsages: test.requestedEKUs, - } - _, err = leafCert.Verify(verifyOpts) - - logInfo := true - if len(test.expectedError) == 0 { - if err != nil { - t.Errorf("#%d: unexpected failure: %s", i, err) - } else { - logInfo = false - } - } else { - if err == nil { - t.Errorf("#%d: unexpected success", i) - } else if !strings.Contains(err.Error(), test.expectedError) { - t.Errorf("#%d: expected error containing %q, but got: %s", i, test.expectedError, err) - } else { - logInfo = false - } - } - - if logInfo { - certAsPEM := func(cert *Certificate) string { - var buf bytes.Buffer - pem.Encode(&buf, &pem.Block{Type: "CERTIFICATE", Bytes: cert.Raw}) - return string(buf.Bytes()) - } - t.Errorf("#%d: root:\n%s", i, certAsPEM(rootPool.certs[0])) - t.Errorf("#%d: leaf:\n%s", i, certAsPEM(leafCert)) - } - - for _, key := range keys { - privateKeys.Put(key) - } - keys = keys[:0] - } -} - -func writePEMsToTempFile(certs []*Certificate) *os.File { - file, err := ioutil.TempFile("", "name_constraints_test") - if err != nil { - panic("cannot create tempfile") - } - - pemBlock := &pem.Block{Type: "CERTIFICATE"} - for _, cert := range certs { - pemBlock.Bytes = cert.Raw - pem.Encode(file, pemBlock) - } - - return file -} - -func testChainAgainstOpenSSL(leaf *Certificate, intermediates, roots *CertPool) (string, error) { - args := []string{"verify", "-no_check_time"} - - rootsFile := writePEMsToTempFile(roots.certs) - if debugOpenSSLFailure { - println("roots file:", rootsFile.Name()) - } else { - defer os.Remove(rootsFile.Name()) - } - args = append(args, "-CAfile", rootsFile.Name()) - - if len(intermediates.certs) > 0 { - intermediatesFile := writePEMsToTempFile(intermediates.certs) - if debugOpenSSLFailure { - println("intermediates file:", intermediatesFile.Name()) - } else { - defer os.Remove(intermediatesFile.Name()) - } - args = append(args, "-untrusted", intermediatesFile.Name()) - } - - leafFile := writePEMsToTempFile([]*Certificate{leaf}) - if debugOpenSSLFailure { - println("leaf file:", leafFile.Name()) - } else { - defer os.Remove(leafFile.Name()) - } - args = append(args, leafFile.Name()) - - var output bytes.Buffer - cmd := exec.Command("openssl", args...) - cmd.Stdout = &output - cmd.Stderr = &output - - err := cmd.Run() - return string(output.Bytes()), err -} - -var rfc2821Tests = []struct { - in string - localPart, domain string -}{ - {"foo@example.com", "foo", "example.com"}, - {"@example.com", "", ""}, - {"\"@example.com", "", ""}, - {"\"\"@example.com", "", "example.com"}, - {"\"a\"@example.com", "a", "example.com"}, - {"\"\\a\"@example.com", "a", "example.com"}, - {"a\"@example.com", "", ""}, - {"foo..bar@example.com", "", ""}, - {".foo.bar@example.com", "", ""}, - {"foo.bar.@example.com", "", ""}, - {"|{}?'@example.com", "|{}?'", "example.com"}, - - // Examples from RFC 3696 - {"Abc\\@def@example.com", "Abc@def", "example.com"}, - {"Fred\\ Bloggs@example.com", "Fred Bloggs", "example.com"}, - {"Joe.\\\\Blow@example.com", "Joe.\\Blow", "example.com"}, - {"\"Abc@def\"@example.com", "Abc@def", "example.com"}, - {"\"Fred Bloggs\"@example.com", "Fred Bloggs", "example.com"}, - {"customer/department=shipping@example.com", "customer/department=shipping", "example.com"}, - {"$A12345@example.com", "$A12345", "example.com"}, - {"!def!xyz%abc@example.com", "!def!xyz%abc", "example.com"}, - {"_somename@example.com", "_somename", "example.com"}, -} - -func TestRFC2821Parsing(t *testing.T) { - for i, test := range rfc2821Tests { - mailbox, ok := parseRFC2821Mailbox(test.in) - expectedFailure := len(test.localPart) == 0 && len(test.domain) == 0 - - if ok && expectedFailure { - t.Errorf("#%d: %q unexpectedly parsed as (%q, %q)", i, test.in, mailbox.local, mailbox.domain) - continue - } - - if !ok && !expectedFailure { - t.Errorf("#%d: unexpected failure for %q", i, test.in) - continue - } - - if !ok { - continue - } - - if mailbox.local != test.localPart || mailbox.domain != test.domain { - t.Errorf("#%d: %q parsed as (%q, %q), but wanted (%q, %q)", i, test.in, mailbox.local, mailbox.domain, test.localPart, test.domain) - } - } -} - -func TestBadNamesInConstraints(t *testing.T) { - constraintParseError := func(err error) bool { - str := err.Error() - return strings.Contains(str, "failed to parse ") && strings.Contains(str, "constraint") - } - - encodingError := func(err error) bool { - return strings.Contains(err.Error(), "cannot be encoded as an IA5String") - } - - // Bad names in constraints should not parse. - badNames := []struct { - name string - matcher func(error) bool - }{ - {"dns:foo.com.", constraintParseError}, - {"email:abc@foo.com.", constraintParseError}, - {"email:foo.com.", constraintParseError}, - {"uri:example.com.", constraintParseError}, - {"uri:1.2.3.4", constraintParseError}, - {"uri:ffff::1", constraintParseError}, - {"dns:not–hyphen.com", encodingError}, - {"email:foo@not–hyphen.com", encodingError}, - {"uri:not–hyphen.com", encodingError}, - } - - priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if err != nil { - panic(err) - } - - for _, test := range badNames { - _, err := makeConstraintsCACert(constraintsSpec{ - ok: []string{test.name}, - }, "TestAbsoluteNamesInConstraints", priv, nil, priv) - - if err == nil { - t.Errorf("bad name %q unexpectedly accepted in name constraint", test.name) - continue - } else { - if !test.matcher(err) { - t.Errorf("bad name %q triggered unrecognised error: %s", test.name, err) - } - } - } -} - -func TestBadNamesInSANs(t *testing.T) { - // Bad names in URI and IP SANs should not parse. Bad DNS and email SANs - // will parse and are tested in name constraint tests at the top of this - // file. - badNames := []string{ - "uri:https://example.com./dsf", - "invalidip:0102", - "invalidip:0102030405", - } - - priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if err != nil { - panic(err) - } - - for _, badName := range badNames { - _, err := makeConstraintsLeafCert(leafSpec{sans: []string{badName}}, priv, nil, priv) - - if err == nil { - t.Errorf("bad name %q unexpectedly accepted in SAN", badName) - continue - } - - if err != nil { - if str := err.Error(); !strings.Contains(str, "cannot parse ") { - t.Errorf("bad name %q triggered unrecognised error: %s", badName, str) - } - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/names_test.go b/vendor/github.com/google/certificate-transparency-go/x509/names_test.go deleted file mode 100644 index a569d43..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/names_test.go +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package x509 - -import ( - "bytes" - "encoding/hex" - "net" - "reflect" - "strings" - "testing" - - "github.com/google/certificate-transparency-go/asn1" - "github.com/google/certificate-transparency-go/x509/pkix" -) - -func TestParseGeneralNames(t *testing.T) { - var tests = []struct { - data string // as hex - want GeneralNames - wantErr string - }{ - { - data: ("3012" + - ("8210" + "7777772e676f6f676c652e636f2e756b")), - want: GeneralNames{ - DNSNames: []string{"www.google.co.uk"}, - }, - }, - { - data: ("3024" + - ("8210" + "7777772e676f6f676c652e636f2e756b") + - ("8610" + "7777772e676f6f676c652e636f2e756b")), - want: GeneralNames{ - DNSNames: []string{"www.google.co.uk"}, - URIs: []string{"www.google.co.uk"}, - }, - }, - { - data: "0a0101", - wantErr: "failed to parse GeneralNames sequence", - }, - { - data: "0a", - wantErr: "failed to parse GeneralNames:", - }, - { - data: "03000a0101", - wantErr: "trailing data", - }, - { - data: ("3005" + ("8703" + "010203")), - wantErr: "invalid IP length", - }, - } - for _, test := range tests { - inData := fromHex(test.data) - var got GeneralNames - err := parseGeneralNames(inData, &got) - if err != nil { - if test.wantErr == "" { - t.Errorf("parseGeneralNames(%s)=%v; want nil", test.data, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("parseGeneralNames(%s)=%v; want %q", test.data, err, test.wantErr) - } - continue - } - if test.wantErr != "" { - t.Errorf("parseGeneralNames(%s)=%+v,nil; want %q", test.data, got, test.wantErr) - continue - } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("parseGeneralNames(%s)=%+v; want %+v", test.data, got, test.want) - } - } -} - -func TestParseGeneralName(t *testing.T) { - var tests = []struct { - data string // as hex - withMask bool - want GeneralNames - wantErr string - }{ - { - data: ("a008" + - ("0603" + "551d0e") + // OID: subject-key-id - ("0a01" + "01")), // enum=1 - want: GeneralNames{ - OtherNames: []OtherName{ - { - TypeID: OIDExtensionSubjectKeyId, - Value: asn1.RawValue{ - Class: asn1.ClassUniversal, - Tag: asn1.TagEnum, - IsCompound: false, - Bytes: fromHex("01"), - FullBytes: fromHex("0a0101"), - }, - }, - }, - }, - }, - { - data: ("8008" + - ("0603" + "551d0e") + // OID: subject-key-id - ("0a01" + "01")), // enum=1 - wantErr: "not compound", - }, - { - data: ("a005" + - ("0603" + "551d0e")), // OID: subject-key-id - wantErr: "sequence truncated", - }, - { - data: ("8110" + "77777740676f6f676c652e636f2e756b"), - want: GeneralNames{ - EmailAddresses: []string{"www@google.co.uk"}, - }, - }, - { - data: ("8210" + "7777772e676f6f676c652e636f2e756b"), - want: GeneralNames{ - DNSNames: []string{"www.google.co.uk"}, - }, - }, - { - data: ("844b" + - ("3049" + - ("310b" + - ("3009" + - ("0603" + "550406") + - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732"))))), // "GoogleInternet Authority G2" - want: GeneralNames{ - DirectoryNames: []pkix.Name{ - { - Country: []string{"US"}, - Organization: []string{"Google Inc"}, - CommonName: "Google Internet Authority G2", - Names: []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - }, - }, - }, - { - data: ("8410" + "7777772e676f6f676c652e636f2e756b"), - wantErr: "failed to unmarshal GeneralNames.directoryName", - }, - { - data: ("8610" + "7777772e676f6f676c652e636f2e756b"), - want: GeneralNames{ - URIs: []string{"www.google.co.uk"}, - }, - }, - { - data: ("8704" + "01020304"), - want: GeneralNames{ - IPNets: []net.IPNet{{IP: net.IP{1, 2, 3, 4}}}, - }, - }, - { - data: ("8708" + "01020304ffffff00"), - withMask: true, - want: GeneralNames{ - IPNets: []net.IPNet{{IP: net.IP{1, 2, 3, 4}, Mask: net.IPMask{0xff, 0xff, 0xff, 0x00}}}, - }, - }, - { - data: ("8710" + "01020304111213142122232431323334"), - want: GeneralNames{ - IPNets: []net.IPNet{{IP: net.IP{1, 2, 3, 4, 0x11, 0x12, 0x13, 0x14, 0x21, 0x22, 0x23, 0x24, 0x31, 0x32, 0x33, 0x34}}}, - }, - }, - { - data: ("8703" + "010203"), - wantErr: "invalid IP length", - }, - { - data: ("8707" + "01020304ffffff"), - withMask: true, - wantErr: "invalid IP/mask length", - }, - { - data: ("8803" + "551d0e"), // OID: subject-key-id - want: GeneralNames{ - RegisteredIDs: []asn1.ObjectIdentifier{OIDExtensionSubjectKeyId}, - }, - }, - { - data: ("8803" + "551d8e"), - wantErr: "syntax error", - }, - { - data: ("9003" + "551d8e"), - wantErr: "unknown tag", - }, - { - data: ("8803"), - wantErr: "data truncated", - }, - } - - for _, test := range tests { - inData := fromHex(test.data) - var got GeneralNames - _, err := parseGeneralName(inData, &got, test.withMask) - if err != nil { - if test.wantErr == "" { - t.Errorf("parseGeneralName(%s)=%v; want nil", test.data, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("parseGeneralName(%s)=%v; want %q", test.data, err, test.wantErr) - } - continue - } - if test.wantErr != "" { - t.Errorf("parseGeneralName(%s)=%+v,nil; want %q", test.data, got, test.wantErr) - continue - } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("parseGeneralName(%s)=%+v; want %+v", test.data, got, test.want) - } - if got.Empty() { - t.Errorf("parseGeneralName(%s).Empty(%+v)=true; want false", test.data, got) - } - if gotLen, wantLen := got.Len(), 1; gotLen != wantLen { - t.Errorf("parseGeneralName(%s).Len(%+v)=%d; want %d", test.data, got, gotLen, wantLen) - } - if !bytes.Equal(inData, fromHex(test.data)) { - t.Errorf("parseGeneralName(%s) modified data to %x", test.data, inData) - } - - // Wrap the GeneralName up in a SEQUENCE and check that we get the same result using parseGeneralNames. - if test.withMask { - continue - } - seqData := append([]byte{0x30, byte(len(inData))}, inData...) - var gotSeq GeneralNames - err = parseGeneralNames(seqData, &gotSeq) - if err != nil { - t.Errorf("parseGeneralNames(%x)=%v; want nil", seqData, err) - continue - } - if !reflect.DeepEqual(gotSeq, test.want) { - t.Errorf("parseGeneralNames(%x)=%+v; want %+v", seqData, gotSeq, test.want) - } - } -} - -func fromHex(s string) []byte { - d, _ := hex.DecodeString(s) - return d -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/pem_decrypt_test.go b/vendor/github.com/google/certificate-transparency-go/x509/pem_decrypt_test.go deleted file mode 100644 index 685d5ee..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/pem_decrypt_test.go +++ /dev/null @@ -1,247 +0,0 @@ -// 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. - -package x509 - -import ( - "bytes" - "crypto/rand" - "encoding/base64" - "encoding/pem" - "strings" - "testing" -) - -func TestDecrypt(t *testing.T) { - for i, data := range testData { - t.Logf("test %v. %v", i, data.kind) - block, rest := pem.Decode(data.pemData) - if len(rest) > 0 { - t.Error("extra data") - } - der, err := DecryptPEMBlock(block, data.password) - if err != nil { - t.Error("decrypt failed: ", err) - continue - } - if _, err := ParsePKCS1PrivateKey(der); err != nil { - t.Error("invalid private key: ", err) - } - plainDER, err := base64.StdEncoding.DecodeString(data.plainDER) - if err != nil { - t.Fatal("cannot decode test DER data: ", err) - } - if !bytes.Equal(der, plainDER) { - t.Error("data mismatch") - } - } -} - -func TestEncrypt(t *testing.T) { - for i, data := range testData { - t.Logf("test %v. %v", i, data.kind) - plainDER, err := base64.StdEncoding.DecodeString(data.plainDER) - if err != nil { - t.Fatal("cannot decode test DER data: ", err) - } - password := []byte("kremvax1") - block, err := EncryptPEMBlock(rand.Reader, "RSA PRIVATE KEY", plainDER, password, data.kind) - if err != nil { - t.Error("encrypt: ", err) - continue - } - if !IsEncryptedPEMBlock(block) { - t.Error("PEM block does not appear to be encrypted") - } - if block.Type != "RSA PRIVATE KEY" { - t.Errorf("unexpected block type; got %q want %q", block.Type, "RSA PRIVATE KEY") - } - if block.Headers["Proc-Type"] != "4,ENCRYPTED" { - t.Errorf("block does not have correct Proc-Type header") - } - der, err := DecryptPEMBlock(block, password) - if err != nil { - t.Error("decrypt: ", err) - continue - } - if !bytes.Equal(der, plainDER) { - t.Errorf("data mismatch") - } - } -} - -var testData = []struct { - kind PEMCipher - password []byte - pemData []byte - plainDER string -}{ - { - kind: PEMCipherDES, - password: []byte("asdf"), - pemData: []byte(` ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-CBC,34F09A4FC8DE22B5 - -WXxy8kbZdiZvANtKvhmPBLV7eVFj2A5z6oAxvI9KGyhG0ZK0skfnt00C24vfU7m5 -ICXeoqP67lzJ18xCzQfHjDaBNs53DSDT+Iz4e8QUep1xQ30+8QKX2NA2coee3nwc -6oM1cuvhNUDemBH2i3dKgMVkfaga0zQiiOq6HJyGSncCMSruQ7F9iWEfRbFcxFCx -qtHb1kirfGKEtgWTF+ynyco6+2gMXNu70L7nJcnxnV/RLFkHt7AUU1yrclxz7eZz -XOH9VfTjb52q/I8Suozq9coVQwg4tXfIoYUdT//O+mB7zJb9HI9Ps77b9TxDE6Gm -4C9brwZ3zg2vqXcwwV6QRZMtyll9rOpxkbw6NPlpfBqkc3xS51bbxivbO/Nve4KD -r12ymjFNF4stXCfJnNqKoZ50BHmEEUDu5Wb0fpVn82XrGw7CYc4iug== ------END RSA PRIVATE KEY-----`), - plainDER: ` -MIIBPAIBAAJBAPASZe+tCPU6p80AjHhDkVsLYa51D35e/YGa8QcZyooeZM8EHozo -KD0fNiKI+53bHdy07N+81VQ8/ejPcRoXPlsCAwEAAQJBAMTxIuSq27VpR+zZ7WJf -c6fvv1OBvpMZ0/d1pxL/KnOAgq2rD5hDtk9b0LGhTPgQAmrrMTKuSeGoIuYE+gKQ -QvkCIQD+GC1m+/do+QRurr0uo46Kx1LzLeSCrjBk34wiOp2+dwIhAPHfTLRXS2fv -7rljm0bYa4+eDZpz+E8RcXEgzhhvcQQ9AiAI5eHZJGOyml3MXnQjiPi55WcDOw0w -glcRgT6QCEtz2wIhANSyqaFtosIkHKqrDUGfz/bb5tqMYTAnBruVPaf/WEOBAiEA -9xORWeRG1tRpso4+dYy4KdDkuLPIO01KY6neYGm3BCM=`, - }, - { - kind: PEMCipher3DES, - password: []byte("asdf"), - pemData: []byte(` ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,C1F4A6A03682C2C7 - -0JqVdBEH6iqM7drTkj+e2W/bE3LqakaiWhb9WUVonFkhyu8ca/QzebY3b5gCvAZQ -YwBvDcT/GHospKqPx+cxDHJNsUASDZws6bz8ZXWJGwZGExKzr0+Qx5fgXn44Ms3x -8g1ENFuTXtxo+KoNK0zuAMAqp66Llcds3Fjl4XR18QaD0CrVNAfOdgATWZm5GJxk -Fgx5f84nT+/ovvreG+xeOzWgvtKo0UUZVrhGOgfKLpa57adumcJ6SkUuBtEFpZFB -ldw5w7WC7d13x2LsRkwo8ZrDKgIV+Y9GNvhuCCkTzNP0V3gNeJpd201HZHR+9n3w -3z0VjR/MGqsfcy1ziEWMNOO53At3zlG6zP05aHMnMcZoVXadEK6L1gz++inSSDCq -gI0UJP4e3JVB7AkgYymYAwiYALAkoEIuanxoc50njJk= ------END RSA PRIVATE KEY-----`), - plainDER: ` -MIIBOwIBAAJBANOCXKdoNS/iP/MAbl9cf1/SF3P+Ns7ZeNL27CfmDh0O6Zduaax5 -NBiumd2PmjkaCu7lQ5JOibHfWn+xJsc3kw0CAwEAAQJANX/W8d1Q/sCqzkuAn4xl -B5a7qfJWaLHndu1QRLNTRJPn0Ee7OKJ4H0QKOhQM6vpjRrz+P2u9thn6wUxoPsef -QQIhAP/jCkfejFcy4v15beqKzwz08/tslVjF+Yq41eJGejmxAiEA05pMoqfkyjcx -fyvGhpoOyoCp71vSGUfR2I9CR65oKh0CIC1Msjs66LlfJtQctRq6bCEtFCxEcsP+ -eEjYo/Sk6WphAiEAxpgWPMJeU/shFT28gS+tmhjPZLpEoT1qkVlC14u0b3ECIQDX -tZZZxCtPAm7shftEib0VU77Lk8MsXJcx2C4voRsjEw==`, - }, - { - kind: PEMCipherAES128, - password: []byte("asdf"), - pemData: []byte(` ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-128-CBC,D4492E793FC835CC038A728ED174F78A - -EyfQSzXSjv6BaNH+NHdXRlkHdimpF9izWlugVJAPApgXrq5YldPe2aGIOFXyJ+QE -ZIG20DYqaPzJRjTEbPNZ6Es0S2JJ5yCpKxwJuDkgJZKtF39Q2i36JeGbSZQIuWJE -GZbBpf1jDH/pr0iGonuAdl2PCCZUiy+8eLsD2tyviHUkFLOB+ykYoJ5t8ngZ/B6D -33U43LLb7+9zD4y3Q9OVHqBFGyHcxCY9+9Qh4ZnFp7DTf6RY5TNEvE3s4g6aDpBs -3NbvRVvYTgs8K9EPk4K+5R+P2kD8J8KvEIGxVa1vz8QoCJ/jr7Ka2rvNgPCex5/E -080LzLHPCrXKdlr/f50yhNWq08ZxMWQFkui+FDHPDUaEELKAXV8/5PDxw80Rtybo -AVYoCVIbZXZCuCO81op8UcOgEpTtyU5Lgh3Mw5scQL0= ------END RSA PRIVATE KEY-----`), - plainDER: ` -MIIBOgIBAAJBAMBlj5FxYtqbcy8wY89d/S7n0+r5MzD9F63BA/Lpl78vQKtdJ5dT -cDGh/rBt1ufRrNp0WihcmZi7Mpl/3jHjiWECAwEAAQJABNOHYnKhtDIqFYj1OAJ3 -k3GlU0OlERmIOoeY/cL2V4lgwllPBEs7r134AY4wMmZSBUj8UR/O4SNO668ElKPE -cQIhAOuqY7/115x5KCdGDMWi+jNaMxIvI4ETGwV40ykGzqlzAiEA0P9oEC3m9tHB -kbpjSTxaNkrXxDgdEOZz8X0uOUUwHNsCIAwzcSCiGLyYJTULUmP1ESERfW1mlV78 -XzzESaJpIM/zAiBQkSTcl9VhcJreQqvjn5BnPZLP4ZHS4gPwJAGdsj5J4QIhAOVR -B3WlRNTXR2WsJ5JdByezg9xzdXzULqmga0OE339a`, - }, - { - kind: PEMCipherAES192, - password: []byte("asdf"), - pemData: []byte(` ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-192-CBC,E2C9FB02BCA23ADE1829F8D8BC5F5369 - -cqVslvHqDDM6qwU6YjezCRifXmKsrgEev7ng6Qs7UmDJOpHDgJQZI9fwMFUhIyn5 -FbCu1SHkLMW52Ld3CuEqMnzWMlhPrW8tFvUOrMWPYSisv7nNq88HobZEJcUNL2MM -Y15XmHW6IJwPqhKyLHpWXyOCVEh4ODND2nV15PCoi18oTa475baxSk7+1qH7GuIs -Rb7tshNTMqHbCpyo9Rn3UxeFIf9efdl8YLiMoIqc7J8E5e9VlbeQSdLMQOgDAQJG -ReUtTw8exmKsY4gsSjhkg5uiw7/ZB1Ihto0qnfQJgjGc680qGkT1d6JfvOfeYAk6 -xn5RqS/h8rYAYm64KnepfC9vIujo4NqpaREDmaLdX5MJPQ+SlytITQvgUsUq3q/t -Ss85xjQEZH3hzwjQqdJvmA4hYP6SUjxYpBM+02xZ1Xw= ------END RSA PRIVATE KEY-----`), - plainDER: ` -MIIBOwIBAAJBAMGcRrZiNNmtF20zyS6MQ7pdGx17aFDl+lTl+qnLuJRUCMUG05xs -OmxmL/O1Qlf+bnqR8Bgg65SfKg21SYuLhiMCAwEAAQJBAL94uuHyO4wux2VC+qpj -IzPykjdU7XRcDHbbvksf4xokSeUFjjD3PB0Qa83M94y89ZfdILIqS9x5EgSB4/lX -qNkCIQD6cCIqLfzq/lYbZbQgAAjpBXeQVYsbvVtJrPrXJAlVVQIhAMXpDKMeFPMn -J0g2rbx1gngx0qOa5r5iMU5w/noN4W2XAiBjf+WzCG5yFvazD+dOx3TC0A8+4x3P -uZ3pWbaXf5PNuQIgAcdXarvhelH2w2piY1g3BPeFqhzBSCK/yLGxR82KIh8CIQDD -+qGKsd09NhQ/G27y/DARzOYtml1NvdmCQAgsDIIOLA==`, - }, - { - kind: PEMCipherAES256, - password: []byte("asdf"), - pemData: []byte(` ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-256-CBC,8E7ED5CD731902CE938957A886A5FFBD - -4Mxr+KIzRVwoOP0wwq6caSkvW0iS+GE2h2Ov/u+n9ZTMwL83PRnmjfjzBgfRZLVf -JFPXxUK26kMNpIdssNnqGOds+DhB+oSrsNKoxgxSl5OBoYv9eJTVYm7qOyAFIsjr -DRKAcjYCmzfesr7PVTowwy0RtHmYwyXMGDlAzzZrEvaiySFFmMyKKvtoavwaFoc7 -Pz3RZScwIuubzTGJ1x8EzdffYOsdCa9Mtgpp3L136+23dOd6L/qK2EG2fzrJSHs/ -2XugkleBFSMKzEp9mxXKRfa++uidQvMZTFLDK9w5YjrRvMBo/l2BoZIsq0jAIE1N -sv5Z/KwlX+3MDEpPQpUwGPlGGdLnjI3UZ+cjgqBcoMiNc6HfgbBgYJSU6aDSHuCk -clCwByxWkBNgJ2GrkwNrF26v+bGJJJNR4SKouY1jQf0= ------END RSA PRIVATE KEY-----`), - plainDER: ` -MIIBOgIBAAJBAKy3GFkstoCHIEeUU/qO8207m8WSrjksR+p9B4tf1w5k+2O1V/GY -AQ5WFCApItcOkQe/I0yZZJk/PmCqMzSxrc8CAwEAAQJAOCAz0F7AW9oNelVQSP8F -Sfzx7O1yom+qWyAQQJF/gFR11gpf9xpVnnyu1WxIRnDUh1LZwUsjwlDYb7MB74id -oQIhANPcOiLwOPT4sIUpRM5HG6BF1BI7L77VpyGVk8xNP7X/AiEA0LMHZtk4I+lJ -nClgYp4Yh2JZ1Znbu7IoQMCEJCjwKDECIGd8Dzm5tViTkUW6Hs3Tlf73nNs65duF -aRnSglss8I3pAiEAonEnKruawgD8RavDFR+fUgmQiPz4FnGGeVgfwpGG1JECIBYq -PXHYtPqxQIbD2pScR5qum7iGUh11lEUPkmt+2uqS`, - }, - { - // generated with: - // openssl genrsa -aes128 -passout pass:asdf -out server.orig.key 128 - kind: PEMCipherAES128, - password: []byte("asdf"), - pemData: []byte(` ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-128-CBC,74611ABC2571AF11B1BF9B69E62C89E7 - -6ei/MlytjE0FFgZOGQ+jrwomKfpl8kdefeE0NSt/DMRrw8OacHAzBNi3pPEa0eX3 -eND9l7C9meCirWovjj9QWVHrXyugFuDIqgdhQ8iHTgCfF3lrmcttVrbIfMDw+smD -hTP8O1mS/MHl92NE0nhv0w== ------END RSA PRIVATE KEY-----`), - plainDER: ` -MGMCAQACEQC6ssxmYuauuHGOCDAI54RdAgMBAAECEQCWIn6Yv2O+kBcDF7STctKB -AgkA8SEfu/2i3g0CCQDGNlXbBHX7kQIIK3Ww5o0cYbECCQDCimPb0dYGsQIIeQ7A -jryIst8=`, - }, -} - -const incompleteBlockPEM = ` ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-128-CBC,74611ABC2571AF11B1BF9B69E62C89E7 - -6L8yXK2MTQUWBk4ZD6OvCiYp+mXyR1594TQ1K38MxGvDw5pwcDME2Lek8RrR5fd40P2XsL2Z4KKt -ai+OP1BZUetfK6AW4MiqB2FDyIdOAJ8XeWuZy21Wtsh8wPD6yYOFM/w7WZL8weX3Y0TSeG/T ------END RSA PRIVATE KEY-----` - -func TestIncompleteBlock(t *testing.T) { - // incompleteBlockPEM contains ciphertext that is not a multiple of the - // block size. This previously panicked. See #11215. - block, _ := pem.Decode([]byte(incompleteBlockPEM)) - _, err := DecryptPEMBlock(block, []byte("foo")) - if err == nil { - t.Fatal("Bad PEM data decrypted successfully") - } - const expectedSubstr = "block size" - if e := err.Error(); !strings.Contains(e, expectedSubstr) { - t.Fatalf("Expected error containing %q but got: %q", expectedSubstr, e) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/pkcs8_test.go b/vendor/github.com/google/certificate-transparency-go/x509/pkcs8_test.go deleted file mode 100644 index c8f11e6..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/pkcs8_test.go +++ /dev/null @@ -1,109 +0,0 @@ -// 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. - -package x509 - -import ( - "bytes" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rsa" - "encoding/hex" - "reflect" - "testing" -) - -// Generated using: -// openssl genrsa 1024 | openssl pkcs8 -topk8 -nocrypt -var pkcs8RSAPrivateKeyHex = `30820278020100300d06092a864886f70d0101010500048202623082025e02010002818100cfb1b5bf9685ffa97b4f99df4ff122b70e59ac9b992f3bc2b3dde17d53c1a34928719b02e8fd17839499bfbd515bd6ef99c7a1c47a239718fe36bfd824c0d96060084b5f67f0273443007a24dfaf5634f7772c9346e10eb294c2306671a5a5e719ae24b4de467291bc571014b0e02dec04534d66a9bb171d644b66b091780e8d020301000102818100b595778383c4afdbab95d2bfed12b3f93bb0a73a7ad952f44d7185fd9ec6c34de8f03a48770f2009c8580bcd275e9632714e9a5e3f32f29dc55474b2329ff0ebc08b3ffcb35bc96e6516b483df80a4a59cceb71918cbabf91564e64a39d7e35dce21cb3031824fdbc845dba6458852ec16af5dddf51a8397a8797ae0337b1439024100ea0eb1b914158c70db39031dd8904d6f18f408c85fbbc592d7d20dee7986969efbda081fdf8bc40e1b1336d6b638110c836bfdc3f314560d2e49cd4fbde1e20b024100e32a4e793b574c9c4a94c8803db5152141e72d03de64e54ef2c8ed104988ca780cd11397bc359630d01b97ebd87067c5451ba777cf045ca23f5912f1031308c702406dfcdbbd5a57c9f85abc4edf9e9e29153507b07ce0a7ef6f52e60dcfebe1b8341babd8b789a837485da6c8d55b29bbb142ace3c24a1f5b54b454d01b51e2ad03024100bd6a2b60dee01e1b3bfcef6a2f09ed027c273cdbbaf6ba55a80f6dcc64e4509ee560f84b4f3e076bd03b11e42fe71a3fdd2dffe7e0902c8584f8cad877cdc945024100aa512fa4ada69881f1d8bb8ad6614f192b83200aef5edf4811313d5ef30a86cbd0a90f7b025c71ea06ec6b34db6306c86b1040670fd8654ad7291d066d06d031` - -// Generated using: -// openssl ecparam -genkey -name secp224r1 | openssl pkcs8 -topk8 -nocrypt -var pkcs8P224PrivateKeyHex = `3078020100301006072a8648ce3d020106052b810400210461305f020101041cca3d72b3e88fed2684576dad9b80a9180363a5424986900e3abcab3fa13c033a0004f8f2a6372872a4e61263ed893afb919576a4cacfecd6c081a2cbc76873cf4ba8530703c6042b3a00e2205087e87d2435d2e339e25702fae1` - -// Generated using: -// openssl ecparam -genkey -name secp256r1 | openssl pkcs8 -topk8 -nocrypt -var pkcs8P256PrivateKeyHex = `308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b0201010420dad6b2f49ca774c36d8ae9517e935226f667c929498f0343d2424d0b9b591b43a14403420004b9c9b90095476afe7b860d8bd43568cab7bcb2eed7b8bf2fa0ce1762dd20b04193f859d2d782b1e4cbfd48492f1f533113a6804903f292258513837f07fda735` - -// Generated using: -// openssl ecparam -genkey -name secp384r1 | openssl pkcs8 -topk8 -nocrypt -var pkcs8P384PrivateKeyHex = `3081b6020100301006072a8648ce3d020106052b8104002204819e30819b02010104309bf832f6aaaeacb78ce47ffb15e6fd0fd48683ae79df6eca39bfb8e33829ac94aa29d08911568684c2264a08a4ceb679a164036200049070ad4ed993c7770d700e9f6dc2baa83f63dd165b5507f98e8ff29b5d2e78ccbe05c8ddc955dbf0f7497e8222cfa49314fe4e269459f8e880147f70d785e530f2939e4bf9f838325bb1a80ad4cf59272ae0e5efe9a9dc33d874492596304bd3` - -// Generated using: -// openssl ecparam -genkey -name secp521r1 | openssl pkcs8 -topk8 -nocrypt -// -// Note that OpenSSL will truncate the private key if it can (i.e. it emits it -// like an integer, even though it's an OCTET STRING field). Thus if you -// regenerate this you may, randomly, find that it's a byte shorter than -// expected and the Go test will fail to recreate it exactly. -var pkcs8P521PrivateKeyHex = `3081ee020100301006072a8648ce3d020106052b810400230481d63081d3020101044200cfe0b87113a205cf291bb9a8cd1a74ac6c7b2ebb8199aaa9a5010d8b8012276fa3c22ac913369fa61beec2a3b8b4516bc049bde4fb3b745ac11b56ab23ac52e361a1818903818600040138f75acdd03fbafa4f047a8e4b272ba9d555c667962b76f6f232911a5786a0964e5edea6bd21a6f8725720958de049c6e3e6661c1c91b227cebee916c0319ed6ca003db0a3206d372229baf9dd25d868bf81140a518114803ce40c1855074d68c4e9dab9e65efba7064c703b400f1767f217dac82715ac1f6d88c74baf47a7971de4ea` - -func TestPKCS8(t *testing.T) { - tests := []struct { - name string - keyHex string - keyType reflect.Type - curve elliptic.Curve - }{ - { - name: "RSA private key", - keyHex: pkcs8RSAPrivateKeyHex, - keyType: reflect.TypeOf(&rsa.PrivateKey{}), - }, - { - name: "P-224 private key", - keyHex: pkcs8P224PrivateKeyHex, - keyType: reflect.TypeOf(&ecdsa.PrivateKey{}), - curve: elliptic.P224(), - }, - { - name: "P-256 private key", - keyHex: pkcs8P256PrivateKeyHex, - keyType: reflect.TypeOf(&ecdsa.PrivateKey{}), - curve: elliptic.P256(), - }, - { - name: "P-384 private key", - keyHex: pkcs8P384PrivateKeyHex, - keyType: reflect.TypeOf(&ecdsa.PrivateKey{}), - curve: elliptic.P384(), - }, - { - name: "P-521 private key", - keyHex: pkcs8P521PrivateKeyHex, - keyType: reflect.TypeOf(&ecdsa.PrivateKey{}), - curve: elliptic.P521(), - }, - } - - for _, test := range tests { - derBytes, err := hex.DecodeString(test.keyHex) - if err != nil { - t.Errorf("%s: failed to decode hex: %s", test.name, err) - continue - } - privKey, err := ParsePKCS8PrivateKey(derBytes) - if err != nil { - t.Errorf("%s: failed to decode PKCS#8: %s", test.name, err) - continue - } - if reflect.TypeOf(privKey) != test.keyType { - t.Errorf("%s: decoded PKCS#8 returned unexpected key type: %T", test.name, privKey) - continue - } - if ecKey, isEC := privKey.(*ecdsa.PrivateKey); isEC && ecKey.Curve != test.curve { - t.Errorf("%s: decoded PKCS#8 returned unexpected curve %#v", test.name, ecKey.Curve) - continue - } - reserialised, err := MarshalPKCS8PrivateKey(privKey) - if err != nil { - t.Errorf("%s: failed to marshal into PKCS#8: %s", test.name, err) - continue - } - if !bytes.Equal(derBytes, reserialised) { - t.Errorf("%s: marshalled PKCS#8 didn't match original: got %x, want %x", test.name, reserialised, derBytes) - continue - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/revoked_test.go b/vendor/github.com/google/certificate-transparency-go/x509/revoked_test.go deleted file mode 100644 index ae621e2..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/revoked_test.go +++ /dev/null @@ -1,2123 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package x509 - -import ( - "encoding/pem" - "math/big" - "reflect" - "strings" - "testing" - "time" - - "github.com/google/certificate-transparency-go/asn1" - "github.com/google/certificate-transparency-go/x509/pkix" -) - -func TestParseCertificateList(t *testing.T) { - var tests = []struct { - desc string - data string // as hex - want TBSCertList - wantErr string - }{ - { - desc: "valid-certlist", - data: ("3082026c" + // SEQUENCE CertificateList - ("30820154" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3081a4" + // SEQUENCE OF - ("3027" + - ("0208" + "764bedd38afd51f7") + // serial number - ("170d" + "3137303131333134313835385a") + // revocation time - ("300c" + - ("300a" + - ("0603" + "551d15") + - ("0403" + "0a0103")))) + - ("3027" + - ("0208" + "3b772e5f1202118e") + - ("170d" + "3137303531303130353530375a") + - ("300c" + - ("300a" + - ("0603" + "551d15") + - ("0403" + "0a0101")))) + - ("3027" + - ("0208" + "0b54e3090079ad4b") + - ("170d" + "3137303431323038353331375a") + - ("300c" + - ("300a" + - ("0603" + "551d15") + - ("0403" + "0a0101")))) + - ("3027" + - ("0208" + "31da3380182af9b2") + - ("170d" + "3136303931353230323231335a") + - ("300c" + - ("300a" + - ("0603" + "551d15") + - ("0403" + "0a0103"))))) + - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{ - &RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(0x764bedd38afd51f7), - RevocationTime: time.Date(2017, 1, 13, 14, 18, 58, 0, time.UTC), - }, - RevocationReason: AffiliationChanged, - }, - &RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(0x3b772e5f1202118e), - RevocationTime: time.Date(2017, 5, 10, 10, 55, 7, 0, time.UTC), - }, - RevocationReason: KeyCompromise, - }, - &RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(0x0b54e3090079ad4b), - RevocationTime: time.Date(2017, 4, 12, 8, 53, 17, 0, time.UTC), - }, - RevocationReason: KeyCompromise, - }, - &RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(0x31da3380182af9b2), - RevocationTime: time.Date(2016, 9, 15, 20, 22, 13, 0, time.UTC), - }, - RevocationReason: AffiliationChanged, - }, - }, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - }, - }, - { - desc: "invalid-cert-critical-ext-revocation-time", - data: ("3082026f" + // SEQUENCE CertificateList - ("30820157" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3081a7" + // SEQUENCE OF - ("302a" + - ("0208" + "764bedd38afd51f7") + // serial number - ("170d" + "3137303131333134313835385a") + // revocation time - ("300f" + - ("300d" + - ("0603" + "551d15") + - ("0101ff") + // INVALID critical: true - ("0403" + "0a0103")))) + - ("3027" + - ("0208" + "3b772e5f1202118e") + - ("170d" + "3137303531303130353530375a") + - ("300c" + - ("300a" + - ("0603" + "551d15") + - ("0403" + "0a0101")))) + - ("3027" + - ("0208" + "0b54e3090079ad4b") + - ("170d" + "3137303431323038353331375a") + - ("300c" + - ("300a" + - ("0603" + "551d15") + - ("0403" + "0a0101")))) + - ("3027" + - ("0208" + "31da3380182af9b2") + - ("170d" + "3136303931353230323231335a") + - ("300c" + - ("300a" + - ("0603" + "551d15") + - ("0403" + "0a0103"))))) + - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "marked critical", - }, - { - desc: "invalid-unknown-critical-ext", - data: ("308201c9" + // SEQUENCE CertificateList - ("3081b2" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a033" + - ("3031" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d1f") + // OID: unknown - ("0101ff") + // critical: true - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "unhandled critical extension", - }, - { - desc: "invalid-unknown-ext-trailing-data", - data: ("308201c9" + // SEQUENCE CertificateList - ("3081b2" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a033" + - ("3031" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d1f") + // OID: unknown - ("010100") + // critical: false - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369") + - "00"), - wantErr: "trailing data", - }, - { - desc: "invalid-wrong-asn1", - data: "0a0101", - wantErr: "structure error", - }, - // The following example is used as the template for other variations - { - desc: "valid-empty-certlist", - data: ("308201c6" + // SEQUENCE CertificateList - ("3081af" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - }, - }, - { - desc: "valid-delta-crl-indicator-ext", - data: ("308201d6" + // SEQUENCE CertificateList - ("3081bf" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a040" + - ("303e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d1b") + // OID: delta-crl-indicator - ("0101ff") + // critical: true - ("0404" + "02020120")) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: 288, - }, - }, - { - desc: "invalid-delta-crl-indicator-ext-non-critical", - data: ("308201d6" + // SEQUENCE CertificateList - ("3081bf" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a040" + - ("303e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d1b") + // OID: delta-crl-indicator - ("010100") + // INVALID: critical: false - ("0404" + "02020120")) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "marked non-critical", - }, - { - desc: "invalid-delta-crl-indicator-ext-wrong-asn1", - data: ("308201d6" + // SEQUENCE CertificateList - ("3081bf" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a040" + - ("303e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d1b") + // OID: delta-crl-indicator - ("0101ff") + // critical: true - ("0404" + "0a020123")) + // INVALID: tag ENUM not int - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "failed to unmarshal", - }, - { - desc: "invalid-delta-crl-indicator-ext-trailing-data", - data: ("308201d6" + // SEQUENCE CertificateList - ("3081bf" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a040" + - ("303e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d1b") + // OID: delta-crl-indicator - ("0101ff") + // critical: true - ("0404" + "020101DD")) + // INVALID: trailing data - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "trailing data", - }, - { - desc: "invalid-delta-crl-indicator-ext-negative", - data: ("308201d6" + // SEQUENCE CertificateList - ("3081bf" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a040" + - ("303e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d1b") + // OID: delta-crl-indicator - ("0101ff") + // critical: true - ("0404" + "02028120")) + // INVALID: negative base CRL - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "negative", - }, - { - desc: "invalid-crl-number-ext-critical", - data: ("308201c9" + // SEQUENCE CertificateList - ("3081b2" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a033" + - ("3031" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d14") + // OID: CRL-number - ("0101ff") + // critical: true - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "marked critical", - }, - { - desc: "invalid-crl-number-ext-trailing-data", - data: ("308201c6" + // SEQUENCE CertificateList - ("3081af" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "0201" + "0623"))))) + // INVALID: trailing data - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "trailing data", - }, - { - desc: "invalid-crl-number-ext-negative", - data: ("308201c6" + // SEQUENCE CertificateList - ("3081af" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "0202" + "8623"))))) + // INVALID: negative value - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "negative", - }, - { - desc: "invalid-crl-number-ext-wrong-asn1", - data: ("308201c6" + // SEQUENCE CertificateList - ("3081af" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "0a02" + "0623"))))) + // INVALID: enum tag - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "structure error", - }, - { - desc: "invalid-auth-key-id-ext-trailing-data", - data: ("308201c6" + // SEQUENCE CertificateList - ("3081af" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3015" + - "8013" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + // INVALID: trailing data - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "0202" + "0623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "trailing data", - }, - { - desc: "invalid-auth-key-id-ext-wrong-asn1", - data: ("308201c6" + // SEQUENCE CertificateList - ("3081af" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // no revoked certs - ("a030" + - ("302e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3116" + // INVALID: set not sequence - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "0202" + "0623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "failed to unmarshal", - }, - - { - desc: "valid-auth-info-access-ext-ca-issuer", - data: ("308201ee" + // SEQUENCE CertificateList - ("3081d7" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a058" + - ("3056" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("3026" + - ("0608" + "2b06010505070101") + // OID: authority-info-access - ("041a" + - ("3018" + - ("3016" + - ("0608" + "2b06010505073002") + // OID: CA issuers - ("860a" + "687474703a2f2f777777"))))) + // 'http://www' - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - IssuingCertificateURL: []string{"http://www"}, - }, - }, - { - desc: "valid-auth-info-access-ext-ocsp-server", - data: ("308201ee" + // SEQUENCE CertificateList - ("3081d7" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a058" + - ("3056" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("3026" + - ("0608" + "2b06010505070101") + // OID: authority-info-access - ("041a" + - ("3018" + - ("3016" + - ("0608" + "2b06010505073001") + // OID: OCSP - ("860a" + "687474703a2f2f777777"))))) + // 'http://www' - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - OCSPServer: []string{"http://www"}, - }, - }, - { - desc: "valid-auth-info-access-ext-non-uri-ignored", - data: ("308201ee" + // SEQUENCE CertificateList - ("3081d7" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a058" + - ("3056" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("3026" + - ("0608" + "2b06010505070101") + // OID: authority-info-access - ("041a" + - ("3018" + - ("3016" + - ("0608" + "2b06010505073001") + // OID: OCSP - ("820a" + "687474703a2f2f777777"))))) + // dNSName: 'http://www' - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - }, - }, - { - desc: "invalid-auth-info-access-ext-wrong-asn1", - data: ("308201ee" + // SEQUENCE CertificateList - ("3081d7" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a058" + - ("3056" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("3026" + - ("0608" + "2b06010505070101") + // OID: authority-info-access - ("041a" + - ("3018" + - ("3116" + // INVALID: set not sequence - ("0608" + "2b06010505073002") + // OID: CA issuers - ("860a" + "687474703a2f2f777777"))))) + // 'http://www' - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "failed to unmarshal", - }, - { - desc: "invalid-auth-info-access-ext-trailing-data", - data: ("308201ee" + // SEQUENCE CertificateList - ("3081d7" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a058" + - ("3056" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("3026" + - ("0608" + "2b06010505070101") + // OID: authority-info-access - ("041a" + - ("3017" + - ("3015" + - ("0608" + "2b06010505073002") + // OID: CA issuers - ("8609" + "687474703a2f2f7777"))) + "77")) + // INVALID: trailing data - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "trailing data", - }, - { - desc: "valid-issuer-alt-name-ext", - data: ("308201d6" + // SEQUENCE CertificateList - ("3081bf" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a040" + - ("303e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d12") + // OID: issuer-alt-name - ("0407" + - ("3005" + - "8203" + "777777"))) + // [2] dNSName = 'www' - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - IssuerAltNames: GeneralNames{DNSNames: []string{"www"}}, - }, - }, - { - desc: "invalid-issuer-alt-name-ext", - data: ("308201d6" + // SEQUENCE CertificateList - ("3081bf" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a040" + - ("303e" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300e" + - ("0603" + "551d12") + // OID: issuer-alt-name - ("0407" + - ("3005" + - "8903" + "777777"))) + // INVALID: tag 9 not used - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "failed to parse", - }, - { - desc: "valid-freshest-crl-ext", - data: ("308201e3" + // SEQUENCE CertificateList - ("3081cc" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a04d" + - ("304b" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("301b" + - ("0603" + "551d2e") + // OID: freshest-crl - ("0414" + - ("3012" + - ("3010" + - ("a00e" + - ("a00c" + - ("860a" + "687474703a2f2f777777"))))))) + // uRI='http://www' - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - FreshestCRLDistributionPoint: []string{"http://www"}, - }, - }, - { - desc: "invalid-freshest-crl-ext", - data: ("308201e3" + // SEQUENCE CertificateList - ("3081cc" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a04d" + - ("304b" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("301b" + - ("0603" + "551d2e") + // OID: freshest-crl - ("0414" + - ("3112" + // INVALID: set-of not sequence-of - ("3010" + - ("a00e" + - ("a00c" + - ("860a" + "687474703a2f2f777777"))))))) + // uRI='http://www' - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "structure error", - }, - { - desc: "valid-issuing-dp-ext", - data: ("308201d7" + // SEQUENCE CertificateList - ("3081c0" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a041" + - ("303f" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300f" + - ("0603" + "551d1c") + // OID: issuing-distribution-point - ("0101ff") + // critical: true - ("0405" + - ("3003" + // SEQUENCE - "8101" + "ff"))) + // [1]: onlyContainsUserCerts: true - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - want: TBSCertList{ - Version: 1, - Signature: pkix.AlgorithmIdentifier{ - Algorithm: oidSignatureSHA256WithRSA, - Parameters: asn1.RawValue{Class: 0, Tag: 5, Bytes: []byte{}, FullBytes: []byte{5, 0}}, - }, - Issuer: pkix.RDNSequence{ - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCountry, Value: "US"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDOrganization, Value: "Google Inc"}, - }, - []pkix.AttributeTypeAndValue{ - {Type: pkix.OIDCommonName, Value: "Google Internet Authority G2"}, - }, - }, - ThisUpdate: time.Date(2017, 6, 29, 01, 0, 2, 0, time.UTC), - NextUpdate: time.Date(2017, 7, 9, 01, 0, 2, 0, time.UTC), - RevokedCertificates: []*RevokedCertificate{}, - AuthorityKeyID: fromHex("4add06161bbcf668b576f581b6bb621aba5a812f"), - CRLNumber: 1571, - BaseCRLNumber: -1, - IssuingDistributionPoint: IssuingDistributionPoint{OnlyContainsUserCerts: true}, - }, - }, - { - desc: "invalid-issuing-dp-ext", - data: ("308201d7" + // SEQUENCE CertificateList - ("3081c0" + // SEQUENCE TBSCertList - ("0201" + "01") + // version 2(0x01) - ("300d" + // SEQUENCE AlgorithmIdentifier - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("3049" + // SEQUENCE Name - ("310b" + - ("3009" + - ("0603" + "550406") + // OID: country - ("1302" + "5553"))) + // "US" - ("3113" + - ("3011" + - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63"))) + // "Google Inc" - ("3125" + - ("3023" + - ("0603" + "550403") + // OID: commonName - ("131c" + "476f6f676c6520496e7465726e657420417574686f72697479204732")))) + - ("170d" + "3137303632393031303030325a") + // UTCTime - ("170d" + "3137303730393031303030325a") + // UTCTime - ("3000") + // SEQUENCE OF no revoked certs - ("a041" + - ("303f" + - ("301f" + - ("0603" + "551d23") + // OID: authority-key-id - ("0418" + - ("3016" + - "8014" + "4add06161bbcf668b576f581b6bb621aba5a812f"))) + - ("300f" + - ("0603" + "551d1c") + // OID: issuing-distribution-point - ("0101ff") + // critical: true - ("0405" + - ("3103" + // INVALID: SET not SEQUENCE - "8101" + "ff"))) + // [1]: onlyContainsUserCerts: true - ("300b" + - ("0603" + "551d14") + // OID: CRL-number - ("0404" + "02020623"))))) + - ("300d" + - ("0609" + "2a864886f70d01010b") + // OID: sha256WithRSA - "0500") + // NULL - ("03820101" + // BIT STRING length 0x101 - "004dcde29667973239cca344c58b72128fb5c5db03efdc75cfb7d9a0410ec03c8cd21160b449cd80224f41ca9d91529295ef7d0179ca4b08bb688cecce13cc07b20ecd87ffde1bc356554083c40bea7a387dacc54b3848b3710acf2fa613d007b12afc37f0a77082655b8dbb6683ba2fc52555e9f74bb5ba9429377ff38e193e799fc05c4c9bbcee29492945a732db67ba3575a79a83427a1f6d18d9ede01c544f3ccd68e5680a9b5418e03e1d80b3e77e69860982a4d21c6b111b07c87fe32c561e871554896b37651d5aaf42b2d092ce8d4dd4ae1d7a97091c0a06c03d71580e0557a51408513fde3012f02dac76536822a564faa2553048729633b68f1fc369")), - wantErr: "failed to unmarshal", - }, - } - - for _, test := range tests { - inData := fromHex(test.data) - got, err := ParseCertificateList(inData) - if err != nil { - if test.wantErr == "" { - t.Errorf("ParseCertificateList(%q)=%+v,%v; want _,nil", test.desc, got, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("ParseCertificateList(%q)=%+v,%v; want _,%q", test.desc, got, err, test.wantErr) - } - continue - } - if test.wantErr != "" { - t.Errorf("ParseCertificateList(%q)=%+v,nil; want _,%q", test.desc, got, test.wantErr) - continue - } - - // Zero out unparsed extensions before comparison to make test data simpler. - got.TBSCertList.Raw = nil - got.TBSCertList.Extensions = nil - for _, rc := range got.TBSCertList.RevokedCertificates { - rc.Extensions = nil - } - - if !reflect.DeepEqual(got.TBSCertList, test.want) { - t.Errorf("ParseCertificateList(%q)=%+v; want %+v", test.desc, got.TBSCertList, test.want) - } - } -} - -func TestParseRevokedCertificate(t *testing.T) { - var tests = []struct { - desc string - data string // as hex - want RevokedCertificate - wantErr string - }{ - // CRL Reason - { - desc: "valid-reason-ext", - data: ("3027" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("300c" + // extensions - ("300a" + // extension - ("0603" + "551d15") + // OID: reason - ("0403" + // octet string - "0a01" + "01")))), // enum:1 - want: RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(4284944556325212558), - RevocationTime: time.Date(2017, 05, 10, 10, 55, 07, 0, time.UTC), - Extensions: []pkix.Extension{ - { - Id: OIDExtensionCRLReasons, - Critical: false, - Value: fromHex("0a01" + "01"), - }, - }, - }, - RevocationReason: KeyCompromise, - }, - }, - { - desc: "invalid-reason-ext-wrong-type", - data: ("3027" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("300c" + // extensions - ("300a" + // extension - ("0603" + "551d15") + // OID: reason - ("0403" + // octet string - "0201" + "01")))), // int:1 - wantErr: "tags don't match", - }, - { - desc: "invalid-reason-ext-trailing-data", - data: ("3028" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("300d" + // extensions - ("300b" + // extension - ("0603" + "551d15") + // OID: reason - ("0404" + // octet string - "0a01" + "01" + "aa")))), // enum:1 - wantErr: "trailing data", - }, - { - desc: "invalid-reason-ext-critical", - data: ("302b" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("3010" + // extensions - ("300e" + // extension - ("0603" + "551d15") + // OID: reason - ("0101ff") + // critical: true - ("0404" + // octet string - "0a01" + "01" + "aa")))), // enum:1 - wantErr: "marked critical", - }, - // Invalidity Date - { - desc: "valid-invalidity-date-ext", - data: ("3033" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("3018" + // extensions - ("3016" + // extension - ("0603" + "551d18") + // OID: invalidity date - ("040f" + // octet string - "170d" + "3137303531303130353530375a")))), - want: RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(4284944556325212558), - RevocationTime: time.Date(2017, 05, 10, 10, 55, 07, 0, time.UTC), - Extensions: []pkix.Extension{ - { - Id: OIDExtensionInvalidityDate, - Critical: false, - Value: fromHex("170d" + "3137303531303130353530375a"), - }, - }, - }, - InvalidityDate: time.Date(2017, 05, 10, 10, 55, 07, 0, time.UTC), - }, - }, - { - desc: "invalid-invalidity-date-ext-wrong-type", - data: ("3027" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("300c" + // extensions - ("300a" + // extension - ("0603" + "551d18") + // OID: invalidity date - ("0403" + // octet string - "0a01" + "01")))), // enum:1 - wantErr: "failed to parse", - }, - { - desc: "invalid-invalidity-date-ext-trailing-data", - data: ("3036" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("301b" + // extensions - ("3019" + // extension - ("0603" + "551d18") + // OID: invalidity date - ("0412" + // octet string - "170d" + "3137303531303130353530375a" + "0a0101")))), - wantErr: "trailing data", - }, - { - desc: "invalid-invalidity-date-ext-critical", - data: ("3036" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("301b" + // extensions - ("3019" + // extension - ("0603" + "551d18") + // OID: invalidity date - ("0101ff") + // critical: true - ("040f" + // octet string - "170d" + "3137303531303130353530375a")))), - wantErr: "marked critical", - }, - // Issuer - { - desc: "valid-issuer-ext", - data: ("303b" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("3020" + // extensions - ("301e" + // extension - ("0603" + "551d1d") + // OID: issuer - ("0101ff") + // critical: true - ("0414" + // octet string - ("3012" + - ("8210" + "7777772e676f6f676c652e636f2e756b")))))), // "www.google.co.uk" - want: RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(4284944556325212558), - RevocationTime: time.Date(2017, 05, 10, 10, 55, 07, 0, time.UTC), - Extensions: []pkix.Extension{ - { - Id: OIDExtensionCertificateIssuer, - Critical: true, - Value: fromHex("3012" + - ("8210" + "7777772e676f6f676c652e636f2e756b")), - }, - }, - }, - Issuer: GeneralNames{ - DNSNames: []string{"www.google.co.uk"}, - }, - }, - }, - { - desc: "invalid-issuer-ext-wrong-type", - data: ("302a" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("300f" + // extensions - ("300d" + // extension - ("0603" + "551d1d") + // OID: issuer - ("0101ff") + // critical: true - ("0403" + // octet string - "0a01" + "01")))), // enum:1 - wantErr: "failed to parse", - }, - { - desc: "invalid-issuer-ext-non-critical", - data: ("303b" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("3020" + // extensions - ("301e" + // extension - ("0603" + "551d1d") + // OID: issuer - ("010100") + // critical: false - ("0414" + // octet string - ("3012" + - ("8210" + "7777772e676f6f676c652e636f2e756b")))))), // "www.google.co.uk" - wantErr: "marked non-critical", - }, - // Unknown extension - { - desc: "valid-unknown-ext", - data: ("3027" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("300c" + // extensions - ("300a" + // extension - ("0603" + "551d14") + // OID: CRL number - ("0403" + // octet string - "0a01" + "01")))), // enum:1 - want: RevokedCertificate{ - RevokedCertificate: pkix.RevokedCertificate{ - SerialNumber: big.NewInt(4284944556325212558), - RevocationTime: time.Date(2017, 05, 10, 10, 55, 07, 0, time.UTC), - Extensions: []pkix.Extension{ - { - Id: OIDExtensionCRLNumber, - Critical: false, - Value: fromHex("0a01" + "01"), - }, - }, - }, - }, - }, - { - desc: "invalid-unknown-ext-critical", - data: ("302a" + // sequence - ("0208" + "3b772e5f1202118e") + // serial number - ("170d" + "3137303531303130353530375a") + // revocation time - ("300f" + // extensions - ("300d" + // extension - ("0603" + "551d14") + // OID: CRL number - ("0101ff") + // critical: true - ("0403" + // octet string - "0a01" + "01")))), // enum:1 - wantErr: "unhandled critical extension", - }, - } - - for _, test := range tests { - inData := fromHex(test.data) - var pkixCert pkix.RevokedCertificate - if _, err := asn1.Unmarshal(inData, &pkixCert); err != nil { - t.Errorf("asn1.Unmarshal(%s)=_,%v; want _,nil", test.data, err) - continue - } - var errs Errors - got := parseRevokedCertificate(pkixCert, &errs) - if len(errs.Errs) > 0 { - err := errs.Errs[0] - if test.wantErr == "" { - t.Errorf("parseRevokedCertificate(%q)=%+v,%v; want _,nil", test.desc, got, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("parseRevokedCertificate(%q)=%+v,%v; want _,%q", test.desc, got, err, test.wantErr) - } - continue - } - if test.wantErr != "" { - t.Errorf("parseRevokedCertificate(%q)=%+v,nil; want _,%q", test.desc, got, test.wantErr) - continue - } - if !reflect.DeepEqual(got, &test.want) { - t.Errorf("parseRevokedCertificate(%q)=%+v; want %+v", test.desc, got, test.want) - } - } -} - -func TestParseIssuingDistributionPoint(t *testing.T) { - var tests = []struct { - data string // as hex - want IssuingDistributionPoint - wantErr string - }{ - { - data: ("3003" + "8101ff"), - want: IssuingDistributionPoint{OnlyContainsUserCerts: true}, - }, - { - data: ("3003" + "8201ff"), - want: IssuingDistributionPoint{OnlyContainsCACerts: true}, - }, - { - data: ("3003" + "8501ff"), - want: IssuingDistributionPoint{OnlyContainsAttributeCerts: true}, - }, - { - data: ("3006" + "810100" + "8501ff"), - want: IssuingDistributionPoint{OnlyContainsAttributeCerts: true}, - }, - { - data: ("3009" + // SEQUENCE - ("a007" + // tag [0] = distributionPoint / DistributionPointName - ("a005" + // CHOICE [0] = fullName / GeneralNames - "8203" + "777777"))), // CHOICE [2] = dNSName - want: IssuingDistributionPoint{ - DistributionPoint: distributionPointName{ - FullName: []asn1.RawValue{ - { - Class: asn1.ClassContextSpecific, - Tag: 2, - IsCompound: false, - Bytes: fromHex("777777"), - FullBytes: fromHex("8203777777"), - }, - }, - }, - }, - }, - { - data: ("3019" + // SEQUENCE - ("a017" + // tag [0] = distributionPoint / DistributionPointName - ("a115" + // CHOICE [1] = nameRelativeToCRLIssuer / RelativeDistinguishedName - ("3113" + // SET OF - ("3011" + // SEQUENCE - ("0603" + "55040a") + // OID: organization - ("130a" + "476f6f676c6520496e63")))))), // "Google Inc" - want: IssuingDistributionPoint{ - DistributionPoint: distributionPointName{ - RelativeName: pkix.RDNSequence{ - pkix.RelativeDistinguishedNameSET{ - pkix.AttributeTypeAndValue{ - Type: pkix.OIDOrganization, - Value: "Google Inc", - }, - }, - }, - }, - }, - }, - { - data: ("3006" + "8101ff" + "8501ff"), - wantErr: "multiple cert", - }, - { - data: ("3003" + "8501ff" + "00"), - wantErr: "trailing data", - }, - { - data: ("3103" + "8101ff"), // INVALID: SET not SEQUENCE - wantErr: "failed to unmarshal", - }, - { - data: ("3009" + // SEQUENCE - ("a007" + // tag [0] = distributionPoint / DistributionPointName - ("a005" + // CHOICE [0] = fullName / GeneralNames - "8903" + "777777"))), // INVALID: choice 9 not allowed - wantErr: "failed to unmarshal GeneralName", - }, - } - for _, test := range tests { - inData := fromHex(test.data) - var got IssuingDistributionPoint - var gn GeneralNames - var errs Errors - parseIssuingDistributionPoint(inData, &got, &gn, &errs) - if !errs.Empty() { - err := errs.Errs[0] - if test.wantErr == "" { - t.Errorf("asn1.Unmarshal(%s)=_,%v; want _,nil", test.data, err) - } else if !strings.Contains(err.Error(), test.wantErr) { - t.Errorf("asn1.Unmarshal(%s)=_,%v; want _,%q", test.data, err, test.wantErr) - } - continue - } - if test.wantErr != "" { - t.Errorf("asn1.Unmarshal(%s)=%+v,nil; want _,%q", test.data, got, test.wantErr) - continue - } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("asn1.Unmarshal(%s)=%+v; want %+v", test.data, got, test.want) - } - } -} - -// CRL for Google Internet Authority G2: -// Certificate Revocation List (CRL): -// Version 2 (0x1) -// Signature Algorithm: sha256WithRSAEncryption -// Issuer: /C=US/O=Google Inc/CN=Google Internet Authority G2 -// Last Update: Jun 29 01:00:02 2017 GMT -// Next Update: Jul 9 01:00:02 2017 GMT -// CRL extensions: -// X509v3 Authority Key Identifier: -// keyid:4A:DD:06:16:1B:BC:F6:68:B5:76:F5:81:B6:BB:62:1A:BA:5A:81:2F -// X509v3 CRL Number: -// 1571 -// Revoked Certificates: -// Serial Number: 764BEDD38AFD51F7 -// Revocation Date: Jan 13 14:18:58 2017 GMT -// CRL entry extensions: -// X509v3 CRL Reason Code: -// Affiliation Changed -// Serial Number: 3B772E5F1202118E -// Revocation Date: May 10 10:55:07 2017 GMT -// CRL entry extensions: -// X509v3 CRL Reason Code: -// Key Compromise -// Serial Number: 0B54E3090079AD4B -// Revocation Date: Apr 12 08:53:17 2017 GMT -// CRL entry extensions: -// X509v3 CRL Reason Code: -// Key Compromise -// Serial Number: 31DA3380182AF9B2 -// Revocation Date: Sep 15 20:22:13 2016 GMT -// CRL entry extensions: -// X509v3 CRL Reason Code: -// Affiliation Changed -// Signature Algorithm: sha256WithRSAEncryption -// 4d:cd:e2:96:67:97:32:39:cc:a3:44:c5:8b:72:12:8f:b5:c5: -// db:03:ef:dc:75:cf:b7:d9:a0:41:0e:c0:3c:8c:d2:11:60:b4: -// 49:cd:80:22:4f:41:ca:9d:91:52:92:95:ef:7d:01:79:ca:4b: -// 08:bb:68:8c:ec:ce:13:cc:07:b2:0e:cd:87:ff:de:1b:c3:56: -// 55:40:83:c4:0b:ea:7a:38:7d:ac:c5:4b:38:48:b3:71:0a:cf: -// 2f:a6:13:d0:07:b1:2a:fc:37:f0:a7:70:82:65:5b:8d:bb:66: -// 83:ba:2f:c5:25:55:e9:f7:4b:b5:ba:94:29:37:7f:f3:8e:19: -// 3e:79:9f:c0:5c:4c:9b:bc:ee:29:49:29:45:a7:32:db:67:ba: -// 35:75:a7:9a:83:42:7a:1f:6d:18:d9:ed:e0:1c:54:4f:3c:cd: -// 68:e5:68:0a:9b:54:18:e0:3e:1d:80:b3:e7:7e:69:86:09:82: -// a4:d2:1c:6b:11:1b:07:c8:7f:e3:2c:56:1e:87:15:54:89:6b: -// 37:65:1d:5a:af:42:b2:d0:92:ce:8d:4d:d4:ae:1d:7a:97:09: -// 1c:0a:06:c0:3d:71:58:0e:05:57:a5:14:08:51:3f:de:30:12: -// f0:2d:ac:76:53:68:22:a5:64:fa:a2:55:30:48:72:96:33:b6: -// 8f:1f:c3:69 -const giag2CRL = `-----BEGIN X509 CRL----- -MIICbDCCAVQCAQEwDQYJKoZIhvcNAQELBQAwSTELMAkGA1UEBhMCVVMxEzARBgNV -BAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRlcm5ldCBBdXRob3Jp -dHkgRzIXDTE3MDYyOTAxMDAwMloXDTE3MDcwOTAxMDAwMlowgaQwJwIIdkvt04r9 -UfcXDTE3MDExMzE0MTg1OFowDDAKBgNVHRUEAwoBAzAnAgg7dy5fEgIRjhcNMTcw -NTEwMTA1NTA3WjAMMAoGA1UdFQQDCgEBMCcCCAtU4wkAea1LFw0xNzA0MTIwODUz -MTdaMAwwCgYDVR0VBAMKAQEwJwIIMdozgBgq+bIXDTE2MDkxNTIwMjIxM1owDDAK -BgNVHRUEAwoBA6AwMC4wHwYDVR0jBBgwFoAUSt0GFhu89mi1dvWBtrtiGrpagS8w -CwYDVR0UBAQCAgYjMA0GCSqGSIb3DQEBCwUAA4IBAQBNzeKWZ5cyOcyjRMWLchKP -tcXbA+/cdc+32aBBDsA8jNIRYLRJzYAiT0HKnZFSkpXvfQF5yksIu2iM7M4TzAey -Ds2H/94bw1ZVQIPEC+p6OH2sxUs4SLNxCs8vphPQB7Eq/Dfwp3CCZVuNu2aDui/F -JVXp90u1upQpN3/zjhk+eZ/AXEybvO4pSSlFpzLbZ7o1daeag0J6H20Y2e3gHFRP -PM1o5WgKm1QY4D4dgLPnfmmGCYKk0hxrERsHyH/jLFYehxVUiWs3ZR1ar0Ky0JLO -jU3Urh16lwkcCgbAPXFYDgVXpRQIUT/eMBLwLax2U2gipWT6olUwSHKWM7aPH8Np ------END X509 CRL-----` - -// Certificate for GIAG2: -// Data: -// Version: 3 (0x2) -// Serial Number: -// 01:00:21:25:88:b0:fa:59:a7:77:ef:05:7b:66:27:df -// Signature Algorithm: sha256WithRSAEncryption -// Issuer: C=US, O=GeoTrust Inc., CN=GeoTrust Global CA -// Validity -// Not Before: May 22 11:32:37 2017 GMT -// Not After : Dec 31 23:59:59 2018 GMT -// Subject: C=US, O=Google Inc, CN=Google Internet Authority G2 -// Subject Public Key Info: -// Public Key Algorithm: rsaEncryption -// Public-Key: (2048 bit) -// Modulus: -// 00:9c:2a:04:77:5c:d8:50:91:3a:06:a3:82:e0:d8: -// 50:48:bc:89:3f:f1:19:70:1a:88:46:7e:e0:8f:c5: -// f1:89:ce:21:ee:5a:fe:61:0d:b7:32:44:89:a0:74: -// 0b:53:4f:55:a4:ce:82:62:95:ee:eb:59:5f:c6:e1: -// 05:80:12:c4:5e:94:3f:bc:5b:48:38:f4:53:f7:24: -// e6:fb:91:e9:15:c4:cf:f4:53:0d:f4:4a:fc:9f:54: -// de:7d:be:a0:6b:6f:87:c0:d0:50:1f:28:30:03:40: -// da:08:73:51:6c:7f:ff:3a:3c:a7:37:06:8e:bd:4b: -// 11:04:eb:7d:24:de:e6:f9:fc:31:71:fb:94:d5:60: -// f3:2e:4a:af:42:d2:cb:ea:c4:6a:1a:b2:cc:53:dd: -// 15:4b:8b:1f:c8:19:61:1f:cd:9d:a8:3e:63:2b:84: -// 35:69:65:84:c8:19:c5:46:22:f8:53:95:be:e3:80: -// 4a:10:c6:2a:ec:ba:97:20:11:c7:39:99:10:04:a0: -// f0:61:7a:95:25:8c:4e:52:75:e2:b6:ed:08:ca:14: -// fc:ce:22:6a:b3:4e:cf:46:03:97:97:03:7e:c0:b1: -// de:7b:af:45:33:cf:ba:3e:71:b7:de:f4:25:25:c2: -// 0d:35:89:9d:9d:fb:0e:11:79:89:1e:37:c5:af:8e: -// 72:69 -// Exponent: 65537 (0x10001) -// X509v3 extensions: -// X509v3 Authority Key Identifier: -// keyid:C0:7A:98:68:8D:89:FB:AB:05:64:0C:11:7D:AA:7D:65:B8:CA:CC:4E -// -// X509v3 Subject Key Identifier: -// 4A:DD:06:16:1B:BC:F6:68:B5:76:F5:81:B6:BB:62:1A:BA:5A:81:2F -// X509v3 Key Usage: critical -// Certificate Sign, CRL Sign -// Authority Information Access: -// OCSP - URI:http://g.symcd.com -// -// X509v3 Basic Constraints: critical -// CA:TRUE, pathlen:0 -// X509v3 CRL Distribution Points: -// -// Full Name: -// URI:http://g.symcb.com/crls/gtglobal.crl -// -// X509v3 Certificate Policies: -// Policy: 1.3.6.1.4.1.11129.2.5.1 -// Policy: 2.23.140.1.2.2 -// -// X509v3 Extended Key Usage: -// TLS Web Server Authentication, TLS Web Client Authentication -// Signature Algorithm: sha256WithRSAEncryption -// ca:49:e5:ac:d7:64:64:77:5b:be:71:fa:cf:f4:1e:23:c7:9a: -// 69:63:54:5f:eb:4c:d6:19:28:23:64:66:8e:1c:c7:87:80:64: -// 5f:04:8b:26:af:98:df:0a:70:bc:bc:19:3d:ee:7b:33:a9:7f: -// bd:f4:05:d4:70:bb:05:26:79:ea:9a:c7:98:b9:07:19:65:34: -// cc:3c:e9:3f:c5:01:fa:6f:0c:7e:db:7a:70:5c:4c:fe:2d:00: -// f0:ca:be:2d:8e:b4:a8:80:fb:01:13:88:cb:9c:3f:e5:bb:77: -// ca:3a:67:36:f3:ce:d5:27:02:72:43:a0:bd:6e:02:f1:47:05: -// 71:3e:01:59:e9:11:9e:1a:f3:84:0f:80:a6:a2:78:35:2f:b6: -// c7:a2:7f:17:7c:e1:8b:56:ae:ee:67:88:51:27:30:60:a5:62: -// 52:c3:37:d5:3b:ea:85:2a:01:38:87:a2:cf:70:ad:a4:7a:c9: -// c4:e7:ca:c5:da:bc:23:32:f2:fe:18:c2:7b:e0:df:3b:2f:d4: -// d0:10:e6:96:4c:fb:44:b7:21:64:0d:b9:00:94:30:12:26:87: -// 58:98:39:05:38:0f:cc:82:48:0c:0a:47:66:ee:bf:b4:5f:c4: -// ff:70:a8:e1:7f:8b:79:2b:b8:65:32:a3:b9:b7:31:e9:0a:f5: -// f6:1f:32:dc -const giag2Cert = `-----BEGIN CERTIFICATE----- -MIIEKDCCAxCgAwIBAgIQAQAhJYiw+lmnd+8Fe2Yn3zANBgkqhkiG9w0BAQsFADBC -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMS -R2VvVHJ1c3QgR2xvYmFsIENBMB4XDTE3MDUyMjExMzIzN1oXDTE4MTIzMTIzNTk1 -OVowSTELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMT -HEdvb2dsZSBJbnRlcm5ldCBBdXRob3JpdHkgRzIwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQCcKgR3XNhQkToGo4Lg2FBIvIk/8RlwGohGfuCPxfGJziHu -Wv5hDbcyRImgdAtTT1WkzoJile7rWV/G4QWAEsRelD+8W0g49FP3JOb7kekVxM/0 -Uw30SvyfVN59vqBrb4fA0FAfKDADQNoIc1Fsf/86PKc3Bo69SxEE630k3ub5/DFx -+5TVYPMuSq9C0svqxGoassxT3RVLix/IGWEfzZ2oPmMrhDVpZYTIGcVGIvhTlb7j -gEoQxirsupcgEcc5mRAEoPBhepUljE5SdeK27QjKFPzOImqzTs9GA5eXA37Asd57 -r0Uzz7o+cbfe9CUlwg01iZ2d+w4ReYkeN8WvjnJpAgMBAAGjggERMIIBDTAfBgNV -HSMEGDAWgBTAephojYn7qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1 -dvWBtrtiGrpagS8wDgYDVR0PAQH/BAQDAgEGMC4GCCsGAQUFBwEBBCIwIDAeBggr -BgEFBQcwAYYSaHR0cDovL2cuc3ltY2QuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAw -NQYDVR0fBC4wLDAqoCigJoYkaHR0cDovL2cuc3ltY2IuY29tL2NybHMvZ3RnbG9i -YWwuY3JsMCEGA1UdIAQaMBgwDAYKKwYBBAHWeQIFATAIBgZngQwBAgIwHQYDVR0l -BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQDKSeWs -12Rkd1u+cfrP9B4jx5ppY1Rf60zWGSgjZGaOHMeHgGRfBIsmr5jfCnC8vBk97nsz -qX+99AXUcLsFJnnqmseYuQcZZTTMPOk/xQH6bwx+23pwXEz+LQDwyr4tjrSogPsB -E4jLnD/lu3fKOmc2887VJwJyQ6C9bgLxRwVxPgFZ6RGeGvOED4Cmong1L7bHon8X -fOGLVq7uZ4hRJzBgpWJSwzfVO+qFKgE4h6LPcK2kesnE58rF2rwjMvL+GMJ74N87 -L9TQEOaWTPtEtyFkDbkAlDASJodYmDkFOA/MgkgMCkdm7r+0X8T/cKjhf4t5K7hl -MqO5tzHpCvX2HzLc ------END CERTIFICATE-----` - -func TestParseGIAG2CertificateList(t *testing.T) { - certList, err := ParseCertificateList([]byte(giag2CRL)) - if err != nil { - t.Fatalf("error parsing: %s", err) - } - if got, want := len(certList.TBSCertList.RevokedCertificates), 4; got != want { - t.Errorf("len(ParseCertificateList(crl).TBSCertList.RevokedCertificates) = %d; want %d", got, want) - } - - when := time.Date(2017, 7, 7, 12, 0, 0, 0, time.UTC) - if certList.ExpiredAt(when) { - t.Errorf("certList.ExpiredAt(%v)=true; want false", when) - } - if got, want := certList.TBSCertList.CRLNumber, 1571; got != want { - t.Errorf("ParseCertificateList(crl).TBSCertList.CRLNumber = %d; want %d", got, want) - } - - pemBlock, _ := pem.Decode([]byte(giag2Cert)) - giag2, err := ParseCertificate(pemBlock.Bytes) - if err != nil { - t.Fatalf("error parsing GIAG2 cert: %v", err) - } - if err := giag2.CheckCertificateListSignature(certList); err != nil { - t.Errorf("CheckCertificateListSignature(giag2CRL)=%v; want nil", err) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/root_darwin_test.go b/vendor/github.com/google/certificate-transparency-go/x509/root_darwin_test.go deleted file mode 100644 index d935cc4..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/root_darwin_test.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2013 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. - -package x509 - -import ( - "runtime" - "testing" - "time" -) - -func TestSystemRoots(t *testing.T) { - switch runtime.GOARCH { - case "arm", "arm64": - t.Skipf("skipping on %s/%s, no system root", runtime.GOOS, runtime.GOARCH) - } - - switch runtime.GOOS { - case "darwin": - t.Skipf("skipping on %s/%s until cgo part of golang.org/issue/16532 has been implemented.", runtime.GOOS, runtime.GOARCH) - } - - t0 := time.Now() - sysRoots := systemRootsPool() // actual system roots - sysRootsDuration := time.Since(t0) - - t1 := time.Now() - execRoots, err := execSecurityRoots() // non-cgo roots - execSysRootsDuration := time.Since(t1) - - if err != nil { - t.Fatalf("failed to read system roots: %v", err) - } - - t.Logf(" cgo sys roots: %v", sysRootsDuration) - t.Logf("non-cgo sys roots: %v", execSysRootsDuration) - - for _, tt := range []*CertPool{sysRoots, execRoots} { - if tt == nil { - t.Fatal("no system roots") - } - // On Mavericks, there are 212 bundled certs, at least - // there was at one point in time on one machine. - // (Maybe it was a corp laptop with extra certs?) - // Other OS X users report - // 135, 142, 145... Let's try requiring at least 100, - // since this is just a sanity check. - t.Logf("got %d roots", len(tt.certs)) - if want, have := 100, len(tt.certs); have < want { - t.Fatalf("want at least %d system roots, have %d", want, have) - } - } - - // Check that the two cert pools are roughly the same; - // |A∩B| > max(|A|, |B|) / 2 should be a reasonably robust check. - - isect := make(map[string]bool, len(sysRoots.certs)) - for _, c := range sysRoots.certs { - isect[string(c.Raw)] = true - } - - have := 0 - for _, c := range execRoots.certs { - if isect[string(c.Raw)] { - have++ - } - } - - var want int - if nsys, nexec := len(sysRoots.certs), len(execRoots.certs); nsys > nexec { - want = nsys / 2 - } else { - want = nexec / 2 - } - - if have < want { - t.Errorf("insufficient overlap between cgo and non-cgo roots; want at least %d, have %d", want, have) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/root_unix_test.go b/vendor/github.com/google/certificate-transparency-go/x509/root_unix_test.go deleted file mode 100644 index 03f935d..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/root_unix_test.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2017 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 dragonfly freebsd linux netbsd openbsd solaris - -package x509 - -import ( - "fmt" - "os" - "testing" -) - -const ( - testDir = "testdata" - testDirCN = "test-dir" - testFile = "test-file.crt" - testFileCN = "test-file" - testMissing = "missing" -) - -func TestEnvVars(t *testing.T) { - testCases := []struct { - name string - fileEnv string - dirEnv string - files []string - dirs []string - cns []string - }{ - { - // Environment variables override the default locations preventing fall through. - name: "override-defaults", - fileEnv: testMissing, - dirEnv: testMissing, - files: []string{testFile}, - dirs: []string{testDir}, - cns: nil, - }, - { - // File environment overrides default file locations. - name: "file", - fileEnv: testFile, - dirEnv: "", - files: nil, - dirs: nil, - cns: []string{testFileCN}, - }, - { - // Directory environment overrides default directory locations. - name: "dir", - fileEnv: "", - dirEnv: testDir, - files: nil, - dirs: nil, - cns: []string{testDirCN}, - }, - { - // File & directory environment overrides both default locations. - name: "file+dir", - fileEnv: testFile, - dirEnv: testDir, - files: nil, - dirs: nil, - cns: []string{testFileCN, testDirCN}, - }, - { - // Environment variable empty / unset uses default locations. - name: "empty-fall-through", - fileEnv: "", - dirEnv: "", - files: []string{testFile}, - dirs: []string{testDir}, - cns: []string{testFileCN, testDirCN}, - }, - } - - // Save old settings so we can restore before the test ends. - origCertFiles, origCertDirectories := certFiles, certDirectories - origFile, origDir := os.Getenv(certFileEnv), os.Getenv(certDirEnv) - defer func() { - certFiles = origCertFiles - certDirectories = origCertDirectories - os.Setenv(certFileEnv, origFile) - os.Setenv(certDirEnv, origDir) - }() - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - if err := os.Setenv(certFileEnv, tc.fileEnv); err != nil { - t.Fatalf("setenv %q failed: %v", certFileEnv, err) - } - if err := os.Setenv(certDirEnv, tc.dirEnv); err != nil { - t.Fatalf("setenv %q failed: %v", certDirEnv, err) - } - - certFiles, certDirectories = tc.files, tc.dirs - - r, err := loadSystemRoots() - if err != nil { - t.Fatal("unexpected failure:", err) - } - - if r == nil { - if tc.cns == nil { - // Expected nil - return - } - t.Fatal("nil roots") - } - - // Verify that the returned certs match, otherwise report where the mismatch is. - for i, cn := range tc.cns { - if i >= len(r.certs) { - t.Errorf("missing cert %v @ %v", cn, i) - } else if r.certs[i].Subject.CommonName != cn { - fmt.Printf("%#v\n", r.certs[0].Subject) - t.Errorf("unexpected cert common name %q, want %q", r.certs[i].Subject.CommonName, cn) - } - } - if len(r.certs) > len(tc.cns) { - t.Errorf("got %v certs, which is more than %v wanted", len(r.certs), len(tc.cns)) - } - }) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/sec1_test.go b/vendor/github.com/google/certificate-transparency-go/x509/sec1_test.go deleted file mode 100644 index 573c937..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/sec1_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -package x509 - -import ( - "bytes" - "encoding/hex" - "testing" -) - -var ecKeyTests = []struct { - derHex string - shouldReserialize bool -}{ - // Generated using: - // openssl ecparam -genkey -name secp384r1 -outform PEM - {"3081a40201010430bdb9839c08ee793d1157886a7a758a3c8b2a17a4df48f17ace57c72c56b4723cf21dcda21d4e1ad57ff034f19fcfd98ea00706052b81040022a16403620004feea808b5ee2429cfcce13c32160e1c960990bd050bb0fdf7222f3decd0a55008e32a6aa3c9062051c4cba92a7a3b178b24567412d43cdd2f882fa5addddd726fe3e208d2c26d733a773a597abb749714df7256ead5105fa6e7b3650de236b50", true}, - // This key was generated by GnuTLS and has illegal zero-padding of the - // private key. See https://golang.org/issues/13699. - {"3078020101042100f9f43a04b9bdc3ab01f53be6df80e7a7bc3eaf7b87fc24e630a4a0aa97633645a00a06082a8648ce3d030107a1440342000441a51bc318461b4c39a45048a16d4fc2a935b1ea7fe86e8c1fa219d6f2438f7c7fd62957d3442efb94b6a23eb0ea66dda663dc42f379cda6630b21b7888a5d3d", false}, - // This was generated using an old version of OpenSSL and is missing a - // leading zero byte in the private key that should be present. - {"3081db0201010441607b4f985774ac21e633999794542e09312073480baa69550914d6d43d8414441e61b36650567901da714f94dffb3ce0e2575c31928a0997d51df5c440e983ca17a00706052b81040023a181890381860004001661557afedd7ac8d6b70e038e576558c626eb62edda36d29c3a1310277c11f67a8c6f949e5430a37dcfb95d902c1b5b5379c389873b9dd17be3bdb088a4774a7401072f830fb9a08d93bfa50a03dd3292ea07928724ddb915d831917a338f6b0aecfbc3cf5352c4a1295d356890c41c34116d29eeb93779aab9d9d78e2613437740f6", false}, -} - -func TestParseECPrivateKey(t *testing.T) { - for i, test := range ecKeyTests { - derBytes, _ := hex.DecodeString(test.derHex) - key, err := ParseECPrivateKey(derBytes) - if err != nil { - t.Fatalf("#%d: failed to decode EC private key: %s", i, err) - } - serialized, err := MarshalECPrivateKey(key) - if err != nil { - t.Fatalf("#%d: failed to encode EC private key: %s", i, err) - } - matches := bytes.Equal(serialized, derBytes) - if matches != test.shouldReserialize { - t.Fatalf("#%d: when serializing key: matches=%t, should match=%t: original %x, reserialized %x", i, matches, test.shouldReserialize, serialized, derBytes) - } - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/sha2_windows_test.go b/vendor/github.com/google/certificate-transparency-go/x509/sha2_windows_test.go deleted file mode 100644 index 79dc685..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/sha2_windows_test.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 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. - -package x509 - -import "syscall" - -func init() { - v, err := syscall.GetVersion() - if err != nil { - return - } - if major := byte(v); major < 6 { - // Windows XP SP2 and Windows 2003 do not support SHA2. - // http://blogs.technet.com/b/pki/archive/2010/09/30/sha2-and-windows.aspx - supportSHA2 = false - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509/testdata/test-dir.crt b/vendor/github.com/google/certificate-transparency-go/x509/testdata/test-dir.crt deleted file mode 100644 index b7fc9c5..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/testdata/test-dir.crt +++ /dev/null @@ -1,31 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFazCCA1OgAwIBAgIJAL8a/lsnspOqMA0GCSqGSIb3DQEBCwUAMEwxCzAJBgNV -BAYTAlVLMRMwEQYDVQQIDApUZXN0LVN0YXRlMRUwEwYDVQQKDAxHb2xhbmcgVGVz -dHMxETAPBgNVBAMMCHRlc3QtZGlyMB4XDTE3MDIwMTIzNTAyN1oXDTI3MDEzMDIz -NTAyN1owTDELMAkGA1UEBhMCVUsxEzARBgNVBAgMClRlc3QtU3RhdGUxFTATBgNV -BAoMDEdvbGFuZyBUZXN0czERMA8GA1UEAwwIdGVzdC1kaXIwggIiMA0GCSqGSIb3 -DQEBAQUAA4ICDwAwggIKAo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dSyZGc -g0/v3aXJCp4j/9VoNhI1WXz3M45nysZIL5OQgXymLqJElQa1pZ3Wa4i/nidvT4AT -Xlxc/qijM8set/nOqp7hVd5J0uG6qdwLRILUddZ6OpXd7ZNi1EXg+Bpc7ehzGsDt -3UFGzYXDjxYnK2frQfjLS8stOQIqSrGthW6x0fdkVx0y8BByvd5J6+JmZl4UZfzA -m99VxXSt4B9x6BvnY7ktzcFDOjtuLc4B/7yg9fv1eQuStA4cHGGAttsCg1X/Kx8W -PvkkeH0UWDZ9vhH9K36703z89da6MWF+bz92B0+4HoOmlVaXRkvblsNaynJnL0LC -Ayry7QBxuh5cMnDdRwJB3AVJIiJ1GVpb7aGvBOnx+s2lwRv9HWtghb+cbwwktx1M -JHyBf3GZNSWTpKY7cD8V+NnBv3UuioOVVo+XAU4LF/bYUjdRpxWADJizNtZrtFo= ------END CERTIFICATE----- diff --git a/vendor/github.com/google/certificate-transparency-go/x509/verify_test.go b/vendor/github.com/google/certificate-transparency-go/x509/verify_test.go deleted file mode 100644 index 95332da..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/verify_test.go +++ /dev/null @@ -1,1793 +0,0 @@ -// 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. - -package x509 - -import ( - "encoding/pem" - "errors" - "fmt" - "runtime" - "strings" - "testing" - "time" - - "github.com/google/certificate-transparency-go/x509/pkix" -) - -var supportSHA2 = true - -type verifyTest struct { - leaf string - intermediates []string - roots []string - currentTime int64 - dnsName string - systemSkip bool - keyUsages []ExtKeyUsage - testSystemRootsError bool - sha2 bool - disableTimeChecks bool - disableCriticalExtensionChecks bool - disableNameChecks bool - - errorCallback func(*testing.T, int, error) bool - expectedChains [][]string -} - -var verifyTests = []verifyTest{ - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - currentTime: 1395785200, - dnsName: "www.google.com", - testSystemRootsError: true, - - // Without any roots specified we should get a system roots - // error. - errorCallback: expectSystemRootsError, - }, - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 1395785200, - dnsName: "www.google.com", - - expectedChains: [][]string{ - {"Google", "Google Internet Authority", "GeoTrust"}, - }, - }, - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 1395785200, - dnsName: "WwW.GooGLE.coM", - - expectedChains: [][]string{ - {"Google", "Google Internet Authority", "GeoTrust"}, - }, - }, - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 1395785200, - dnsName: "www.example.com", - - errorCallback: expectHostnameError, - }, - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 1, - dnsName: "www.example.com", - - errorCallback: expectExpired, - }, - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 1, - dnsName: "www.google.com", - disableTimeChecks: true, - - expectedChains: [][]string{ - {"Google", "Google Internet Authority", "GeoTrust"}, - }, - }, - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 10000000000, - dnsName: "www.google.com", - - errorCallback: expectExpired, - }, - { - leaf: googleLeaf, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 10000000000, - dnsName: "www.google.com", - disableTimeChecks: true, - - expectedChains: [][]string{ - {"Google", "Google Internet Authority", "GeoTrust"}, - }, - }, - { - leaf: googleLeaf, - roots: []string{geoTrustRoot}, - currentTime: 1395785200, - dnsName: "www.google.com", - - // Skip when using systemVerify, since Windows - // *will* find the missing intermediate cert. - systemSkip: true, - errorCallback: expectAuthorityUnknown, - }, - { - leaf: googleLeaf, - intermediates: []string{geoTrustRoot, giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 1395785200, - dnsName: "www.google.com", - - expectedChains: [][]string{ - {"Google", "Google Internet Authority", "GeoTrust"}, - }, - // CAPI doesn't build the chain with the duplicated GeoTrust - // entry so the results don't match. Thus we skip this test - // until that's fixed. - systemSkip: true, - }, - { - leaf: dnssecExpLeaf, - intermediates: []string{startComIntermediate}, - roots: []string{startComRoot}, - currentTime: 1302726541, - - expectedChains: [][]string{ - {"dnssec-exp", "StartCom Class 1", "StartCom Certification Authority"}, - }, - }, - { - leaf: dnssecExpLeaf, - intermediates: []string{startComIntermediate, startComRoot}, - roots: []string{startComRoot}, - currentTime: 1302726541, - - expectedChains: [][]string{ - {"dnssec-exp", "StartCom Class 1", "StartCom Certification Authority"}, - }, - }, - { - leaf: googleLeafWithInvalidHash, - intermediates: []string{giag2Intermediate}, - roots: []string{geoTrustRoot}, - currentTime: 1395785200, - dnsName: "www.google.com", - - // The specific error message may not occur when using system - // verification. - systemSkip: true, - errorCallback: expectHashError, - }, - { - // The default configuration should reject an S/MIME chain. - leaf: smimeLeaf, - roots: []string{smimeIntermediate}, - currentTime: 1339436154, - - // Key usage not implemented for Windows yet. - systemSkip: true, - errorCallback: expectUsageError, - }, - { - leaf: smimeLeaf, - roots: []string{smimeIntermediate}, - currentTime: 1339436154, - keyUsages: []ExtKeyUsage{ExtKeyUsageServerAuth}, - - // Key usage not implemented for Windows yet. - systemSkip: true, - errorCallback: expectUsageError, - }, - { - leaf: smimeLeaf, - roots: []string{smimeIntermediate}, - currentTime: 1339436154, - keyUsages: []ExtKeyUsage{ExtKeyUsageEmailProtection}, - - // Key usage not implemented for Windows yet. - systemSkip: true, - expectedChains: [][]string{ - {"Ryan Hurst", "GlobalSign PersonalSign 2 CA - G2"}, - }, - }, - { - leaf: megaLeaf, - intermediates: []string{comodoIntermediate1}, - roots: []string{comodoRoot}, - currentTime: 1360431182, - - // CryptoAPI can find alternative validation paths so we don't - // perform this test with system validation. - systemSkip: true, - expectedChains: [][]string{ - {"mega.co.nz", "EssentialSSL CA", "COMODO Certification Authority"}, - }, - }, - { - // Check that a name constrained intermediate works even when - // it lists multiple constraints. - leaf: nameConstraintsLeaf, - intermediates: []string{nameConstraintsIntermediate1, nameConstraintsIntermediate2}, - roots: []string{globalSignRoot}, - currentTime: 1382387896, - dnsName: "secure.iddl.vt.edu", - - expectedChains: [][]string{ - { - "Technology-enhanced Learning and Online Strategies", - "Virginia Tech Global Qualified Server CA", - "Trusted Root CA G2", - "GlobalSign Root CA", - }, - }, - }, - { - // Check that SHA-384 intermediates (which are popping up) - // work. - leaf: moipLeafCert, - intermediates: []string{comodoIntermediateSHA384, comodoRSAAuthority}, - roots: []string{addTrustRoot}, - currentTime: 1397502195, - dnsName: "api.moip.com.br", - - // CryptoAPI can find alternative validation paths so we don't - // perform this test with system validation. - systemSkip: true, - - sha2: true, - expectedChains: [][]string{ - { - "api.moip.com.br", - "COMODO RSA Extended Validation Secure Server CA", - "COMODO RSA Certification Authority", - "AddTrust External CA Root", - }, - }, - }, - { - // Putting a certificate as a root directly should work as a - // way of saying “exactly this”. - leaf: selfSigned, - roots: []string{selfSigned}, - currentTime: 1471624472, - dnsName: "foo.example", - systemSkip: true, - - expectedChains: [][]string{ - {"Acme Co"}, - }, - }, - { - // Putting a certificate as a root directly should not skip - // other checks however. - leaf: selfSigned, - roots: []string{selfSigned}, - currentTime: 1471624472, - dnsName: "notfoo.example", - systemSkip: true, - - errorCallback: expectHostnameError, - }, - { - // The issuer name in the leaf doesn't exactly match the - // subject name in the root. Go does not perform - // canonicalization and so should reject this. See issue 14955. - leaf: issuerSubjectMatchLeaf, - roots: []string{issuerSubjectMatchRoot}, - currentTime: 1475787715, - systemSkip: true, - - errorCallback: expectSubjectIssuerMismatchError, - }, - { - leaf: issuerSubjectMatchLeaf, - roots: []string{issuerSubjectMatchRoot}, - currentTime: 1475787715, - systemSkip: true, - disableNameChecks: true, - - expectedChains: [][]string{ - {"Leaf", "Root ca"}, - }, - }, - { - // An X.509 v1 certificate should not be accepted as an - // intermediate. - leaf: x509v1TestLeaf, - intermediates: []string{x509v1TestIntermediate}, - roots: []string{x509v1TestRoot}, - currentTime: 1481753183, - systemSkip: true, - - errorCallback: expectNotAuthorizedError, - }, - { - // If any SAN extension is present (even one without any DNS - // names), the CN should be ignored. - leaf: ignoreCNWithSANLeaf, - dnsName: "foo.example.com", - roots: []string{ignoreCNWithSANRoot}, - currentTime: 1486684488, - systemSkip: true, - - errorCallback: expectHostnameError, - }, - { - // Test that excluded names are respected. - leaf: excludedNamesLeaf, - dnsName: "bender.local", - intermediates: []string{excludedNamesIntermediate}, - roots: []string{excludedNamesRoot}, - currentTime: 1486684488, - systemSkip: true, - - errorCallback: expectNameConstraintsError, - }, - { - // Test that unknown critical extensions in a leaf cause a - // verify error. - leaf: criticalExtLeafWithExt, - dnsName: "example.com", - intermediates: []string{criticalExtIntermediate}, - roots: []string{criticalExtRoot}, - currentTime: 1486684488, - systemSkip: true, - - errorCallback: expectUnhandledCriticalExtension, - }, - { - // Test that unknown critical extensions in an intermediate - // cause a verify error. - leaf: criticalExtLeaf, - dnsName: "example.com", - intermediates: []string{criticalExtIntermediateWithExt}, - roots: []string{criticalExtRoot}, - currentTime: 1486684488, - systemSkip: true, - - errorCallback: expectUnhandledCriticalExtension, - }, - { - leaf: criticalExtLeafWithExt, - dnsName: "example.com", - intermediates: []string{criticalExtIntermediate}, - roots: []string{criticalExtRoot}, - currentTime: 1486684488, - systemSkip: true, - disableCriticalExtensionChecks: true, - - expectedChains: [][]string{ - { - "example.com", - "Intermediate", - "Root", - }, - }, - }, - { - leaf: criticalExtLeaf, - dnsName: "example.com", - intermediates: []string{criticalExtIntermediateWithExt}, - roots: []string{criticalExtRoot}, - currentTime: 1486684488, - systemSkip: true, - disableCriticalExtensionChecks: true, - - expectedChains: [][]string{ - { - "example.com", - "Intermediate with Critical Extension", - "Root", - }, - }, - }, -} - -func expectHostnameError(t *testing.T, i int, err error) (ok bool) { - if _, ok := err.(HostnameError); !ok { - t.Errorf("#%d: error was not a HostnameError: %s", i, err) - return false - } - return true -} - -func expectExpired(t *testing.T, i int, err error) (ok bool) { - if inval, ok := err.(CertificateInvalidError); !ok || inval.Reason != Expired { - t.Errorf("#%d: error was not Expired: %s", i, err) - return false - } - return true -} - -func expectUsageError(t *testing.T, i int, err error) (ok bool) { - if inval, ok := err.(CertificateInvalidError); !ok || inval.Reason != IncompatibleUsage { - t.Errorf("#%d: error was not IncompatibleUsage: %s", i, err) - return false - } - return true -} - -func expectAuthorityUnknown(t *testing.T, i int, err error) (ok bool) { - e, ok := err.(UnknownAuthorityError) - if !ok { - t.Errorf("#%d: error was not UnknownAuthorityError: %s", i, err) - return false - } - if e.Cert == nil { - t.Errorf("#%d: error was UnknownAuthorityError, but missing Cert: %s", i, err) - return false - } - return true -} - -func expectSystemRootsError(t *testing.T, i int, err error) bool { - if _, ok := err.(SystemRootsError); !ok { - t.Errorf("#%d: error was not SystemRootsError: %s", i, err) - return false - } - return true -} - -func expectHashError(t *testing.T, i int, err error) bool { - if err == nil { - t.Errorf("#%d: no error resulted from invalid hash", i) - return false - } - if expected := "algorithm unimplemented"; !strings.Contains(err.Error(), expected) { - t.Errorf("#%d: error resulting from invalid hash didn't contain '%s', rather it was: %s", i, expected, err) - return false - } - return true -} - -func expectSubjectIssuerMismatchError(t *testing.T, i int, err error) (ok bool) { - if inval, ok := err.(CertificateInvalidError); !ok || inval.Reason != NameMismatch { - t.Errorf("#%d: error was not a NameMismatch: %s", i, err) - return false - } - return true -} - -func expectNameConstraintsError(t *testing.T, i int, err error) (ok bool) { - if inval, ok := err.(CertificateInvalidError); !ok || inval.Reason != CANotAuthorizedForThisName { - t.Errorf("#%d: error was not a CANotAuthorizedForThisName: %s", i, err) - return false - } - return true -} - -func expectNotAuthorizedError(t *testing.T, i int, err error) (ok bool) { - if inval, ok := err.(CertificateInvalidError); !ok || inval.Reason != NotAuthorizedToSign { - t.Errorf("#%d: error was not a NotAuthorizedToSign: %s", i, err) - return false - } - return true -} - -func expectUnhandledCriticalExtension(t *testing.T, i int, err error) (ok bool) { - if _, ok := err.(UnhandledCriticalExtension); !ok { - t.Errorf("#%d: error was not an UnhandledCriticalExtension: %s", i, err) - return false - } - return true -} - -func certificateFromPEM(pemBytes string) (*Certificate, error) { - block, _ := pem.Decode([]byte(pemBytes)) - if block == nil { - return nil, errors.New("failed to decode PEM") - } - return ParseCertificate(block.Bytes) -} - -func testVerify(t *testing.T, useSystemRoots bool) { - for i, test := range verifyTests { - if useSystemRoots && test.systemSkip { - continue - } - if runtime.GOOS == "windows" && test.testSystemRootsError { - continue - } - if useSystemRoots && !supportSHA2 && test.sha2 { - continue - } - - opts := VerifyOptions{ - Intermediates: NewCertPool(), - DNSName: test.dnsName, - CurrentTime: time.Unix(test.currentTime, 0), - KeyUsages: test.keyUsages, - DisableTimeChecks: test.disableTimeChecks, - DisableCriticalExtensionChecks: test.disableCriticalExtensionChecks, - DisableNameChecks: test.disableNameChecks, - } - - if !useSystemRoots { - opts.Roots = NewCertPool() - for j, root := range test.roots { - ok := opts.Roots.AppendCertsFromPEM([]byte(root)) - if !ok { - t.Errorf("#%d: failed to parse root #%d", i, j) - return - } - } - } - - for j, intermediate := range test.intermediates { - ok := opts.Intermediates.AppendCertsFromPEM([]byte(intermediate)) - if !ok { - t.Errorf("#%d: failed to parse intermediate #%d", i, j) - return - } - } - - leaf, err := certificateFromPEM(test.leaf) - if err != nil { - t.Errorf("#%d: failed to parse leaf: %s", i, err) - return - } - - var oldSystemRoots *CertPool - if test.testSystemRootsError { - oldSystemRoots = systemRootsPool() - systemRoots = nil - opts.Roots = nil - } - - chains, err := leaf.Verify(opts) - - if test.testSystemRootsError { - systemRoots = oldSystemRoots - } - - if test.errorCallback == nil && err != nil { - t.Errorf("#%d: unexpected error: %s", i, err) - } - if test.errorCallback != nil { - if !test.errorCallback(t, i, err) { - return - } - } - - if len(chains) != len(test.expectedChains) { - t.Errorf("#%d: wanted %d chains, got %d", i, len(test.expectedChains), len(chains)) - } - - // We check that each returned chain matches a chain from - // expectedChains but an entry in expectedChains can't match - // two chains. - seenChains := make([]bool, len(chains)) - NextOutputChain: - for _, chain := range chains { - TryNextExpected: - for j, expectedChain := range test.expectedChains { - if seenChains[j] { - continue - } - if len(chain) != len(expectedChain) { - continue - } - for k, cert := range chain { - if !strings.Contains(nameToKey(&cert.Subject), expectedChain[k]) { - continue TryNextExpected - } - } - // we matched - seenChains[j] = true - continue NextOutputChain - } - t.Errorf("#%d: No expected chain matched %s", i, chainToDebugString(chain)) - } - } -} - -func TestGoVerify(t *testing.T) { - testVerify(t, false) -} - -func TestSystemVerify(t *testing.T) { - if runtime.GOOS != "windows" { - t.Skipf("skipping verify test using system APIs on %q", runtime.GOOS) - } - - testVerify(t, true) -} - -func chainToDebugString(chain []*Certificate) string { - var chainStr string - for _, cert := range chain { - if len(chainStr) > 0 { - chainStr += " -> " - } - chainStr += nameToKey(&cert.Subject) - } - return chainStr -} - -func nameToKey(name *pkix.Name) string { - return strings.Join(name.Country, ",") + "/" + strings.Join(name.Organization, ",") + "/" + strings.Join(name.OrganizationalUnit, ",") + "/" + name.CommonName -} - -const geoTrustRoot = `-----BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg -R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 -9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq -fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv -iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU -1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ -bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW -MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA -ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l -uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn -Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS -tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF -PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un -hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV -5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== ------END CERTIFICATE----- -` - -const giag2Intermediate = `-----BEGIN CERTIFICATE----- -MIIEBDCCAuygAwIBAgIDAjppMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMTMwNDA1MTUxNTU1WhcNMTUwNDA0MTUxNTU1WjBJMQswCQYDVQQG -EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy -bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I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YbvPZotXb1gba7Yhq6WoEvMBcGA1UdIAQQMA4wDAYKKwYBBAHW -eQIFATAwBgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vcGtpLmdvb2dsZS5jb20vR0lB -RzIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCR3RJtHzgDh33b/MI1ugiki+nl8Ikj -5larbJRE/rcA5oite+QJyAr6SU1gJJ/rRrK3ItVEHr9L621BCM7GSdoNMjB9MMcf -tJAW0kYGJ+wqKm53wG/JaOADTnnq2Mt/j6F2uvjgN/ouns1nRHufIvd370N0LeH+ -orKqTuAPzXK7imQk6+OycYABbqCtC/9qmwRd8wwn7sF97DtYfK8WuNHtFalCAwyi -8LxJJYJCLWoMhZ+V8GZm+FOex5qkQAjnZrtNlbQJ8ro4r+rpKXtmMFFhfa+7L+PA -Kom08eUK8skxAzfDDijZPh10VtJ66uBoiDPdT+uCBehcBIcmSTrKjFGX ------END CERTIFICATE----- -` - -// googleLeafWithInvalidHash is the same as googleLeaf, but the signature -// algorithm in the certificate contains a nonsense OID. -const googleLeafWithInvalidHash = `-----BEGIN CERTIFICATE----- -MIIEdjCCA16gAwIBAgIIcR5k4dkoe04wDQYJKoZIhvcNAWAFBQAwSTELMAkGA1UE -BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl -cm5ldCBBdXRob3JpdHkgRzIwHhcNMTQwMzEyMDkzODMwWhcNMTQwNjEwMDAwMDAw -WjBoMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN -TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEXMBUGA1UEAwwOd3d3 -Lmdvb2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4zYCe -m0oUBhwE0EwBr65eBOcgcQO2PaSIAB2dEP/c1EMX2tOy0ov8rk83ePhJ+MWdT1z6 -jge9X4z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RHLq0gfGabDBoYvvF0nXYbFFSF87ICHpW7LM9NfpMfULFWE7epTj69m8f5SuauNi -YpaoZHy4h/OZMn6SolK+u/hlz8nyMPyLwcKmltdfieFcNID1j0cHL7SRv7Gifl9L -WtBbnySGBVFaaQNlQ0lxxeBvlDRr9hvYqbBMflPrj0jfyjO1SPo2ShpTpjMM0InN -SRXNiTE8kMBy12VLUjWKRhFEuT2OKGWmPnmeXAhEKa2wNREuIU640ucQPl2Eg7PD -wuTSxv0JS3QJ3fGz0xk+gA2iCxnwOOfFwq/iI9th4p1cbiCJSS4jarJiwUW0n6+L -p/EiO/h94pDQehn7Skzj0n1fSoMD7SfWI55rjbRZotnvbIIp3XUZPD9MEI3vu3Un -0q6Dp6jOW6c= ------END CERTIFICATE-----` - -const startComRoot = `-----BEGIN CERTIFICATE----- -MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW -MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg -Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9 -MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi -U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh -cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk -pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf -OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWz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NUG4+BAe/eiCL+O5lCeHHSQgyPQ0o -fkkdt0rvAucNgBfIXOBhYsvss2B5JdoaZXOcOBCgJjqwyBZ9kzEi7nQLiMBciUEA -KKlHMd99SUWa9eanRRrSjhMQ34Ovmw2tfn6dNVA0BM7pINae253UqNpktNEvWS5e -ojZh1CSggjMziqHRbO9haKPl0latxf1eYusVqHQSTC8xjOnB3xBLAer2VBvNfzu9 -XJ/B288ByvK6YBIhMe2pZLiySVgXbVrXzYxtvp5/4gJYp9vDLVj2dAZqmvZh+fYA -tmnYOosxWd2R5nwnI4fdAw+PKowegwFOAWEMUnNt/AiiuSpm5HZNMaBWm9lTjaK2 -jwLI5jqmBNFI+8NKAnb9L9K8E7bobTQk+p0pisehKxTxlgBzuRPpwLk6R1YCcYAn -pLwltum95OmYdBbxN4SBB7SC ------END CERTIFICATE-----` - -const comodoRSAAuthority = `-----BEGIN CERTIFICATE----- -MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv -MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk -ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF -eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow -gYUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO -BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMSswKQYD -VQQDEyJDT01PRE8gUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkq -hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkehUktIKVrGsDSTdxc9EZ3SZKzejfSNw -AHG8U9/E+ioSj0t/EFa9n3Byt2F/yUsPF6c947AEYe7/EZfH9IY+Cvo+XPm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9TFOYF -w0Tk0Luo/PyKJpZnwhsP++iiGQiteJbndy8aLKmJ2MpLfpDGIgxEIyNb5dgoDi0D -WReDCpE6K9WDYqvKVGnQ2Jvqqra6Gfx0tFkuqJxQuqA8aUOlPHcCH4KBZdNEoXdY -YL3E4dCAh0YiDs80wNZx4cHqEM3L8gTEFqW2Tn1TSuPZO6gjJ9QPsuUZVjaMZuuO -NVxqLGujZkDzARhC3fBpptMuaAfi20+BAgMBAAGjTTBLMA4GA1UdDwEB/wQEAwIF -oDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMBYGA1UdEQQPMA2C -C2Zvby5leGFtcGxlMA0GCSqGSIb3DQEBCwUAA4IBAQBPvvfnDhsHWt+/cfwdAVim -4EDn+hYOMkTQwU0pouYIvY8QXYkZ8MBxpBtBMK4JhFU+ewSWoBAEH2dCCvx/BDxN -UGTSJHMbsvJHcFvdmsvvRxOqQ/cJz7behx0cfoeHMwcs0/vWv8ms5wHesb5Ek7L0 -pl01FCBGTcncVqr6RK1r4fTpeCCfRIERD+YRJz8TtPH6ydesfLL8jIV40H8NiDfG -vRAvOtNiKtPzFeQVdbRPOskC4rcHyPeiDAMAMixeLi63+CFty4da3r5lRezeedCE -cw3ESZzThBwWqvPOtJdpXdm+r57pDW8qD+/0lY8wfImMNkQAyCUCLg/1Lxt/hrBj ------END CERTIFICATE-----` - -const issuerSubjectMatchRoot = ` -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 161640039802297062 (0x23e42c281e55ae6) - Signature Algorithm: sha256WithRSAEncryption - Issuer: O=Golang, CN=Root ca - Validity - Not Before: Jan 1 00:00:00 2015 GMT - Not After : Jan 1 00:00:00 2025 GMT - Subject: O=Golang, CN=Root ca - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:e9:0e:7f:11:0c:e6:5a:e6:86:83:70:f6:51:07: - 2e:02:78:11:f5:b2:24:92:38:ee:26:62:02:c7:94: - f1:3e:a1:77:6a:c0:8f:d5:22:68:b6:5d:e2:4c:da: - e0:85:11:35:c2:92:72:49:8d:81:b4:88:97:6b:b7: - fc:b2:44:5b:d9:4d:06:70:f9:0c:c6:8f:e9:b3:df: - a3:6a:84:6c:43:59:be:9d:b2:d0:76:9b:c3:d7:fa: - 99:59:c3:b8:e5:f3:53:03:bd:49:d6:b3:cc:a2:43: - fe:ad:c2:0b:b9:01:b8:56:29:94:03:24:a7:0d:28: - 21:29:a9:ae:94:5b:4a:f9:9f - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign - X509v3 Extended Key Usage: - TLS Web Server Authentication, TLS Web Client Authentication - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - 40:37:D7:01:FB:40:2F:B8:1C:7E:54:04:27:8C:59:01 - Signature Algorithm: sha256WithRSAEncryption - 6f:84:df:49:e0:99:d4:71:66:1d:32:86:56:cb:ea:5a:6b:0e: - 00:6a:d1:5a:6e:1f:06:23:07:ff:cb:d1:1a:74:e4:24:43:0b: - aa:2a:a0:73:75:25:82:bc:bf:3f:a9:f8:48:88:ac:ed:3a:94: - 3b:0d:d3:88:c8:67:44:61:33:df:71:6c:c5:af:ed:16:8c:bf: - 82:f9:49:bb:e3:2a:07:53:36:37:25:77:de:91:a4:77:09:7f: - 6f:b2:91:58:c4:05:89:ea:8e:fa:e1:3b:19:ef:f8:f6:94:b7: - 7b:27:e6:e4:84:dd:2b:f5:93:f5:3c:d8:86:c5:38:01:56:5c: - 9f:6d ------BEGIN CERTIFICATE----- -MIICIDCCAYmgAwIBAgIIAj5CwoHlWuYwDQYJKoZIhvcNAQELBQAwIzEPMA0GA1UE -ChMGR29sYW5nMRAwDgYDVQQDEwdSb290IGNhMB4XDTE1MDEwMTAwMDAwMFoXDTI1 -MDEwMTAwMDAwMFowIzEPMA0GA1UEChMGR29sYW5nMRAwDgYDVQQDEwdSb290IGNh -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDpDn8RDOZa5oaDcPZRBy4CeBH1 -siSSOO4mYgLHlPE+oXdqwI/VImi2XeJM2uCFETXCknJJjYG0iJdrt/yyRFvZTQZw -+QzGj+mz36NqhGxDWb6dstB2m8PX+plZw7jl81MDvUnWs8yiQ/6twgu5AbhWKZQD -JKcNKCEpqa6UW0r5nwIDAQABo10wWzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0lBBYw -FAYIKwYBBQUHAwEGCCsGAQUFBwMCMA8GA1UdEwEB/wQFMAMBAf8wGQYDVR0OBBIE -EEA31wH7QC+4HH5UBCeMWQEwDQYJKoZIhvcNAQELBQADgYEAb4TfSeCZ1HFmHTKG -VsvqWmsOAGrRWm4fBiMH/8vRGnTkJEMLqiqgc3Ulgry/P6n4SIis7TqUOw3TiMhn -RGEz33Fsxa/tFoy/gvlJu+MqB1M2NyV33pGkdwl/b7KRWMQFieqO+uE7Ge/49pS3 -eyfm5ITdK/WT9TzYhsU4AVZcn20= ------END CERTIFICATE-----` - -const issuerSubjectMatchLeaf = ` -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 16785088708916013734 (0xe8f09d3fe25beaa6) - Signature Algorithm: sha256WithRSAEncryption - Issuer: O=Golang, CN=Root CA - Validity - Not Before: Jan 1 00:00:00 2015 GMT - Not After : Jan 1 00:00:00 2025 GMT - Subject: O=Golang, CN=Leaf - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) - Modulus: - 00:db:46:7d:93:2e:12:27:06:48:bc:06:28:21:ab: - 7e:c4:b6:a2:5d:fe:1e:52:45:88:7a:36:47:a5:08: - 0d:92:42:5b:c2:81:c0:be:97:79:98:40:fb:4f:6d: - 14:fd:2b:13:8b:c2:a5:2e:67:d8:d4:09:9e:d6:22: - 38:b7:4a:0b:74:73:2b:c2:34:f1:d1:93:e5:96:d9: - 74:7b:f3:58:9f:6c:61:3c:c0:b0:41:d4:d9:2b:2b: - 24:23:77:5b:1c:3b:bd:75:5d:ce:20:54:cf:a1:63: - 87:1d:1e:24:c4:f3:1d:1a:50:8b:aa:b6:14:43:ed: - 97:a7:75:62:f4:14:c8:52:d7 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Digital Signature, Key Encipherment - X509v3 Extended Key Usage: - TLS Web Server Authentication, TLS Web Client Authentication - X509v3 Basic Constraints: critical - CA:FALSE - X509v3 Subject Key Identifier: - 9F:91:16:1F:43:43:3E:49:A6:DE:6D:B6:80:D7:9F:60 - X509v3 Authority Key Identifier: - keyid:40:37:D7:01:FB:40:2F:B8:1C:7E:54:04:27:8C:59:01 - - Signature Algorithm: sha256WithRSAEncryption - 8d:86:05:da:89:f5:1d:c5:16:14:41:b9:34:87:2b:5c:38:99: - e3:d9:5a:5b:7a:5b:de:0b:5c:08:45:09:6f:1c:9d:31:5f:08: - ca:7a:a3:99:da:83:0b:22:be:4f:02:35:91:4e:5d:5c:37:bf: - 89:22:58:7d:30:76:d2:2f:d0:a0:ee:77:9e:77:c0:d6:19:eb: - ec:a0:63:35:6a:80:9b:80:1a:80:de:64:bc:40:38:3c:22:69: - ad:46:26:a2:3d:ea:f4:c2:92:49:16:03:96:ae:64:21:b9:7c: - ee:64:91:47:81:aa:b4:0c:09:2b:12:1a:b2:f3:af:50:b3:b1: - ce:24 ------BEGIN CERTIFICATE----- -MIICODCCAaGgAwIBAgIJAOjwnT/iW+qmMA0GCSqGSIb3DQEBCwUAMCMxDzANBgNV -BAoTBkdvbGFuZzEQMA4GA1UEAxMHUm9vdCBDQTAeFw0xNTAxMDEwMDAwMDBaFw0y -NTAxMDEwMDAwMDBaMCAxDzANBgNVBAoTBkdvbGFuZzENMAsGA1UEAxMETGVhZjCB -nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA20Z9ky4SJwZIvAYoIat+xLaiXf4e -UkWIejZHpQgNkkJbwoHAvpd5mED7T20U/SsTi8KlLmfY1Ame1iI4t0oLdHMrwjTx -0ZPlltl0e/NYn2xhPMCwQd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pGpYkQ6b248xijCK7zI+lOeWN89zfSXn1AvfsC9pSdTMeDklWktbF/Ad0IN8Md -h2NtN34ard0hEfHc8qW8mkXdsysVmq6cPvFYaHz+dBtkHuHDoy8YQnC0zdN/WyYB -/1JmacUUofl+HusHuLkDxmadogI= ------END CERTIFICATE-----` - -const x509v1TestIntermediate = ` ------BEGIN CERTIFICATE----- -MIIByjCCATMCCQCCdEMsT8ykqTANBgkqhkiG9w0BAQsFADAjMQ8wDQYDVQQKEwZH -b2xhbmcxEDAOBgNVBAMTB1Jvb3QgQ0EwHhcNMTUwMTAxMDAwMDAwWhcNMjUwMTAx -MDAwMDAwWjAwMQ8wDQYDVQQKEwZHb2xhbmcxHTAbBgNVBAMTFFguNTA5djEgaW50 -ZXJtZWRpYXRlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJ2QyniAOT+5YL -jeinEBJr3NsC/Q2QJ/VKmgvp+xRxuKTHJiVmxVijmp0vWg8AWfkmuE4p3hXQbbqM -k5yxrk1n60ONhim2L4VXriEvCE7X2OXhTmBls5Ufr7aqIgPMikwjScCXwz8E8qI8 -UxyAhnjeJwMYBU8TuwBImSd4LBHoQQIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAIab -DRG6FbF9kL9jb/TDHkbVBk+sl/Pxi4/XjuFyIALlARgAkeZcPmL5tNW1ImHkwsHR -zWE77kJDibzd141u21ZbLsKvEdUJXjla43bdyMmEqf5VGpC3D4sFt3QVH7lGeRur -x5Wlq1u3YDL/j6s1nU2dQ3ySB/oP7J+vQ9V4QeM+ ------END CERTIFICATE-----` - -const x509v1TestLeaf = ` ------BEGIN CERTIFICATE----- -MIICMzCCAZygAwIBAgIJAPo99mqJJrpJMA0GCSqGSIb3DQEBCwUAMDAxDzANBgNV -BAoTBkdvbGFuZzEdMBsGA1UEAxMUWC41MDl2MSBpbnRlcm1lZGlhdGUwHhcNMTUw -MTAxMDAwMDAwWhcNMjUwMTAxMDAwMDAwWjArMQ8wDQYDVQQKEwZHb2xhbmcxGDAW -BgNVBAMTD2Zvby5leGFtcGxlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC -gYEApUh60Z+a5/oKJxG//Dn8CihSo2CJHNIIO3zEJZ1EeNSMZCynaIR6D3IPZEIR -+RG2oGt+f5EEukAPYxwasp6VeZEezoQWJ+97nPCT6DpwLlWp3i2MF8piK2R9vxkG -Z5n0+HzYk1VM8epIrZFUXSMGTX8w1y041PX/yYLxbdEifdcCAwEAAaNaMFgwDgYD -VR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNV -HRMBAf8EAjAAMBkGA1UdDgQSBBBFozXe0SnzAmjy+1U6M/cvMA0GCSqGSIb3DQEB -CwUAA4GBADYzYUvaToO/ucBskPdqXV16AaakIhhSENswYVSl97/sODaxsjishKq9 -5R7siu+JnIFotA7IbBe633p75xEnLN88X626N/XRFG9iScLzpj0o0PWXBUiB+fxL -/jt8qszOXCv2vYdUTPNuPqufXLWMoirpuXrr1liJDmedCcAHepY/ ------END CERTIFICATE-----` - -const ignoreCNWithSANRoot = ` ------BEGIN CERTIFICATE----- -MIIDPzCCAiegAwIBAgIIJkzCwkNrPHMwDQYJKoZIhvcNAQELBQAwMDEQMA4GA1UE -ChMHVEVTVElORzEcMBoGA1UEAxMTKipUZXN0aW5nKiogUm9vdCBDQTAeFw0xNTAx -MDEwMDAwMDBaFw0yNTAxMDEwMDAwMDBaMDAxEDAOBgNVBAoTB1RFU1RJTkcxHDAa -BgNVBAMTEyoqVGVzdGluZyoqIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQC4YAf5YqlXGcikvbMWtVrNICt+V/NNWljwfvSKdg4Inm7k6BwW -P6y4Y+n4qSYIWNU4iRkdpajufzctxQCO6ty13iw3qVktzcC5XBIiS6ymiRhhDgnY -VQqyakVGw9MxrPwdRZVlssUv3Hmy6tU+v5Ok31SLY5z3w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m9vdCBm -b3IgMzM5MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJymcnX29ekc -7+MLyr8QuAzoHWznmGdDd2sITwWRjM89/21cdlHCGKSpULUNdFp9HDLWvYECtxt+ -8TuzKiQz7qAerzGUT1zI5McIjHy0e/i4xIkfiBiNeTCuB/N9QRbZlcfM80ErkaA4 -gCAFK8qZAcWkHIl6e+KaQFMPLKk9kckgAnVDHEJe8oLNCogCJ15558b65g05p9eb -5Lg+E98hoPRTQaDwlz3CZPfTTA2EiEZInSi8qzodFCbTpJUVTbiVUH/JtVjlibbb -smdcx5PORK+8ZJkhLEh54AjaWOX4tB/7Tkk8stg2VBmrIARt/j4UVj7cTrIWU3bV -m8TwHJG+YgsCAwEAAaNaMFgwDwYDVR0TAQH/BAUwAwEB/zBFBgNVHR4EPjA8oBww -CocICgEAAP//AAAwDoIMYmVuZGVyLmxvY2FsoRwwCocICgEAAP//AAAwDoIMYmVu -ZGVyLmxvY2FsMA0GCSqGSIb3DQEBCwUAA4IBAQAMjbheffPxtSKSv9NySW+8qmHs -n7Mb5GGyCFu+cMZSoSaabstbml+zHEFJvWz6/1E95K4F8jKhAcu/CwDf4IZrSD2+ -Hee0DolVSQhZpnHgPyj7ZATz48e3aJaQPUlhCEOh0wwF4Y0N4FV0t7R6woLylYRZ -yU1yRHUqUYpN0DWFpsPbBqgM6uUAVO2ayBFhPgWUaqkmSbZ/Nq7isGvknaTmcIwT -6mOAFN0qFb4RGzfGJW7x6z7KCULS7qVDp6fU3tRoScHFEgRubks6jzQ1W5ooSm4o -+NQCZDd5eFeU8PpNX7rgaYE4GPq+EEmLVCBYmdctr8QVdqJ//8Xu3+1phjDy ------END CERTIFICATE-----` - -var unknownAuthorityErrorTests = []struct { - cert string - expected string -}{ - {selfSignedWithCommonName, "x509: certificate signed by unknown authority (possibly because of \"empty\" while trying to verify candidate authority certificate \"test\")"}, - {selfSignedNoCommonNameWithOrgName, "x509: certificate signed by unknown authority (possibly because of \"empty\" while trying to verify candidate authority certificate \"ca\")"}, - {selfSignedNoCommonNameNoOrgName, "x509: certificate signed by unknown authority (possibly because of \"empty\" while trying to verify candidate authority certificate \"serial:0\")"}, -} - -func TestUnknownAuthorityError(t *testing.T) { - for i, tt := range unknownAuthorityErrorTests { - der, _ := pem.Decode([]byte(tt.cert)) - if der == nil { - t.Errorf("#%d: Unable to decode PEM block", i) - } - c, err := ParseCertificate(der.Bytes) - if err != nil { - t.Errorf("#%d: Unable to parse certificate -> %s", i, err) - } - uae := &UnknownAuthorityError{ - Cert: c, - hintErr: fmt.Errorf("empty"), - hintCert: c, - } - actual := uae.Error() - if actual != tt.expected { - t.Errorf("#%d: UnknownAuthorityError.Error() response invalid actual: %s expected: %s", i, actual, tt.expected) - } - } -} - -var nameConstraintTests = []struct { - constraint, domain string - expectError bool - shouldMatch bool -}{ - {"", "anything.com", false, true}, - {"example.com", "example.com", false, true}, - {"example.com.", "example.com", true, false}, - {"example.com", "example.com.", true, false}, - {"example.com", "ExAmPle.coM", false, true}, - {"example.com", "exampl1.com", false, false}, - {"example.com", "www.ExAmPle.coM", false, true}, - {"example.com", "sub.www.ExAmPle.coM", false, true}, - {"example.com", "notexample.com", false, false}, - {".example.com", "example.com", false, false}, - {".example.com", "www.example.com", false, true}, - {".example.com", "www..example.com", true, false}, -} - -func TestNameConstraints(t *testing.T) { - for i, test := range nameConstraintTests { - result, err := matchDomainConstraint(test.domain, test.constraint) - - if err != nil && !test.expectError { - t.Errorf("unexpected error for test #%d: domain=%s, constraint=%s, err=%s", i, test.domain, test.constraint, err) - continue - } - - if err == nil && test.expectError { - t.Errorf("unexpected success for test #%d: domain=%s, constraint=%s", i, test.domain, test.constraint) - continue - } - - if result != test.shouldMatch { - t.Errorf("unexpected result for test #%d: domain=%s, constraint=%s, result=%t", i, test.domain, test.constraint, result) - } - } -} - -const selfSignedWithCommonName = `-----BEGIN CERTIFICATE----- -MIIDCjCCAfKgAwIBAgIBADANBgkqhkiG9w0BAQsFADA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-----` - -const criticalExtRoot = `-----BEGIN CERTIFICATE----- -MIIBqzCCAVGgAwIBAgIJAJ+mI/85cXApMAoGCCqGSM49BAMCMB0xDDAKBgNVBAoT -A09yZzENMAsGA1UEAxMEUm9vdDAeFw0xNTAxMDEwMDAwMDBaFw0yNTAxMDEwMDAw -MDBaMB0xDDAKBgNVBAoTA09yZzENMAsGA1UEAxMEUm9vdDBZMBMGByqGSM49AgEG -CCqGSM49AwEHA0IABJGp9joiG2QSQA+1FczEDAsWo84rFiP3GTL+n+ugcS6TyNib -gzMsdbJgVi+a33y0SzLZxB+YvU3/4KTk8yKLC+2jejB4MA4GA1UdDwEB/wQEAwIC -BDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDwYDVR0TAQH/BAUwAwEB -/zAZBgNVHQ4EEgQQQDfXAftAL7gcflQEJ4xZATAbBgNVHSMEFDASgBBAN9cB+0Av -uBx+VAQnjFkBMAoGCCqGSM49BAMCA0gAMEUCIFeSV00fABFceWR52K+CfIgOHotY -FizzGiLB47hGwjMuAiEA8e0um2Kr8FPQ4wmFKaTRKHMaZizCGl3m+RG5QsE1KWo= ------END CERTIFICATE-----` - -const criticalExtIntermediate = `-----BEGIN CERTIFICATE----- -MIIBszCCAVmgAwIBAgIJAL2kcGZKpzVqMAoGCCqGSM49BAMCMB0xDDAKBgNVBAoT -A09yZzENMAsGA1UEAxMEUm9vdDAeFw0xNTAxMDEwMDAwMDBaFw0yNTAxMDEwMDAw -MDBaMCUxDDAKBgNVBAoTA09yZzEVMBMGA1UEAxMMSW50ZXJtZWRpYXRlMFkwEwYH -KoZIzj0CAQYIKoZIzj0DAQcDQgAESqVq92iPEq01cL4o99WiXDc5GZjpjNlzMS1n -rk8oHcVDp4tQRRQG3F4A6dF1rn/L923ha3b0fhDLlAvXZB+7EKN6MHgwDgYDVR0P -AQH/BAQDAgIEMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAPBgNVHRMB -Af8EBTADAQH/MBkGA1UdDgQSBBCMGmiotXbbXVd7H40UsgajMBsGA1UdIwQUMBKA -EEA31wH7QC+4HH5UBCeMWQEwCgYIKoZIzj0EAwIDSAAwRQIhAOhhNRb6KV7h3wbE -cdap8bojzvUcPD78fbsQPCNw1jPxAiBOeAJhlTwpKn9KHpeJphYSzydj9NqcS26Y -xXbdbm27KQ== ------END CERTIFICATE-----` - -const criticalExtLeafWithExt = `-----BEGIN CERTIFICATE----- -MIIBxTCCAWugAwIBAgIJAJZAUtw5ccb1MAoGCCqGSM49BAMCMCUxDDAKBgNVBAoT -A09yZzEVMBMGA1UEAxMMSW50ZXJtZWRpYXRlMB4XDTE1MDEwMTAwMDAwMFoXDTI1 -MDEwMTAwMDAwMFowJDEMMAoGA1UEChMDT3JnMRQwEgYDVQQDEwtleGFtcGxlLmNv -bTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABF3ABa2+B6gUyg6ayCaRQWYY/+No -6PceLqEavZNUeVNuz7bS74Toy8I7R3bGMkMgbKpLSPlPTroAATvebTXoBaijgYQw -gYEwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD -AjAMBgNVHRMBAf8EAjAAMBkGA1UdDgQSBBBRNtBL2vq8nCV3qVp7ycxMMBsGA1Ud -IwQUMBKAEIwaaKi1dttdV3sfjRSyBqMwCgYDUQMEAQH/BAAwCgYIKoZIzj0EAwID -SAAwRQIgVjy8GBgZFiagexEuDLqtGjIRJQtBcf7lYgf6XFPH1h4CIQCT6nHhGo6E -I+crEm4P5q72AnA/Iy0m24l7OvLuXObAmg== ------END CERTIFICATE-----` - -const criticalExtIntermediateWithExt = `-----BEGIN CERTIFICATE----- -MIIB2TCCAX6gAwIBAgIIQD3NrSZtcUUwCgYIKoZIzj0EAwIwHTEMMAoGA1UEChMD -T3JnMQ0wCwYDVQQDEwRSb290MB4XDTE1MDEwMTAwMDAwMFoXDTI1MDEwMTAwMDAw -MFowPTEMMAoGA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bnqw7de8GzGA1nfMAoG -CCqGSM49BAMCA0gAMEUCIQClA3d4tdrDu9Eb5ZBpgyC+fU1xTZB0dKQHz6M5fPZA -2AIgN96lM+CPGicwhN24uQI6flOsO3H0TJ5lNzBYLtnQtlc= ------END CERTIFICATE-----` diff --git a/vendor/github.com/google/certificate-transparency-go/x509/x509_test.go b/vendor/github.com/google/certificate-transparency-go/x509/x509_test.go deleted file mode 100644 index 8c4c16a..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509/x509_test.go +++ /dev/null @@ -1,2429 +0,0 @@ -// Copyright 2009 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. - -package x509 - -import ( - "bytes" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/rsa" - _ "crypto/sha256" - _ "crypto/sha512" - "encoding/base64" - "encoding/hex" - "encoding/pem" - "errors" - "fmt" - "math/big" - "net" - "net/url" - "os/exec" - "reflect" - "runtime" - "strings" - "testing" - "time" - - "github.com/google/certificate-transparency-go/asn1" - "github.com/google/certificate-transparency-go/x509/pkix" -) - -func TestParsePKCS1PrivateKey(t *testing.T) { - block, _ := pem.Decode([]byte(pemPrivateKey)) - priv, err := ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - t.Errorf("Failed to parse private key: %s", err) - return - } - if priv.PublicKey.N.Cmp(rsaPrivateKey.PublicKey.N) != 0 || - priv.PublicKey.E != rsaPrivateKey.PublicKey.E || - priv.D.Cmp(rsaPrivateKey.D) != 0 || - priv.Primes[0].Cmp(rsaPrivateKey.Primes[0]) != 0 || - priv.Primes[1].Cmp(rsaPrivateKey.Primes[1]) != 0 { - t.Errorf("got:%+v want:%+v", priv, rsaPrivateKey) - } - - // This private key includes an invalid prime that - // rsa.PrivateKey.Validate should reject. - data := []byte("0\x16\x02\x00\x02\x02\u007f\x00\x02\x0200\x02\x0200\x02\x02\x00\x01\x02\x02\u007f\x00") - if _, err := ParsePKCS1PrivateKey(data); err == nil { - t.Errorf("parsing invalid private key did not result in an error") - } -} - -func TestParsePKIXPublicKey(t *testing.T) { - block, _ := pem.Decode([]byte(pemPublicKey)) - pub, err := ParsePKIXPublicKey(block.Bytes) - if err != nil { - t.Errorf("Failed to parse RSA public key: %s", err) - return - } - rsaPub, ok := pub.(*rsa.PublicKey) - if !ok { - t.Errorf("Value returned from ParsePKIXPublicKey was not an RSA public key") - return - } - - pubBytes2, err := MarshalPKIXPublicKey(rsaPub) - if err != nil { - t.Errorf("Failed to marshal RSA public key for the second time: %s", err) - return - } - if !bytes.Equal(pubBytes2, block.Bytes) { - t.Errorf("Reserialization of public key didn't match. got %x, want %x", pubBytes2, block.Bytes) - } -} - -var pemPublicKey = `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3VoPN9PKUjKFLMwOge6+ -wnDi8sbETGIx2FKXGgqtAKpzmem53kRGEQg8WeqRmp12wgp74TGpkEXsGae7RS1k -enJCnma4fii+noGH7R0qKgHvPrI2Bwa9hzsH8tHxpyM3qrXslOmD45EH9SxIDUBJ -FehNdaPbLP1gFyahKMsdfxFJLUvbUycuZSJ2ZnIgeVxwm4qbSvZInL9Iu4FzuPtg -fINKcbbovy1qq4KvPIrXzhbY3PWDc6btxCf3SE0JdE1MCPThntB62/bLMSQ7xdDR -FF53oIpvxe/SCOymfWq/LW849Ytv3Xwod0+wzAP8STXG4HSELS4UedPYeHJJJYcZ -+QIDAQAB ------END PUBLIC KEY----- -` - -var pemPrivateKey = ` ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQCxoeCUW5KJxNPxMp+KmCxKLc1Zv9Ny+4CFqcUXVUYH69L3mQ7v -IWrJ9GBfcaA7BPQqUlWxWM+OCEQZH1EZNIuqRMNQVuIGCbz5UQ8w6tS0gcgdeGX7 -J7jgCQ4RK3F/PuCM38QBLaHx988qG8NMc6VKErBjctCXFHQt14lerd5KpQIDAQAB -AoGAYrf6Hbk+mT5AI33k2Jt1kcweodBP7UkExkPxeuQzRVe0KVJw0EkcFhywKpr1 -V5eLMrILWcJnpyHE5slWwtFHBG6a5fLaNtsBBtcAIfqTQ0Vfj5c6SzVaJv0Z5rOd -7gQF6isy3t3w9IF3We9wXQKzT6q5ypPGdm6fciKQ8RnzREkCQQDZwppKATqQ41/R -vhSj90fFifrGE6aVKC1hgSpxGQa4oIdsYYHwMzyhBmWW9Xv/R+fPyr8ZwPxp2c12 -33QwOLPLAkEA0NNUb+z4ebVVHyvSwF5jhfJxigim+s49KuzJ1+A2RaSApGyBZiwS -rWvWkB471POAKUYt5ykIWVZ83zcceQiNTwJBAMJUFQZX5GDqWFc/zwGoKkeR49Yi -MTXIvf7Wmv6E++eFcnT461FlGAUHRV+bQQXGsItR/opIG7mGogIkVXa3E1MCQARX -AAA7eoZ9AEHflUeuLn9QJI/r0hyQQLEtrpwv6rDT1GCWaLII5HJ6NUFVf4TTcqxo -6vdM4QGKTJoO+SaCyP0CQFdpcxSAuzpFcKv0IlJ8XzS/cy+mweCMwyJ1PFEc4FX6 -wg/HcAJWY60xZTJDFN+Qfx8ZQvBEin6c2/h+zZi5IVY= ------END RSA PRIVATE KEY----- -` - -var testPrivateKey *rsa.PrivateKey - -func init() { - block, _ := pem.Decode([]byte(pemPrivateKey)) - - var err error - if testPrivateKey, err = ParsePKCS1PrivateKey(block.Bytes); err != nil { - panic("Failed to parse private key: " + err.Error()) - } -} - -func bigFromString(s string) *big.Int { - ret := new(big.Int) - ret.SetString(s, 10) - return ret -} - -func fromBase10(base10 string) *big.Int { - i := new(big.Int) - i.SetString(base10, 10) - return i -} - -func bigFromHexString(s string) *big.Int { - ret := new(big.Int) - ret.SetString(s, 16) - return ret -} - -var rsaPrivateKey = &rsa.PrivateKey{ - PublicKey: rsa.PublicKey{ - N: bigFromString("124737666279038955318614287965056875799409043964547386061640914307192830334599556034328900586693254156136128122194531292927142396093148164407300419162827624945636708870992355233833321488652786796134504707628792159725681555822420087112284637501705261187690946267527866880072856272532711620639179596808018872997"), - E: 65537, - }, - D: bigFromString("69322600686866301945688231018559005300304807960033948687567105312977055197015197977971637657636780793670599180105424702854759606794705928621125408040473426339714144598640466128488132656829419518221592374964225347786430566310906679585739468938549035854760501049443920822523780156843263434219450229353270690889"), - Primes: []*big.Int{ - bigFromString("11405025354575369741595561190164746858706645478381139288033759331174478411254205003127028642766986913445391069745480057674348716675323735886284176682955723"), - bigFromString("10937079261204603443118731009201819560867324167189758120988909645641782263430128449826989846631183550578761324239709121189827307416350485191350050332642639"), - }, -} - -func TestMarshalRSAPrivateKey(t *testing.T) { - priv := &rsa.PrivateKey{ - PublicKey: rsa.PublicKey{ - N: fromBase10("16346378922382193400538269749936049106320265317511766357599732575277382844051791096569333808598921852351577762718529818072849191122419410612033592401403764925096136759934497687765453905884149505175426053037420486697072448609022753683683718057795566811401938833367954642951433473337066311978821180526439641496973296037000052546108507805269279414789035461158073156772151892452251106173507240488993608650881929629163465099476849643165682709047462010581308719577053905787496296934240246311806555924593059995202856826239801816771116902778517096212527979497399966526283516447337775509777558018145573127308919204297111496233"), - E: 3, - }, - D: fromBase10("10897585948254795600358846499957366070880176878341177571733155050184921896034527397712889205732614568234385175145686545381899460748279607074689061600935843283397424506622998458510302603922766336783617368686090042765718290914099334449154829375179958369993407724946186243249568928237086215759259909861748642124071874879861299389874230489928271621259294894142840428407196932444474088857746123104978617098858619445675532587787023228852383149557470077802718705420275739737958953794088728369933811184572620857678792001136676902250566845618813972833750098806496641114644760255910789397593428910198080271317419213080834885003"), - Primes: []*big.Int{ - fromBase10("1025363189502892836833747188838978207017355117492483312747347695538428729137306368764177201532277413433182799108299960196606011786562992097313508180436744488171474690412562218914213688661311117337381958560443"), - fromBase10("3467903426626310123395340254094941045497208049900750380025518552334536945536837294961497712862519984786362199788654739924501424784631315081391467293694361474867825728031147665777546570788493758372218019373"), - fromBase10("4597024781409332673052708605078359346966325141767460991205742124888960305710298765592730135879076084498363772408626791576005136245060321874472727132746643162385746062759369754202494417496879741537284589047"), - }, - } - - derBytes := MarshalPKCS1PrivateKey(priv) - - priv2, err := ParsePKCS1PrivateKey(derBytes) - if err != nil { - t.Errorf("error parsing serialized key: %s", err) - return - } - if priv.PublicKey.N.Cmp(priv2.PublicKey.N) != 0 || - priv.PublicKey.E != priv2.PublicKey.E || - priv.D.Cmp(priv2.D) != 0 || - len(priv2.Primes) != 3 || - priv.Primes[0].Cmp(priv2.Primes[0]) != 0 || - priv.Primes[1].Cmp(priv2.Primes[1]) != 0 || - priv.Primes[2].Cmp(priv2.Primes[2]) != 0 { - t.Errorf("got:%+v want:%+v", priv, priv2) - } -} - -func TestMarshalRSAPublicKey(t *testing.T) { - pub := &rsa.PublicKey{ - N: fromBase10("16346378922382193400538269749936049106320265317511766357599732575277382844051791096569333808598921852351577762718529818072849191122419410612033592401403764925096136759934497687765453905884149505175426053037420486697072448609022753683683718057795566811401938833367954642951433473337066311978821180526439641496973296037000052546108507805269279414789035461158073156772151892452251106173507240488993608650881929629163465099476849643165682709047462010581308719577053905787496296934240246311806555924593059995202856826239801816771116902778517096212527979497399966526283516447337775509777558018145573127308919204297111496233"), - E: 3, - } - derBytes := MarshalPKCS1PublicKey(pub) - pub2, err := ParsePKCS1PublicKey(derBytes) - if err != nil { - t.Errorf("ParsePKCS1PublicKey: %s", err) - } - if pub.N.Cmp(pub2.N) != 0 || pub.E != pub2.E { - t.Errorf("ParsePKCS1PublicKey = %+v, want %+v", pub, pub2) - } - - // It's never been documented that asn1.Marshal/Unmarshal on rsa.PublicKey works, - // but it does, and we know of code that depends on it. - // Lock that in, even though we'd prefer that people use MarshalPKCS1PublicKey and ParsePKCS1PublicKey. - derBytes2, err := asn1.Marshal(*pub) - if err != nil { - t.Errorf("Marshal(rsa.PublicKey): %v", err) - } else if !bytes.Equal(derBytes, derBytes2) { - t.Errorf("Marshal(rsa.PublicKey) = %x, want %x", derBytes2, derBytes) - } - pub3 := new(rsa.PublicKey) - rest, err := asn1.Unmarshal(derBytes, pub3) - if err != nil { - t.Errorf("Unmarshal(rsa.PublicKey): %v", err) - } - if len(rest) != 0 || pub.N.Cmp(pub3.N) != 0 || pub.E != pub3.E { - t.Errorf("Unmarshal(rsa.PublicKey) = %+v, %q want %+v, %q", pub, rest, pub2, []byte(nil)) - } - - publicKeys := []struct { - derBytes []byte - expectedErrSubstr string - }{ - { - derBytes: []byte{ - 0x30, 6, // SEQUENCE, 6 bytes - 0x02, 1, // INTEGER, 1 byte - 17, - 0x02, 1, // INTEGER, 1 byte - 3, // 3 - }, - }, { - derBytes: []byte{ - 0x30, 6, // SEQUENCE - 0x02, 1, // INTEGER, 1 byte - 0xff, // -1 - 0x02, 1, // INTEGER, 1 byte - 3, - }, - expectedErrSubstr: "zero or negative", - }, { - derBytes: []byte{ - 0x30, 6, // SEQUENCE - 0x02, 1, // INTEGER, 1 byte - 17, - 0x02, 1, // INTEGER, 1 byte - 0xff, // -1 - }, - expectedErrSubstr: "zero or negative", - }, { - derBytes: []byte{ - 0x30, 6, // SEQUENCE - 0x02, 1, // INTEGER, 1 byte - 17, - 0x02, 1, // INTEGER, 1 byte - 3, - 1, - }, - expectedErrSubstr: "trailing data", - }, { - derBytes: []byte{ - 0x30, 9, // SEQUENCE - 0x02, 1, // INTEGER, 1 byte - 17, - 0x02, 4, // INTEGER, 4 bytes - 0x7f, 0xff, 0xff, 0xff, - }, - }, { - derBytes: []byte{ - 0x30, 10, // SEQUENCE - 0x02, 1, // INTEGER, 1 byte - 17, - 0x02, 5, // INTEGER, 5 bytes - 0x00, 0x80, 0x00, 0x00, 0x00, - }, - // On 64-bit systems, encoding/asn1 will accept the - // public exponent, but ParsePKCS1PublicKey will return - // an error. On 32-bit systems, encoding/asn1 will - // return the error. The common substring of both error - // is the word “large”. - expectedErrSubstr: "large", - }, - } - - for i, test := range publicKeys { - shouldFail := len(test.expectedErrSubstr) > 0 - pub, err := ParsePKCS1PublicKey(test.derBytes) - if shouldFail { - if err == nil { - t.Errorf("#%d: unexpected success, got %#v", i, pub) - } else if !strings.Contains(err.Error(), test.expectedErrSubstr) { - t.Errorf("#%d: expected error containing %q, got %s", i, test.expectedErrSubstr, err) - } - } else { - if err != nil { - t.Errorf("#%d: unexpected failure: %s", i, err) - continue - } - reserialized := MarshalPKCS1PublicKey(pub) - if !bytes.Equal(reserialized, test.derBytes) { - t.Errorf("#%d: failed to reserialize: got %x, expected %x", i, reserialized, test.derBytes) - } - } - } -} - -type matchHostnamesTest struct { - pattern, host string - ok bool -} - -var matchHostnamesTests = []matchHostnamesTest{ - {"a.b.c", "a.b.c", true}, - {"a.b.c", "b.b.c", false}, - {"", "b.b.c", false}, - {"a.b.c", "", false}, - {"example.com", "example.com", true}, - {"example.com", "www.example.com", false}, - {"*.example.com", "example.com", false}, - {"*.example.com", "www.example.com", true}, - {"*.example.com", "www.example.com.", true}, - {"*.example.com", "xyz.www.example.com", false}, - {"*.*.example.com", "xyz.www.example.com", false}, - {"*.www.*.com", "xyz.www.example.com", false}, - {"*bar.example.com", "foobar.example.com", false}, - {"f*.example.com", "foobar.example.com", false}, - {"", ".", false}, - {".", "", false}, - {".", ".", false}, - {"example.com", "example.com.", true}, - {"example.com.", "example.com", true}, - {"example.com.", "example.com.", true}, - {"*.com.", "example.com.", true}, - {"*.com.", "example.com", true}, - {"*.com", "example.com", true}, - {"*.com", "example.com.", true}, -} - -func TestMatchHostnames(t *testing.T) { - for i, test := range matchHostnamesTests { - r := matchHostnames(test.pattern, test.host) - if r != test.ok { - t.Errorf("#%d mismatch got: %t want: %t when matching '%s' against '%s'", i, r, test.ok, test.host, test.pattern) - } - } -} - -func TestMatchIP(t *testing.T) { - // Check that pattern matching is working. - c := &Certificate{ - DNSNames: []string{"*.foo.bar.baz"}, - Subject: pkix.Name{ - CommonName: "*.foo.bar.baz", - }, - } - err := c.VerifyHostname("quux.foo.bar.baz") - if err != nil { - t.Fatalf("VerifyHostname(quux.foo.bar.baz): %v", err) - } - - // But check that if we change it to be matching against an IP address, - // it is rejected. - c = &Certificate{ - DNSNames: []string{"*.2.3.4"}, - Subject: pkix.Name{ - CommonName: "*.2.3.4", - }, - } - err = c.VerifyHostname("1.2.3.4") - if err == nil { - t.Fatalf("VerifyHostname(1.2.3.4) should have failed, did not") - } - - c = &Certificate{ - IPAddresses: []net.IP{net.ParseIP("127.0.0.1"), net.ParseIP("::1")}, - } - err = c.VerifyHostname("127.0.0.1") - if err != nil { - t.Fatalf("VerifyHostname(127.0.0.1): %v", err) - } - err = c.VerifyHostname("::1") - if err != nil { - t.Fatalf("VerifyHostname(::1): %v", err) - } - err = c.VerifyHostname("[::1]") - if err != nil { - t.Fatalf("VerifyHostname([::1]): %v", err) - } -} - -func TestCertificateParse(t *testing.T) { - s, _ := hex.DecodeString(certBytes) - certs, err := ParseCertificates(s) - if err != nil { - t.Error(err) - } - if len(certs) != 2 { - t.Errorf("Wrong number of certs: got %d want 2", len(certs)) - return - } - - err = certs[0].CheckSignatureFrom(certs[1]) - if err != nil { - t.Error(err) - } - - if err := certs[0].VerifyHostname("mail.google.com"); err != nil { - t.Error(err) - } - - const expectedExtensions = 4 - if n := len(certs[0].Extensions); n != expectedExtensions { - t.Errorf("want %d extensions, got %d", expectedExtensions, n) - } -} - -func TestMismatchedSignatureAlgorithm(t *testing.T) { - der, _ := pem.Decode([]byte(rsaPSSSelfSignedPEM)) - if der == nil { - t.Fatal("Failed to find PEM block") - } - - cert, err := ParseCertificate(der.Bytes) - if err != nil { - t.Fatal(err) - } - - if err = cert.CheckSignature(ECDSAWithSHA256, nil, nil); err == nil { - t.Fatal("CheckSignature unexpectedly return no error") - } - - const expectedSubstring = " but have public key of type " - if !strings.Contains(err.Error(), expectedSubstring) { - t.Errorf("Expected error containing %q, but got %q", expectedSubstring, err) - } -} - -var certBytes = "308203223082028ba00302010202106edf0d9499fd4533dd1297fc42a93be1300d06092a864886" + - "f70d0101050500304c310b3009060355040613025a4131253023060355040a131c546861777465" + - "20436f6e73756c74696e67202850747929204c74642e311630140603550403130d546861777465" + - "20534743204341301e170d3039303332353136343932395a170d3130303332353136343932395a" + - "3069310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630" + - "140603550407130d4d6f756e7461696e205669657731133011060355040a130a476f6f676c6520" + - "496e63311830160603550403130f6d61696c2e676f6f676c652e636f6d30819f300d06092a8648" + - "86f70d010101050003818d0030818902818100c5d6f892fccaf5614b064149e80a2c9581a218ef" + - "41ec35bd7a58125ae76f9ea54ddc893abbeb029f6b73616bf0ffd868791fba7af9c4aebf3706ba" + - "3eeaeed27435b4ddcfb157c05f351d66aa87fee0de072d66d773affbd36ab78bef090e0cc861a9" + - "03ac90dd98b51c9c41566c017f0beec3bff391051ffba0f5cc6850ad2a590203010001a381e730" + - "81e430280603551d250421301f06082b0601050507030106082b06010505070302060960864801" + - "86f842040130360603551d1f042f302d302ba029a0278625687474703a2f2f63726c2e74686177" + - "74652e636f6d2f54686177746553474343412e63726c307206082b060105050701010466306430" + - "2206082b060105050730018616687474703a2f2f6f6373702e7468617774652e636f6d303e0608" + - "2b060105050730028632687474703a2f2f7777772e7468617774652e636f6d2f7265706f736974" + - "6f72792f5468617774655f5347435f43412e637274300c0603551d130101ff04023000300d0609" + - "2a864886f70d01010505000381810062f1f3050ebc105e497c7aedf87e24d2f4a986bb3b837bd1" + - "9b91ebcad98b065992f6bd2b49b7d6d3cb2e427a99d606c7b1d46352527fac39e6a8b6726de5bf" + - "70212a52cba07634a5e332011bd1868e78eb5e3c93cf03072276786f207494feaa0ed9d53b2110" + - "a76571f90209cdae884385c882587030ee15f33d761e2e45a6bc308203233082028ca003020102" + - "020430000002300d06092a864886f70d0101050500305f310b3009060355040613025553311730" + - "15060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c61737320" + - "33205075626c6963205072696d6172792043657274696669636174696f6e20417574686f726974" + - "79301e170d3034303531333030303030305a170d3134303531323233353935395a304c310b3009" + - "060355040613025a4131253023060355040a131c54686177746520436f6e73756c74696e672028" + - "50747929204c74642e311630140603550403130d5468617774652053474320434130819f300d06" + - "092a864886f70d010101050003818d0030818902818100d4d367d08d157faecd31fe7d1d91a13f" + - "0b713cacccc864fb63fc324b0794bd6f80ba2fe10493c033fc093323e90b742b71c403c6d2cde2" + - "2ff50963cdff48a500bfe0e7f388b72d32de9836e60aad007bc4644a3b847503f270927d0e62f5" + - "21ab693684317590f8bfc76c881b06957cc9e5a8de75a12c7a68dfd5ca1c875860190203010001" + - "a381fe3081fb30120603551d130101ff040830060101ff020100300b0603551d0f040403020106" + - "301106096086480186f842010104040302010630280603551d110421301fa41d301b3119301706" + - "035504031310507269766174654c6162656c332d313530310603551d1f042a30283026a024a022" + - "8620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726c303206082b" + - "0601050507010104263024302206082b060105050730018616687474703a2f2f6f6373702e7468" + - "617774652e636f6d30340603551d25042d302b06082b0601050507030106082b06010505070302" + - "06096086480186f8420401060a6086480186f845010801300d06092a864886f70d010105050003" + - "81810055ac63eadea1ddd2905f9f0bce76be13518f93d9052bc81b774bad6950a1eededcfddb07" + - "e9e83994dcab72792f06bfab8170c4a8edea5334edef1e53d906c7562bd15cf4d18a8eb42bb137" + - "9048084225c53e8acb7feb6f04d16dc574a2f7a27c7b603c77cd0ece48027f012fb69b37e02a2a" + - "36dcd585d6ace53f546f961e05af" - -var certWithSCTListPEM = ` ------BEGIN CERTIFICATE----- -MIIHkzCCBnugAwIBAgIUHz6ZOwEjk6zhU9v3n2Jo3qeucqYwDQYJKoZIhvcNAQEL -BQAwSTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHzAd -BgNVBAMTFlF1b1ZhZGlzIEVWIFNTTCBJQ0EgRzEwHhcNMTcwMjA4MTQxNTU3WhcN -MTgwMjA4MTQyNTAwWjCByzETMBEGCysGAQQBgjc8AgEDEwJHQjEYMBYGA1UEDwwP -QnVzaW5lc3MgRW50aXR5MREwDwYDVQQFEwhTQzA5NTAwMDELMAkGA1UEBhMCR0Ix -EjAQBgNVBAgM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RlC -JvNuS1lDM0u3+g/MHNpQM1aGZVKtwpzRABIYhydSJrO14TzWJjbKm1UTnKiwvHbt -p1ATnYNDZKj3Ec8EASXGTHHoorX0jZpMiNxHv4p4BUinsNFttkhudMGbCfbjjqef -UfUJESblkeQVpcnndMfnsHSahCVd96k= ------END CERTIFICATE----- -` - -// The cert above contains the following SCTs, each of which is a TLS-encoded -// SignedCertificateTimestamp structure from RFC6962 s3.2. -/* - struct { - Version sct_version; - LogID id; - uint64 timestamp; - CtExtensions extensions; - digitally-signed struct { - Version sct_version; - SignatureType signature_type = certificate_timestamp; - uint64 timestamp; - LogEntryType entry_type; - select(entry_type) { - case x509_entry: ASN.1Cert; - case precert_entry: PreCert; - } signed_entry; - CtExtensions extensions; - }; - } SignedCertificateTimestamp; -*/ - -var wantSCTs = []string{ - ("00" + // Version: v1(0) - "bbd9dfbc1f8a71b593942397aa927b473857950aab52e81a909664368e1ed185" + // LogID: Google Skydiver - "0000015a1e1ddc08" + // Timestamp - "0000" + // No Extensions - ("04" + "03" + // SHA-256, ECDSA - ("0047" + - "3045022100f77e1ffa0a9dc8e38a6829f840ec89218c89ef97ca82f49928a32701ecd7c496022032285cf05d00a7580853b5940b15a05749d4c5e5a9df89a9fa0d083e7349d4a7"))), - - ("00" + // Version: v1(0) - "a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10" + // LogID: Google Pilot - "0000015a1e1ddc1a" + - "0000" + // No Extensions - ("04" + "03" + // SHA-256, ECDSA - ("0047" + - "304502200e39bbda5f7a2acd1e7f0ad311c30947c28a1412149a34618985c581203bc184022100c035dd988924bf7949d6d77e4634f35cc0488e9f51dc88b51ae98e18a7bc22a7"))), - ("00" + // Version: v1(0) - "5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd" + // LogID: Digicert Log Server - "0000015a1e1ddc40" + // Timestamp - "0000" + // No Extensions - ("04" + "03" + // SHA-256, ECDSA - ("0047" + - "3045022047dee60ad1893bda1d92787b88256c67ed67cee7d6941fda555ec81314ab45da022100ffe5bea8271577784755a609af23baed26026d40629d4e7fea37bc7832ce10ce"))), -} - -func TestParseCertificateSCTs(t *testing.T) { - pemBlock, _ := pem.Decode([]byte(certWithSCTListPEM)) - cert, err := ParseCertificate(pemBlock.Bytes) - if err != nil { - t.Fatalf("ParseCertificate()=_,%v; want _, nil", err) - } - if len(cert.RawSCT) == 0 { - t.Errorf("len(cert.RawSCT)=0, want >0") - } - for i, got := range cert.SCTList.SCTList { - want, _ := hex.DecodeString(wantSCTs[i]) - if !bytes.Equal(got.Val, want) { - t.Errorf("SCT[%d]=%x; want %x", i, got.Val, want) - } - } -} - -func parseCIDR(s string) *net.IPNet { - _, net, err := net.ParseCIDR(s) - if err != nil { - panic(err) - } - return net -} - -func parseURI(s string) *url.URL { - uri, err := url.Parse(s) - if err != nil { - panic(err) - } - return uri -} - -func TestCreateSelfSignedCertificate(t *testing.T) { - random := rand.Reader - - ecdsaPriv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if err != nil { - t.Fatalf("Failed to generate ECDSA key: %s", err) - } - - tests := []struct { - name string - pub, priv interface{} - checkSig bool - sigAlgo SignatureAlgorithm - }{ - {"RSA/RSA", &testPrivateKey.PublicKey, testPrivateKey, true, SHA1WithRSA}, - {"RSA/ECDSA", &testPrivateKey.PublicKey, ecdsaPriv, false, ECDSAWithSHA384}, - {"ECDSA/RSA", &ecdsaPriv.PublicKey, testPrivateKey, false, SHA256WithRSA}, - {"ECDSA/ECDSA", &ecdsaPriv.PublicKey, ecdsaPriv, true, ECDSAWithSHA1}, - {"RSAPSS/RSAPSS", &testPrivateKey.PublicKey, testPrivateKey, true, SHA256WithRSAPSS}, - {"ECDSA/RSAPSS", &ecdsaPriv.PublicKey, testPrivateKey, false, SHA256WithRSAPSS}, - {"RSAPSS/ECDSA", &testPrivateKey.PublicKey, ecdsaPriv, false, ECDSAWithSHA384}, - } - - testExtKeyUsage := []ExtKeyUsage{ExtKeyUsageClientAuth, ExtKeyUsageServerAuth} - testUnknownExtKeyUsage := []asn1.ObjectIdentifier{[]int{1, 2, 3}, []int{2, 59, 1}} - extraExtensionData := []byte("extra extension") - - for _, test := range tests { - commonName := "test.example.com" - template := Certificate{ - // SerialNumber is negative to ensure that negative - // values are parsed. This is due to the prevalence of - // buggy code that produces certificates with negative - // serial numbers. - SerialNumber: big.NewInt(-1), - Subject: pkix.Name{ - CommonName: commonName, - Organization: []string{"Σ Acme Co"}, - Country: []string{"US"}, - ExtraNames: []pkix.AttributeTypeAndValue{ - { - Type: []int{2, 5, 4, 42}, - Value: "Gopher", - }, - // This should override the Country, above. - { - Type: []int{2, 5, 4, 6}, - Value: "NL", - }, - }, - }, - NotBefore: time.Unix(1000, 0), - NotAfter: time.Unix(100000, 0), - - SignatureAlgorithm: test.sigAlgo, - - SubjectKeyId: []byte{1, 2, 3, 4}, - KeyUsage: KeyUsageCertSign, - - ExtKeyUsage: testExtKeyUsage, - UnknownExtKeyUsage: testUnknownExtKeyUsage, - - BasicConstraintsValid: true, - IsCA: true, - - OCSPServer: []string{"http://ocsp.example.com"}, - IssuingCertificateURL: []string{"http://crt.example.com/ca1.crt"}, - - DNSNames: []string{"test.example.com"}, - EmailAddresses: []string{"gopher@golang.org"}, - IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1).To4(), net.ParseIP("2001:4860:0:2001::68")}, - URIs: []*url.URL{parseURI("https://foo.com/wibble#foo")}, - - PolicyIdentifiers: []asn1.ObjectIdentifier{[]int{1, 2, 3}}, - PermittedDNSDomains: []string{".example.com", "example.com"}, - ExcludedDNSDomains: []string{"bar.example.com"}, - PermittedIPRanges: []*net.IPNet{parseCIDR("192.168.1.1/16"), parseCIDR("1.2.3.4/8")}, - ExcludedIPRanges: []*net.IPNet{parseCIDR("2001:db8::/48")}, - PermittedEmailAddresses: []string{"foo@example.com"}, - ExcludedEmailAddresses: []string{".example.com", "example.com"}, - PermittedURIDomains: []string{".bar.com", "bar.com"}, - ExcludedURIDomains: []string{".bar2.com", "bar2.com"}, - - CRLDistributionPoints: []string{"http://crl1.example.com/ca1.crl", "http://crl2.example.com/ca1.crl"}, - - RawSCT: []byte{0xde, 0xad}, // Ignored because SCTList provided. - SCTList: SignedCertificateTimestampList{ - SCTList: []SerializedSCT{ - {Val: []byte{0x01, 0x02, 0x03}}, - {Val: []byte{0x04, 0x05, 0x06}}, - }, - }, - - ExtraExtensions: []pkix.Extension{ - { - Id: []int{1, 2, 3, 4}, - Value: extraExtensionData, - }, - // This extension should override the SubjectKeyId, above. - { - Id: OIDExtensionSubjectKeyId, - Critical: false, - Value: []byte{0x04, 0x04, 4, 3, 2, 1}, - }, - }, - } - - derBytes, err := CreateCertificate(random, &template, &template, test.pub, test.priv) - if err != nil { - t.Errorf("%s: failed to create certificate: %s", test.name, err) - continue - } - - cert, err := ParseCertificate(derBytes) - if err != nil { - t.Errorf("%s: failed to parse certificate: %s", test.name, err) - continue - } - - if len(cert.PolicyIdentifiers) != 1 || !cert.PolicyIdentifiers[0].Equal(template.PolicyIdentifiers[0]) { - t.Errorf("%s: failed to parse policy identifiers: got:%#v want:%#v", test.name, cert.PolicyIdentifiers, template.PolicyIdentifiers) - } - - if len(cert.PermittedDNSDomains) != 2 || cert.PermittedDNSDomains[0] != ".example.com" || cert.PermittedDNSDomains[1] != "example.com" { - t.Errorf("%s: failed to parse name constraints: %#v", test.name, cert.PermittedDNSDomains) - } - - if len(cert.ExcludedDNSDomains) != 1 || cert.ExcludedDNSDomains[0] != "bar.example.com" { - t.Errorf("%s: failed to parse name constraint exclusions: %#v", test.name, cert.ExcludedDNSDomains) - } - - if len(cert.PermittedIPRanges) != 2 || cert.PermittedIPRanges[0].String() != "192.168.0.0/16" || cert.PermittedIPRanges[1].String() != "1.0.0.0/8" { - t.Errorf("%s: failed to parse IP constraints: %#v", test.name, cert.PermittedIPRanges) - } - - if len(cert.ExcludedIPRanges) != 1 || cert.ExcludedIPRanges[0].String() != "2001:db8::/48" { - t.Errorf("%s: failed to parse IP constraint exclusions: %#v", test.name, cert.ExcludedIPRanges) - } - - if len(cert.PermittedEmailAddresses) != 1 || cert.PermittedEmailAddresses[0] != "foo@example.com" { - t.Errorf("%s: failed to parse permitted email addreses: %#v", test.name, cert.PermittedEmailAddresses) - } - - if len(cert.ExcludedEmailAddresses) != 2 || cert.ExcludedEmailAddresses[0] != ".example.com" || cert.ExcludedEmailAddresses[1] != "example.com" { - t.Errorf("%s: failed to parse excluded email addreses: %#v", test.name, cert.ExcludedEmailAddresses) - } - - if len(cert.PermittedURIDomains) != 2 || cert.PermittedURIDomains[0] != ".bar.com" || cert.PermittedURIDomains[1] != "bar.com" { - t.Errorf("%s: failed to parse permitted URIs: %#v", test.name, cert.PermittedURIDomains) - } - - if len(cert.ExcludedURIDomains) != 2 || cert.ExcludedURIDomains[0] != ".bar2.com" || cert.ExcludedURIDomains[1] != "bar2.com" { - t.Errorf("%s: failed to parse excluded URIs: %#v", test.name, cert.ExcludedURIDomains) - } - - if cert.Subject.CommonName != commonName { - t.Errorf("%s: subject wasn't correctly copied from the template. Got %s, want %s", test.name, cert.Subject.CommonName, commonName) - } - - if len(cert.Subject.Country) != 1 || cert.Subject.Country[0] != "NL" { - t.Errorf("%s: ExtraNames didn't override Country", test.name) - } - - for _, ext := range cert.Extensions { - if ext.Id.Equal(OIDExtensionSubjectAltName) { - if ext.Critical { - t.Fatal("SAN extension is marked critical") - } - } - } - - found := false - for _, atv := range cert.Subject.Names { - if atv.Type.Equal([]int{2, 5, 4, 42}) { - found = true - break - } - } - if !found { - t.Errorf("%s: Names didn't contain oid 2.5.4.42 from ExtraNames", test.name) - } - - if cert.Issuer.CommonName != commonName { - t.Errorf("%s: issuer wasn't correctly copied from the template. Got %s, want %s", test.name, cert.Issuer.CommonName, commonName) - } - - if cert.SignatureAlgorithm != test.sigAlgo { - t.Errorf("%s: SignatureAlgorithm wasn't copied from template. Got %v, want %v", test.name, cert.SignatureAlgorithm, test.sigAlgo) - } - - if !reflect.DeepEqual(cert.ExtKeyUsage, testExtKeyUsage) { - t.Errorf("%s: extkeyusage wasn't correctly copied from the template. Got %v, want %v", test.name, cert.ExtKeyUsage, testExtKeyUsage) - } - - if !reflect.DeepEqual(cert.UnknownExtKeyUsage, testUnknownExtKeyUsage) { - t.Errorf("%s: unknown extkeyusage wasn't correctly copied from the template. Got %v, want %v", test.name, cert.UnknownExtKeyUsage, testUnknownExtKeyUsage) - } - - if !reflect.DeepEqual(cert.OCSPServer, template.OCSPServer) { - t.Errorf("%s: OCSP servers differ from template. Got %v, want %v", test.name, cert.OCSPServer, template.OCSPServer) - } - - if !reflect.DeepEqual(cert.IssuingCertificateURL, template.IssuingCertificateURL) { - t.Errorf("%s: Issuing certificate URLs differ from template. Got %v, want %v", test.name, cert.IssuingCertificateURL, template.IssuingCertificateURL) - } - - if !reflect.DeepEqual(cert.DNSNames, template.DNSNames) { - t.Errorf("%s: SAN DNS names differ from template. Got %v, want %v", test.name, cert.DNSNames, template.DNSNames) - } - - if !reflect.DeepEqual(cert.EmailAddresses, template.EmailAddresses) { - t.Errorf("%s: SAN emails differ from template. Got %v, want %v", test.name, cert.EmailAddresses, template.EmailAddresses) - } - - if len(cert.URIs) != 1 || cert.URIs[0].String() != "https://foo.com/wibble#foo" { - t.Errorf("%s: URIs differ from template. Got %v, want %v", test.name, cert.URIs, template.URIs) - } - - if !reflect.DeepEqual(cert.IPAddresses, template.IPAddresses) { - t.Errorf("%s: SAN IPs differ from template. Got %v, want %v", test.name, cert.IPAddresses, template.IPAddresses) - } - - if !reflect.DeepEqual(cert.CRLDistributionPoints, template.CRLDistributionPoints) { - t.Errorf("%s: CRL distribution points differ from template. Got %v, want %v", test.name, cert.CRLDistributionPoints, template.CRLDistributionPoints) - } - - if !reflect.DeepEqual(cert.SCTList, template.SCTList) { - t.Errorf("%s: SCTList differs from template. Got %v, want %v", test.name, cert.SCTList, template.SCTList) - } - - if !bytes.Equal(cert.SubjectKeyId, []byte{4, 3, 2, 1}) { - t.Errorf("%s: ExtraExtensions didn't override SubjectKeyId", test.name) - } - - if !bytes.Contains(derBytes, extraExtensionData) { - t.Errorf("%s: didn't find extra extension in DER output", test.name) - } - - if test.checkSig { - err = cert.CheckSignatureFrom(cert) - if err != nil { - t.Errorf("%s: signature verification failed: %s", test.name, err) - } - } - } -} - -// Self-signed certificate using ECDSA with SHA1 & secp256r1 -var ecdsaSHA1CertPem = ` ------BEGIN CERTIFICATE----- -MIICDjCCAbUCCQDF6SfN0nsnrjAJBgcqhkjOPQQBMIGPMQswCQYDVQQGEwJVUzET -MBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzEVMBMG -A1UECgwMR29vZ2xlLCBJbmMuMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEG -CSqGSIb3DQEJARYUZ29sYW5nLWRldkBnbWFpbC5jb20wHhcNMTIwNTIwMjAyMDUw -WhcNMjIwNTE4MjAyMDUwWjCBjzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm -b3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFTATBgNVBAoMDEdvb2dsZSwg -SW5jLjEXMBUGA1UEAwwOd3d3Lmdvb2dsZS5jb20xIzAhBgkqhkiG9w0BCQEWFGdv -bGFuZy1kZXZAZ21haWwuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/Wgn -WQDo5+bz71T0327ERgd5SDDXFbXLpzIZDXTkjpe8QTEbsF+ezsQfrekrpDPC4Cd3 -P9LY0tG+aI8IyVKdUjAJBgcqhkjOPQQBA0gAMEUCIGlsqMcRqWVIWTD6wXwe6Jk2 -DKxL46r/FLgJYnzBEH99AiEA3fBouObsvV1R3oVkb4BQYnD4/4LeId6lAT43YvyV -a/A= ------END CERTIFICATE----- -` - -// Self-signed certificate using ECDSA with SHA256 & secp256r1 -var ecdsaSHA256p256CertPem = ` ------BEGIN CERTIFICATE----- -MIICDzCCAbYCCQDlsuMWvgQzhTAKBggqhkjOPQQDAjCBjzELMAkGA1UEBhMCVVMx -EzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFTAT -BgNVBAoMDEdvb2dsZSwgSW5jLjEXMBUGA1UEAwwOd3d3Lmdvb2dsZS5jb20xIzAh -BgkqhkiG9w0BCQEWFGdvbGFuZy1kZXZAZ21haWwuY29tMB4XDTEyMDUyMTAwMTkx -NloXDTIyMDUxOTAwMTkxNlowgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxp -Zm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRUwEwYDVQQKDAxHb29nbGUs -IEluYy4xFzAVBgNVBAMMDnd3dy5nb29nbGUuY29tMSMwIQYJKoZIhvcNAQkBFhRn -b2xhbmctZGV2QGdtYWlsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPMt -2ErhxAty5EJRu9yM+MTy+hUXm3pdW1ensAv382KoGExSXAFWP7pjJnNtHO+XSwVm -YNtqjcAGFKpweoN//kQwCgYIKoZIzj0EAwIDRwAwRAIgIYSaUA/IB81gjbIw/hUV -70twxJr5EcgOo0hLp3Jm+EYCIFDO3NNcgmURbJ1kfoS3N/0O+irUtoPw38YoNkqJ -h5wi ------END CERTIFICATE----- -` - -// Self-signed certificate using ECDSA with SHA256 & secp384r1 -var ecdsaSHA256p384CertPem = ` ------BEGIN CERTIFICATE----- -MIICSjCCAdECCQDje/no7mXkVzAKBggqhkjOPQQDAjCBjjELMAkGA1UEBhMCVVMx -EzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDAS -BgNVBAoMC0dvb2dsZSwgSW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEG -CSqGSIb3DQEJARYUZ29sYW5nLWRldkBnbWFpbC5jb20wHhcNMTIwNTIxMDYxMDM0 -WhcNMjIwNTE5MDYxMDM0WjCBjjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm -b3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDASBgNVBAoMC0dvb2dsZSwg -SW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEGCSqGSIb3DQEJARYUZ29s -YW5nLWRldkBnbWFpbC5jb20wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARRuzRNIKRK -jIktEmXanNmrTR/q/FaHXLhWRZ6nHWe26Fw7Rsrbk+VjGy4vfWtNn7xSFKrOu5ze -qxKnmE0h5E480MNgrUiRkaGO2GMJJVmxx20aqkXOk59U8yGA4CghE6MwCgYIKoZI -zj0EAwIDZwAwZAIwBZEN8gvmRmfeP/9C1PRLzODIY4JqWub2PLRT4mv9GU+yw3Gr -PU9A3CHMdEcdw/MEAjBBO1lId8KOCh9UZunsSMfqXiVurpzmhWd6VYZ/32G+M+Mh -3yILeYQzllt/g0rKVRk= ------END CERTIFICATE----- -` - -// Self-signed certificate using ECDSA with SHA384 & secp521r1 -var ecdsaSHA384p521CertPem = ` ------BEGIN CERTIFICATE----- -MIICljCCAfcCCQDhp1AFD/ahKjAKBggqhkjOPQQDAzCBjjELMAkGA1UEBhMCVVMx -EzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDAS -BgNVBAoMC0dvb2dsZSwgSW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEG -CSqGSIb3DQEJARYUZ29sYW5nLWRldkBnbWFpbC5jb20wHhcNMTIwNTIxMTUwNDI5 -WhcNMjIwNTE5MTUwNDI5WjCBjjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm -b3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDASBgNVBAoMC0dvb2dsZSwg -SW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEGCSqGSIb3DQEJARYUZ29s -YW5nLWRldkBnbWFpbC5jb20wgZswEAYHKoZIzj0CAQYFK4EEACMDgYYABACqx9Rv -IssRs1LWYcNN+WffwlHw4Tv3y8/LIAA9MF1ZScIonU9nRMxt4a2uGJVCPDw6JHpz -PaYc0E9puLoE9AfKpwFr59Jkot7dBg55SKPEFkddoip/rvmN7NPAWjMBirOwjOkm -8FPthvPhGPqsu9AvgVuHu3PosWiHGNrhh379pva8MzAKBggqhkjOPQQDAwOBjAAw -gYgCQgEHNmswkUdPpHqrVxp9PvLVl+xxPuHBkT+75z9JizyxtqykHQo9Uh6SWCYH -BF9KLolo01wMt8DjoYP5Fb3j5MH7xwJCAbWZzTOp4l4DPkIvAh4LeC4VWbwPPyqh -kBg71w/iEcSY3wUKgHGcJJrObZw7wys91I5kENljqw/Samdr3ka+jBJa ------END CERTIFICATE----- -` - -var ecdsaTests = []struct { - sigAlgo SignatureAlgorithm - pemCert string -}{ - {ECDSAWithSHA1, ecdsaSHA1CertPem}, - {ECDSAWithSHA256, ecdsaSHA256p256CertPem}, - {ECDSAWithSHA256, ecdsaSHA256p384CertPem}, - {ECDSAWithSHA384, ecdsaSHA384p521CertPem}, -} - -func TestECDSA(t *testing.T) { - for i, test := range ecdsaTests { - pemBlock, _ := pem.Decode([]byte(test.pemCert)) - cert, err := ParseCertificate(pemBlock.Bytes) - if err != nil { - t.Errorf("%d: failed to parse certificate: %s", i, err) - continue - } - if sa := cert.SignatureAlgorithm; sa != test.sigAlgo { - t.Errorf("%d: signature algorithm is %v, want %v", i, sa, test.sigAlgo) - } - if parsedKey, ok := cert.PublicKey.(*ecdsa.PublicKey); !ok { - t.Errorf("%d: wanted an ECDSA public key but found: %#v", i, parsedKey) - } - if pka := cert.PublicKeyAlgorithm; pka != ECDSA { - t.Errorf("%d: public key algorithm is %v, want ECDSA", i, pka) - } - if err = cert.CheckSignatureFrom(cert); err != nil { - t.Errorf("%d: certificate verification failed: %s", i, err) - } - } -} - -// Self-signed certificate using DSA with SHA1 -var dsaCertPem = `-----BE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ZFFpWX50298Sa3V+rzCBqwYDVR0jBIGjMIGggBQVyyr7hO11 -ZFFpWX50298Sa3V+r6F9pHsweTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk5DMQ8w -DQYDVQQHEwZOZXd0b24xFDASBgNVBAoTC0dvb2dsZSwgSW5jMRIwEAYDVQQDEwlK -b24gQWxsaWUxIjAgBgkqhkiG9w0BCQEWE2pvbmFsbGllQGdvb2dsZS5jb22CCQCx -z4IWqMXg4TAMBgNVHRMEBTADAQH/MAkGByqGSM44BAMDLwAwLAIUPtn/5j8Q1jJI -7ggOIsgrhgUdjGQCFCsmDq1H11q9+9Wp9IMeGrTSKHIM ------END CERTIFICATE----- -` - -func TestParseCertificateWithDsaPublicKey(t *testing.T) { - expectedKey := &dsa.PublicKey{ - Parameters: dsa.Parameters{ - P: bigFromHexString("00BC84B52743B169158BB85974E3E832AF5EFCFC42B264349095313A4A013EEE069A1B937D92E51ACF297A1C77880DF25C8607D8204B4DC45651305EF4A63B40C7D8C42D91EDA397D8F51CBC9D0A531FE2C6F1E55E9357D205C39D395358968CBEDAC11320C607BE16CB9DB492B6E78163305A34DD99CE43C64927D13A0040EB97"), - Q: bigFromHexString("009A67067F66A323F5D4EC7902C73FE5D9E36FA74F"), - G: bigFromHexString("009147778295BF5893542BC41BA806898A29E43261DBC85441C37D92E97ED80D323D44825FDDE8374D0FF15877798812682599B216BBCC31B9DCCAD527465FEAFFD7FC2A193612E575E34E7A98AF4D10339FE47390A518CB9975B3160B1D0285D1418D0977C52994F43C29A053E3D685834104C9FAFDC221E38BE9F3989D7A8E42"), - }, - Y: bigFromHexString("59A27C269FCDE45AA2160A5C980C19211A820095091AB9C5DC8309AB7EC1B3A48C2E267C6D35FEE9B71BCBB92F16AC8E559129347FB5C00BEEDD10BA8915C90698755CA965735A32DC7575BED806E1E38F768FFBC24E41123DC73F1C6E9E4D0C9E692128853AFE29DC665FA993DCA9C903B7BF00B6442B9A76A5DADC6186317A"), - } - pemBlock, _ := pem.Decode([]byte(dsaCertPem)) - cert, err := ParseCertificate(pemBlock.Bytes) - if err != nil { - t.Fatalf("Failed to parse certificate: %s", err) - } - if cert.PublicKeyAlgorithm != DSA { - t.Errorf("Parsed key algorithm was not DSA") - } - parsedKey, ok := cert.PublicKey.(*dsa.PublicKey) - if !ok { - t.Fatalf("Parsed key was not a DSA key: %s", err) - } - if expectedKey.Y.Cmp(parsedKey.Y) != 0 || - expectedKey.P.Cmp(parsedKey.P) != 0 || - expectedKey.Q.Cmp(parsedKey.Q) != 0 || - expectedKey.G.Cmp(parsedKey.G) != 0 { - t.Fatal("Parsed key differs from expected key") - } -} - -func TestParseCertificateWithDSASignatureAlgorithm(t *testing.T) { - pemBlock, _ := pem.Decode([]byte(dsaCertPem)) - cert, err := ParseCertificate(pemBlock.Bytes) - if err != nil { - t.Fatalf("Failed to parse certificate: %s", err) - } - if cert.SignatureAlgorithm != DSAWithSHA1 { - t.Errorf("Parsed signature algorithm was not DSAWithSHA1") - } -} - -func TestVerifyCertificateWithDSASignature(t *testing.T) { - pemBlock, _ := pem.Decode([]byte(dsaCertPem)) - cert, err := ParseCertificate(pemBlock.Bytes) - if err != nil { - t.Fatalf("Failed to parse certificate: %s", err) - } - // test cert is self-signed - if err = cert.CheckSignatureFrom(cert); err != nil { - t.Fatalf("DSA Certificate verification failed: %s", err) - } -} - -var rsaPSSSelfSignedPEM = `-----BEGIN CERTIFICATE----- -MIIGHjCCA9KgAwIBAgIBdjBBBgkqhkiG9w0BAQowNKAPMA0GCWCGSAFlAwQCAQUA -oRwwGgYJKoZIhvcNAQEIMA0GCWCGSAFlAwQCAQUAogMCASAwbjELMAkGA1UEBhMC -SlAxHDAaBgNVBAoME0phcGFuZXNlIEdvdmVybm1lbnQxKDAmBgNVBAsMH1RoZSBN -aW5pc3RyeSBvZiBGb3JlaWduIEFmZmFpcnMxFzAVBgNVBAMMDmUtcGFzc3BvcnRD -U0NBMB4XDTEzMDUxNDA1MDczMFoXDTI5MDUxNDA1MDcz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SIb3DQEBCDANBglghkgBZQMEAgEFAKIDAgEgA4IC -AQAaxWBQn5CZuNBfyzL57mn31ukHUFd61OMROSX3PT7oCv1Dy+C2AdRlxOcbN3/n -li0yfXUUqiY3COlLAHKRlkr97mLtxEFoJ0R8nVN2IQdChNQM/XSCzSGyY8NVa1OR -TTpEWLnexJ9kvIdbFXwUqdTnAkOI0m7Rg8j+E+lRRHg1xDAA1qKttrtUj3HRQWf3 -kNTu628SiMvap6aIdncburaK56MP7gkR1Wr/ichOfjIA3Jgw2PapI31i0GqeMd66 -U1+lC9FeyMAJpuSVp/SoiYzYo+79SFcVoM2yw3yAnIKg7q9GLYYqzncdykT6C06c -15gWFI6igmReAsD9ITSvYh0jLrLHfEYcPTOD3ZXJ4EwwHtWSoO3gq1EAtOYKu/Lv -C8zfBsZcFdsHvsSiYeBU8Oioe42mguky3Ax9O7D805Ek6R68ra07MW/G4YxvV7IN -2BfSaYy8MX9IG0ZMIOcoc0FeF5xkFmJ7kdrlTaJzC0IE9PNxNaH5QnOAFB8vxHcO -FioUxb6UKdHcPLR1VZtAdTdTMjSJxUqD/35Cdfqs7oDJXz8f6TXO2Tdy6G++YUs9 -qsGZWxzFvvkXUkQSl0dQQ5jO/FtUJcAVXVVp20LxPemfatAHpW31WdJYeWSQWky2 -+f9b5TXKXVyjlUL7uHxowWrT2AtTchDH22wTEtqLEF9Z3Q== ------END CERTIFICATE-----` - -func TestRSAPSSSelfSigned(t *testing.T) { - der, _ := pem.Decode([]byte(rsaPSSSelfSignedPEM)) - if der == nil { - t.Fatal("Failed to find PEM block") - } - - cert, err := ParseCertificate(der.Bytes) - if err != nil { - t.Fatal(err) - } - - if err = cert.CheckSignatureFrom(cert); err != nil { - t.Fatal(err) - } -} - -const ( - pemCertificate = `-----BEGIN CERTIFICATE----- -MIIDATCCAemgAwIBAgIRAKQkkrFx1T/dgB/Go/xBM5swDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHQWNtZSBDbzAeFw0xNjA4MT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A1UEChMbQ2VydGlmaWNhdGUgVHJhbnNwYXJlbmN5IENBMQ4wDAYDVQQIEwVX -YWxlczEQMA4GA1UEBxMHRXJ3IFdlbjAeFw0xMjA2MDEwMDAwMDBaFw0yMjA2MDEw -MDAwMDBaMFIxCzAJBgNVBAYTAkdCMSEwHwYDVQQKExhDZXJ0aWZpY2F0ZSBUcmFu -c3BhcmVuY3kxDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdFcncgV2VuMIGfMA0G -CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+75jnwmh3rjhfdTJaDB0ym+3xj6r015a/ -BH634c4VyVui+A7kWL19uG+KSyUhkaeb1wDDjpwDibRc1NyaEgqyHgy0HNDnKAWk -EM2cW9tdSSdyba8XEPYBhzd+olsaHjnu0LiBGdwVTcaPfajjDK8VijPmyVCfSgWw -FAn/Xdh+tQIDAQABo4HBMIG+MB0GA1UdDgQWBBQgMVQa8lwF/9hli2hDeU9ekDb3 -tDB9BgNVHSMEdjB0gBRfnYgNyHPmVNT4DdjmsMEktEfDVaFZpFcwVTELMAkGA1UE -BhMCR0IxJDAiBgNVBAoTG0NlcnRpZmljYXRlIFRyYW5zcGFyZW5jeSBDQTEOMAwG -A1UECBMFV2FsZXMxEDAOBgNVBAcTB0VydyBXZW6CAQAwCQYDVR0TBAIwADATBgor -BgEEAdZ5AgQDAQH/BAIFADANBgkqhkiG9w0BAQUFAAOBgQACocOeAVr1Tf8CPDNg -h1//NDdVLx8JAb3CVDFfM3K3I/sV+87MTfRxoM5NjFRlXYSHl/soHj36u0YtLGhL -BW/qe2O0cP8WbjLURgY1s9K8bagkmyYw5x/DTwjyPdTuIo+PdPY9eGMR3QpYEUBf -kGzKLC0+6/yBmWTr2M98CIY/vg== ------END CERTIFICATE-----` -) - -func TestIsPrecertificate(t *testing.T) { - tests := []struct { - desc string - certPEM string - want bool - }{ - { - desc: "certificate", - certPEM: pemCertificate, - want: false, - }, - { - desc: "precertificate", - certPEM: pemPrecertificate, - want: true, - }, - { - desc: "nil", - certPEM: "", - want: false, - }, - } - - for _, test := range tests { - var cert *Certificate - if test.certPEM != "" { - var err error - cert, err = certificateFromPEM(test.certPEM) - if err != nil { - t.Errorf("%s: error parsing certificate: %s", test.desc, err) - continue - } - } - if got := cert.IsPrecertificate(); got != test.want { - t.Errorf("%s: c.IsPrecertificate() = %t, want %t", test.desc, got, test.want) - } - } -} - -func TestCRLCreation(t *testing.T) { - block, _ := pem.Decode([]byte(pemPrivateKey)) - priv, _ := ParsePKCS1PrivateKey(block.Bytes) - block, _ = pem.Decode([]byte(pemCertificate)) - cert, _ := ParseCertificate(block.Bytes) - - loc := time.FixedZone("Oz/Atlantis", int((2 * time.Hour).Seconds())) - - now := time.Unix(1000, 0).In(loc) - nowUTC := now.UTC() - expiry := time.Unix(10000, 0) - - revokedCerts := []pkix.RevokedCertificate{ - { - SerialNumber: big.NewInt(1), - RevocationTime: nowUTC, - }, - { - SerialNumber: big.NewInt(42), - // RevocationTime should be converted to UTC before marshaling. - RevocationTime: now, - }, - } - expectedCerts := []pkix.RevokedCertificate{ - { - SerialNumber: big.NewInt(1), - RevocationTime: nowUTC, - }, - { - SerialNumber: big.NewInt(42), - RevocationTime: nowUTC, - }, - } - - crlBytes, err := cert.CreateCRL(rand.Reader, priv, revokedCerts, now, expiry) - if err != nil { - t.Errorf("error creating CRL: %s", err) - } - - parsedCRL, err := ParseDERCRL(crlBytes) - if err != nil { - t.Errorf("error reparsing CRL: %s", err) - } - if !reflect.DeepEqual(parsedCRL.TBSCertList.RevokedCertificates, expectedCerts) { - t.Errorf("RevokedCertificates mismatch: got %v; want %v.", - parsedCRL.TBSCertList.RevokedCertificates, expectedCerts) - } -} - -func fromBase64(in string) []byte { - out := make([]byte, base64.StdEncoding.DecodedLen(len(in))) - n, err := base64.StdEncoding.Decode(out, []byte(in)) - if err != nil { - panic("failed to base64 decode") - } - return out[:n] -} - -func TestParseDERCRL(t *testing.T) { - derBytes := fromBase64(derCRLBase64) - certList, err := ParseDERCRL(derBytes) - if err != nil { - t.Errorf("error parsing: %s", err) - return - } - numCerts := len(certList.TBSCertList.RevokedCertificates) - expected := 88 - if numCerts != expected { - t.Errorf("bad number of revoked certificates. got: %d want: %d", numCerts, expected) - } - - if certList.HasExpired(time.Unix(1302517272, 0)) { - t.Errorf("CRL has expired (but shouldn't have)") - } - - // Can't check the signature here without a package cycle. -} - -func TestCRLWithoutExpiry(t *testing.T) { - derBytes := fromBase64("MIHYMIGZMAkGByqGSM44BAMwEjEQMA4GA1UEAxMHQ2FybERTUxcNOTkwODI3MDcwMDAwWjBpMBMCAgDIFw05OTA4MjIwNzAwMDBaMBMCAgDJFw05OTA4MjIwNzAwMDBaMBMCAgDTFw05OTA4MjIwNzAwMDBaMBMCAgDSFw05OTA4MjIwNzAwMDBaMBMCAgDUFw05OTA4MjQwNzAwMDBaMAkGByqGSM44BAMDLwAwLAIUfmVSdjP+NHMX0feW+aDU2G1cfT0CFAJ6W7fVWxjBz4fvftok8yqDnDWh") - certList, err := ParseDERCRL(derBytes) - if err != nil { - t.Fatal(err) - } - if !certList.TBSCertList.NextUpdate.IsZero() { - t.Errorf("NextUpdate is not the zero value") - } -} - -func TestParsePEMCRL(t *testing.T) { - pemBytes := fromBase64(pemCRLBase64) - certList, err := ParseCRL(pemBytes) - if err != nil { - t.Errorf("error parsing: %s", err) - return - } - numCerts := len(certList.TBSCertList.RevokedCertificates) - expected := 2 - if numCerts != expected { - t.Errorf("bad number of revoked certificates. got: %d want: %d", numCerts, expected) - } - - if certList.HasExpired(time.Unix(1302517272, 0)) { - t.Errorf("CRL has expired (but shouldn't have)") - } - - // Can't check the signature here without a package cycle. -} - -func TestNonFatalErrors(t *testing.T) { - nfe := NonFatalErrors{} - - nfe.AddError(errors.New("one")) - nfe.AddError(errors.New("two")) - nfe.AddError(errors.New("three")) - - if !nfe.HasError() { - t.Fatal("NonFatalError claimed not to have an error") - } - - if !strings.Contains(nfe.Error(), "one; two; three") { - t.Fatalf("Didn't see expected string from Error(), got '%s'", nfe.Error()) - } -} - -const ( - tbsNoPoison = "30820245a003020102020842822a5b866fbfeb300d06092a864886f70d01010b" + - "05003071310b3009060355040613024742310f300d060355040813064c6f6e64" + - "6f6e310f300d060355040713064c6f6e646f6e310f300d060355040a1306476f" + - "6f676c65310c300a060355040b1303456e673121301f0603550403131846616b" + - "654365727469666963617465417574686f72697479301e170d31363037313731" + - "31313534305a170d3139303331393131313534305a3066310b30090603550406" + - "130255533113301106035504080c0a43616c69666f726e696131163014060355" + - "04070c0d4d6f756e7461696e205669657731133011060355040a0c0a476f6f67" + - "6c6520496e633115301306035504030c0c2a2e676f6f676c652e636f6d305930" + - "1306072a8648ce3d020106082a8648ce3d03010703420004c4093984f5158d12" + - "54b2029cf901e26d3547d40dd011616609351dcb121495b23fff35bd228e4dfc" + - "38502d22d6981ecaa023afa4967e32d1825f3157fb28ff37a381ce3081cb301d" + - "0603551d250416301406082b0601050507030106082b06010505070302306806" + - "082b06010505070101045c305a302b06082b06010505073002861f687474703a" + - "2f2f706b692e676f6f676c652e636f6d2f47494147322e637274302b06082b06" + - "010505073001861f687474703a2f2f636c69656e7473312e676f6f676c652e63" + - "6f6d2f6f637370301d0603551d0e04160414dbf46e63eee2dcbebf38604f9831" + - "d06444f163d830210603551d20041a3018300c060a2b06010401d67902050130" + - "08060667810c010202" - tbsPoisonFirst = "3082025aa003020102020842822a5b866fbfeb300d06092a864886f70d01010b" + - "05003071310b3009060355040613024742310f300d060355040813064c6f6e64" + - "6f6e310f300d060355040713064c6f6e646f6e310f300d060355040a1306476f" + - "6f676c65310c300a060355040b1303456e673121301f0603550403131846616b" + - "654365727469666963617465417574686f72697479301e170d31363037313731" + - "31313534305a170d3139303331393131313534305a3066310b30090603550406" + - "130255533113301106035504080c0a43616c69666f726e696131163014060355" + - "04070c0d4d6f756e7461696e205669657731133011060355040a0c0a476f6f67" + - "6c6520496e633115301306035504030c0c2a2e676f6f676c652e636f6d305930" + - "1306072a8648ce3d020106082a8648ce3d03010703420004c4093984f5158d12" + - "54b2029cf901e26d3547d40dd011616609351dcb121495b23fff35bd228e4dfc" + - "38502d22d6981ecaa023afa4967e32d1825f3157fb28ff37a381e33081e03013" + - "060a2b06010401d6790204030101ff04020500301d0603551d25041630140608" + - "2b0601050507030106082b06010505070302306806082b06010505070101045c" + - "305a302b06082b06010505073002861f687474703a2f2f706b692e676f6f676c" + - "652e636f6d2f47494147322e637274302b06082b06010505073001861f687474" + - "703a2f2f636c69656e7473312e676f6f676c652e636f6d2f6f637370301d0603" + - "551d0e04160414dbf46e63eee2dcbebf38604f9831d06444f163d83021060355" + - "1d20041a3018300c060a2b06010401d6790205013008060667810c010202" - tbsPoisonLast = "3082025aa003020102020842822a5b866fbfeb300d06092a864886f70d01010b" + - "05003071310b3009060355040613024742310f300d060355040813064c6f6e64" + - "6f6e310f300d060355040713064c6f6e646f6e310f300d060355040a1306476f" + - "6f676c65310c300a060355040b1303456e673121301f0603550403131846616b" + - "654365727469666963617465417574686f72697479301e170d31363037313731" + - "31313534305a170d3139303331393131313534305a3066310b30090603550406" + - "130255533113301106035504080c0a43616c69666f726e696131163014060355" + - "04070c0d4d6f756e7461696e205669657731133011060355040a0c0a476f6f67" + - "6c6520496e633115301306035504030c0c2a2e676f6f676c652e636f6d305930" + - "1306072a8648ce3d020106082a8648ce3d03010703420004c4093984f5158d12" + - "54b2029cf901e26d3547d40dd011616609351dcb121495b23fff35bd228e4dfc" + - "38502d22d6981ecaa023afa4967e32d1825f3157fb28ff37a381e33081e0301d" + - "0603551d250416301406082b0601050507030106082b06010505070302306806" + - "082b06010505070101045c305a302b06082b06010505073002861f687474703a" + - "2f2f706b692e676f6f676c652e636f6d2f47494147322e637274302b06082b06" + - "010505073001861f687474703a2f2f636c69656e7473312e676f6f676c652e63" + - "6f6d2f6f637370301d0603551d0e04160414dbf46e63eee2dcbebf38604f9831" + - "d06444f163d830210603551d20041a3018300c060a2b06010401d67902050130" + - "08060667810c0102023013060a2b06010401d6790204030101ff04020500" - tbsPoisonMiddle = "3082025aa003020102020842822a5b866fbfeb300d06092a864886f70d01010b" + - "05003071310b3009060355040613024742310f300d060355040813064c6f6e64" + - "6f6e310f300d060355040713064c6f6e646f6e310f300d060355040a1306476f" + - "6f676c65310c300a060355040b1303456e673121301f0603550403131846616b" + - "654365727469666963617465417574686f72697479301e170d31363037313731" + - "31313534305a170d3139303331393131313534305a3066310b30090603550406" + - "130255533113301106035504080c0a43616c69666f726e696131163014060355" + - "04070c0d4d6f756e7461696e205669657731133011060355040a0c0a476f6f67" + - "6c6520496e633115301306035504030c0c2a2e676f6f676c652e636f6d305930" + - "1306072a8648ce3d020106082a8648ce3d03010703420004c4093984f5158d12" + - "54b2029cf901e26d3547d40dd011616609351dcb121495b23fff35bd228e4dfc" + - "38502d22d6981ecaa023afa4967e32d1825f3157fb28ff37a381e33081e0301d" + - "0603551d250416301406082b0601050507030106082b06010505070302306806" + - "082b06010505070101045c305a302b06082b06010505073002861f687474703a" + - "2f2f706b692e676f6f676c652e636f6d2f47494147322e637274302b06082b06" + - "010505073001861f687474703a2f2f636c69656e7473312e676f6f676c652e63" + - "6f6d2f6f6373703013060a2b06010401d6790204030101ff04020500301d0603" + - "551d0e04160414dbf46e63eee2dcbebf38604f9831d06444f163d83021060355" + - "1d20041a3018300c060a2b06010401d6790205013008060667810c010202" - tbsPoisonTwice = "3082026fa003020102020842822a5b866fbfeb300d06092a864886f70d01010b" + - "05003071310b3009060355040613024742310f300d060355040813064c6f6e64" + - "6f6e310f300d060355040713064c6f6e646f6e310f300d060355040a1306476f" + - "6f676c65310c300a060355040b1303456e673121301f0603550403131846616b" + - "654365727469666963617465417574686f72697479301e170d31363037313731" + - "31313534305a170d3139303331393131313534305a3066310b30090603550406" + - "130255533113301106035504080c0a43616c69666f726e696131163014060355" + - "04070c0d4d6f756e7461696e205669657731133011060355040a0c0a476f6f67" + - "6c6520496e633115301306035504030c0c2a2e676f6f676c652e636f6d305930" + - "1306072a8648ce3d020106082a8648ce3d03010703420004c4093984f5158d12" + - "54b2029cf901e26d3547d40dd011616609351dcb121495b23fff35bd228e4dfc" + - "38502d22d6981ecaa023afa4967e32d1825f3157fb28ff37a381f83081f5301d" + - "0603551d250416301406082b0601050507030106082b06010505070302306806" + - "082b06010505070101045c305a302b06082b06010505073002861f687474703a" + - "2f2f706b692e676f6f676c652e636f6d2f47494147322e637274302b06082b06" + - "010505073001861f687474703a2f2f636c69656e7473312e676f6f676c652e63" + - "6f6d2f6f6373703013060a2b06010401d6790204030101ff04020500301d0603" + - "551d0e04160414dbf46e63eee2dcbebf38604f9831d06444f163d83013060a2b" + - "06010401d6790204030101ff0402050030210603551d20041a3018300c060a2b" + - "06010401d6790205013008060667810c010202" -) - -func TestRemoveCTPoison(t *testing.T) { - var tests = []struct { - name string // for human consumption - tbs string // hex encoded - want string // hex encoded - errstr string - }{ - {name: "invalid-der", tbs: "01020304", errstr: "failed to parse"}, - {name: "trailing-data", tbs: tbsPoisonMiddle + "01020304", errstr: "trailing data"}, - {name: "no-poison-ext", tbs: tbsNoPoison, errstr: "no extension of specified type present"}, - {name: "two-poison-exts", tbs: tbsPoisonTwice, errstr: "multiple extensions of specified type present"}, - {name: "poison-first", tbs: tbsPoisonFirst, want: tbsNoPoison}, - {name: "poison-last", tbs: tbsPoisonLast, want: tbsNoPoison}, - {name: "poison-middle", tbs: tbsPoisonMiddle, want: tbsNoPoison}, - } - for _, test := range tests { - in, _ := hex.DecodeString(test.tbs) - got, err := RemoveCTPoison(in) - if test.errstr != "" { - if err == nil { - t.Errorf("RemoveCTPoison(%s)=%s,nil; want error %q", test.name, hex.EncodeToString(got), test.errstr) - } else if !strings.Contains(err.Error(), test.errstr) { - t.Errorf("RemoveCTPoison(%s)=nil,%q; want error %q", test.name, err, test.errstr) - } - continue - } - want, _ := hex.DecodeString(test.want) - if err != nil { - t.Errorf("RemoveCTPoison(%s)=nil,%q; want %s,nil", test.name, err, test.want) - } else if !bytes.Equal(got, want) { - t.Errorf("RemoveCTPoison(%s)=%s,nil; want %s,nil", test.name, hex.EncodeToString(got), test.want) - } - } -} - -func makeCert(t *testing.T, template, issuer *Certificate) *Certificate { - t.Helper() - certData, err := CreateCertificate(rand.Reader, template, issuer, &testPrivateKey.PublicKey, testPrivateKey) - if err != nil { - t.Fatalf("failed to create pre-cert: %v", err) - } - cert, err := ParseCertificate(certData) - if err != nil { - t.Fatalf("failed to re-parse pre-cert: %v", err) - } - return cert -} - -func TestBuildPrecertTBS(t *testing.T) { - poisonExt := pkix.Extension{Id: OIDExtensionCTPoison, Critical: true, Value: asn1.NullBytes} - preIssuerKeyID := []byte{0x19, 0x09, 0x19, 0x70} - issuerKeyID := []byte{0x07, 0x07, 0x20, 0x07} - preCertTemplate := Certificate{ - Version: 3, - SerialNumber: big.NewInt(123), - Issuer: pkix.Name{CommonName: "precert Issuer"}, - Subject: pkix.Name{CommonName: "precert subject"}, - NotBefore: time.Now(), - NotAfter: time.Now().Add(3 * time.Hour), - ExtraExtensions: []pkix.Extension{poisonExt}, - AuthorityKeyId: preIssuerKeyID, - } - preIssuerTemplate := Certificate{ - Version: 3, - SerialNumber: big.NewInt(1234), - Issuer: pkix.Name{CommonName: "real Issuer"}, - Subject: pkix.Name{CommonName: "precert Issuer"}, - NotBefore: time.Now(), - NotAfter: time.Now().Add(3 * time.Hour), - AuthorityKeyId: issuerKeyID, - SubjectKeyId: preIssuerKeyID, - ExtKeyUsage: []ExtKeyUsage{ExtKeyUsageCertificateTransparency}, - } - actualIssuerTemplate := Certificate{ - Version: 3, - SerialNumber: big.NewInt(12345), - Issuer: pkix.Name{CommonName: "real Issuer"}, - Subject: pkix.Name{CommonName: "real Issuer"}, - NotBefore: time.Now(), - NotAfter: time.Now().Add(3 * time.Hour), - SubjectKeyId: issuerKeyID, - } - preCertWithAKI := makeCert(t, &preCertTemplate, &preIssuerTemplate) - preIssuerWithAKI := makeCert(t, &preIssuerTemplate, &actualIssuerTemplate) - - preIssuerTemplate.AuthorityKeyId = nil - actualIssuerTemplate.SubjectKeyId = nil - preIssuerWithoutAKI := makeCert(t, &preIssuerTemplate, &actualIssuerTemplate) - - preCertTemplate.AuthorityKeyId = nil - preIssuerTemplate.SubjectKeyId = nil - preCertWithoutAKI := makeCert(t, &preCertTemplate, &preIssuerTemplate) - - preIssuerTemplate.ExtKeyUsage = nil - invalidPreIssuer := makeCert(t, &preIssuerTemplate, &actualIssuerTemplate) - - akiPrefix := []byte{0x30, 0x06, 0x80, 0x04} // SEQUENCE { [0] { ... } } - var tests = []struct { - name string - tbs *Certificate - preIssuer *Certificate - wantAKI []byte - wantErr bool - }{ - { - name: "no-preIssuer-provided", - tbs: preCertWithAKI, - wantAKI: append(akiPrefix, preIssuerKeyID...), - }, - { - name: "both-with-AKI", - tbs: preCertWithAKI, - preIssuer: preIssuerWithAKI, - wantAKI: append(akiPrefix, issuerKeyID...), - }, - { - name: "invalid-preIssuer", - tbs: preCertWithAKI, - preIssuer: invalidPreIssuer, - wantErr: true, - }, - { - name: "both-without-AKI", - tbs: preCertWithoutAKI, - preIssuer: preIssuerWithoutAKI, - }, - { - name: "precert-with-preIssuer-without-AKI", - tbs: preCertWithAKI, - preIssuer: preIssuerWithoutAKI, - }, - { - name: "precert-without-preIssuer-with-AKI", - tbs: preCertWithoutAKI, - preIssuer: preIssuerWithAKI, - wantAKI: append(akiPrefix, issuerKeyID...), - }, - } - for _, test := range tests { - got, err := BuildPrecertTBS(test.tbs.RawTBSCertificate, test.preIssuer) - if err != nil { - if !test.wantErr { - t.Errorf("BuildPrecertTBS(%s)=nil,%q; want _,nil", test.name, err) - } - continue - } - if test.wantErr { - t.Errorf("BuildPrecertTBS(%s)=_,nil; want _,non-nil", test.name) - } - - var tbs tbsCertificate - if rest, err := asn1.Unmarshal(got, &tbs); err != nil { - t.Errorf("BuildPrecertTBS(%s) gave unparsable TBS: %v", test.name, err) - continue - } else if len(rest) > 0 { - t.Errorf("BuildPrecertTBS(%s) gave extra data in DER", test.name) - } - if test.preIssuer != nil { - if got, want := tbs.Issuer.FullBytes, test.preIssuer.RawIssuer; !bytes.Equal(got, want) { - t.Errorf("BuildPrecertTBS(%s).Issuer=%x, want %x", test.name, got, want) - } - } - var gotAKI []byte - for _, ext := range tbs.Extensions { - if ext.Id.Equal(OIDExtensionAuthorityKeyId) { - gotAKI = ext.Value - break - } - } - if gotAKI != nil { - if test.wantAKI != nil { - if !reflect.DeepEqual(gotAKI, test.wantAKI) { - t.Errorf("BuildPrecertTBS(%s).Extensions[AKI]=%+v, want %+v", test.name, gotAKI, test.wantAKI) - } - } else { - t.Errorf("BuildPrecertTBS(%s).Extensions[AKI]=%+v, want nil", test.name, gotAKI) - } - } else if test.wantAKI != nil { - t.Errorf("BuildPrecertTBS(%s).Extensions[AKI]=nil, want %+v", test.name, test.wantAKI) - } - } -} - -func TestImports(t *testing.T) { - // testenv.MustHaveGoRun(t) - - // Replace testenv.GoToolPath(t) with "go" for use outside of Go repo. - if err := exec.Command("go", "run", "x509_test_import.go").Run(); err != nil { - t.Errorf("failed to run x509_test_import.go: %s", err) - } -} - -const derCRLBase64 = "MIINqzCCDJMCAQEwDQYJKoZIhvcNAQEFBQAwVjEZMBcGA1UEAxMQUEtJIEZJTk1FQ0NBTklDQTEVMBMGA1UEChMMRklOTUVDQ0FOSUNBMRUwEwYDVQQLEwxGSU5NRUNDQU5JQ0ExCzAJBgNVBAYTAklUFw0xMTA1MDQxNjU3NDJaFw0xMTA1MDQyMDU3NDJaMIIMBzAhAg4Ze1od49Lt1qIXBydAzhcNMDkwNzE2MDg0MzIyWjAAMCECDl0HSL9bcZ1Ci/UHJ0DPFw0wOTA3MTYwODQzMTNaMAAwIQIOESB9tVAmX3cY7QcnQNAXDTA5MDcxNjA4NDUyMlowADAhAg4S1tGAQ3mHt8uVBydA1RcNMDkwODA0MTUyNTIyWjAAMCECDlQ249Y7vtC25ScHJ0DWFw0wOTA4MDQxNTI1MzdaMAAwIQIOISMop3NkA4PfYwcnQNkXDTA5MDgwNDExMDAzNFowADAhAg56/B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hTUJnR0ExVUVDaE1SVWxOQklGTmxZM1Z5DQphWFI1SUVsdVl5NHhIakFjQmdOVkJBTVRGVkpUUVNCUWRXSnNhV01nVW05dmRDQkRRU0IyTVRFdU1Dd0dDU3FHDQpTSWIzRFFFSkFSWWZjbk5oYTJWdmJuSnZiM1J6YVdkdVFISnpZWE5sWTNWeWFYUjVMbU52YlJjTk1URXdNakl6DQpNVGt5T0RNd1doY05NVEV3T0RJeU1Ua3lPRE13V2pDQmpEQktBaEVBckRxb2g5RkhKSFhUN09QZ3V1bjQrQmNODQpNRGt4TVRBeU1UUXlOekE1V2pBbU1Bb0dBMVVkRlFRRENnRUpNQmdHQTFVZEdBUVJHQTh5TURBNU1URXdNakUwDQpNalExTlZvd1BnSVJBTEd6blowOTVQQjVhQU9MUGc1N2ZNTVhEVEF5TVRBeU16RTBOVEF4TkZvd0dqQVlCZ05WDQpIUmdFRVJnUE1qQXdNakV3TWpNeE5EVXdNVFJhb0RBd0xqQWZCZ05WSFNNRUdEQVdnQlQxVERGNlVRTS9MTmVMDQpsNWx2cUhHUXEzZzltekFMQmdOVkhSUUVCQUlDQUlRd0RRWUpLb1pJaHZjTkFRRUZCUUFEZ1lFQUZVNUFzNk16DQpxNVBSc2lmYW9iUVBHaDFhSkx5QytNczVBZ2MwYld5QTNHQWR4dXI1U3BQWmVSV0NCamlQL01FSEJXSkNsQkhQDQpHUmNxNXlJZDNFakRrYUV5eFJhK2k2N0x6dmhJNmMyOUVlNks5cFNZd2ppLzdSVWhtbW5Qclh0VHhsTDBsckxyDQptUVFKNnhoRFJhNUczUUE0Q21VZHNITnZicnpnbUNZcHZWRT0NCi0tLS0tRU5EIFg1MDkgQ1JMLS0tLS0NCg0K" - -func TestCreateCertificateRequest(t *testing.T) { - random := rand.Reader - - ecdsa256Priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if err != nil { - t.Fatalf("Failed to generate ECDSA key: %s", err) - } - - ecdsa384Priv, err := ecdsa.GenerateKey(elliptic.P384(), rand.Reader) - if err != nil { - t.Fatalf("Failed to generate ECDSA key: %s", err) - } - - ecdsa521Priv, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader) - if err != nil { - t.Fatalf("Failed to generate ECDSA key: %s", err) - } - - tests := []struct { - name string - priv interface{} - sigAlgo SignatureAlgorithm - }{ - {"RSA", testPrivateKey, SHA1WithRSA}, - {"ECDSA-256", ecdsa256Priv, ECDSAWithSHA1}, - {"ECDSA-384", ecdsa384Priv, ECDSAWithSHA1}, - {"ECDSA-521", ecdsa521Priv, ECDSAWithSHA1}, - } - - for _, test := range tests { - template := CertificateRequest{ - Subject: pkix.Name{ - CommonName: "test.example.com", - Organization: []string{"Σ Acme Co"}, - }, - SignatureAlgorithm: test.sigAlgo, - DNSNames: []string{"test.example.com"}, - EmailAddresses: []string{"gopher@golang.org"}, - IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1).To4(), net.ParseIP("2001:4860:0:2001::68")}, - } - - derBytes, err := CreateCertificateRequest(random, &template, test.priv) - if err != nil { - t.Errorf("%s: failed to create certificate request: %s", test.name, err) - continue - } - - out, err := ParseCertificateRequest(derBytes) - if err != nil { - t.Errorf("%s: failed to create certificate request: %s", test.name, err) - continue - } - - err = out.CheckSignature() - if err != nil { - t.Errorf("%s: failed to check certificate request signature: %s", test.name, err) - continue - } - - if out.Subject.CommonName != template.Subject.CommonName { - t.Errorf("%s: output subject common name and template subject common name don't match", test.name) - } else if len(out.Subject.Organization) != len(template.Subject.Organization) { - t.Errorf("%s: output subject organisation and template subject organisation don't match", test.name) - } else if len(out.DNSNames) != len(template.DNSNames) { - t.Errorf("%s: output DNS names and template DNS names don't match", test.name) - } else if len(out.EmailAddresses) != len(template.EmailAddresses) { - t.Errorf("%s: output email addresses and template email addresses don't match", test.name) - } else if len(out.IPAddresses) != len(template.IPAddresses) { - t.Errorf("%s: output IP addresses and template IP addresses names don't match", test.name) - } - } -} - -func marshalAndParseCSR(t *testing.T, template *CertificateRequest) *CertificateRequest { - derBytes, err := CreateCertificateRequest(rand.Reader, template, testPrivateKey) - if err != nil { - t.Fatal(err) - } - - csr, err := ParseCertificateRequest(derBytes) - if err != nil { - t.Fatal(err) - } - - return csr -} - -func TestCertificateRequestOverrides(t *testing.T) { - sanContents, err := marshalSANs([]string{"foo.example.com"}, nil, nil, nil) - if err != nil { - t.Fatal(err) - } - - template := CertificateRequest{ - Subject: pkix.Name{ - CommonName: "test.example.com", - Organization: []string{"Σ Acme Co"}, - }, - DNSNames: []string{"test.example.com"}, - - // An explicit extension should override the DNSNames from the - // template. - ExtraExtensions: []pkix.Extension{ - { - Id: OIDExtensionSubjectAltName, - Value: sanContents, - }, - }, - } - - csr := marshalAndParseCSR(t, &template) - - if len(csr.DNSNames) != 1 || csr.DNSNames[0] != "foo.example.com" { - t.Errorf("Extension did not override template. Got %v\n", csr.DNSNames) - } - - // If there is already an attribute with X.509 extensions then the - // extra extensions should be added to it rather than creating a CSR - // with two extension attributes. - - template.Attributes = []pkix.AttributeTypeAndValueSET{ - { - Type: oidExtensionRequest, - Value: [][]pkix.AttributeTypeAndValue{ - { - { - Type: OIDExtensionAuthorityInfoAccess, - Value: []byte("foo"), - }, - }, - }, - }, - } - - csr = marshalAndParseCSR(t, &template) - if l := len(csr.Attributes); l != 1 { - t.Errorf("incorrect number of attributes: %d\n", l) - } - - if !csr.Attributes[0].Type.Equal(oidExtensionRequest) || - len(csr.Attributes[0].Value) != 1 || - len(csr.Attributes[0].Value[0]) != 2 { - t.Errorf("bad attributes: %#v\n", csr.Attributes) - } - - sanContents2, err := marshalSANs([]string{"foo2.example.com"}, nil, nil, nil) - if err != nil { - t.Fatal(err) - } - - // Extensions in Attributes should override those in ExtraExtensions. - template.Attributes[0].Value[0] = append(template.Attributes[0].Value[0], pkix.AttributeTypeAndValue{ - Type: OIDExtensionSubjectAltName, - Value: sanContents2, - }) - - csr = marshalAndParseCSR(t, &template) - - if len(csr.DNSNames) != 1 || csr.DNSNames[0] != "foo2.example.com" { - t.Errorf("Attributes did not override ExtraExtensions. Got %v\n", csr.DNSNames) - } -} - -func TestParseCertificateRequest(t *testing.T) { - for _, csrBase64 := range csrBase64Array { - csrBytes := fromBase64(csrBase64) - csr, err := ParseCertificateRequest(csrBytes) - if err != nil { - t.Fatalf("failed to parse CSR: %s", err) - } - - if len(csr.EmailAddresses) != 1 || csr.EmailAddresses[0] != "gopher@golang.org" { - t.Errorf("incorrect email addresses found: %v", csr.EmailAddresses) - } - - if len(csr.DNSNames) != 1 || csr.DNSNames[0] != "test.example.com" { - t.Errorf("incorrect DNS names found: %v", csr.DNSNames) - } - - if len(csr.Subject.Country) != 1 || csr.Subject.Country[0] != "AU" { - t.Errorf("incorrect Subject name: %v", csr.Subject) - } - - found := false - for _, e := range csr.Extensions { - if e.Id.Equal(OIDExtensionBasicConstraints) { - found = true - break - } - } - if !found { - t.Errorf("basic constraints extension not found in CSR") - } - } -} - -func TestCriticalFlagInCSRRequestedExtensions(t *testing.T) { - // This CSR contains an extension request where the extensions have a - // critical flag in them. In the past we failed to handle this. - const csrBase64 = "MIICrTCCAZUCAQIwMzEgMB4GA1UEAwwXU0NFUCBDQSBmb3IgRGV2ZWxlciBTcmwxDzANBgNVBAsMBjQzNTk3MTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALFMAJ7Zy9YyfgbNlbUWAW0LalNRMPs7aXmLANsCpjhnw3lLlfDPaLeWyKh1nK5I5ojaJOW6KIOSAcJkDUe3rrE0wR0RVt3UxArqs0R/ND3u5Q+bDQY2X1HAFUHzUzcdm5JRAIA355v90teMckaWAIlkRQjDE22Lzc6NAl64KOd1rqOUNj8+PfX6fSo20jm94Pp1+a6mfk3G/RUWVuSm7owO5DZI/Fsi2ijdmb4NUar6K/bDKYTrDFkzcqAyMfP3TitUtBp19Mp3B1yAlHjlbp/r5fSSXfOGHZdgIvp0WkLuK2u5eQrX5l7HMB/5epgUs3HQxKY6ljhh5wAjDwz//LsCAwEAAaA1MDMGCSqGSIb3DQEJDjEmMCQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAoQwDQYJKoZIhvcNAQEFBQADggEBAAMq3bxJSPQEgzLYR/yaVvgjCDrc3zUbIwdOis6Go06Q4RnjH5yRaSZAqZQTDsPurQcnz2I39VMGEiSkFJFavf4QHIZ7QFLkyXadMtALc87tm17Ej719SbHcBSSZayR9VYJUNXRLayI6HvyUrmqcMKh+iX3WY3ICr59/wlM0tYa8DYN4yzmOa2Onb29gy3YlaF5A2AKAMmk003cRT9gY26mjpv7d21czOSSeNyVIoZ04IR9ee71vWTMdv0hu/af5kSjQ+ZG5/Qgc0+mnECLz/1gtxt1srLYbtYQ/qAY8oX1DCSGFS61tN/vl+4cxGMD/VGcGzADRLRHSlVqy2Qgss6Q=" - - csrBytes := fromBase64(csrBase64) - csr, err := ParseCertificateRequest(csrBytes) - if err != nil { - t.Fatalf("failed to parse CSR: %s", err) - } - - expected := []struct { - Id asn1.ObjectIdentifier - Value []byte - }{ - {OIDExtensionBasicConstraints, fromBase64("MAYBAf8CAQA=")}, - {OIDExtensionKeyUsage, fromBase64("AwIChA==")}, - } - - if n := len(csr.Extensions); n != len(expected) { - t.Fatalf("expected to find %d extensions but found %d", len(expected), n) - } - - for i, extension := range csr.Extensions { - if !extension.Id.Equal(expected[i].Id) { - t.Fatalf("extension #%d has unexpected type %v (expected %v)", i, extension.Id, expected[i].Id) - } - - if !bytes.Equal(extension.Value, expected[i].Value) { - t.Fatalf("extension #%d has unexpected contents %x (expected %x)", i, extension.Value, expected[i].Value) - } - } -} - -// serialiseAndParse generates a self-signed certificate from template and -// returns a parsed version of it. -func serialiseAndParse(t *testing.T, template *Certificate) *Certificate { - derBytes, err := CreateCertificate(rand.Reader, template, template, &testPrivateKey.PublicKey, testPrivateKey) - if err != nil { - t.Fatalf("failed to create certificate: %s", err) - return nil - } - - cert, err := ParseCertificate(derBytes) - if err != nil { - t.Fatalf("failed to parse certificate: %s", err) - return nil - } - - return cert -} - -func TestMaxPathLen(t *testing.T) { - template := &Certificate{ - SerialNumber: big.NewInt(1), - Subject: pkix.Name{ - CommonName: "Σ Acme Co", - }, - NotBefore: time.Unix(1000, 0), - NotAfter: time.Unix(100000, 0), - - BasicConstraintsValid: true, - IsCA: true, - } - - cert1 := serialiseAndParse(t, template) - if m := cert1.MaxPathLen; m != -1 { - t.Errorf("Omitting MaxPathLen didn't turn into -1, got %d", m) - } - if cert1.MaxPathLenZero { - t.Errorf("Omitting MaxPathLen resulted in MaxPathLenZero") - } - - template.MaxPathLen = 1 - cert2 := serialiseAndParse(t, template) - if m := cert2.MaxPathLen; m != 1 { - t.Errorf("Setting MaxPathLen didn't work. Got %d but set 1", m) - } - if cert2.MaxPathLenZero { - t.Errorf("Setting MaxPathLen resulted in MaxPathLenZero") - } - - template.MaxPathLen = 0 - template.MaxPathLenZero = true - cert3 := serialiseAndParse(t, template) - if m := cert3.MaxPathLen; m != 0 { - t.Errorf("Setting MaxPathLenZero didn't work, got %d", m) - } - if !cert3.MaxPathLenZero { - t.Errorf("Setting MaxPathLen to zero didn't result in MaxPathLenZero") - } -} - -func TestNoAuthorityKeyIdInSelfSignedCert(t *testing.T) { - template := &Certificate{ - SerialNumber: big.NewInt(1), - Subject: pkix.Name{ - CommonName: "Σ Acme Co", - }, - NotBefore: time.Unix(1000, 0), - NotAfter: time.Unix(100000, 0), - - BasicConstraintsValid: true, - IsCA: true, - SubjectKeyId: []byte{1, 2, 3, 4}, - } - - if cert := serialiseAndParse(t, template); len(cert.AuthorityKeyId) != 0 { - t.Fatalf("self-signed certificate contained default authority key id") - } - - template.AuthorityKeyId = []byte{1, 2, 3, 4} - if cert := serialiseAndParse(t, template); len(cert.AuthorityKeyId) == 0 { - t.Fatalf("self-signed certificate erased explicit authority key id") - } -} - -func TestASN1BitLength(t *testing.T) { - tests := []struct { - bytes []byte - bitLen int - }{ - {nil, 0}, - {[]byte{0x00}, 0}, - {[]byte{0x00, 0x00}, 0}, - {[]byte{0xf0}, 4}, - {[]byte{0x88}, 5}, - {[]byte{0xff}, 8}, - {[]byte{0xff, 0x80}, 9}, - {[]byte{0xff, 0x81}, 16}, - } - - for i, test := range tests { - if got := asn1BitLength(test.bytes); got != test.bitLen { - t.Errorf("#%d: calculated bit-length of %d for %x, wanted %d", i, got, test.bytes, test.bitLen) - } - } -} - -func TestVerifyEmptyCertificate(t *testing.T) { - if _, err := new(Certificate).Verify(VerifyOptions{}); err != errNotParsed { - t.Errorf("Verifying empty certificate resulted in unexpected error: %q (wanted %q)", err, errNotParsed) - } -} - -func TestInsecureAlgorithmErrorString(t *testing.T) { - tests := []struct { - sa SignatureAlgorithm - want string - }{ - {MD2WithRSA, "x509: cannot verify signature: insecure algorithm MD2-RSA"}, - {-1, "x509: cannot verify signature: insecure algorithm -1"}, - {0, "x509: cannot verify signature: insecure algorithm 0"}, - {9999, "x509: cannot verify signature: insecure algorithm 9999"}, - } - for i, tt := range tests { - if got := fmt.Sprint(InsecureAlgorithmError(tt.sa)); got != tt.want { - t.Errorf("%d. mismatch.\n got: %s\nwant: %s\n", i, got, tt.want) - } - } -} - -// These CSR was generated with OpenSSL: -// openssl req -out CSR.csr -new -sha256 -nodes -keyout privateKey.key -config openssl.cnf -// -// With openssl.cnf containing the following sections: -// [ v3_req ] -// basicConstraints = CA:FALSE -// keyUsage = nonRepudiation, digitalSignature, keyEncipherment -// subjectAltName = email:gopher@golang.org,DNS:test.example.com -// [ req_attributes ] -// challengePassword = ignored challenge -// unstructuredName = ignored unstructured name -var csrBase64Array = [...]string{ - // Just [ v3_req ] - "MIIDHDCCAgQCAQAwfjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEUMBIGA1UEAwwLQ29tbW9uIE5hbWUxITAfBgkqhkiG9w0BCQEWEnRlc3RAZW1haWwuYWRkcmVzczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK1GY4YFx2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BMKU29tZS1TdGF0ZTERMA8GA1UEChMITUQ1IEluYy4wHhcNMTUx -MjAzMTkyOTMyWhcNMjkwODEyMTkyOTMyWjA1MQswCQYDVQQGEwJBVTETMBEGA1UE -CBMKU29tZS1TdGF0ZTERMA8GA1UEChMITUQ1IEluYy4wgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBANrq2nhLQj5mlXbpVX3QUPhfEm/vdEqPkoWtR/jRZIWm4WGf -Wpq/LKHJx2Pqwn+t117syN8l4U5unyAi1BJSXjBwPZNd7dXjcuJ+bRLV7FZ/iuvs -cfYyQQFTxan4TaJMd0x1HoNDbNbjHa02IyjjYE/r3mb/PIg+J2t5AZEh80lPAgMB -AAEwDQYJKoZIhvcNAQEEBQADgYEAjGzp3K3ey/YfKHohf33yHHWd695HQxDAP+wY -cs9/TAyLR+gJzJP7d18EcDDLJWVi7bhfa4EAD86di05azOh9kWSn4b3o9QYRGCSw -GNnI3Zk0cwNKA49hZntKKiy22DhRk7JAHF01d6Bu3KkHkmENrtJ+zj/+159WAnUa -qViorq4= ------END CERTIFICATE----- -` - -func TestMD5(t *testing.T) { - pemBlock, _ := pem.Decode([]byte(md5cert)) - cert, err := ParseCertificate(pemBlock.Bytes) - if err != nil { - t.Fatalf("failed to parse certificate: %s", err) - } - if sa := cert.SignatureAlgorithm; sa != MD5WithRSA { - t.Errorf("signature algorithm is %v, want %v", sa, MD5WithRSA) - } - if err = cert.CheckSignatureFrom(cert); err == nil { - t.Fatalf("certificate verification succeeded incorrectly") - } - if _, ok := err.(InsecureAlgorithmError); !ok { - t.Fatalf("certificate verification returned %v (%T), wanted InsecureAlgorithmError", err, err) - } -} - -// certMissingRSANULL contains an RSA public key where the AlgorithmIdentifer -// parameters are omitted rather than being an ASN.1 NULL. -const certMissingRSANULL = ` ------BEGIN CERTIFICATE----- -MIIB7TCCAVigAwIBAgIBADALBgkqhkiG9w0BAQUwJjEQMA4GA1UEChMHQWNtZSBD -bzESMBAGA1UEAxMJMTI3LjAuMC4xMB4XDTExMTIwODA3NTUxMloXDTEyMTIwNzA4 -MDAxMlowJjEQMA4GA1UEChMHQWNtZSBDbzESMBAGA1UEAxMJMTI3LjAuMC4xMIGc -MAsGCSqGSIb3DQEBAQOBjAAwgYgCgYBO0Hsx44Jk2VnAwoekXh6LczPHY1PfZpIG -hPZk1Y/kNqcdK+izIDZFI7Xjla7t4PUgnI2V339aEu+H5Fto5OkOdOwEin/ekyfE -ARl6vfLcPRSr0FTKIQzQTW6HLlzF0rtNS0/Otiz3fojsfNcCkXSmHgwa2uNKWi7e -E5xMQIhZkwIDAQABozIwMDAOBgNVHQ8BAf8EBAMCAKAwDQYDVR0OBAYEBAECAwQw -DwYDVR0jBAgwBoAEAQIDBDALBgkqhkiG9w0BAQUDgYEANh+zegx1yW43RmEr1b3A -p0vMRpqBWHyFeSnIyMZn3TJWRSt1tukkqVCavh9a+hoV2cxVlXIWg7nCto/9iIw4 -hB2rXZIxE0/9gzvGnfERYraL7KtnvshksBFQRlgXa5kc0x38BvEO5ZaoDPl4ILdE -GFGNEH5PlGffo05wc46QkYU= ------END CERTIFICATE-----` - -func TestRSAMissingNULLParameters(t *testing.T) { - block, _ := pem.Decode([]byte(certMissingRSANULL)) - if _, err := ParseCertificate(block.Bytes); err == nil { - t.Error("unexpected success when parsing certificate with missing RSA NULL parameter") - } else if !strings.Contains(err.Error(), "missing NULL") { - t.Errorf("unrecognised error when parsing certificate with missing RSA NULL parameter: %s", err) - } -} - -const certISOOID = ` ------BEGIN CERTIFICATE----- -MIIB5TCCAVKgAwIBAgIQtwyL3RPWV7dJQp34HwZG9DAJBgUrDgMCHQUAMBExDzAN -BgNVBAMTBm15dGVzdDAeFw0xNjA4MDkyMjExMDVaFw0zOTEyMzEyMzU5NTlaMBEx -DzANBgNVBAMTBm15dGVzdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArzIH -GsyDB3ohIGkkvijF2PTRUX1bvOtY1eUUpjwHyu0twpAKSuaQv2Ha+/63+aHe8O86 -BT+98wjXFX6RFSagtAujo80rIF2dSm33BGt18pDN8v6zp93dnAm0jRaSQrHJ75xw -5O+S1oEYR1LtUoFJy6qB104j6aINBAgOiLIKiMkCAwEAAaNGMEQwQgYDVR0BBDsw -OYAQVuYVQ/WDjdGSkZRlTtJDNKETMBExDzANBgNVBAMTBm15dGVzdIIQtwyL3RPW -V7dJQp34HwZG9DAJBgUrDgMCHQUAA4GBABngrSkH7vG5lY4sa4AZF59lAAXqBVJE -J4TBiKC62hCdZv18rBleP6ETfhbPg7pTs8p4ebQbpmtNxRS9Lw3MzQ8Ya5Ybwzj2 -NwBSyCtCQl7mrEg4nJqJl4A2EUhnET/oVxU0oTV/SZ3ziGXcY1oG1s6vidV7TZTu -MCRtdSdaM7g3 ------END CERTIFICATE-----` - -func TestISOOIDInCertificate(t *testing.T) { - block, _ := pem.Decode([]byte(certISOOID)) - if cert, err := ParseCertificate(block.Bytes); err != nil { - t.Errorf("certificate with ISO OID failed to parse: %s", err) - } else if cert.SignatureAlgorithm == UnknownSignatureAlgorithm { - t.Errorf("ISO OID not recognised in certificate") - } -} - -// certMultipleRDN contains a RelativeDistinguishedName with two elements (the -// common name and serial number). This particular certificate was the first -// such certificate in the “Pilot” Certificate Transparency log. -const certMultipleRDN = ` ------BEGIN CERTIFICATE----- -MIIFRzCCBC+gAwIBAgIEOl59NTANBgkqhkiG9w0BAQUFADA9MQswCQYDVQQGEwJz -aTEbMBkGA1UEChMSc3RhdGUtaW5zdGl0dXRpb25zMREwDwYDVQQLEwhzaWdvdi1j -YTAeFw0xMjExMTYxMDUyNTdaFw0xNzExMTYxMjQ5MDVaMIGLMQswCQYDVQQGEwJz -aTEbMBkGA1UEChMSc3RhdGUtaW5zdGl0dXRpb25zMRkwFwYDVQQLExB3ZWItY2Vy -dGlmaWNhdGVzMRAwDgYDVQQLEwdTZXJ2ZXJzMTIwFAYDVQQFEw0xMjM2NDg0MDEw -MDEwMBoGA1UEAxMTZXBvcnRhbC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NbwcbM69ZMAkGA1UdEwQCMAAwGQYJ -KoZIhvZ9B0EABAwwChsEVjcuMQMCA6gwDQYJKoZIhvcNAQEFBQADggEBAHny0K1y -BQznrzDu3DDpBcGYguKU0dvU9rqsV1ua4nxkriSMWjgsX6XJFDdDW60I3P4VWab5 -ag5fZzbGqi8kva/CzGgZh+CES0aWCPy+4Gb8lwOTt+854/laaJvd6kgKTER7z7U9 -9C86Ch2y4sXNwwwPJ1A9dmrZJZOcJjS/WYZgwaafY2Hdxub5jqPE5nehwYUPVu9R -uH6/skk4OEKcfOtN0hCnISOVuKYyS4ANARWRG5VGHIH06z3lGUVARFRJ61gtAprd -La+fgSS+LVZ+kU2TkeoWAKvGq8MAgDq4D4Xqwekg7WKFeuyusi/NI5rm40XgjBMF -DF72IUofoVt7wo0= ------END CERTIFICATE-----` - -func TestMultipleRDN(t *testing.T) { - block, _ := pem.Decode([]byte(certMultipleRDN)) - cert, err := ParseCertificate(block.Bytes) - if err != nil { - t.Fatalf("certificate with two elements in an RDN failed to parse: %v", err) - } - - if want := "eportal.mss.edus.si"; cert.Subject.CommonName != want { - t.Errorf("got common name of %q, but want %q", cert.Subject.CommonName, want) - } - - if want := "1236484010010"; cert.Subject.SerialNumber != want { - t.Errorf("got serial number of %q, but want %q", cert.Subject.SerialNumber, want) - } -} - -func TestSystemCertPool(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skip("not implemented on Windows; Issue 16736, 18609") - } - _, err := SystemCertPool() - if err != nil { - t.Fatal(err) - } -} - -const emptyNameConstraintsPEM = ` ------BEGIN CERTIFICATE----- -MIIC1jCCAb6gAwIBAgICEjQwDQYJKoZIhvcNAQELBQAwKDEmMCQGA1UEAxMdRW1w -dHkgbmFtZSBjb25zdHJhaW50cyBpc3N1ZXIwHhcNMTMwMjAxMDAwMDAwWhcNMjAw -NTMwMTA0ODM4WjAhMR8wHQYDVQQDExZFbXB0eSBuYW1lIGNvbnN0cmFpbnRzMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwriElUIt3LCqmJObs+yDoWPD -F5IqgWk6moIobYjPfextZiYU6I3EfvAwoNxPDkN2WowcocUZMJbEeEq5ebBksFnx -f12gBxlIViIYwZAzu7aFvhDMyPKQI3C8CG0ZSC9ABZ1E3umdA3CEueNOmP/TChNq -Cl23+BG1Qb/PJkpAO+GfpWSVhTcV53Mf/cKvFHcjGNrxzdSoq9fyW7a6gfcGEQY0 -LVkmwFWUfJ0wT8kaeLr0E0tozkIfo01KNWNzv6NcYP80QOBRDlApWu9ODmEVJHPD -blx4jzTQ3JLa+4DvBNOjVUOp+mgRmjiW0rLdrxwOxIqIOwNjweMCp/hgxX/hTQID -AQABoxEwDzANBgNVHR4EBjAEoAChADANBgkqhkiG9w0BAQsFAAOCAQEAWG+/zUMH -QhP8uNCtgSHyim/vh7wminwAvWgMKxlkLBFns6nZeQqsOV1lABY7U0Zuoqa1Z5nb -6L+iJa4ElREJOi/erLc9uLwBdDCAR0hUTKD7a6i4ooS39DTle87cUnj0MW1CUa6H -v5SsvpYW+1XleYJk/axQOOTcy4Es53dvnZsjXH0EA/QHnn7UV+JmlE3rtVxcYp6M -LYPmRhTioROA/drghicRkiu9hxdPyxkYS16M5g3Zj30jdm+k/6C6PeNtN9YmOOga -nCOSyFYfGhqOANYzpmuV+oIedAsPpIbfIzN8njYUs1zio+1IoI4o8ddM9sCbtPU8 -o+WoY6IsCKXV/g== ------END CERTIFICATE-----` - -func TestEmptyNameConstraints(t *testing.T) { - block, _ := pem.Decode([]byte(emptyNameConstraintsPEM)) - _, err := ParseCertificate(block.Bytes) - if err == nil { - t.Fatal("unexpected success") - } - - const expected = "empty name constraints" - if str := err.Error(); !strings.Contains(str, expected) { - t.Errorf("expected %q in error but got %q", expected, str) - } -} - -func TestPKIXNameString(t *testing.T) { - pem, err := hex.DecodeString(certBytes) - if err != nil { - t.Fatal(err) - } - certs, err := ParseCertificates(pem) - if err != nil { - t.Fatal(err) - } - - tests := []struct { - dn pkix.Name - want string - }{ - {pkix.Name{ - CommonName: "Steve Kille", - Organization: []string{"Isode Limited"}, - OrganizationalUnit: []string{"RFCs"}, - Locality: []string{"Richmond"}, - Province: []string{"Surrey"}, - StreetAddress: []string{"The Square"}, - PostalCode: []string{"TW9 1DT"}, - SerialNumber: "RFC 2253", - Country: []string{"GB"}, - }, "SERIALNUMBER=RFC 2253,CN=Steve Kille,OU=RFCs,O=Isode Limited,POSTALCODE=TW9 1DT,STREET=The Square,L=Richmond,ST=Surrey,C=GB"}, - {certs[0].Subject, - "CN=mail.google.com,O=Google Inc,L=Mountain View,ST=California,C=US"}, - {pkix.Name{ - Organization: []string{"#Google, Inc. \n-> 'Alphabet\" "}, - Country: []string{"US"}, - }, "O=\\#Google\\, Inc. \n-\\> 'Alphabet\\\"\\ ,C=US"}, - {pkix.Name{ - CommonName: "foo.com", - Organization: []string{"Gopher Industries"}, - ExtraNames: []pkix.AttributeTypeAndValue{ - {Type: asn1.ObjectIdentifier([]int{2, 5, 4, 3}), Value: "bar.com"}}, - }, "CN=bar.com,O=Gopher Industries"}, - {pkix.Name{ - Locality: []string{"Gophertown"}, - ExtraNames: []pkix.AttributeTypeAndValue{ - {Type: asn1.ObjectIdentifier([]int{1, 2, 3, 4, 5}), Value: "golang.org"}}, - }, "1.2.3.4.5=#130a676f6c616e672e6f7267,L=Gophertown"}, - } - - for i, test := range tests { - if got := test.dn.String(); got != test.want { - t.Errorf("#%d: String() = \n%s\n, want \n%s", i, got, test.want) - } - } -} - -func TestRDNSequenceString(t *testing.T) { - // Test some extra cases that get lost in pkix.Name conversions such as - // multi-valued attributes. - - var ( - oidCountry = []int{2, 5, 4, 6} - oidOrganization = []int{2, 5, 4, 10} - oidOrganizationalUnit = []int{2, 5, 4, 11} - oidCommonName = []int{2, 5, 4, 3} - ) - - tests := []struct { - seq pkix.RDNSequence - want string - }{ - { - seq: pkix.RDNSequence{ - pkix.RelativeDistinguishedNameSET{ - pkix.AttributeTypeAndValue{Type: oidCountry, Value: "US"}, - }, - pkix.RelativeDistinguishedNameSET{ - pkix.AttributeTypeAndValue{Type: oidOrganization, Value: "Widget Inc."}, - }, - pkix.RelativeDistinguishedNameSET{ - pkix.AttributeTypeAndValue{Type: oidOrganizationalUnit, Value: "Sales"}, - pkix.AttributeTypeAndValue{Type: oidCommonName, Value: "J. Smith"}, - }, - }, - want: "OU=Sales+CN=J. Smith,O=Widget Inc.,C=US", - }, - } - - for i, test := range tests { - if got := test.seq.String(); got != test.want { - t.Errorf("#%d: String() = \n%s\n, want \n%s", i, got, test.want) - } - } -} - -const criticalNameConstraintWithUnknownTypePEM = ` ------BEGIN CERTIFICATE----- -MIIC/TCCAeWgAwIBAgICEjQwDQYJKoZIhvcNAQELBQAwKDEmMCQGA1UEAxMdRW1w -dHkgbmFtZSBjb25zdHJhaW50cyBpc3N1ZXIwHhcNMTMwMjAxMDAwMDAwWhcNMjAw -NTMwMTA0ODM4WjAhMR8wHQYDVQQDExZFbXB0eSBuYW1lIGNvbnN0cmFpbnRzMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwriElUIt3LCqmJObs+yDoWPD -F5IqgWk6moIobYjPfextZiYU6I3EfvAwoNxPDkN2WowcocUZMJbEeEq5ebBksFnx -f12gBxlIViIYwZAzu7aFvhDMyPKQI3C8CG0ZSC9ABZ1E3umdA3CEueNOmP/TChNq -Cl23+BG1Qb/PJkpAO+GfpWSVhTcV53Mf/cKvFHcjGNrxzdSoq9fyW7a6gfcGEQY0 -LVkmwFWUfJ0wT8kaeLr0E0tozkIfo01KNWNzv6NcYP80QOBRDlApWu9ODmEVJHPD -blx4jzTQ3JLa+4DvBNOjVUOp+mgRmjiW0rLdrxwOxIqIOwNjweMCp/hgxX/hTQID -AQABozgwNjA0BgNVHR4BAf8EKjAooCQwIokgIACrzQAAAAAAAAAAAAAAAP////8A -AAAAAAAAAAAAAAChADANBgkqhkiG9w0BAQsFAAOCAQEAWG+/zUMHQhP8uNCtgSHy -im/vh7wminwAvWgMKxlkLBFns6nZeQqsOV1lABY7U0Zuoqa1Z5nb6L+iJa4ElREJ -Oi/erLc9uLwBdDCAR0hUTKD7a6i4ooS39DTle87cUnj0MW1CUa6Hv5SsvpYW+1Xl -eYJk/axQOOTcy4Es53dvnZsjXH0EA/QHnn7UV+JmlE3rtVxcYp6MLYPmRhTioROA -/drghicRkiu9hxdPyxkYS16M5g3Zj30jdm+k/6C6PeNtN9YmOOganCOSyFYfGhqO -ANYzpmuV+oIedAsPpIbfIzN8njYUs1zio+1IoI4o8ddM9sCbtPU8o+WoY6IsCKXV -/g== ------END CERTIFICATE-----` - -func TestCriticalNameConstraintWithUnknownType(t *testing.T) { - block, _ := pem.Decode([]byte(criticalNameConstraintWithUnknownTypePEM)) - cert, err := ParseCertificate(block.Bytes) - if err != nil { - t.Fatalf("unexpected parsing failure: %s", err) - } - - if l := len(cert.UnhandledCriticalExtensions); l != 1 { - t.Fatalf("expected one unhandled critical extension, but found %d", l) - } -} - -const badIPMaskPEM = ` ------BEGIN CERTIFICATE----- -MIICzzCCAbegAwIBAgICEjQwDQYJKoZIhvcNAQELBQAwHTEbMBkGA1UEAxMSQmFk -IElQIG1hc2sgaXNzdWVyMB4XDTEzMDIwMTAwMDAwMFoXDTIwMDUzMDEwNDgzOFow -FjEUMBIGA1UEAxMLQmFkIElQIG1hc2swggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDCuISVQi3csKqYk5uz7IOhY8MXkiqBaTqagihtiM997G1mJhTojcR+ -8DCg3E8OQ3ZajByhxRkwlsR4Srl5sGSwWfF/XaAHGUhWIhjBkDO7toW+EMzI8pAj -cLwIbRlIL0AFnUTe6Z0DcIS5406Y/9MKE2oKXbf4EbVBv88mSkA74Z+lZJWFNxXn -cx/9wq8UdyMY2vHN1Kir1/JbtrqB9wYRBjQtWSbAVZR8nTBPyRp4uvQTS2jOQh+j -TUo1Y3O/o1xg/zRA4FEOUCla704OYRUkc8NuXHiPNNDcktr7gO8E06NVQ6n6aBGa -OJbSst2vHA7Eiog7A2PB4wKn+GDFf+FNAgMBAAGjIDAeMBwGA1UdHgEB/wQSMBCg -DDAKhwgBAgME//8BAKEAMA0GCSqGSIb3DQEBCwUAA4IBAQBYb7/NQwdCE/y40K2B -IfKKb++HvCaKfAC9aAwrGWQsEWezqdl5Cqw5XWUAFjtTRm6iprVnmdvov6IlrgSV -EQk6L96stz24vAF0MIBHSFRMoPtrqLiihLf0NOV7ztxSePQxbUJRroe/lKy+lhb7 -VeV5gmT9rFA45NzLgSznd2+dmyNcfQQD9AeeftRX4maUTeu1XFxinowtg+ZGFOKh -E4D92uCGJxGSK72HF0/LGRhLXozmDdmPfSN2b6T/oLo942031iY46BqcI5LIVh8a -Go4A1jOma5X6gh50Cw+kht8jM3yeNhSzXOKj7Uigjijx10z2wJu09Tyj5ahjoiwI -pdX+ ------END CERTIFICATE-----` - -func TestBadIPMask(t *testing.T) { - block, _ := pem.Decode([]byte(badIPMaskPEM)) - _, err := ParseCertificate(block.Bytes) - if err == nil { - t.Fatalf("unexpected success") - } - - const expected = "contained invalid mask" - if !strings.Contains(err.Error(), expected) { - t.Fatalf("expected %q in error but got: %s", expected, err) - } -} - -const additionalGeneralSubtreePEM = ` ------BEGIN CERTIFICATE----- -MIIG4TCCBMmgAwIBAgIRALss+4rLw2Ia7tFFhxE8g5cwDQYJKoZIhvcNAQELBQAw -bjELMAkGA1UEBhMCTkwxIDAeBgNVBAoMF01pbmlzdGVyaWUgdmFuIERlZmVuc2ll -MT0wOwYDVQQDDDRNaW5pc3RlcmllIHZhbiBEZWZlbnNpZSBDZXJ0aWZpY2F0aWUg -QXV0b3JpdGVpdCAtIEcyMB4XDTEzMDMwNjEyMDM0OVoXDTEzMTEzMDEyMDM1MFow -bDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUNlcnRpUGF0aCBMTEMxIjAgBgNVBAsT -GUNlcnRpZmljYXRpb24gQXV0aG9yaXRpZXMxITAfBgNVBAMTGENlcnR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MCTkwxIDAeBgNVBAoTF01pbmlzdGVyaWUgdmFuIERlZmVuc2ll -gQFjMF0GA1UdIQRWMFQwGgYKYIQQAYdrAQIFAQYMKwYBBAGBu1MBAQECMBoGCmCE -EAGHawECBQIGDCsGAQQBgbtTAQEBAjAaBgpghBABh2sBAgUDBgwrBgEEAYG7UwEB -AQIwHQYDVR0OBBYEFNDCjBM3M3ZKkag84ei3/aKc0d0UMA0GCSqGSIb3DQEBCwUA -A4ICAQAQXFn9jF90/DNFf15JhoGtta/0dNInb14PMu3PAjcdrXYCDPpQZOArTUng -5YT1WuzfmjnXiTsziT3my0r9Mxvz/btKK/lnVOMW4c2q/8sIsIPnnW5ZaRGrsANB -dNDZkzMYmeG2Pfgvd0AQSOrpE/TVgWfu/+MMRWwX9y6VbooBR7BLv7zMuVH0WqLn -6OMFth7fqsThlfMSzkE/RDSaU6n3wXAWT1SIqBITtccRjSUQUFm/q3xrb2cwcZA6 -8vdS4hzNd+ttS905ay31Ks4/1Wrm1bH5RhEfRSH0VSXnc0b+z+RyBbmiwtVZqzxE -u3UQg/rAmtLDclLFEzjp8YDTIRYSLwstDbEXO/0ArdGrQm79HQ8i/3ZbP2357myW -i15qd6gMJIgGHS4b8Hc7R1K8LQ9Gm1aLKBEWVNGZlPK/cpXThpVmoEyslN2DHCrc -fbMbjNZpXlTMa+/b9z7Fa4X8dY8u/ELzZuJXJv5Rmqtg29eopFFYDCl0Nkh1XAjo -QejEoHHUvYV8TThHZr6Z6Ib8CECgTehU4QvepkgDXNoNrKRZBG0JhLjkwxh2whZq -nvWBfALC2VuNOM6C0rDY+HmhMlVt0XeqnybD9MuQALMit7Z00Cw2CIjNsBI9xBqD -xKK9CjUb7gzRUWSpB9jGHsvpEMHOzIFhufvH2Bz1XJw+Cl7khw== ------END CERTIFICATE-----` - -func TestAdditionFieldsInGeneralSubtree(t *testing.T) { - // Very rarely, certificates can include additional fields in the - // GeneralSubtree structure. This tests that such certificates can be - // parsed. - block, _ := pem.Decode([]byte(additionalGeneralSubtreePEM)) - if _, err := ParseCertificate(block.Bytes); err != nil { - t.Fatalf("failed to parse certificate: %s", err) - } -} - -func TestEmptySubject(t *testing.T) { - template := Certificate{ - SerialNumber: big.NewInt(1), - DNSNames: []string{"example.com"}, - } - - derBytes, err := CreateCertificate(rand.Reader, &template, &template, &testPrivateKey.PublicKey, testPrivateKey) - if err != nil { - t.Fatalf("failed to create certificate: %s", err) - } - - cert, err := ParseCertificate(derBytes) - if err != nil { - t.Fatalf("failed to parse certificate: %s", err) - } - - for _, ext := range cert.Extensions { - if ext.Id.Equal(OIDExtensionSubjectAltName) { - if !ext.Critical { - t.Fatal("SAN extension is not critical") - } - return - } - } - - t.Fatal("SAN extension is missing") -} - -// multipleURLsInCRLDPPEM contains two URLs in a single CRL DistributionPoint -// structure. It is taken from https://crt.sh/?id=12721534. -const multipleURLsInCRLDPPEM = ` ------BEGIN CERTIFICATE----- -MIIF4TCCBMmgAwIBAgIQc+6uFePfrahUGpXs8lhiTzANBgkqhkiG9w0BAQsFADCB -8zELMAkGA1UEBhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2Vy -dGlmaWNhY2lvIChOSUYgUS0wODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1 -YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYDVQQLEyxWZWdldSBodHRwczovL3d3 -dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UECxMsSmVyYXJxdWlh -IEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMTBkVD -LUFDQzAeFw0xNDA5MTgwODIxMDBaFw0zMDA5MTgwODIxMDBaMIGGMQswCQYDVQQG -EwJFUzEzMDEGA1UECgwqQ09OU09SQ0kgQURNSU5JU1RSQUNJTyBPQkVSVEEgREUg -Q0FUQUxVTllBMSowKAYDVQQLDCFTZXJ2ZWlzIFDDumJsa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BzY2QyLmNhdGNlcnQubmV0L2NybC9lYy1hY2MuY3JsMA0GCSqGSIb3DQEBCwUA -A4IBAQChqFTjlAH5PyIhLjLgEs68CyNNC1+vDuZXRhy22TI83JcvGmQrZosPvVIL -PsUXx+C06Pfqmh48Q9S89X9K8w1SdJxP/rZeGEoRiKpwvQzM4ArD9QxyC8jirxex -3Umg9Ai/sXQ+1lBf6xw4HfUUr1WIp7pNHj0ZWLo106urqktcdeAFWme+/klis5fu -labCSVPuT/QpwakPrtqOhRms8vgpKiXa/eLtL9ZiA28X/Mker0zlAeTA7Z7uAnp6 -oPJTlZu1Gg1ZDJueTWWsLlO+P+Wzm3MRRIbcgdRzm4mdO7ubu26SzX/aQXDhuih+ -eVxXDTCfs7GUlxnjOp5j559X/N0A ------END CERTIFICATE----- -` - -func TestMultipleURLsInCRLDP(t *testing.T) { - block, _ := pem.Decode([]byte(multipleURLsInCRLDPPEM)) - cert, err := ParseCertificate(block.Bytes) - if err != nil { - t.Fatalf("failed to parse certificate: %s", err) - } - - want := []string{ - "http://epscd.catcert.net/crl/ec-acc.crl", - "http://epscd2.catcert.net/crl/ec-acc.crl", - } - if got := cert.CRLDistributionPoints; !reflect.DeepEqual(got, want) { - t.Errorf("CRL distribution points = %#v, want #%v", got, want) - } -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509util/files.go b/vendor/github.com/google/certificate-transparency-go/x509util/files.go deleted file mode 100644 index 08e7781..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509util/files.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package x509util - -import ( - "encoding/pem" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/google/certificate-transparency-go/x509" -) - -// ReadPossiblePEMFile loads data from a file which may be in DER format -// or may be in PEM format (with the given blockname). -func ReadPossiblePEMFile(filename, blockname string) ([][]byte, error) { - data, err := ioutil.ReadFile(filename) - if err != nil { - return nil, fmt.Errorf("%s: failed to read data: %v", filename, err) - } - return dePEM(data, blockname), nil -} - -// ReadPossiblePEMURL attempts to determine if the given target is a local file or a -// URL, and return the file contents regardless. It also copes with either PEM or DER -// format data. -func ReadPossiblePEMURL(target, blockname string) ([][]byte, error) { - if !strings.HasPrefix(target, "http://") && !strings.HasPrefix(target, "https://") { - // Assume it's a filename - return ReadPossiblePEMFile(target, blockname) - } - - rsp, err := http.Get(target) - if err != nil { - return nil, fmt.Errorf("failed to http.Get(%q): %v", target, err) - } - data, err := ioutil.ReadAll(rsp.Body) - if err != nil { - return nil, fmt.Errorf("failed to ioutil.ReadAll(%q): %v", target, err) - } - return dePEM(data, blockname), nil -} - -func dePEM(data []byte, blockname string) [][]byte { - var results [][]byte - if strings.Contains(string(data), "BEGIN "+blockname) { - rest := data - for { - var block *pem.Block - block, rest = pem.Decode(rest) - if block == nil { - break - } - if block.Type == blockname { - results = append(results, block.Bytes) - } - } - } else { - results = append(results, data) - } - return results -} - -// ReadFileOrURL returns the data from a target which may be either a filename -// or an HTTP(S) URL. -func ReadFileOrURL(target string, client *http.Client) ([]byte, error) { - u, err := url.Parse(target) - if err != nil || (u.Scheme != "http" && u.Scheme != "https") { - return ioutil.ReadFile(target) - } - - rsp, err := client.Get(u.String()) - if err != nil { - return nil, fmt.Errorf("failed to http.Get(%q): %v", target, err) - } - return ioutil.ReadAll(rsp.Body) -} - -// GetIssuer attempts to retrieve the issuer for a certificate, by examining -// the cert's Authority Information Access extension (if present) for the -// issuer's URL and retrieving from there. -func GetIssuer(cert *x509.Certificate, client *http.Client) (*x509.Certificate, error) { - if len(cert.IssuingCertificateURL) == 0 { - return nil, nil - } - issuerURL := cert.IssuingCertificateURL[0] - rsp, err := client.Get(issuerURL) - if err != nil || rsp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("failed to get issuer from %q: %v", issuerURL, err) - } - defer rsp.Body.Close() - body, err := ioutil.ReadAll(rsp.Body) - if err != nil { - return nil, fmt.Errorf("failed to read issuer from %q: %v", issuerURL, err) - } - issuers, err := x509.ParseCertificates(body) - if err != nil { - return nil, fmt.Errorf("failed to parse issuer cert: %v", err) - } - return issuers[0], nil -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509util/fuzz.go b/vendor/github.com/google/certificate-transparency-go/x509util/fuzz.go deleted file mode 100644 index ece6fd1..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509util/fuzz.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package x509util - -import "github.com/google/certificate-transparency-go/x509" - -// Fuzz is a go-fuzz (https://github.com/dvyukov/go-fuzz) entrypoint -// for fuzzing the parsing of X509 certificates. -func Fuzz(data []byte) int { - if _, err := x509.ParseCertificate(data); err == nil { - return 1 - } - return 0 -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509util/revoked.go b/vendor/github.com/google/certificate-transparency-go/x509util/revoked.go deleted file mode 100644 index 3026ff1..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509util/revoked.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package x509util - -import ( - "bytes" - "encoding/hex" - "fmt" - "strconv" - - "github.com/google/certificate-transparency-go/x509" - "github.com/google/certificate-transparency-go/x509/pkix" -) - -// RevocationReasonToString generates a string describing a revocation reason code. -func RevocationReasonToString(reason x509.RevocationReasonCode) string { - switch reason { - case x509.Unspecified: - return "Unspecified" - case x509.KeyCompromise: - return "Key Compromise" - case x509.CACompromise: - return "CA Compromise" - case x509.AffiliationChanged: - return "Affiliation Changed" - case x509.Superseded: - return "Superseded" - case x509.CessationOfOperation: - return "Cessation Of Operation" - case x509.CertificateHold: - return "Certificate Hold" - case x509.RemoveFromCRL: - return "Remove From CRL" - case x509.PrivilegeWithdrawn: - return "Privilege Withdrawn" - case x509.AACompromise: - return "AA Compromise" - default: - return strconv.Itoa(int(reason)) - } -} - -// CRLToString generates a string describing the given certificate revocation list. -// The output roughly resembles that from openssl crl -text. -func CRLToString(crl *x509.CertificateList) string { - var result bytes.Buffer - var showCritical = func(critical bool) { - if critical { - result.WriteString(" critical") - } - result.WriteString("\n") - } - result.WriteString("Certificate Revocation List (CRL):\n") - result.WriteString(fmt.Sprintf(" Version: %d (%#x)\n", crl.TBSCertList.Version+1, crl.TBSCertList.Version)) - result.WriteString(fmt.Sprintf(" Signature Algorithm: %v\n", x509.SignatureAlgorithmFromAI(crl.TBSCertList.Signature))) - var issuer pkix.Name - issuer.FillFromRDNSequence(&crl.TBSCertList.Issuer) - result.WriteString(fmt.Sprintf(" Issuer: %v\n", NameToString(issuer))) - result.WriteString(fmt.Sprintf(" Last Update: %v\n", crl.TBSCertList.ThisUpdate)) - result.WriteString(fmt.Sprintf(" Next Update: %v\n", crl.TBSCertList.NextUpdate)) - - if len(crl.TBSCertList.Extensions) > 0 { - result.WriteString(" CRL extensions:\n") - } - - count, critical := OIDInExtensions(x509.OIDExtensionAuthorityKeyId, crl.TBSCertList.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Authority Key Identifier:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" keyid:%v\n", hex.EncodeToString(crl.TBSCertList.AuthorityKeyID))) - } - count, critical = OIDInExtensions(x509.OIDExtensionIssuerAltName, crl.TBSCertList.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Issuer Alt Name:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" %s\n", GeneralNamesToString(&crl.TBSCertList.IssuerAltNames))) - } - count, critical = OIDInExtensions(x509.OIDExtensionCRLNumber, crl.TBSCertList.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 CRLNumber:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" %d\n", crl.TBSCertList.CRLNumber)) - } - count, critical = OIDInExtensions(x509.OIDExtensionDeltaCRLIndicator, crl.TBSCertList.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Delta CRL Indicator:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" %d\n", crl.TBSCertList.BaseCRLNumber)) - } - count, critical = OIDInExtensions(x509.OIDExtensionIssuingDistributionPoint, crl.TBSCertList.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Issuing Distribution Point:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" %s\n", GeneralNamesToString(&crl.TBSCertList.IssuingDPFullNames))) - } - count, critical = OIDInExtensions(x509.OIDExtensionFreshestCRL, crl.TBSCertList.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Freshest CRL:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" Full Name:\n")) - var buf bytes.Buffer - for _, pt := range crl.TBSCertList.FreshestCRLDistributionPoint { - commaAppend(&buf, "URI:"+pt) - } - result.WriteString(fmt.Sprintf(" %v\n", buf.String())) - } - count, critical = OIDInExtensions(x509.OIDExtensionAuthorityInfoAccess, crl.TBSCertList.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" Authority Information Access:")) - showCritical(critical) - var issuerBuf bytes.Buffer - for _, issuer := range crl.TBSCertList.IssuingCertificateURL { - commaAppend(&issuerBuf, "URI:"+issuer) - } - if issuerBuf.Len() > 0 { - result.WriteString(fmt.Sprintf(" CA Issuers - %v\n", issuerBuf.String())) - } - var ocspBuf bytes.Buffer - for _, ocsp := range crl.TBSCertList.OCSPServer { - commaAppend(&ocspBuf, "URI:"+ocsp) - } - if ocspBuf.Len() > 0 { - result.WriteString(fmt.Sprintf(" OCSP - %v\n", ocspBuf.String())) - } - // TODO(drysdale): Display other GeneralName types - } - - result.WriteString("\n") - result.WriteString("Revoked Certificates:\n") - for _, c := range crl.TBSCertList.RevokedCertificates { - result.WriteString(fmt.Sprintf(" Serial Number: %d (%#[1]x)\n", c.SerialNumber)) - result.WriteString(fmt.Sprintf(" Revocation Date : %v\n", c.RevocationTime)) - count, critical = OIDInExtensions(x509.OIDExtensionCRLReasons, c.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 CRL Reason Code:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" %s\n", RevocationReasonToString(c.RevocationReason))) - } - count, critical = OIDInExtensions(x509.OIDExtensionInvalidityDate, c.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" Invalidity Date:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" %s\n", c.InvalidityDate)) - } - count, critical = OIDInExtensions(x509.OIDExtensionCertificateIssuer, c.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" Issuer:")) - showCritical(critical) - result.WriteString(fmt.Sprintf(" %s\n", GeneralNamesToString(&c.Issuer))) - } - } - result.WriteString(fmt.Sprintf(" Signature Algorithm: %v\n", x509.SignatureAlgorithmFromAI(crl.SignatureAlgorithm))) - appendHexData(&result, crl.SignatureValue.Bytes, 18, " ") - result.WriteString("\n") - - return result.String() -} diff --git a/vendor/github.com/google/certificate-transparency-go/x509util/x509util.go b/vendor/github.com/google/certificate-transparency-go/x509util/x509util.go deleted file mode 100644 index 270d1ce..0000000 --- a/vendor/github.com/google/certificate-transparency-go/x509util/x509util.go +++ /dev/null @@ -1,773 +0,0 @@ -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package x509util includes utility code for working with X.509 -// certificates from the x509 package. -package x509util - -import ( - "bytes" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rsa" - "encoding/base64" - "encoding/hex" - "encoding/pem" - "errors" - "fmt" - "strconv" - - ct "github.com/google/certificate-transparency-go" - "github.com/google/certificate-transparency-go/asn1" - "github.com/google/certificate-transparency-go/gossip/minimal/x509ext" - "github.com/google/certificate-transparency-go/tls" - "github.com/google/certificate-transparency-go/x509" - "github.com/google/certificate-transparency-go/x509/pkix" -) - -// OIDForStandardExtension indicates whether oid identifies a standard extension. -// Standard extensions are listed in RFC 5280 (and other RFCs). -func OIDForStandardExtension(oid asn1.ObjectIdentifier) bool { - if oid.Equal(x509.OIDExtensionSubjectKeyId) || - oid.Equal(x509.OIDExtensionKeyUsage) || - oid.Equal(x509.OIDExtensionExtendedKeyUsage) || - oid.Equal(x509.OIDExtensionAuthorityKeyId) || - oid.Equal(x509.OIDExtensionBasicConstraints) || - oid.Equal(x509.OIDExtensionSubjectAltName) || - oid.Equal(x509.OIDExtensionCertificatePolicies) || - oid.Equal(x509.OIDExtensionNameConstraints) || - oid.Equal(x509.OIDExtensionCRLDistributionPoints) || - oid.Equal(x509.OIDExtensionIssuerAltName) || - oid.Equal(x509.OIDExtensionSubjectDirectoryAttributes) || - oid.Equal(x509.OIDExtensionInhibitAnyPolicy) || - oid.Equal(x509.OIDExtensionPolicyConstraints) || - oid.Equal(x509.OIDExtensionPolicyMappings) || - oid.Equal(x509.OIDExtensionFreshestCRL) || - oid.Equal(x509.OIDExtensionSubjectInfoAccess) || - oid.Equal(x509.OIDExtensionAuthorityInfoAccess) || - oid.Equal(x509.OIDExtensionCTPoison) || - oid.Equal(x509.OIDExtensionCTSCT) { - return true - } - return false -} - -// OIDInExtensions checks whether the extension identified by oid is present in extensions -// and returns how many times it occurs together with an indication of whether any of them -// are marked critical. -func OIDInExtensions(oid asn1.ObjectIdentifier, extensions []pkix.Extension) (int, bool) { - count := 0 - critical := false - for _, ext := range extensions { - if ext.Id.Equal(oid) { - count++ - if ext.Critical { - critical = true - } - } - } - return count, critical -} - -// String formatting for various X.509/ASN.1 types -func bitStringToString(b asn1.BitString) string { - result := hex.EncodeToString(b.Bytes) - bitsLeft := b.BitLength % 8 - if bitsLeft != 0 { - result += " (" + strconv.Itoa(8-bitsLeft) + " unused bits)" - } - return result -} - -func publicKeyAlgorithmToString(algo x509.PublicKeyAlgorithm) string { - // Use OpenSSL-compatible strings for the algorithms. - switch algo { - case x509.RSA: - return "rsaEncryption" - case x509.DSA: - return "dsaEncryption" - case x509.ECDSA: - return "id-ecPublicKey" - default: - return strconv.Itoa(int(algo)) - } -} - -// appendHexData adds a hex dump of binary data to buf, with line breaks -// after each set of count bytes, and with each new line prefixed with the -// given prefix. -func appendHexData(buf *bytes.Buffer, data []byte, count int, prefix string) { - for ii, byte := range data { - if ii%count == 0 { - if ii > 0 { - buf.WriteString("\n") - } - buf.WriteString(prefix) - } - buf.WriteString(fmt.Sprintf("%02x:", byte)) - } -} - -func curveOIDToString(oid asn1.ObjectIdentifier) (t string, bitlen int) { - switch { - case oid.Equal(x509.OIDNamedCurveP224): - return "secp224r1", 224 - case oid.Equal(x509.OIDNamedCurveP256): - return "prime256v1", 256 - case oid.Equal(x509.OIDNamedCurveP384): - return "secp384r1", 384 - case oid.Equal(x509.OIDNamedCurveP521): - return "secp521r1", 521 - } - return fmt.Sprintf("%v", oid), -1 -} - -func publicKeyToString(algo x509.PublicKeyAlgorithm, pub interface{}) string { - var buf bytes.Buffer - switch pub := pub.(type) { - case *rsa.PublicKey: - bitlen := pub.N.BitLen() - buf.WriteString(fmt.Sprintf(" Public Key: (%d bit)\n", bitlen)) - buf.WriteString(" Modulus:\n") - data := pub.N.Bytes() - appendHexData(&buf, data, 15, " ") - buf.WriteString("\n") - buf.WriteString(fmt.Sprintf(" Exponent: %d (0x%x)", pub.E, pub.E)) - case *dsa.PublicKey: - buf.WriteString(" pub:\n") - appendHexData(&buf, pub.Y.Bytes(), 15, " ") - buf.WriteString("\n") - buf.WriteString(" P:\n") - appendHexData(&buf, pub.P.Bytes(), 15, " ") - buf.WriteString("\n") - buf.WriteString(" Q:\n") - appendHexData(&buf, pub.Q.Bytes(), 15, " ") - buf.WriteString("\n") - buf.WriteString(" G:\n") - appendHexData(&buf, pub.G.Bytes(), 15, " ") - case *ecdsa.PublicKey: - data := elliptic.Marshal(pub.Curve, pub.X, pub.Y) - oid, ok := x509.OIDFromNamedCurve(pub.Curve) - if !ok { - return " " - } - oidname, bitlen := curveOIDToString(oid) - buf.WriteString(fmt.Sprintf(" Public Key: (%d bit)\n", bitlen)) - buf.WriteString(" pub:\n") - appendHexData(&buf, data, 15, " ") - buf.WriteString("\n") - buf.WriteString(fmt.Sprintf(" ASN1 OID: %s", oidname)) - default: - buf.WriteString(fmt.Sprintf("%v", pub)) - } - return buf.String() -} - -func commaAppend(buf *bytes.Buffer, s string) { - if buf.Len() > 0 { - buf.WriteString(", ") - } - buf.WriteString(s) -} - -func keyUsageToString(k x509.KeyUsage) string { - var buf bytes.Buffer - if k&x509.KeyUsageDigitalSignature != 0 { - commaAppend(&buf, "Digital Signature") - } - if k&x509.KeyUsageContentCommitment != 0 { - commaAppend(&buf, "Content Commitment") - } - if k&x509.KeyUsageKeyEncipherment != 0 { - commaAppend(&buf, "Key Encipherment") - } - if k&x509.KeyUsageDataEncipherment != 0 { - commaAppend(&buf, "Data Encipherment") - } - if k&x509.KeyUsageKeyAgreement != 0 { - commaAppend(&buf, "Key Agreement") - } - if k&x509.KeyUsageCertSign != 0 { - commaAppend(&buf, "Certificate Signing") - } - if k&x509.KeyUsageCRLSign != 0 { - commaAppend(&buf, "CRL Signing") - } - if k&x509.KeyUsageEncipherOnly != 0 { - commaAppend(&buf, "Encipher Only") - } - if k&x509.KeyUsageDecipherOnly != 0 { - commaAppend(&buf, "Decipher Only") - } - return buf.String() -} - -func extKeyUsageToString(u x509.ExtKeyUsage) string { - switch u { - case x509.ExtKeyUsageAny: - return "Any" - case x509.ExtKeyUsageServerAuth: - return "TLS Web server authentication" - case x509.ExtKeyUsageClientAuth: - return "TLS Web client authentication" - case x509.ExtKeyUsageCodeSigning: - return "Signing of executable code" - case x509.ExtKeyUsageEmailProtection: - return "Email protection" - case x509.ExtKeyUsageIPSECEndSystem: - return "IPSEC end system" - case x509.ExtKeyUsageIPSECTunnel: - return "IPSEC tunnel" - case x509.ExtKeyUsageIPSECUser: - return "IPSEC user" - case x509.ExtKeyUsageTimeStamping: - return "Time stamping" - case x509.ExtKeyUsageOCSPSigning: - return "OCSP signing" - case x509.ExtKeyUsageMicrosoftServerGatedCrypto: - return "Microsoft server gated cryptography" - case x509.ExtKeyUsageNetscapeServerGatedCrypto: - return "Netscape server gated cryptography" - case x509.ExtKeyUsageCertificateTransparency: - return "Certificate transparency" - default: - return "Unknown" - } -} - -func attributeOIDToString(oid asn1.ObjectIdentifier) string { - switch { - case oid.Equal(pkix.OIDCountry): - return "Country" - case oid.Equal(pkix.OIDOrganization): - return "Organization" - case oid.Equal(pkix.OIDOrganizationalUnit): - return "OrganizationalUnit" - case oid.Equal(pkix.OIDCommonName): - return "CommonName" - case oid.Equal(pkix.OIDSerialNumber): - return "SerialNumber" - case oid.Equal(pkix.OIDLocality): - return "Locality" - case oid.Equal(pkix.OIDProvince): - return "Province" - case oid.Equal(pkix.OIDStreetAddress): - return "StreetAddress" - case oid.Equal(pkix.OIDPostalCode): - return "PostalCode" - case oid.Equal(pkix.OIDPseudonym): - return "Pseudonym" - case oid.Equal(pkix.OIDTitle): - return "Title" - case oid.Equal(pkix.OIDDnQualifier): - return "DnQualifier" - case oid.Equal(pkix.OIDName): - return "Name" - case oid.Equal(pkix.OIDSurname): - return "Surname" - case oid.Equal(pkix.OIDGivenName): - return "GivenName" - case oid.Equal(pkix.OIDInitials): - return "Initials" - case oid.Equal(pkix.OIDGenerationQualifier): - return "GenerationQualifier" - default: - return oid.String() - } -} - -// NameToString creates a string description of a pkix.Name object. -func NameToString(name pkix.Name) string { - var result bytes.Buffer - addSingle := func(prefix, item string) { - if len(item) == 0 { - return - } - commaAppend(&result, prefix) - result.WriteString(item) - } - addList := func(prefix string, items []string) { - for _, item := range items { - addSingle(prefix, item) - } - } - addList("C=", name.Country) - addList("O=", name.Organization) - addList("OU=", name.OrganizationalUnit) - addList("L=", name.Locality) - addList("ST=", name.Province) - addList("streetAddress=", name.StreetAddress) - addList("postalCode=", name.PostalCode) - addSingle("serialNumber=", name.SerialNumber) - addSingle("CN=", name.CommonName) - for _, atv := range name.Names { - value, ok := atv.Value.(string) - if !ok { - continue - } - t := atv.Type - // All of the defined attribute OIDs are of the form 2.5.4.N, and OIDAttribute is - // the 2.5.4 prefix ('id-at' in RFC 5280). - if len(t) == 4 && t[0] == pkix.OIDAttribute[0] && t[1] == pkix.OIDAttribute[1] && t[2] == pkix.OIDAttribute[2] { - // OID is 'id-at N', so check the final value to figure out which attribute. - switch t[3] { - case pkix.OIDCommonName[3], pkix.OIDSerialNumber[3], pkix.OIDCountry[3], pkix.OIDLocality[3], pkix.OIDProvince[3], - pkix.OIDStreetAddress[3], pkix.OIDOrganization[3], pkix.OIDOrganizationalUnit[3], pkix.OIDPostalCode[3]: - continue // covered by explicit fields - case pkix.OIDPseudonym[3]: - addSingle("pseudonym=", value) - continue - case pkix.OIDTitle[3]: - addSingle("title=", value) - continue - case pkix.OIDDnQualifier[3]: - addSingle("dnQualifier=", value) - continue - case pkix.OIDName[3]: - addSingle("name=", value) - continue - case pkix.OIDSurname[3]: - addSingle("surname=", value) - continue - case pkix.OIDGivenName[3]: - addSingle("givenName=", value) - continue - case pkix.OIDInitials[3]: - addSingle("initials=", value) - continue - case pkix.OIDGenerationQualifier[3]: - addSingle("generationQualifier=", value) - continue - } - } - addSingle(t.String()+"=", value) - } - return result.String() -} - -// OtherNameToString creates a string description of an x509.OtherName object. -func OtherNameToString(other x509.OtherName) string { - return fmt.Sprintf("%v=%v", other.TypeID, hex.EncodeToString(other.Value.Bytes)) -} - -// GeneralNamesToString creates a string description of an x509.GeneralNames object. -func GeneralNamesToString(gname *x509.GeneralNames) string { - var buf bytes.Buffer - for _, name := range gname.DNSNames { - commaAppend(&buf, "DNS:"+name) - } - for _, email := range gname.EmailAddresses { - commaAppend(&buf, "email:"+email) - } - for _, name := range gname.DirectoryNames { - commaAppend(&buf, "DirName:"+NameToString(name)) - } - for _, uri := range gname.URIs { - commaAppend(&buf, "URI:"+uri) - } - for _, ip := range gname.IPNets { - if ip.Mask == nil { - commaAppend(&buf, "IP Address:"+ip.IP.String()) - } else { - commaAppend(&buf, "IP Address:"+ip.IP.String()+"/"+ip.Mask.String()) - } - } - for _, id := range gname.RegisteredIDs { - commaAppend(&buf, "Registered ID:"+id.String()) - } - for _, other := range gname.OtherNames { - commaAppend(&buf, "othername:"+OtherNameToString(other)) - } - return buf.String() -} - -// CertificateToString generates a string describing the given certificate. -// The output roughly resembles that from openssl x509 -text. -func CertificateToString(cert *x509.Certificate) string { - var result bytes.Buffer - result.WriteString(fmt.Sprintf("Certificate:\n")) - result.WriteString(fmt.Sprintf(" Data:\n")) - result.WriteString(fmt.Sprintf(" Version: %d (%#x)\n", cert.Version, cert.Version-1)) - result.WriteString(fmt.Sprintf(" Serial Number: %d (%#[1]x)\n", cert.SerialNumber)) - result.WriteString(fmt.Sprintf(" Signature Algorithm: %v\n", cert.SignatureAlgorithm)) - result.WriteString(fmt.Sprintf(" Issuer: %v\n", NameToString(cert.Issuer))) - result.WriteString(fmt.Sprintf(" Validity:\n")) - result.WriteString(fmt.Sprintf(" Not Before: %v\n", cert.NotBefore)) - result.WriteString(fmt.Sprintf(" Not After : %v\n", cert.NotAfter)) - result.WriteString(fmt.Sprintf(" Subject: %v\n", NameToString(cert.Subject))) - result.WriteString(fmt.Sprintf(" Subject Public Key Info:\n")) - result.WriteString(fmt.Sprintf(" Public Key Algorithm: %v\n", publicKeyAlgorithmToString(cert.PublicKeyAlgorithm))) - result.WriteString(fmt.Sprintf("%v\n", publicKeyToString(cert.PublicKeyAlgorithm, cert.PublicKey))) - - if len(cert.Extensions) > 0 { - result.WriteString(fmt.Sprintf(" X509v3 extensions:\n")) - } - // First display the extensions that are already cracked out - showAuthKeyID(&result, cert) - showSubjectKeyID(&result, cert) - showKeyUsage(&result, cert) - showExtendedKeyUsage(&result, cert) - showBasicConstraints(&result, cert) - showSubjectAltName(&result, cert) - showNameConstraints(&result, cert) - showCertPolicies(&result, cert) - showCRLDPs(&result, cert) - showAuthInfoAccess(&result, cert) - showCTPoison(&result, cert) - showCTSCT(&result, cert) - showCTLogSTHInfo(&result, cert) - - showUnhandledExtensions(&result, cert) - showSignature(&result, cert) - - return result.String() -} - -func showCritical(result *bytes.Buffer, critical bool) { - if critical { - result.WriteString(" critical") - } - result.WriteString("\n") -} - -func showAuthKeyID(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionAuthorityKeyId, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Authority Key Identifier:")) - showCritical(result, critical) - result.WriteString(fmt.Sprintf(" keyid:%v\n", hex.EncodeToString(cert.AuthorityKeyId))) - } -} - -func showSubjectKeyID(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionSubjectKeyId, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Subject Key Identifier:")) - showCritical(result, critical) - result.WriteString(fmt.Sprintf(" keyid:%v\n", hex.EncodeToString(cert.SubjectKeyId))) - } -} - -func showKeyUsage(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionKeyUsage, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Key Usage:")) - showCritical(result, critical) - result.WriteString(fmt.Sprintf(" %v\n", keyUsageToString(cert.KeyUsage))) - } -} - -func showExtendedKeyUsage(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionExtendedKeyUsage, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Extended Key Usage:")) - showCritical(result, critical) - var usages bytes.Buffer - for _, usage := range cert.ExtKeyUsage { - commaAppend(&usages, extKeyUsageToString(usage)) - } - for _, oid := range cert.UnknownExtKeyUsage { - commaAppend(&usages, oid.String()) - } - result.WriteString(fmt.Sprintf(" %v\n", usages.String())) - } -} - -func showBasicConstraints(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionBasicConstraints, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Basic Constraints:")) - showCritical(result, critical) - result.WriteString(fmt.Sprintf(" CA:%t", cert.IsCA)) - if cert.MaxPathLen > 0 || cert.MaxPathLenZero { - result.WriteString(fmt.Sprintf(", pathlen:%d", cert.MaxPathLen)) - } - result.WriteString(fmt.Sprintf("\n")) - } -} - -func showSubjectAltName(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionSubjectAltName, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Subject Alternative Name:")) - showCritical(result, critical) - var buf bytes.Buffer - for _, name := range cert.DNSNames { - commaAppend(&buf, "DNS:"+name) - } - for _, email := range cert.EmailAddresses { - commaAppend(&buf, "email:"+email) - } - for _, ip := range cert.IPAddresses { - commaAppend(&buf, "IP Address:"+ip.String()) - } - - result.WriteString(fmt.Sprintf(" %v\n", buf.String())) - // TODO(drysdale): include other name forms - } -} - -func showNameConstraints(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionNameConstraints, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Name Constraints:")) - showCritical(result, critical) - if len(cert.PermittedDNSDomains) > 0 { - result.WriteString(fmt.Sprintf(" Permitted:\n")) - var buf bytes.Buffer - for _, name := range cert.PermittedDNSDomains { - commaAppend(&buf, "DNS:"+name) - } - result.WriteString(fmt.Sprintf(" %v\n", buf.String())) - } - // TODO(drysdale): include other name forms - } - -} - -func showCertPolicies(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionCertificatePolicies, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 Certificate Policies:")) - showCritical(result, critical) - for _, oid := range cert.PolicyIdentifiers { - result.WriteString(fmt.Sprintf(" Policy: %v\n", oid.String())) - // TODO(drysdale): Display any qualifiers associated with the policy - } - } - -} - -func showCRLDPs(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionCRLDistributionPoints, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" X509v3 CRL Distribution Points:")) - showCritical(result, critical) - result.WriteString(fmt.Sprintf(" Full Name:\n")) - var buf bytes.Buffer - for _, pt := range cert.CRLDistributionPoints { - commaAppend(&buf, "URI:"+pt) - } - result.WriteString(fmt.Sprintf(" %v\n", buf.String())) - // TODO(drysdale): Display other GeneralNames types, plus issuer/reasons/relative-name - } - -} - -func showAuthInfoAccess(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionAuthorityInfoAccess, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" Authority Information Access:")) - showCritical(result, critical) - var issuerBuf bytes.Buffer - for _, issuer := range cert.IssuingCertificateURL { - commaAppend(&issuerBuf, "URI:"+issuer) - } - if issuerBuf.Len() > 0 { - result.WriteString(fmt.Sprintf(" CA Issuers - %v\n", issuerBuf.String())) - } - var ocspBuf bytes.Buffer - for _, ocsp := range cert.OCSPServer { - commaAppend(&ocspBuf, "URI:"+ocsp) - } - if ocspBuf.Len() > 0 { - result.WriteString(fmt.Sprintf(" OCSP - %v\n", ocspBuf.String())) - } - // TODO(drysdale): Display other GeneralNames types - } -} - -func showCTPoison(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionCTPoison, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" RFC6962 Pre-Certificate Poison:")) - showCritical(result, critical) - result.WriteString(" .....\n") - } -} - -func showCTSCT(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509.OIDExtensionCTSCT, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" RFC6962 Certificate Transparency SCT:")) - showCritical(result, critical) - for i, sctData := range cert.SCTList.SCTList { - result.WriteString(fmt.Sprintf(" SCT [%d]:\n", i)) - var sct ct.SignedCertificateTimestamp - _, err := tls.Unmarshal(sctData.Val, &sct) - if err != nil { - appendHexData(result, sctData.Val, 16, " ") - result.WriteString("\n") - continue - } - result.WriteString(fmt.Sprintf(" Version: %d\n", sct.SCTVersion)) - result.WriteString(fmt.Sprintf(" LogID: %s\n", base64.StdEncoding.EncodeToString(sct.LogID.KeyID[:]))) - result.WriteString(fmt.Sprintf(" Timestamp: %d\n", sct.Timestamp)) - result.WriteString(fmt.Sprintf(" Signature: %s\n", sct.Signature.Algorithm)) - result.WriteString(fmt.Sprintf(" Signature:\n")) - appendHexData(result, sct.Signature.Signature, 16, " ") - result.WriteString("\n") - } - } -} - -func showCTLogSTHInfo(result *bytes.Buffer, cert *x509.Certificate) { - count, critical := OIDInExtensions(x509ext.OIDExtensionCTSTH, cert.Extensions) - if count > 0 { - result.WriteString(fmt.Sprintf(" Certificate Transparency STH:")) - showCritical(result, critical) - sthInfo, err := x509ext.LogSTHInfoFromCert(cert) - if err != nil { - result.WriteString(fmt.Sprintf(" Failed to decode STH:\n")) - return - } - result.WriteString(fmt.Sprintf(" LogURL: %s\n", string(sthInfo.LogURL))) - result.WriteString(fmt.Sprintf(" Version: %d\n", sthInfo.Version)) - result.WriteString(fmt.Sprintf(" TreeSize: %d\n", sthInfo.TreeSize)) - result.WriteString(fmt.Sprintf(" Timestamp: %d\n", sthInfo.Timestamp)) - result.WriteString(fmt.Sprintf(" RootHash:\n")) - appendHexData(result, sthInfo.SHA256RootHash[:], 16, " ") - result.WriteString("\n") - result.WriteString(fmt.Sprintf(" TreeHeadSignature: %s\n", sthInfo.TreeHeadSignature.Algorithm)) - result.WriteString(fmt.Sprintf(" TreeHeadSignature:\n")) - appendHexData(result, sthInfo.TreeHeadSignature.Signature, 16, " ") - result.WriteString("\n") - } -} - -func showUnhandledExtensions(result *bytes.Buffer, cert *x509.Certificate) { - for _, ext := range cert.Extensions { - // Skip extensions that are already cracked out - if oidAlreadyPrinted(ext.Id) { - continue - } - result.WriteString(fmt.Sprintf(" %v:", ext.Id)) - showCritical(result, ext.Critical) - appendHexData(result, ext.Value, 16, " ") - result.WriteString("\n") - } -} - -func showSignature(result *bytes.Buffer, cert *x509.Certificate) { - result.WriteString(fmt.Sprintf(" Signature Algorithm: %v\n", cert.SignatureAlgorithm)) - appendHexData(result, cert.Signature, 18, " ") - result.WriteString("\n") -} - -// TODO(drysdale): remove this once all standard OIDs are parsed and printed. -func oidAlreadyPrinted(oid asn1.ObjectIdentifier) bool { - if oid.Equal(x509.OIDExtensionSubjectKeyId) || - oid.Equal(x509.OIDExtensionKeyUsage) || - oid.Equal(x509.OIDExtensionExtendedKeyUsage) || - oid.Equal(x509.OIDExtensionAuthorityKeyId) || - oid.Equal(x509.OIDExtensionBasicConstraints) || - oid.Equal(x509.OIDExtensionSubjectAltName) || - oid.Equal(x509.OIDExtensionCertificatePolicies) || - oid.Equal(x509.OIDExtensionNameConstraints) || - oid.Equal(x509.OIDExtensionCRLDistributionPoints) || - oid.Equal(x509.OIDExtensionAuthorityInfoAccess) || - oid.Equal(x509.OIDExtensionCTPoison) || - oid.Equal(x509.OIDExtensionCTSCT) || - oid.Equal(x509ext.OIDExtensionCTSTH) { - return true - } - return false -} - -// CertificateFromPEM takes a certificate in PEM format and returns the -// corresponding x509.Certificate object. -func CertificateFromPEM(pemBytes []byte) (*x509.Certificate, error) { - block, rest := pem.Decode(pemBytes) - if len(rest) != 0 { - return nil, errors.New("trailing data found after PEM block") - } - if block == nil { - return nil, errors.New("PEM block is nil") - } - if block.Type != "CERTIFICATE" { - return nil, errors.New("PEM block is not a CERTIFICATE") - } - return x509.ParseCertificate(block.Bytes) -} - -// CertificatesFromPEM parses one or more certificates from the given PEM data. -// The PEM certificates must be concatenated. This function can be used for -// parsing PEM-formatted certificate chains, but does not verify that the -// resulting chain is a valid certificate chain. -func CertificatesFromPEM(pemBytes []byte) ([]*x509.Certificate, error) { - var chain []*x509.Certificate - for { - var block *pem.Block - block, pemBytes = pem.Decode(pemBytes) - if block == nil { - return chain, nil - } - if block.Type != "CERTIFICATE" { - return nil, fmt.Errorf("PEM block is not a CERTIFICATE") - } - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return nil, errors.New("failed to parse certificate") - } - chain = append(chain, cert) - } -} - -// ParseSCTsFromSCTList parses each of the SCTs contained within an SCT list. -func ParseSCTsFromSCTList(sctList *x509.SignedCertificateTimestampList) ([]*ct.SignedCertificateTimestamp, error) { - var scts []*ct.SignedCertificateTimestamp - for i, data := range sctList.SCTList { - sct, err := ExtractSCT(&data) - if err != nil { - return nil, fmt.Errorf("error extracting SCT number %d: %s", i, err) - } - scts = append(scts, sct) - } - return scts, nil -} - -// ExtractSCT deserializes an SCT from a TLS-encoded SCT. -func ExtractSCT(sctData *x509.SerializedSCT) (*ct.SignedCertificateTimestamp, error) { - if sctData == nil { - return nil, errors.New("SCT is nil") - } - var sct ct.SignedCertificateTimestamp - if rest, err := tls.Unmarshal(sctData.Val, &sct); err != nil { - return nil, fmt.Errorf("error parsing SCT: %s", err) - } else if len(rest) > 0 { - return nil, fmt.Errorf("extra data (%d bytes) after serialized SCT", len(rest)) - } - return &sct, nil -} - -var pemCertificatePrefix = []byte("-----BEGIN CERTIFICATE") - -// ParseSCTsFromCertificate parses any SCTs that are embedded in the -// certificate provided. The certificate bytes provided can be either DER or -// PEM, provided the PEM data starts with the PEM block marker (i.e. has no -// leading text). -func ParseSCTsFromCertificate(certBytes []byte) ([]*ct.SignedCertificateTimestamp, error) { - var cert *x509.Certificate - var err error - if bytes.HasPrefix(certBytes, pemCertificatePrefix) { - cert, err = CertificateFromPEM(certBytes) - } else { - cert, err = x509.ParseCertificate(certBytes) - } - if err != nil { - return nil, fmt.Errorf("failed to parse certificate: %s", err) - } - return ParseSCTsFromSCTList(&cert.SCTList) -} diff --git a/vendor/github.com/kr/pretty/.gitignore b/vendor/github.com/kr/pretty/.gitignore deleted file mode 100644 index 1f0a99f..0000000 --- a/vendor/github.com/kr/pretty/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -[568].out -_go* -_test* -_obj diff --git a/vendor/github.com/kr/pretty/License b/vendor/github.com/kr/pretty/License deleted file mode 100644 index 05c783c..0000000 --- a/vendor/github.com/kr/pretty/License +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright 2012 Keith Rarick - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/kr/pretty/Readme b/vendor/github.com/kr/pretty/Readme deleted file mode 100644 index c589fc6..0000000 --- a/vendor/github.com/kr/pretty/Readme +++ /dev/null @@ -1,9 +0,0 @@ -package pretty - - import "github.com/kr/pretty" - - Package pretty provides pretty-printing for Go values. - -Documentation - - http://godoc.org/github.com/kr/pretty diff --git a/vendor/github.com/kr/pretty/diff.go b/vendor/github.com/kr/pretty/diff.go deleted file mode 100644 index 6aa7f74..0000000 --- a/vendor/github.com/kr/pretty/diff.go +++ /dev/null @@ -1,265 +0,0 @@ -package pretty - -import ( - "fmt" - "io" - "reflect" -) - -type sbuf []string - -func (p *sbuf) Printf(format string, a ...interface{}) { - s := fmt.Sprintf(format, a...) - *p = append(*p, s) -} - -// Diff returns a slice where each element describes -// a difference between a and b. -func Diff(a, b interface{}) (desc []string) { - Pdiff((*sbuf)(&desc), a, b) - return desc -} - -// wprintfer calls Fprintf on w for each Printf call -// with a trailing newline. -type wprintfer struct{ w io.Writer } - -func (p *wprintfer) Printf(format string, a ...interface{}) { - fmt.Fprintf(p.w, format+"\n", a...) -} - -// Fdiff writes to w a description of the differences between a and b. -func Fdiff(w io.Writer, a, b interface{}) { - Pdiff(&wprintfer{w}, a, b) -} - -type Printfer interface { - Printf(format string, a ...interface{}) -} - -// Pdiff prints to p a description of the differences between a and b. -// It calls Printf once for each difference, with no trailing newline. -// The standard library log.Logger is a Printfer. -func Pdiff(p Printfer, a, b interface{}) { - diffPrinter{w: p}.diff(reflect.ValueOf(a), reflect.ValueOf(b)) -} - -type Logfer interface { - Logf(format string, a ...interface{}) -} - -// logprintfer calls Fprintf on w for each Printf call -// with a trailing newline. -type logprintfer struct{ l Logfer } - -func (p *logprintfer) Printf(format string, a ...interface{}) { - p.l.Logf(format, a...) -} - -// Ldiff prints to l a description of the differences between a and b. -// It calls Logf once for each difference, with no trailing newline. -// The standard library testing.T and testing.B are Logfers. -func Ldiff(l Logfer, a, b interface{}) { - Pdiff(&logprintfer{l}, a, b) -} - -type diffPrinter struct { - w Printfer - l string // label -} - -func (w diffPrinter) printf(f string, a ...interface{}) { - var l string - if w.l != "" { - l = w.l + ": " - } - w.w.Printf(l+f, a...) -} - -func (w diffPrinter) diff(av, bv reflect.Value) { - if !av.IsValid() && bv.IsValid() { - w.printf("nil != %# v", formatter{v: bv, quote: true}) - return - } - if av.IsValid() && !bv.IsValid() { - w.printf("%# v != nil", formatter{v: av, quote: true}) - return - } - if !av.IsValid() && !bv.IsValid() { - return - } - - at := av.Type() - bt := bv.Type() - if at != bt { - w.printf("%v != %v", at, bt) - return - } - - switch kind := at.Kind(); kind { - case reflect.Bool: - if a, b := av.Bool(), bv.Bool(); a != b { - w.printf("%v != %v", a, b) - } - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if a, b := av.Int(), bv.Int(); a != b { - w.printf("%d != %d", a, b) - } - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - if a, b := av.Uint(), bv.Uint(); a != b { - w.printf("%d != %d", a, b) - } - case reflect.Float32, reflect.Float64: - if a, b := av.Float(), bv.Float(); a != b { - w.printf("%v != %v", a, b) - } - case reflect.Complex64, reflect.Complex128: - if a, b := av.Complex(), bv.Complex(); a != b { - w.printf("%v != %v", a, b) - } - case reflect.Array: - n := av.Len() - for i := 0; i < n; i++ { - w.relabel(fmt.Sprintf("[%d]", i)).diff(av.Index(i), bv.Index(i)) - } - case reflect.Chan, reflect.Func, reflect.UnsafePointer: - if a, b := av.Pointer(), bv.Pointer(); a != b { - w.printf("%#x != %#x", a, b) - } - case reflect.Interface: - w.diff(av.Elem(), bv.Elem()) - case reflect.Map: - ak, both, bk := keyDiff(av.MapKeys(), bv.MapKeys()) - for _, k := range ak { - w := w.relabel(fmt.Sprintf("[%#v]", k)) - w.printf("%q != (missing)", av.MapIndex(k)) - } - for _, k := range both { - w := w.relabel(fmt.Sprintf("[%#v]", k)) - w.diff(av.MapIndex(k), bv.MapIndex(k)) - } - for _, k := range bk { - w := w.relabel(fmt.Sprintf("[%#v]", k)) - w.printf("(missing) != %q", bv.MapIndex(k)) - } - case reflect.Ptr: - switch { - case av.IsNil() && !bv.IsNil(): - w.printf("nil != %# v", formatter{v: bv, quote: true}) - case !av.IsNil() && bv.IsNil(): - w.printf("%# v != nil", formatter{v: av, quote: true}) - case !av.IsNil() && !bv.IsNil(): - w.diff(av.Elem(), bv.Elem()) - } - case reflect.Slice: - lenA := av.Len() - lenB := bv.Len() - if lenA != lenB { - w.printf("%s[%d] != %s[%d]", av.Type(), lenA, bv.Type(), lenB) - break - } - for i := 0; i < lenA; i++ { - w.relabel(fmt.Sprintf("[%d]", i)).diff(av.Index(i), bv.Index(i)) - } - case reflect.String: - if a, b := av.String(), bv.String(); a != b { - w.printf("%q != %q", a, b) - } - case reflect.Struct: - for i := 0; i < av.NumField(); i++ { - w.relabel(at.Field(i).Name).diff(av.Field(i), bv.Field(i)) - } - default: - panic("unknown reflect Kind: " + kind.String()) - } -} - -func (d diffPrinter) relabel(name string) (d1 diffPrinter) { - d1 = d - if d.l != "" && name[0] != '[' { - d1.l += "." - } - d1.l += name - return d1 -} - -// keyEqual compares a and b for equality. -// Both a and b must be valid map keys. -func keyEqual(av, bv reflect.Value) bool { - if !av.IsValid() && !bv.IsValid() { - return true - } - if !av.IsValid() || !bv.IsValid() || av.Type() != bv.Type() { - return false - } - switch kind := av.Kind(); kind { - case reflect.Bool: - a, b := av.Bool(), bv.Bool() - return a == b - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - a, b := av.Int(), bv.Int() - return a == b - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - a, b := av.Uint(), bv.Uint() - return a == b - case reflect.Float32, reflect.Float64: - a, b := av.Float(), bv.Float() - return a == b - case reflect.Complex64, reflect.Complex128: - a, b := av.Complex(), bv.Complex() - return a == b - case reflect.Array: - for i := 0; i < av.Len(); i++ { - if !keyEqual(av.Index(i), bv.Index(i)) { - return false - } - } - return true - case reflect.Chan, reflect.UnsafePointer, reflect.Ptr: - a, b := av.Pointer(), bv.Pointer() - return a == b - case reflect.Interface: - return keyEqual(av.Elem(), bv.Elem()) - case reflect.String: - a, b := av.String(), bv.String() - return a == b - case reflect.Struct: - for i := 0; i < av.NumField(); i++ { - if !keyEqual(av.Field(i), bv.Field(i)) { - return false - } - } - return true - default: - panic("invalid map key type " + av.Type().String()) - } -} - -func keyDiff(a, b []reflect.Value) (ak, both, bk []reflect.Value) { - for _, av := range a { - inBoth := false - for _, bv := range b { - if keyEqual(av, bv) { - inBoth = true - both = append(both, av) - break - } - } - if !inBoth { - ak = append(ak, av) - } - } - for _, bv := range b { - inBoth := false - for _, av := range a { - if keyEqual(av, bv) { - inBoth = true - break - } - } - if !inBoth { - bk = append(bk, bv) - } - } - return -} diff --git a/vendor/github.com/kr/pretty/diff_test.go b/vendor/github.com/kr/pretty/diff_test.go deleted file mode 100644 index a951e4b..0000000 --- a/vendor/github.com/kr/pretty/diff_test.go +++ /dev/null @@ -1,213 +0,0 @@ -package pretty - -import ( - "bytes" - "fmt" - "log" - "reflect" - "testing" - "unsafe" -) - -var ( - _ Logfer = (*testing.T)(nil) - _ Logfer = (*testing.B)(nil) - _ Printfer = (*log.Logger)(nil) -) - -type difftest struct { - a interface{} - b interface{} - exp []string -} - -type S struct { - A int - S *S - I interface{} - C []int -} - -type ( - N struct{ N int } - E interface{} -) - -var ( - c0 = make(chan int) - c1 = make(chan int) - f0 = func() {} - f1 = func() {} - i0 = 0 - i1 = 1 -) - -var diffs = []difftest{ - {a: nil, b: nil}, - {a: S{A: 1}, b: S{A: 1}}, - - {0, "", []string{`int != string`}}, - {0, 1, []string{`0 != 1`}}, - {S{}, new(S), []string{`pretty.S != *pretty.S`}}, - {"a", "b", []string{`"a" != "b"`}}, - {S{}, S{A: 1}, []string{`A: 0 != 1`}}, - {new(S), &S{A: 1}, []string{`A: 0 != 1`}}, - {S{S: new(S)}, S{S: &S{A: 1}}, []string{`S.A: 0 != 1`}}, - {S{}, S{I: 0}, []string{`I: nil != int(0)`}}, - {S{I: 1}, S{I: "x"}, []string{`I: int != string`}}, - {S{}, S{C: []int{1}}, []string{`C: []int[0] != []int[1]`}}, - {S{C: []int{}}, S{C: []int{1}}, []string{`C: []int[0] != []int[1]`}}, - {S{C: []int{1, 2, 3}}, S{C: []int{1, 2, 4}}, []string{`C[2]: 3 != 4`}}, - {S{}, S{A: 1, S: new(S)}, []string{`A: 0 != 1`, `S: nil != &pretty.S{}`}}, - - // unexported fields of every reflect.Kind (both equal and unequal) - {struct{ x bool }{false}, struct{ x bool }{false}, nil}, - {struct{ x bool }{false}, struct{ x bool }{true}, []string{`x: false != true`}}, - {struct{ x int }{0}, struct{ x int }{0}, nil}, - {struct{ x int }{0}, struct{ x int }{1}, []string{`x: 0 != 1`}}, - {struct{ x int8 }{0}, struct{ x int8 }{0}, nil}, - {struct{ x int8 }{0}, struct{ x int8 }{1}, []string{`x: 0 != 1`}}, - {struct{ x int16 }{0}, struct{ x int16 }{0}, nil}, - {struct{ x int16 }{0}, struct{ x int16 }{1}, []string{`x: 0 != 1`}}, - {struct{ x int32 }{0}, struct{ x int32 }{0}, nil}, - {struct{ x int32 }{0}, struct{ x int32 }{1}, []string{`x: 0 != 1`}}, - {struct{ x int64 }{0}, struct{ x int64 }{0}, nil}, - {struct{ x int64 }{0}, struct{ x int64 }{1}, []string{`x: 0 != 1`}}, - {struct{ x uint }{0}, struct{ x uint }{0}, nil}, - {struct{ x uint }{0}, struct{ x uint }{1}, []string{`x: 0 != 1`}}, - {struct{ x uint8 }{0}, struct{ x uint8 }{0}, nil}, - {struct{ x uint8 }{0}, struct{ x uint8 }{1}, []string{`x: 0 != 1`}}, - {struct{ x uint16 }{0}, struct{ x uint16 }{0}, nil}, - {struct{ x uint16 }{0}, struct{ x uint16 }{1}, []string{`x: 0 != 1`}}, - {struct{ x uint32 }{0}, struct{ x uint32 }{0}, nil}, - {struct{ x uint32 }{0}, struct{ x uint32 }{1}, []string{`x: 0 != 1`}}, - {struct{ x uint64 }{0}, struct{ x uint64 }{0}, nil}, - {struct{ x uint64 }{0}, struct{ x uint64 }{1}, []string{`x: 0 != 1`}}, - {struct{ x uintptr }{0}, struct{ x uintptr }{0}, nil}, - {struct{ x uintptr }{0}, struct{ x uintptr }{1}, []string{`x: 0 != 1`}}, - {struct{ x float32 }{0}, struct{ x float32 }{0}, nil}, - {struct{ x float32 }{0}, struct{ x float32 }{1}, []string{`x: 0 != 1`}}, - {struct{ x float64 }{0}, struct{ x float64 }{0}, nil}, - {struct{ x float64 }{0}, struct{ x float64 }{1}, []string{`x: 0 != 1`}}, - {struct{ x complex64 }{0}, struct{ x complex64 }{0}, nil}, - {struct{ x complex64 }{0}, struct{ x complex64 }{1}, []string{`x: (0+0i) != (1+0i)`}}, - {struct{ x complex128 }{0}, struct{ x complex128 }{0}, nil}, - {struct{ x complex128 }{0}, struct{ x complex128 }{1}, []string{`x: (0+0i) != (1+0i)`}}, - {struct{ x [1]int }{[1]int{0}}, struct{ x [1]int }{[1]int{0}}, nil}, - {struct{ x [1]int }{[1]int{0}}, struct{ x [1]int }{[1]int{1}}, []string{`x[0]: 0 != 1`}}, - {struct{ x chan int }{c0}, struct{ x chan int }{c0}, nil}, - {struct{ x chan int }{c0}, struct{ x chan int }{c1}, []string{fmt.Sprintf("x: %p != %p", c0, c1)}}, - {struct{ x func() }{f0}, struct{ x func() }{f0}, nil}, - {struct{ x func() }{f0}, struct{ x func() }{f1}, []string{fmt.Sprintf("x: %p != %p", f0, f1)}}, - {struct{ x interface{} }{0}, struct{ x interface{} }{0}, nil}, - {struct{ x interface{} }{0}, struct{ x interface{} }{1}, []string{`x: 0 != 1`}}, - {struct{ x interface{} }{0}, struct{ x interface{} }{""}, []string{`x: int != string`}}, - {struct{ x interface{} }{0}, struct{ x interface{} }{nil}, []string{`x: int(0) != nil`}}, - {struct{ x interface{} }{nil}, struct{ x interface{} }{0}, []string{`x: nil != int(0)`}}, - {struct{ x map[int]int }{map[int]int{0: 0}}, struct{ x map[int]int }{map[int]int{0: 0}}, nil}, - {struct{ x map[int]int }{map[int]int{0: 0}}, struct{ x map[int]int }{map[int]int{0: 1}}, []string{`x[0]: 0 != 1`}}, - {struct{ x *int }{new(int)}, struct{ x *int }{new(int)}, nil}, - {struct{ x *int }{&i0}, struct{ x *int }{&i1}, []string{`x: 0 != 1`}}, - {struct{ x *int }{nil}, struct{ x *int }{&i0}, []string{`x: nil != &int(0)`}}, - {struct{ x *int }{&i0}, struct{ x *int }{nil}, []string{`x: &int(0) != nil`}}, - {struct{ x []int }{[]int{0}}, struct{ x []int }{[]int{0}}, nil}, - {struct{ x []int }{[]int{0}}, struct{ x []int }{[]int{1}}, []string{`x[0]: 0 != 1`}}, - {struct{ x string }{"a"}, struct{ x string }{"a"}, nil}, - {struct{ x string }{"a"}, struct{ x string }{"b"}, []string{`x: "a" != "b"`}}, - {struct{ x N }{N{0}}, struct{ x N }{N{0}}, nil}, - {struct{ x N }{N{0}}, struct{ x N }{N{1}}, []string{`x.N: 0 != 1`}}, - { - struct{ x unsafe.Pointer }{unsafe.Pointer(uintptr(0))}, - struct{ x unsafe.Pointer }{unsafe.Pointer(uintptr(0))}, - nil, - }, - { - struct{ x unsafe.Pointer }{unsafe.Pointer(uintptr(0))}, - struct{ x unsafe.Pointer }{unsafe.Pointer(uintptr(1))}, - []string{`x: 0x0 != 0x1`}, - }, -} - -func TestDiff(t *testing.T) { - for _, tt := range diffs { - got := Diff(tt.a, tt.b) - eq := len(got) == len(tt.exp) - if eq { - for i := range got { - eq = eq && got[i] == tt.exp[i] - } - } - if !eq { - t.Errorf("diffing % #v", tt.a) - t.Errorf("with % #v", tt.b) - diffdiff(t, got, tt.exp) - continue - } - } -} - -func TestKeyEqual(t *testing.T) { - var emptyInterfaceZero interface{} = 0 - - cases := []interface{}{ - new(bool), - new(int), - new(int8), - new(int16), - new(int32), - new(int64), - new(uint), - new(uint8), - new(uint16), - new(uint32), - new(uint64), - new(uintptr), - new(float32), - new(float64), - new(complex64), - new(complex128), - new([1]int), - new(chan int), - new(unsafe.Pointer), - new(interface{}), - &emptyInterfaceZero, - new(*int), - new(string), - new(struct{ int }), - } - - for _, test := range cases { - rv := reflect.ValueOf(test).Elem() - if !keyEqual(rv, rv) { - t.Errorf("keyEqual(%s, %s) = false want true", rv.Type(), rv.Type()) - } - } -} - -func TestFdiff(t *testing.T) { - var buf bytes.Buffer - Fdiff(&buf, 0, 1) - want := "0 != 1\n" - if got := buf.String(); got != want { - t.Errorf("Fdiff(0, 1) = %q want %q", got, want) - } -} - -func diffdiff(t *testing.T, got, exp []string) { - minus(t, "unexpected:", got, exp) - minus(t, "missing:", exp, got) -} - -func minus(t *testing.T, s string, a, b []string) { - var i, j int - for i = 0; i < len(a); i++ { - for j = 0; j < len(b); j++ { - if a[i] == b[j] { - break - } - } - if j == len(b) { - t.Error(s, a[i]) - } - } -} diff --git a/vendor/github.com/kr/pretty/example_test.go b/vendor/github.com/kr/pretty/example_test.go deleted file mode 100644 index ecf40f3..0000000 --- a/vendor/github.com/kr/pretty/example_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package pretty_test - -import ( - "fmt" - "github.com/kr/pretty" -) - -func Example() { - type myType struct { - a, b int - } - var x = []myType{{1, 2}, {3, 4}, {5, 6}} - fmt.Printf("%# v", pretty.Formatter(x)) - // output: - // []pretty_test.myType{ - // {a:1, b:2}, - // {a:3, b:4}, - // {a:5, b:6}, - // } -} diff --git a/vendor/github.com/kr/pretty/formatter.go b/vendor/github.com/kr/pretty/formatter.go deleted file mode 100644 index a317d7b..0000000 --- a/vendor/github.com/kr/pretty/formatter.go +++ /dev/null @@ -1,328 +0,0 @@ -package pretty - -import ( - "fmt" - "io" - "reflect" - "strconv" - "text/tabwriter" - - "github.com/kr/text" -) - -type formatter struct { - v reflect.Value - force bool - quote bool -} - -// Formatter makes a wrapper, f, that will format x as go source with line -// breaks and tabs. Object f responds to the "%v" formatting verb when both the -// "#" and " " (space) flags are set, for example: -// -// fmt.Sprintf("%# v", Formatter(x)) -// -// If one of these two flags is not set, or any other verb is used, f will -// format x according to the usual rules of package fmt. -// In particular, if x satisfies fmt.Formatter, then x.Format will be called. -func Formatter(x interface{}) (f fmt.Formatter) { - return formatter{v: reflect.ValueOf(x), quote: true} -} - -func (fo formatter) String() string { - return fmt.Sprint(fo.v.Interface()) // unwrap it -} - -func (fo formatter) passThrough(f fmt.State, c rune) { - s := "%" - for i := 0; i < 128; i++ { - if f.Flag(i) { - s += string(i) - } - } - if w, ok := f.Width(); ok { - s += fmt.Sprintf("%d", w) - } - if p, ok := f.Precision(); ok { - s += fmt.Sprintf(".%d", p) - } - s += string(c) - fmt.Fprintf(f, s, fo.v.Interface()) -} - -func (fo formatter) Format(f fmt.State, c rune) { - if fo.force || c == 'v' && f.Flag('#') && f.Flag(' ') { - w := tabwriter.NewWriter(f, 4, 4, 1, ' ', 0) - p := &printer{tw: w, Writer: w, visited: make(map[visit]int)} - p.printValue(fo.v, true, fo.quote) - w.Flush() - return - } - fo.passThrough(f, c) -} - -type printer struct { - io.Writer - tw *tabwriter.Writer - visited map[visit]int - depth int -} - -func (p *printer) indent() *printer { - q := *p - q.tw = tabwriter.NewWriter(p.Writer, 4, 4, 1, ' ', 0) - q.Writer = text.NewIndentWriter(q.tw, []byte{'\t'}) - return &q -} - -func (p *printer) printInline(v reflect.Value, x interface{}, showType bool) { - if showType { - io.WriteString(p, v.Type().String()) - fmt.Fprintf(p, "(%#v)", x) - } else { - fmt.Fprintf(p, "%#v", x) - } -} - -// printValue must keep track of already-printed pointer values to avoid -// infinite recursion. -type visit struct { - v uintptr - typ reflect.Type -} - -func (p *printer) printValue(v reflect.Value, showType, quote bool) { - if p.depth > 10 { - io.WriteString(p, "!%v(DEPTH EXCEEDED)") - return - } - - switch v.Kind() { - case reflect.Bool: - p.printInline(v, v.Bool(), showType) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - p.printInline(v, v.Int(), showType) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - p.printInline(v, v.Uint(), showType) - case reflect.Float32, reflect.Float64: - p.printInline(v, v.Float(), showType) - case reflect.Complex64, reflect.Complex128: - fmt.Fprintf(p, "%#v", v.Complex()) - case reflect.String: - p.fmtString(v.String(), quote) - case reflect.Map: - t := v.Type() - if showType { - io.WriteString(p, t.String()) - } - writeByte(p, '{') - if nonzero(v) { - expand := !canInline(v.Type()) - pp := p - if expand { - writeByte(p, '\n') - pp = p.indent() - } - keys := v.MapKeys() - for i := 0; i < v.Len(); i++ { - showTypeInStruct := true - k := keys[i] - mv := v.MapIndex(k) - pp.printValue(k, false, true) - writeByte(pp, ':') - if expand { - writeByte(pp, '\t') - } - showTypeInStruct = t.Elem().Kind() == reflect.Interface - pp.printValue(mv, showTypeInStruct, true) - if expand { - io.WriteString(pp, ",\n") - } else if i < v.Len()-1 { - io.WriteString(pp, ", ") - } - } - if expand { - pp.tw.Flush() - } - } - writeByte(p, '}') - case reflect.Struct: - t := v.Type() - if v.CanAddr() { - addr := v.UnsafeAddr() - vis := visit{addr, t} - if vd, ok := p.visited[vis]; ok && vd < p.depth { - p.fmtString(t.String()+"{(CYCLIC REFERENCE)}", false) - break // don't print v again - } - p.visited[vis] = p.depth - } - - if showType { - io.WriteString(p, t.String()) - } - writeByte(p, '{') - if nonzero(v) { - expand := !canInline(v.Type()) - pp := p - if expand { - writeByte(p, '\n') - pp = p.indent() - } - for i := 0; i < v.NumField(); i++ { - showTypeInStruct := true - if f := t.Field(i); f.Name != "" { - io.WriteString(pp, f.Name) - writeByte(pp, ':') - if expand { - writeByte(pp, '\t') - } - showTypeInStruct = labelType(f.Type) - } - pp.printValue(getField(v, i), showTypeInStruct, true) - if expand { - io.WriteString(pp, ",\n") - } else if i < v.NumField()-1 { - io.WriteString(pp, ", ") - } - } - if expand { - pp.tw.Flush() - } - } - writeByte(p, '}') - case reflect.Interface: - switch e := v.Elem(); { - case e.Kind() == reflect.Invalid: - io.WriteString(p, "nil") - case e.IsValid(): - pp := *p - pp.depth++ - pp.printValue(e, showType, true) - default: - io.WriteString(p, v.Type().String()) - io.WriteString(p, "(nil)") - } - case reflect.Array, reflect.Slice: - t := v.Type() - if showType { - io.WriteString(p, t.String()) - } - if v.Kind() == reflect.Slice && v.IsNil() && showType { - io.WriteString(p, "(nil)") - break - } - if v.Kind() == reflect.Slice && v.IsNil() { - io.WriteString(p, "nil") - break - } - writeByte(p, '{') - expand := !canInline(v.Type()) - pp := p - if expand { - writeByte(p, '\n') - pp = p.indent() - } - for i := 0; i < v.Len(); i++ { - showTypeInSlice := t.Elem().Kind() == reflect.Interface - pp.printValue(v.Index(i), showTypeInSlice, true) - if expand { - io.WriteString(pp, ",\n") - } else if i < v.Len()-1 { - io.WriteString(pp, ", ") - } - } - if expand { - pp.tw.Flush() - } - writeByte(p, '}') - case reflect.Ptr: - e := v.Elem() - if !e.IsValid() { - writeByte(p, '(') - io.WriteString(p, v.Type().String()) - io.WriteString(p, ")(nil)") - } else { - pp := *p - pp.depth++ - writeByte(pp, '&') - pp.printValue(e, true, true) - } - case reflect.Chan: - x := v.Pointer() - if showType { - writeByte(p, '(') - io.WriteString(p, v.Type().String()) - fmt.Fprintf(p, ")(%#v)", x) - } else { - fmt.Fprintf(p, "%#v", x) - } - case reflect.Func: - io.WriteString(p, v.Type().String()) - io.WriteString(p, " {...}") - case reflect.UnsafePointer: - p.printInline(v, v.Pointer(), showType) - case reflect.Invalid: - io.WriteString(p, "nil") - } -} - -func canInline(t reflect.Type) bool { - switch t.Kind() { - case reflect.Map: - return !canExpand(t.Elem()) - case reflect.Struct: - for i := 0; i < t.NumField(); i++ { - if canExpand(t.Field(i).Type) { - return false - } - } - return true - case reflect.Interface: - return false - case reflect.Array, reflect.Slice: - return !canExpand(t.Elem()) - case reflect.Ptr: - return false - case reflect.Chan, reflect.Func, reflect.UnsafePointer: - return false - } - return true -} - -func canExpand(t reflect.Type) bool { - switch t.Kind() { - case reflect.Map, reflect.Struct, - reflect.Interface, reflect.Array, reflect.Slice, - reflect.Ptr: - return true - } - return false -} - -func labelType(t reflect.Type) bool { - switch t.Kind() { - case reflect.Interface, reflect.Struct: - return true - } - return false -} - -func (p *printer) fmtString(s string, quote bool) { - if quote { - s = strconv.Quote(s) - } - io.WriteString(p, s) -} - -func writeByte(w io.Writer, b byte) { - w.Write([]byte{b}) -} - -func getField(v reflect.Value, i int) reflect.Value { - val := v.Field(i) - if val.Kind() == reflect.Interface && !val.IsNil() { - val = val.Elem() - } - return val -} diff --git a/vendor/github.com/kr/pretty/formatter_test.go b/vendor/github.com/kr/pretty/formatter_test.go deleted file mode 100644 index c8c0b51..0000000 --- a/vendor/github.com/kr/pretty/formatter_test.go +++ /dev/null @@ -1,288 +0,0 @@ -package pretty - -import ( - "fmt" - "io" - "strings" - "testing" - "unsafe" -) - -type test struct { - v interface{} - s string -} - -type passtest struct { - v interface{} - f, s string -} - -type LongStructTypeName struct { - longFieldName interface{} - otherLongFieldName interface{} -} - -type SA struct { - t *T - v T -} - -type T struct { - x, y int -} - -type F int - -func (f F) Format(s fmt.State, c rune) { - fmt.Fprintf(s, "F(%d)", int(f)) -} - -type Stringer struct { i int } - -func (s *Stringer) String() string { return "foo" } - -var long = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - -var passthrough = []passtest{ - {1, "%d", "1"}, - {"a", "%s", "a"}, - {&Stringer{}, "%s", "foo"}, -} - -func TestPassthrough(t *testing.T) { - for _, tt := range passthrough { - s := fmt.Sprintf(tt.f, Formatter(tt.v)) - if tt.s != s { - t.Errorf("expected %q", tt.s) - t.Errorf("got %q", s) - t.Errorf("expraw\n%s", tt.s) - t.Errorf("gotraw\n%s", s) - } - } -} - -var gosyntax = []test{ - {nil, `nil`}, - {"", `""`}, - {"a", `"a"`}, - {1, "int(1)"}, - {1.0, "float64(1)"}, - {[]int(nil), "[]int(nil)"}, - {[0]int{}, "[0]int{}"}, - {complex(1, 0), "(1+0i)"}, - //{make(chan int), "(chan int)(0x1234)"}, - {unsafe.Pointer(uintptr(unsafe.Pointer(&long))), fmt.Sprintf("unsafe.Pointer(0x%02x)", uintptr(unsafe.Pointer(&long)))}, - {func(int) {}, "func(int) {...}"}, - {map[int]int{1: 1}, "map[int]int{1:1}"}, - {int32(1), "int32(1)"}, - {io.EOF, `&errors.errorString{s:"EOF"}`}, - {[]string{"a"}, `[]string{"a"}`}, - { - []string{long}, - `[]string{"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}`, - }, - {F(5), "pretty.F(5)"}, - { - SA{&T{1, 2}, T{3, 4}}, - `pretty.SA{ - t: &pretty.T{x:1, y:2}, - v: pretty.T{x:3, y:4}, -}`, - }, - { - map[int][]byte{1: {}}, - `map[int][]uint8{ - 1: {}, -}`, - }, - { - map[int]T{1: {}}, - `map[int]pretty.T{ - 1: {}, -}`, - }, - { - long, - `"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"`, - }, - { - LongStructTypeName{ - longFieldName: LongStructTypeName{}, - otherLongFieldName: long, - }, - `pretty.LongStructTypeName{ - longFieldName: pretty.LongStructTypeName{}, - otherLongFieldName: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", -}`, - }, - { - &LongStructTypeName{ - longFieldName: &LongStructTypeName{}, - otherLongFieldName: (*LongStructTypeName)(nil), - }, - `&pretty.LongStructTypeName{ - longFieldName: &pretty.LongStructTypeName{}, - otherLongFieldName: (*pretty.LongStructTypeName)(nil), -}`, - }, - { - []LongStructTypeName{ - {nil, nil}, - {3, 3}, - {long, nil}, - }, - `[]pretty.LongStructTypeName{ - {}, - { - longFieldName: int(3), - otherLongFieldName: int(3), - }, - { - longFieldName: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", - otherLongFieldName: nil, - }, -}`, - }, - { - []interface{}{ - LongStructTypeName{nil, nil}, - []byte{1, 2, 3}, - T{3, 4}, - LongStructTypeName{long, nil}, - }, - `[]interface {}{ - pretty.LongStructTypeName{}, - []uint8{0x1, 0x2, 0x3}, - pretty.T{x:3, y:4}, - pretty.LongStructTypeName{ - longFieldName: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", - otherLongFieldName: nil, - }, -}`, - }, -} - -func TestGoSyntax(t *testing.T) { - for _, tt := range gosyntax { - s := fmt.Sprintf("%# v", Formatter(tt.v)) - if tt.s != s { - t.Errorf("expected %q", tt.s) - t.Errorf("got %q", s) - t.Errorf("expraw\n%s", tt.s) - t.Errorf("gotraw\n%s", s) - } - } -} - -type I struct { - i int - R interface{} -} - -func (i *I) I() *I { return i.R.(*I) } - -func TestCycle(t *testing.T) { - type A struct{ *A } - v := &A{} - v.A = v - - // panics from stack overflow without cycle detection - t.Logf("Example cycle:\n%# v", Formatter(v)) - - p := &A{} - s := fmt.Sprintf("%# v", Formatter([]*A{p, p})) - if strings.Contains(s, "CYCLIC") { - t.Errorf("Repeated address detected as cyclic reference:\n%s", s) - } - - type R struct { - i int - *R - } - r := &R{ - i: 1, - R: &R{ - i: 2, - R: &R{ - i: 3, - }, - }, - } - r.R.R.R = r - t.Logf("Example longer cycle:\n%# v", Formatter(r)) - - r = &R{ - i: 1, - R: &R{ - i: 2, - R: &R{ - i: 3, - R: &R{ - i: 4, - R: &R{ - i: 5, - R: &R{ - i: 6, - R: &R{ - i: 7, - R: &R{ - i: 8, - R: &R{ - i: 9, - R: &R{ - i: 10, - R: &R{ - i: 11, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - // here be pirates - r.R.R.R.R.R.R.R.R.R.R.R = r - t.Logf("Example very long cycle:\n%# v", Formatter(r)) - - i := &I{ - i: 1, - R: &I{ - i: 2, - R: &I{ - i: 3, - R: &I{ - i: 4, - R: &I{ - i: 5, - R: &I{ - i: 6, - R: &I{ - i: 7, - R: &I{ - i: 8, - R: &I{ - i: 9, - R: &I{ - i: 10, - R: &I{ - i: 11, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - iv := i.I().I().I().I().I().I().I().I().I().I() - *iv = *i - t.Logf("Example long interface cycle:\n%# v", Formatter(i)) -} diff --git a/vendor/github.com/kr/pretty/go.mod b/vendor/github.com/kr/pretty/go.mod deleted file mode 100644 index 1e29533..0000000 --- a/vendor/github.com/kr/pretty/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module "github.com/kr/pretty" - -require "github.com/kr/text" v0.1.0 diff --git a/vendor/github.com/kr/pretty/pretty.go b/vendor/github.com/kr/pretty/pretty.go deleted file mode 100644 index 49423ec..0000000 --- a/vendor/github.com/kr/pretty/pretty.go +++ /dev/null @@ -1,108 +0,0 @@ -// Package pretty provides pretty-printing for Go values. This is -// useful during debugging, to avoid wrapping long output lines in -// the terminal. -// -// It provides a function, Formatter, that can be used with any -// function that accepts a format string. It also provides -// convenience wrappers for functions in packages fmt and log. -package pretty - -import ( - "fmt" - "io" - "log" - "reflect" -) - -// Errorf is a convenience wrapper for fmt.Errorf. -// -// Calling Errorf(f, x, y) is equivalent to -// fmt.Errorf(f, Formatter(x), Formatter(y)). -func Errorf(format string, a ...interface{}) error { - return fmt.Errorf(format, wrap(a, false)...) -} - -// Fprintf is a convenience wrapper for fmt.Fprintf. -// -// Calling Fprintf(w, f, x, y) is equivalent to -// fmt.Fprintf(w, f, Formatter(x), Formatter(y)). -func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error error) { - return fmt.Fprintf(w, format, wrap(a, false)...) -} - -// Log is a convenience wrapper for log.Printf. -// -// Calling Log(x, y) is equivalent to -// log.Print(Formatter(x), Formatter(y)), but each operand is -// formatted with "%# v". -func Log(a ...interface{}) { - log.Print(wrap(a, true)...) -} - -// Logf is a convenience wrapper for log.Printf. -// -// Calling Logf(f, x, y) is equivalent to -// log.Printf(f, Formatter(x), Formatter(y)). -func Logf(format string, a ...interface{}) { - log.Printf(format, wrap(a, false)...) -} - -// Logln is a convenience wrapper for log.Printf. -// -// Calling Logln(x, y) is equivalent to -// log.Println(Formatter(x), Formatter(y)), but each operand is -// formatted with "%# v". -func Logln(a ...interface{}) { - log.Println(wrap(a, true)...) -} - -// Print pretty-prints its operands and writes to standard output. -// -// Calling Print(x, y) is equivalent to -// fmt.Print(Formatter(x), Formatter(y)), but each operand is -// formatted with "%# v". -func Print(a ...interface{}) (n int, errno error) { - return fmt.Print(wrap(a, true)...) -} - -// Printf is a convenience wrapper for fmt.Printf. -// -// Calling Printf(f, x, y) is equivalent to -// fmt.Printf(f, Formatter(x), Formatter(y)). -func Printf(format string, a ...interface{}) (n int, errno error) { - return fmt.Printf(format, wrap(a, false)...) -} - -// Println pretty-prints its operands and writes to standard output. -// -// Calling Print(x, y) is equivalent to -// fmt.Println(Formatter(x), Formatter(y)), but each operand is -// formatted with "%# v". -func Println(a ...interface{}) (n int, errno error) { - return fmt.Println(wrap(a, true)...) -} - -// Sprint is a convenience wrapper for fmt.Sprintf. -// -// Calling Sprint(x, y) is equivalent to -// fmt.Sprint(Formatter(x), Formatter(y)), but each operand is -// formatted with "%# v". -func Sprint(a ...interface{}) string { - return fmt.Sprint(wrap(a, true)...) -} - -// Sprintf is a convenience wrapper for fmt.Sprintf. -// -// Calling Sprintf(f, x, y) is equivalent to -// fmt.Sprintf(f, Formatter(x), Formatter(y)). -func Sprintf(format string, a ...interface{}) string { - return fmt.Sprintf(format, wrap(a, false)...) -} - -func wrap(a []interface{}, force bool) []interface{} { - w := make([]interface{}, len(a)) - for i, x := range a { - w[i] = formatter{v: reflect.ValueOf(x), force: force} - } - return w -} diff --git a/vendor/github.com/kr/pretty/zero.go b/vendor/github.com/kr/pretty/zero.go deleted file mode 100644 index abb5b6f..0000000 --- a/vendor/github.com/kr/pretty/zero.go +++ /dev/null @@ -1,41 +0,0 @@ -package pretty - -import ( - "reflect" -) - -func nonzero(v reflect.Value) bool { - switch v.Kind() { - case reflect.Bool: - return v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() != 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() != 0 - case reflect.Float32, reflect.Float64: - return v.Float() != 0 - case reflect.Complex64, reflect.Complex128: - return v.Complex() != complex(0, 0) - case reflect.String: - return v.String() != "" - case reflect.Struct: - for i := 0; i < v.NumField(); i++ { - if nonzero(getField(v, i)) { - return true - } - } - return false - case reflect.Array: - for i := 0; i < v.Len(); i++ { - if nonzero(v.Index(i)) { - return true - } - } - return false - case reflect.Map, reflect.Interface, reflect.Slice, reflect.Ptr, reflect.Chan, reflect.Func: - return !v.IsNil() - case reflect.UnsafePointer: - return v.Pointer() != 0 - } - return true -} diff --git a/vendor/github.com/kr/text/License b/vendor/github.com/kr/text/License deleted file mode 100644 index 480a328..0000000 --- a/vendor/github.com/kr/text/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2012 Keith Rarick - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/kr/text/Readme b/vendor/github.com/kr/text/Readme deleted file mode 100644 index 7e6e7c0..0000000 --- a/vendor/github.com/kr/text/Readme +++ /dev/null @@ -1,3 +0,0 @@ -This is a Go package for manipulating paragraphs of text. - -See http://go.pkgdoc.org/github.com/kr/text for full documentation. diff --git a/vendor/github.com/kr/text/doc.go b/vendor/github.com/kr/text/doc.go deleted file mode 100644 index cf4c198..0000000 --- a/vendor/github.com/kr/text/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package text provides rudimentary functions for manipulating text in -// paragraphs. -package text diff --git a/vendor/github.com/kr/text/go.mod b/vendor/github.com/kr/text/go.mod deleted file mode 100644 index fa0528b..0000000 --- a/vendor/github.com/kr/text/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module "github.com/kr/text" - -require "github.com/kr/pty" v1.1.1 diff --git a/vendor/github.com/kr/text/indent.go b/vendor/github.com/kr/text/indent.go deleted file mode 100644 index 4ebac45..0000000 --- a/vendor/github.com/kr/text/indent.go +++ /dev/null @@ -1,74 +0,0 @@ -package text - -import ( - "io" -) - -// Indent inserts prefix at the beginning of each non-empty line of s. The -// end-of-line marker is NL. -func Indent(s, prefix string) string { - return string(IndentBytes([]byte(s), []byte(prefix))) -} - -// IndentBytes inserts prefix at the beginning of each non-empty line of b. -// The end-of-line marker is NL. -func IndentBytes(b, prefix []byte) []byte { - var res []byte - bol := true - for _, c := range b { - if bol && c != '\n' { - res = append(res, prefix...) - } - res = append(res, c) - bol = c == '\n' - } - return res -} - -// Writer indents each line of its input. -type indentWriter struct { - w io.Writer - bol bool - pre [][]byte - sel int - off int -} - -// NewIndentWriter makes a new write filter that indents the input -// lines. Each line is prefixed in order with the corresponding -// element of pre. If there are more lines than elements, the last -// element of pre is repeated for each subsequent line. -func NewIndentWriter(w io.Writer, pre ...[]byte) io.Writer { - return &indentWriter{ - w: w, - pre: pre, - bol: true, - } -} - -// The only errors returned are from the underlying indentWriter. -func (w *indentWriter) Write(p []byte) (n int, err error) { - for _, c := range p { - if w.bol { - var i int - i, err = w.w.Write(w.pre[w.sel][w.off:]) - w.off += i - if err != nil { - return n, err - } - } - _, err = w.w.Write([]byte{c}) - if err != nil { - return n, err - } - n++ - w.bol = c == '\n' - if w.bol { - w.off = 0 - if w.sel < len(w.pre)-1 { - w.sel++ - } - } - } - return n, nil -} diff --git a/vendor/github.com/kr/text/indent_test.go b/vendor/github.com/kr/text/indent_test.go deleted file mode 100644 index 5c723ee..0000000 --- a/vendor/github.com/kr/text/indent_test.go +++ /dev/null @@ -1,119 +0,0 @@ -package text - -import ( - "bytes" - "testing" -) - -type T struct { - inp, exp, pre string -} - -var tests = []T{ - { - "The quick brown fox\njumps over the lazy\ndog.\nBut not quickly.\n", - "xxxThe quick brown fox\nxxxjumps over the lazy\nxxxdog.\nxxxBut not quickly.\n", - "xxx", - }, - { - "The quick brown fox\njumps over the lazy\ndog.\n\nBut not quickly.", - "xxxThe quick brown fox\nxxxjumps over the lazy\nxxxdog.\n\nxxxBut not quickly.", - "xxx", - }, -} - -func TestIndent(t *testing.T) { - for _, test := range tests { - got := Indent(test.inp, test.pre) - if got != test.exp { - t.Errorf("mismatch %q != %q", got, test.exp) - } - } -} - -type IndentWriterTest struct { - inp, exp string - pre []string -} - -var ts = []IndentWriterTest{ - { - ` -The quick brown fox -jumps over the lazy -dog. -But not quickly. -`[1:], - ` -xxxThe quick brown fox -xxxjumps over the lazy -xxxdog. -xxxBut not quickly. -`[1:], - []string{"xxx"}, - }, - { - ` -The quick brown fox -jumps over the lazy -dog. -But not quickly. -`[1:], - ` -xxaThe quick brown fox -xxxjumps over the lazy -xxxdog. -xxxBut not quickly. -`[1:], - []string{"xxa", "xxx"}, - }, - { - ` -The quick brown fox -jumps over the lazy -dog. -But not quickly. -`[1:], - ` -xxaThe quick brown fox -xxbjumps over the lazy -xxcdog. -xxxBut not quickly. -`[1:], - []string{"xxa", "xxb", "xxc", "xxx"}, - }, - { - ` -The quick brown fox -jumps over the lazy -dog. - -But not quickly.`[1:], - ` -xxaThe quick brown fox -xxxjumps over the lazy -xxxdog. -xxx -xxxBut not quickly.`[1:], - []string{"xxa", "xxx"}, - }, -} - -func TestIndentWriter(t *testing.T) { - for _, test := range ts { - b := new(bytes.Buffer) - pre := make([][]byte, len(test.pre)) - for i := range test.pre { - pre[i] = []byte(test.pre[i]) - } - w := NewIndentWriter(b, pre...) - if _, err := w.Write([]byte(test.inp)); err != nil { - t.Error(err) - } - if got := b.String(); got != test.exp { - t.Errorf("mismatch %q != %q", got, test.exp) - t.Log(got) - t.Log(test.exp) - } - } -} diff --git a/vendor/github.com/kr/text/wrap.go b/vendor/github.com/kr/text/wrap.go deleted file mode 100644 index b09bb03..0000000 --- a/vendor/github.com/kr/text/wrap.go +++ /dev/null @@ -1,86 +0,0 @@ -package text - -import ( - "bytes" - "math" -) - -var ( - nl = []byte{'\n'} - sp = []byte{' '} -) - -const defaultPenalty = 1e5 - -// Wrap wraps s into a paragraph of lines of length lim, with minimal -// raggedness. -func Wrap(s string, lim int) string { - return string(WrapBytes([]byte(s), lim)) -} - -// WrapBytes wraps b into a paragraph of lines of length lim, with minimal -// raggedness. -func WrapBytes(b []byte, lim int) []byte { - words := bytes.Split(bytes.Replace(bytes.TrimSpace(b), nl, sp, -1), sp) - var lines [][]byte - for _, line := range WrapWords(words, 1, lim, defaultPenalty) { - lines = append(lines, bytes.Join(line, sp)) - } - return bytes.Join(lines, nl) -} - -// WrapWords is the low-level line-breaking algorithm, useful if you need more -// control over the details of the text wrapping process. For most uses, either -// Wrap or WrapBytes will be sufficient and more convenient. -// -// WrapWords splits a list of words into lines with minimal "raggedness", -// treating each byte as one unit, accounting for spc units between adjacent -// words on each line, and attempting to limit lines to lim units. Raggedness -// is the total error over all lines, where error is the square of the -// difference of the length of the line and lim. Too-long lines (which only -// happen when a single word is longer than lim units) have pen penalty units -// added to the error. -func WrapWords(words [][]byte, spc, lim, pen int) [][][]byte { - n := len(words) - - length := make([][]int, n) - for i := 0; i < n; i++ { - length[i] = make([]int, n) - length[i][i] = len(words[i]) - for j := i + 1; j < n; j++ { - length[i][j] = length[i][j-1] + spc + len(words[j]) - } - } - - nbrk := make([]int, n) - cost := make([]int, n) - for i := range cost { - cost[i] = math.MaxInt32 - } - for i := n - 1; i >= 0; i-- { - if length[i][n-1] <= lim || i == n-1 { - cost[i] = 0 - nbrk[i] = n - } else { - for j := i + 1; j < n; j++ { - d := lim - length[i][j-1] - c := d*d + cost[j] - if length[i][j-1] > lim { - c += pen // too-long lines get a worse penalty - } - if c < cost[i] { - cost[i] = c - nbrk[i] = j - } - } - } - } - - var lines [][][]byte - i := 0 - for i < n { - lines = append(lines, words[i:nbrk[i]]) - i = nbrk[i] - } - return lines -} diff --git a/vendor/github.com/kr/text/wrap_test.go b/vendor/github.com/kr/text/wrap_test.go deleted file mode 100644 index 634b6e8..0000000 --- a/vendor/github.com/kr/text/wrap_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package text - -import ( - "bytes" - "testing" -) - -var text = "The quick brown fox jumps over the lazy dog." - -func TestWrap(t *testing.T) { - exp := [][]string{ - {"The", "quick", "brown", "fox"}, - {"jumps", "over", "the", "lazy", "dog."}, - } - words := bytes.Split([]byte(text), sp) - got := WrapWords(words, 1, 24, defaultPenalty) - if len(exp) != len(got) { - t.Fail() - } - for i := range exp { - if len(exp[i]) != len(got[i]) { - t.Fail() - } - for j := range exp[i] { - if exp[i][j] != string(got[i][j]) { - t.Fatal(i, exp[i][j], got[i][j]) - } - } - } -} - -func TestWrapNarrow(t *testing.T) { - exp := "The\nquick\nbrown\nfox\njumps\nover\nthe\nlazy\ndog." - if Wrap(text, 5) != exp { - t.Fail() - } -} - -func TestWrapOneLine(t *testing.T) { - exp := "The quick brown fox jumps over the lazy dog." - if Wrap(text, 500) != exp { - t.Fail() - } -} - -func TestWrapBug1(t *testing.T) { - cases := []struct { - limit int - text string - want string - }{ - {4, "aaaaa", "aaaaa"}, - {4, "a aaaaa", "a\naaaaa"}, - } - - for _, test := range cases { - got := Wrap(test.text, test.limit) - if got != test.want { - t.Errorf("Wrap(%q, %d) = %q want %q", test.text, test.limit, got, test.want) - } - } -} diff --git a/vendor/golang.org/x/crypto/AUTHORS b/vendor/golang.org/x/crypto/AUTHORS new file mode 100644 index 0000000..2b00ddb --- /dev/null +++ b/vendor/golang.org/x/crypto/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at https://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/crypto/CONTRIBUTORS b/vendor/golang.org/x/crypto/CONTRIBUTORS new file mode 100644 index 0000000..1fbd3e9 --- /dev/null +++ b/vendor/golang.org/x/crypto/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at https://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/vendor/golang.org/x/crypto/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/crypto/PATENTS b/vendor/golang.org/x/crypto/PATENTS new file mode 100644 index 0000000..7330990 --- /dev/null +++ b/vendor/golang.org/x/crypto/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/crypto/cryptobyte/asn1_test.go b/vendor/golang.org/x/crypto/cryptobyte/asn1_test.go deleted file mode 100644 index 9f6c952..0000000 --- a/vendor/golang.org/x/crypto/cryptobyte/asn1_test.go +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright 2017 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. - -package cryptobyte - -import ( - "bytes" - encoding_asn1 "encoding/asn1" - "math/big" - "reflect" - "testing" - "time" - - "golang.org/x/crypto/cryptobyte/asn1" -) - -type readASN1Test struct { - name string - in []byte - tag asn1.Tag - ok bool - out interface{} -} - -var readASN1TestData = []readASN1Test{ - {"valid", []byte{0x30, 2, 1, 2}, 0x30, true, []byte{1, 2}}, - {"truncated", []byte{0x30, 3, 1, 2}, 0x30, false, nil}, - {"zero length of length", []byte{0x30, 0x80}, 0x30, false, nil}, - {"invalid long form length", []byte{0x30, 0x81, 1, 1}, 0x30, false, nil}, - {"non-minimal length", append([]byte{0x30, 0x82, 0, 0x80}, make([]byte, 0x80)...), 0x30, false, nil}, - {"invalid tag", []byte{0xa1, 3, 0x4, 1, 1}, 31, false, nil}, - {"high tag", []byte{0x1f, 0x81, 0x80, 0x01, 2, 1, 2}, 0xff /* actually 0x4001, but tag is uint8 */, false, nil}, -} - -func TestReadASN1(t *testing.T) { - for _, test := range readASN1TestData { - t.Run(test.name, func(t *testing.T) { - var in, out String = test.in, nil - ok := in.ReadASN1(&out, test.tag) - if ok != test.ok || ok && !bytes.Equal(out, test.out.([]byte)) { - t.Errorf("in.ReadASN1() = %v, want %v; out = %v, want %v", ok, test.ok, out, test.out) - } - }) - } -} - -func TestReadASN1Optional(t *testing.T) { - var empty String - var present bool - ok := empty.ReadOptionalASN1(nil, &present, 0xa0) - if !ok || present { - t.Errorf("empty.ReadOptionalASN1() = %v, want true; present = %v want false", ok, present) - } - - var in, out String = []byte{0xa1, 3, 0x4, 1, 1}, nil - ok = in.ReadOptionalASN1(&out, &present, 0xa0) - if !ok || present { - t.Errorf("in.ReadOptionalASN1() = %v, want true, present = %v, want false", ok, present) - } - ok = in.ReadOptionalASN1(&out, &present, 0xa1) - wantBytes := []byte{4, 1, 1} - if !ok || !present || !bytes.Equal(out, wantBytes) { - t.Errorf("in.ReadOptionalASN1() = %v, want true; present = %v, want true; out = %v, want = %v", ok, present, out, wantBytes) - } -} - -var optionalOctetStringTestData = []struct { - readASN1Test - present bool -}{ - {readASN1Test{"empty", []byte{}, 0xa0, true, []byte{}}, false}, - {readASN1Test{"invalid", []byte{0xa1, 3, 0x4, 2, 1}, 0xa1, false, []byte{}}, true}, - {readASN1Test{"missing", []byte{0xa1, 3, 0x4, 1, 1}, 0xa0, true, []byte{}}, false}, - {readASN1Test{"present", []byte{0xa1, 3, 0x4, 1, 1}, 0xa1, true, []byte{1}}, true}, -} - -func TestReadASN1OptionalOctetString(t *testing.T) { - for _, test := range optionalOctetStringTestData { - t.Run(test.name, func(t *testing.T) { - in := String(test.in) - var out []byte - var present bool - ok := in.ReadOptionalASN1OctetString(&out, &present, test.tag) - if ok != test.ok || present != test.present || !bytes.Equal(out, test.out.([]byte)) { - t.Errorf("in.ReadOptionalASN1OctetString() = %v, want %v; present = %v want %v; out = %v, want %v", ok, test.ok, present, test.present, out, test.out) - } - }) - } -} - -const defaultInt = -1 - -var optionalIntTestData = []readASN1Test{ - {"empty", []byte{}, 0xa0, true, defaultInt}, - {"invalid", []byte{0xa1, 3, 0x2, 2, 127}, 0xa1, false, 0}, - {"missing", []byte{0xa1, 3, 0x2, 1, 127}, 0xa0, true, defaultInt}, - {"present", []byte{0xa1, 3, 0x2, 1, 42}, 0xa1, true, 42}, -} - -func TestReadASN1OptionalInteger(t *testing.T) { - for _, test := range optionalIntTestData { - t.Run(test.name, func(t *testing.T) { - in := String(test.in) - var out int - ok := in.ReadOptionalASN1Integer(&out, test.tag, defaultInt) - if ok != test.ok || ok && out != test.out.(int) { - t.Errorf("in.ReadOptionalASN1Integer() = %v, want %v; out = %v, want %v", ok, test.ok, out, test.out) - } - }) - } -} - -func TestReadASN1IntegerSigned(t *testing.T) { - testData64 := []struct { - in []byte - out int64 - }{ - {[]byte{2, 3, 128, 0, 0}, -0x800000}, - {[]byte{2, 2, 255, 0}, -256}, - {[]byte{2, 2, 255, 127}, -129}, - {[]byte{2, 1, 128}, -128}, - {[]byte{2, 1, 255}, -1}, - {[]byte{2, 1, 0}, 0}, - {[]byte{2, 1, 1}, 1}, - {[]byte{2, 1, 2}, 2}, - {[]byte{2, 1, 127}, 127}, - {[]byte{2, 2, 0, 128}, 128}, - {[]byte{2, 2, 1, 0}, 256}, - {[]byte{2, 4, 0, 128, 0, 0}, 0x800000}, - } - for i, test := range testData64 { - in := String(test.in) - var out int64 - ok := in.ReadASN1Integer(&out) - if !ok || out != test.out { - t.Errorf("#%d: in.ReadASN1Integer() = %v, want true; out = %d, want %d", i, ok, out, test.out) - } - } - - // Repeat the same cases, reading into a big.Int. - t.Run("big.Int", func(t *testing.T) { - for i, test := range testData64 { - in := String(test.in) - var out big.Int - ok := in.ReadASN1Integer(&out) - if !ok || out.Int64() != test.out { - t.Errorf("#%d: in.ReadASN1Integer() = %v, want true; out = %d, want %d", i, ok, out.Int64(), test.out) - } - } - }) - - // Repeat with the implicit-tagging functions - t.Run("WithTag", func(t *testing.T) { - for i, test := range testData64 { - tag := asn1.Tag((i * 3) % 32).ContextSpecific() - - testData := make([]byte, len(test.in)) - copy(testData, test.in) - - // Alter the tag of the test case. - testData[0] = uint8(tag) - - in := String(testData) - var out int64 - ok := in.ReadASN1Int64WithTag(&out, tag) - if !ok || out != test.out { - t.Errorf("#%d: in.ReadASN1Int64WithTag() = %v, want true; out = %d, want %d", i, ok, out, test.out) - } - - var b Builder - b.AddASN1Int64WithTag(test.out, tag) - result, err := b.Bytes() - - if err != nil { - t.Errorf("#%d: AddASN1Int64WithTag failed: %s", i, err) - continue - } - - if !bytes.Equal(result, testData) { - t.Errorf("#%d: AddASN1Int64WithTag: got %x, want %x", i, result, testData) - } - } - }) -} - -func TestReadASN1IntegerUnsigned(t *testing.T) { - testData := []struct { - in []byte - out uint64 - }{ - {[]byte{2, 1, 0}, 0}, - {[]byte{2, 1, 1}, 1}, - {[]byte{2, 1, 2}, 2}, - {[]byte{2, 1, 127}, 127}, - {[]byte{2, 2, 0, 128}, 128}, - {[]byte{2, 2, 1, 0}, 256}, - {[]byte{2, 4, 0, 128, 0, 0}, 0x800000}, - {[]byte{2, 8, 127, 255, 255, 255, 255, 255, 255, 255}, 0x7fffffffffffffff}, - {[]byte{2, 9, 0, 128, 0, 0, 0, 0, 0, 0, 0}, 0x8000000000000000}, - {[]byte{2, 9, 0, 255, 255, 255, 255, 255, 255, 255, 255}, 0xffffffffffffffff}, - } - for i, test := range testData { - in := String(test.in) - var out uint64 - ok := in.ReadASN1Integer(&out) - if !ok || out != test.out { - t.Errorf("#%d: in.ReadASN1Integer() = %v, want true; out = %d, want %d", i, ok, out, test.out) - } - } -} - -func TestReadASN1IntegerInvalid(t *testing.T) { - testData := []String{ - []byte{3, 1, 0}, // invalid tag - // truncated - []byte{2, 1}, - []byte{2, 2, 0}, - // not minimally encoded - []byte{2, 2, 0, 1}, - []byte{2, 2, 0xff, 0xff}, - } - - for i, test := range testData { - var out int64 - if test.ReadASN1Integer(&out) { - t.Errorf("#%d: in.ReadASN1Integer() = true, want false (out = %d)", i, out) - } - } -} - -func TestASN1ObjectIdentifier(t *testing.T) { - testData := []struct { - in []byte - ok bool - out []int - }{ - {[]byte{}, false, []int{}}, - {[]byte{6, 0}, false, []int{}}, - {[]byte{5, 1, 85}, false, []int{2, 5}}, - {[]byte{6, 1, 85}, true, []int{2, 5}}, - {[]byte{6, 2, 85, 0x02}, true, []int{2, 5, 2}}, - {[]byte{6, 4, 85, 0x02, 0xc0, 0x00}, true, []int{2, 5, 2, 0x2000}}, - {[]byte{6, 3, 0x81, 0x34, 0x03}, true, []int{2, 100, 3}}, - {[]byte{6, 7, 85, 0x02, 0xc0, 0x80, 0x80, 0x80, 0x80}, false, []int{}}, - } - - for i, test := range testData { - in := String(test.in) - var out encoding_asn1.ObjectIdentifier - ok := in.ReadASN1ObjectIdentifier(&out) - if ok != test.ok || ok && !out.Equal(test.out) { - t.Errorf("#%d: in.ReadASN1ObjectIdentifier() = %v, want %v; out = %v, want %v", i, ok, test.ok, out, test.out) - continue - } - - var b Builder - b.AddASN1ObjectIdentifier(out) - result, err := b.Bytes() - if builderOk := err == nil; test.ok != builderOk { - t.Errorf("#%d: error from Builder.Bytes: %s", i, err) - continue - } - if test.ok && !bytes.Equal(result, test.in) { - t.Errorf("#%d: reserialisation didn't match, got %x, want %x", i, result, test.in) - continue - } - } -} - -func TestReadASN1GeneralizedTime(t *testing.T) { - testData := []struct { - in string - ok bool - out time.Time - }{ - {"20100102030405Z", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.UTC)}, - {"20100102030405", false, time.Time{}}, - {"20100102030405+0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", 6*60*60+7*60))}, - {"20100102030405-0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", -6*60*60-7*60))}, - /* These are invalid times. However, the time package normalises times - * and they were accepted in some versions. See #11134. */ - {"00000100000000Z", false, time.Time{}}, - {"20101302030405Z", false, time.Time{}}, - {"20100002030405Z", false, time.Time{}}, - {"20100100030405Z", false, time.Time{}}, - {"20100132030405Z", false, time.Time{}}, - {"20100231030405Z", false, time.Time{}}, - {"20100102240405Z", false, time.Time{}}, - {"20100102036005Z", false, time.Time{}}, - {"20100102030460Z", false, time.Time{}}, - {"-20100102030410Z", false, time.Time{}}, - {"2010-0102030410Z", false, time.Time{}}, - {"2010-0002030410Z", false, time.Time{}}, - {"201001-02030410Z", false, time.Time{}}, - {"20100102-030410Z", false, time.Time{}}, - {"2010010203-0410Z", false, time.Time{}}, - {"201001020304-10Z", false, time.Time{}}, - } - for i, test := range testData { - in := String(append([]byte{byte(asn1.GeneralizedTime), byte(len(test.in))}, test.in...)) - var out time.Time - ok := in.ReadASN1GeneralizedTime(&out) - if ok != test.ok || ok && !reflect.DeepEqual(out, test.out) { - t.Errorf("#%d: in.ReadASN1GeneralizedTime() = %v, want %v; out = %q, want %q", i, ok, test.ok, out, test.out) - } - } -} - -func TestReadASN1BitString(t *testing.T) { - testData := []struct { - in []byte - ok bool - out encoding_asn1.BitString - }{ - {[]byte{}, false, encoding_asn1.BitString{}}, - {[]byte{0x00}, true, encoding_asn1.BitString{}}, - {[]byte{0x07, 0x00}, true, encoding_asn1.BitString{Bytes: []byte{0}, BitLength: 1}}, - {[]byte{0x07, 0x01}, false, encoding_asn1.BitString{}}, - {[]byte{0x07, 0x40}, false, encoding_asn1.BitString{}}, - {[]byte{0x08, 0x00}, false, encoding_asn1.BitString{}}, - {[]byte{0xff}, false, encoding_asn1.BitString{}}, - {[]byte{0xfe, 0x00}, false, encoding_asn1.BitString{}}, - } - for i, test := range testData { - in := String(append([]byte{3, byte(len(test.in))}, test.in...)) - var out encoding_asn1.BitString - ok := in.ReadASN1BitString(&out) - if ok != test.ok || ok && (!bytes.Equal(out.Bytes, test.out.Bytes) || out.BitLength != test.out.BitLength) { - t.Errorf("#%d: in.ReadASN1BitString() = %v, want %v; out = %v, want %v", i, ok, test.ok, out, test.out) - } - } -} diff --git a/vendor/golang.org/x/crypto/cryptobyte/cryptobyte_test.go b/vendor/golang.org/x/crypto/cryptobyte/cryptobyte_test.go deleted file mode 100644 index f294dd5..0000000 --- a/vendor/golang.org/x/crypto/cryptobyte/cryptobyte_test.go +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright 2017 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. - -package cryptobyte - -import ( - "bytes" - "errors" - "fmt" - "testing" -) - -func builderBytesEq(b *Builder, want ...byte) error { - got := b.BytesOrPanic() - if !bytes.Equal(got, want) { - return fmt.Errorf("Bytes() = %v, want %v", got, want) - } - return nil -} - -func TestContinuationError(t *testing.T) { - const errorStr = "TestContinuationError" - var b Builder - b.AddUint8LengthPrefixed(func(b *Builder) { - b.AddUint8(1) - panic(BuildError{Err: errors.New(errorStr)}) - }) - - ret, err := b.Bytes() - if ret != nil { - t.Error("expected nil result") - } - if err == nil { - t.Fatal("unexpected nil error") - } - if s := err.Error(); s != errorStr { - t.Errorf("expected error %q, got %v", errorStr, s) - } -} - -func TestContinuationNonError(t *testing.T) { - defer func() { - recover() - }() - - var b Builder - b.AddUint8LengthPrefixed(func(b *Builder) { - b.AddUint8(1) - panic(1) - }) - - t.Error("Builder did not panic") -} - -func TestGeneratedPanic(t *testing.T) { - defer func() { - recover() - }() - - var b Builder - b.AddUint8LengthPrefixed(func(b *Builder) { - var p *byte - *p = 0 - }) - - t.Error("Builder did not panic") -} - -func TestBytes(t *testing.T) { - var b Builder - v := []byte("foobarbaz") - b.AddBytes(v[0:3]) - b.AddBytes(v[3:4]) - b.AddBytes(v[4:9]) - if err := builderBytesEq(&b, v...); err != nil { - t.Error(err) - } - s := String(b.BytesOrPanic()) - for _, w := range []string{"foo", "bar", "baz"} { - var got []byte - if !s.ReadBytes(&got, 3) { - t.Errorf("ReadBytes() = false, want true (w = %v)", w) - } - want := []byte(w) - if !bytes.Equal(got, want) { - t.Errorf("ReadBytes(): got = %v, want %v", got, want) - } - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } -} - -func TestUint8(t *testing.T) { - var b Builder - b.AddUint8(42) - if err := builderBytesEq(&b, 42); err != nil { - t.Error(err) - } - - var s String = b.BytesOrPanic() - var v uint8 - if !s.ReadUint8(&v) { - t.Error("ReadUint8() = false, want true") - } - if v != 42 { - t.Errorf("v = %d, want 42", v) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } -} - -func TestUint16(t *testing.T) { - var b Builder - b.AddUint16(65534) - if err := builderBytesEq(&b, 255, 254); err != nil { - t.Error(err) - } - var s String = b.BytesOrPanic() - var v uint16 - if !s.ReadUint16(&v) { - t.Error("ReadUint16() == false, want true") - } - if v != 65534 { - t.Errorf("v = %d, want 65534", v) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } -} - -func TestUint24(t *testing.T) { - var b Builder - b.AddUint24(0xfffefd) - if err := builderBytesEq(&b, 255, 254, 253); err != nil { - t.Error(err) - } - - var s String = b.BytesOrPanic() - var v uint32 - if !s.ReadUint24(&v) { - t.Error("ReadUint8() = false, want true") - } - if v != 0xfffefd { - t.Errorf("v = %d, want fffefd", v) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } -} - -func TestUint24Truncation(t *testing.T) { - var b Builder - b.AddUint24(0x10111213) - if err := builderBytesEq(&b, 0x11, 0x12, 0x13); err != nil { - t.Error(err) - } -} - -func TestUint32(t *testing.T) { - var b Builder - b.AddUint32(0xfffefdfc) - if err := builderBytesEq(&b, 255, 254, 253, 252); err != nil { - t.Error(err) - } - - var s String = b.BytesOrPanic() - var v uint32 - if !s.ReadUint32(&v) { - t.Error("ReadUint8() = false, want true") - } - if v != 0xfffefdfc { - t.Errorf("v = %x, want fffefdfc", v) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } -} - -func TestUMultiple(t *testing.T) { - var b Builder - b.AddUint8(23) - b.AddUint32(0xfffefdfc) - b.AddUint16(42) - if err := builderBytesEq(&b, 23, 255, 254, 253, 252, 0, 42); err != nil { - t.Error(err) - } - - var s String = b.BytesOrPanic() - var ( - x uint8 - y uint32 - z uint16 - ) - if !s.ReadUint8(&x) || !s.ReadUint32(&y) || !s.ReadUint16(&z) { - t.Error("ReadUint8() = false, want true") - } - if x != 23 || y != 0xfffefdfc || z != 42 { - t.Errorf("x, y, z = %d, %d, %d; want 23, 4294901244, 5", x, y, z) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } -} - -func TestUint8LengthPrefixedSimple(t *testing.T) { - var b Builder - b.AddUint8LengthPrefixed(func(c *Builder) { - c.AddUint8(23) - c.AddUint8(42) - }) - if err := builderBytesEq(&b, 2, 23, 42); err != nil { - t.Error(err) - } - - var base, child String = b.BytesOrPanic(), nil - var x, y uint8 - if !base.ReadUint8LengthPrefixed(&child) || !child.ReadUint8(&x) || - !child.ReadUint8(&y) { - t.Error("parsing failed") - } - if x != 23 || y != 42 { - t.Errorf("want x, y == 23, 42; got %d, %d", x, y) - } - if len(base) != 0 { - t.Errorf("len(base) = %d, want 0", len(base)) - } - if len(child) != 0 { - t.Errorf("len(child) = %d, want 0", len(child)) - } -} - -func TestUint8LengthPrefixedMulti(t *testing.T) { - var b Builder - b.AddUint8LengthPrefixed(func(c *Builder) { - c.AddUint8(23) - c.AddUint8(42) - }) - b.AddUint8(5) - b.AddUint8LengthPrefixed(func(c *Builder) { - c.AddUint8(123) - c.AddUint8(234) - }) - if err := builderBytesEq(&b, 2, 23, 42, 5, 2, 123, 234); err != nil { - t.Error(err) - } - - var s, child String = b.BytesOrPanic(), nil - var u, v, w, x, y uint8 - if !s.ReadUint8LengthPrefixed(&child) || !child.ReadUint8(&u) || !child.ReadUint8(&v) || - !s.ReadUint8(&w) || !s.ReadUint8LengthPrefixed(&child) || !child.ReadUint8(&x) || !child.ReadUint8(&y) { - t.Error("parsing failed") - } - if u != 23 || v != 42 || w != 5 || x != 123 || y != 234 { - t.Errorf("u, v, w, x, y = %d, %d, %d, %d, %d; want 23, 42, 5, 123, 234", - u, v, w, x, y) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } - if len(child) != 0 { - t.Errorf("len(child) = %d, want 0", len(child)) - } -} - -func TestUint8LengthPrefixedNested(t *testing.T) { - var b Builder - b.AddUint8LengthPrefixed(func(c *Builder) { - c.AddUint8(5) - c.AddUint8LengthPrefixed(func(d *Builder) { - d.AddUint8(23) - d.AddUint8(42) - }) - c.AddUint8(123) - }) - if err := builderBytesEq(&b, 5, 5, 2, 23, 42, 123); err != nil { - t.Error(err) - } - - var base, child1, child2 String = b.BytesOrPanic(), nil, nil - var u, v, w, x uint8 - if !base.ReadUint8LengthPrefixed(&child1) { - t.Error("parsing base failed") - } - if !child1.ReadUint8(&u) || !child1.ReadUint8LengthPrefixed(&child2) || !child1.ReadUint8(&x) { - t.Error("parsing child1 failed") - } - if !child2.ReadUint8(&v) || !child2.ReadUint8(&w) { - t.Error("parsing child2 failed") - } - if u != 5 || v != 23 || w != 42 || x != 123 { - t.Errorf("u, v, w, x = %d, %d, %d, %d, want 5, 23, 42, 123", - u, v, w, x) - } - if len(base) != 0 { - t.Errorf("len(base) = %d, want 0", len(base)) - } - if len(child1) != 0 { - t.Errorf("len(child1) = %d, want 0", len(child1)) - } - if len(base) != 0 { - t.Errorf("len(child2) = %d, want 0", len(child2)) - } -} - -func TestPreallocatedBuffer(t *testing.T) { - var buf [5]byte - b := NewBuilder(buf[0:0]) - b.AddUint8(1) - b.AddUint8LengthPrefixed(func(c *Builder) { - c.AddUint8(3) - c.AddUint8(4) - }) - b.AddUint16(1286) // Outgrow buf by one byte. - want := []byte{1, 2, 3, 4, 0} - if !bytes.Equal(buf[:], want) { - t.Errorf("buf = %v want %v", buf, want) - } - if err := builderBytesEq(b, 1, 2, 3, 4, 5, 6); err != nil { - t.Error(err) - } -} - -func TestWriteWithPendingChild(t *testing.T) { - var b Builder - b.AddUint8LengthPrefixed(func(c *Builder) { - c.AddUint8LengthPrefixed(func(d *Builder) { - defer func() { - if recover() == nil { - t.Errorf("recover() = nil, want error; c.AddUint8() did not panic") - } - }() - c.AddUint8(2) // panics - - defer func() { - if recover() == nil { - t.Errorf("recover() = nil, want error; b.AddUint8() did not panic") - } - }() - b.AddUint8(2) // panics - }) - - defer func() { - if recover() == nil { - t.Errorf("recover() = nil, want error; b.AddUint8() did not panic") - } - }() - b.AddUint8(2) // panics - }) -} - -// ASN.1 - -func TestASN1Int64(t *testing.T) { - tests := []struct { - in int64 - want []byte - }{ - {-0x800000, []byte{2, 3, 128, 0, 0}}, - {-256, []byte{2, 2, 255, 0}}, - {-129, []byte{2, 2, 255, 127}}, - {-128, []byte{2, 1, 128}}, - {-1, []byte{2, 1, 255}}, - {0, []byte{2, 1, 0}}, - {1, []byte{2, 1, 1}}, - {2, []byte{2, 1, 2}}, - {127, []byte{2, 1, 127}}, - {128, []byte{2, 2, 0, 128}}, - {256, []byte{2, 2, 1, 0}}, - {0x800000, []byte{2, 4, 0, 128, 0, 0}}, - } - for i, tt := range tests { - var b Builder - b.AddASN1Int64(tt.in) - if err := builderBytesEq(&b, tt.want...); err != nil { - t.Errorf("%v, (i = %d; in = %v)", err, i, tt.in) - } - - var n int64 - s := String(b.BytesOrPanic()) - ok := s.ReadASN1Integer(&n) - if !ok || n != tt.in { - t.Errorf("s.ReadASN1Integer(&n) = %v, n = %d; want true, n = %d (i = %d)", - ok, n, tt.in, i) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } - } -} - -func TestASN1Uint64(t *testing.T) { - tests := []struct { - in uint64 - want []byte - }{ - {0, []byte{2, 1, 0}}, - {1, []byte{2, 1, 1}}, - {2, []byte{2, 1, 2}}, - {127, []byte{2, 1, 127}}, - {128, []byte{2, 2, 0, 128}}, - {256, []byte{2, 2, 1, 0}}, - {0x800000, []byte{2, 4, 0, 128, 0, 0}}, - {0x7fffffffffffffff, []byte{2, 8, 127, 255, 255, 255, 255, 255, 255, 255}}, - {0x8000000000000000, []byte{2, 9, 0, 128, 0, 0, 0, 0, 0, 0, 0}}, - {0xffffffffffffffff, []byte{2, 9, 0, 255, 255, 255, 255, 255, 255, 255, 255}}, - } - for i, tt := range tests { - var b Builder - b.AddASN1Uint64(tt.in) - if err := builderBytesEq(&b, tt.want...); err != nil { - t.Errorf("%v, (i = %d; in = %v)", err, i, tt.in) - } - - var n uint64 - s := String(b.BytesOrPanic()) - ok := s.ReadASN1Integer(&n) - if !ok || n != tt.in { - t.Errorf("s.ReadASN1Integer(&n) = %v, n = %d; want true, n = %d (i = %d)", - ok, n, tt.in, i) - } - if len(s) != 0 { - t.Errorf("len(s) = %d, want 0", len(s)) - } - } -} diff --git a/vendor/golang.org/x/crypto/cryptobyte/example_test.go b/vendor/golang.org/x/crypto/cryptobyte/example_test.go deleted file mode 100644 index 86c098a..0000000 --- a/vendor/golang.org/x/crypto/cryptobyte/example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2017 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. - -package cryptobyte_test - -import ( - "errors" - "fmt" - - "golang.org/x/crypto/cryptobyte" - "golang.org/x/crypto/cryptobyte/asn1" -) - -func ExampleString_lengthPrefixed() { - // This is an example of parsing length-prefixed data (as found in, for - // example, TLS). Imagine a 16-bit prefixed series of 8-bit prefixed - // strings. - - input := cryptobyte.String([]byte{0, 12, 5, 'h', 'e', 'l', 'l', 'o', 5, 'w', 'o', 'r', 'l', 'd'}) - var result []string - - var values cryptobyte.String - if !input.ReadUint16LengthPrefixed(&values) || - !input.Empty() { - panic("bad format") - } - - for !values.Empty() { - var value cryptobyte.String - if !values.ReadUint8LengthPrefixed(&value) { - panic("bad format") - } - - result = append(result, string(value)) - } - - // Output: []string{"hello", "world"} - fmt.Printf("%#v\n", result) -} - -func ExampleString_aSN1() { - // This is an example of parsing ASN.1 data that looks like: - // Foo ::= SEQUENCE { - // version [6] INTEGER DEFAULT 0 - // data OCTET STRING - // } - - input := cryptobyte.String([]byte{0x30, 12, 0xa6, 3, 2, 1, 2, 4, 5, 'h', 'e', 'l', 'l', 'o'}) - - var ( - version int64 - data, inner, versionBytes cryptobyte.String - haveVersion bool - ) - if !input.ReadASN1(&inner, asn1.SEQUENCE) || - !input.Empty() || - !inner.ReadOptionalASN1(&versionBytes, &haveVersion, asn1.Tag(6).Constructed().ContextSpecific()) || - (haveVersion && !versionBytes.ReadASN1Integer(&version)) || - (haveVersion && !versionBytes.Empty()) || - !inner.ReadASN1(&data, asn1.OCTET_STRING) || - !inner.Empty() { - panic("bad format") - } - - // Output: haveVersion: true, version: 2, data: hello - fmt.Printf("haveVersion: %t, version: %d, data: %s\n", haveVersion, version, string(data)) -} - -func ExampleBuilder_aSN1() { - // This is an example of building ASN.1 data that looks like: - // Foo ::= SEQUENCE { - // version [6] INTEGER DEFAULT 0 - // data OCTET STRING - // } - - version := int64(2) - data := []byte("hello") - const defaultVersion = 0 - - var b cryptobyte.Builder - b.AddASN1(asn1.SEQUENCE, func(b *cryptobyte.Builder) { - if version != defaultVersion { - b.AddASN1(asn1.Tag(6).Constructed().ContextSpecific(), func(b *cryptobyte.Builder) { - b.AddASN1Int64(version) - }) - } - b.AddASN1OctetString(data) - }) - - result, err := b.Bytes() - if err != nil { - panic(err) - } - - // Output: 300ca603020102040568656c6c6f - fmt.Printf("%x\n", result) -} - -func ExampleBuilder_lengthPrefixed() { - // This is an example of building length-prefixed data (as found in, - // for example, TLS). Imagine a 16-bit prefixed series of 8-bit - // prefixed strings. - input := []string{"hello", "world"} - - var b cryptobyte.Builder - b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { - for _, value := range input { - b.AddUint8LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes([]byte(value)) - }) - } - }) - - result, err := b.Bytes() - if err != nil { - panic(err) - } - - // Output: 000c0568656c6c6f05776f726c64 - fmt.Printf("%x\n", result) -} - -func ExampleBuilder_lengthPrefixOverflow() { - // Writing more data that can be expressed by the length prefix results - // in an error from Bytes(). - - tooLarge := make([]byte, 256) - - var b cryptobyte.Builder - b.AddUint8LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes(tooLarge) - }) - - result, err := b.Bytes() - fmt.Printf("len=%d err=%s\n", len(result), err) - - // Output: len=0 err=cryptobyte: pending child length 256 exceeds 1-byte length prefix -} - -func ExampleBuilderContinuation_errorHandling() { - var b cryptobyte.Builder - // Continuations that panic with a BuildError will cause Bytes to - // return the inner error. - b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddUint32(0) - panic(cryptobyte.BuildError{Err: errors.New("example error")}) - }) - - result, err := b.Bytes() - fmt.Printf("len=%d err=%s\n", len(result), err) - - // Output: len=0 err=example error -} diff --git a/vendor/golang.org/x/crypto/ocsp/ocsp_test.go b/vendor/golang.org/x/crypto/ocsp/ocsp_test.go deleted file mode 100644 index 70b1976..0000000 --- a/vendor/golang.org/x/crypto/ocsp/ocsp_test.go +++ /dev/null @@ -1,875 +0,0 @@ -// Copyright 2013 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 go1.7 - -package ocsp - -import ( - "bytes" - "crypto" - "crypto/sha1" - "crypto/x509" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/hex" - "math/big" - "reflect" - "testing" - "time" -) - -func TestOCSPDecode(t *testing.T) { - responseBytes, _ := hex.DecodeString(ocspResponseHex) - resp, err := ParseResponse(responseBytes, nil) - if err != nil { - t.Fatal(err) - } - - responderCert, _ := hex.DecodeString(startComResponderCertHex) - responder, err := x509.ParseCertificate(responderCert) - if err != nil { - t.Fatal(err) - } - - expected := Response{ - Status: Good, - SerialNumber: big.NewInt(0x1d0fa), - RevocationReason: Unspecified, - ThisUpdate: time.Date(2010, 7, 7, 15, 1, 5, 0, time.UTC), - NextUpdate: time.Date(2010, 7, 7, 18, 35, 17, 0, time.UTC), - RawResponderName: responder.RawSubject, - } - - if !reflect.DeepEqual(resp.ThisUpdate, expected.ThisUpdate) { - t.Errorf("resp.ThisUpdate: got %v, want %v", resp.ThisUpdate, expected.ThisUpdate) - } - - if !reflect.DeepEqual(resp.NextUpdate, expected.NextUpdate) { - t.Errorf("resp.NextUpdate: got %v, want %v", resp.NextUpdate, expected.NextUpdate) - } - - if resp.Status != expected.Status { - t.Errorf("resp.Status: got %d, want %d", resp.Status, expected.Status) - } - - if resp.SerialNumber.Cmp(expected.SerialNumber) != 0 { - t.Errorf("resp.SerialNumber: got %x, want %x", resp.SerialNumber, expected.SerialNumber) - } - - if resp.RevocationReason != expected.RevocationReason { - t.Errorf("resp.RevocationReason: got %d, want %d", resp.RevocationReason, expected.RevocationReason) - } - - if !bytes.Equal(resp.RawResponderName, expected.RawResponderName) { - t.Errorf("resp.RawResponderName: got %x, want %x", resp.RawResponderName, expected.RawResponderName) - } - - if !bytes.Equal(resp.ResponderKeyHash, expected.ResponderKeyHash) { - t.Errorf("resp.ResponderKeyHash: got %x, want %x", resp.ResponderKeyHash, expected.ResponderKeyHash) - } -} - -func TestOCSPDecodeWithoutCert(t *testing.T) { - responseBytes, _ := hex.DecodeString(ocspResponseWithoutCertHex) - _, err := ParseResponse(responseBytes, nil) - if err != nil { - t.Error(err) - } -} - -func TestOCSPDecodeWithExtensions(t *testing.T) { - responseBytes, _ := hex.DecodeString(ocspResponseWithCriticalExtensionHex) - _, err := ParseResponse(responseBytes, nil) - if err == nil { - t.Error(err) - } - - responseBytes, _ = hex.DecodeString(ocspResponseWithExtensionHex) - response, err := ParseResponse(responseBytes, nil) - if err != nil { - t.Fatal(err) - } - - if len(response.Extensions) != 1 { - t.Errorf("len(response.Extensions): got %v, want %v", len(response.Extensions), 1) - } - - extensionBytes := response.Extensions[0].Value - expectedBytes, _ := hex.DecodeString(ocspExtensionValueHex) - if !bytes.Equal(extensionBytes, expectedBytes) { - t.Errorf("response.Extensions[0]: got %x, want %x", extensionBytes, expectedBytes) - } -} - -func TestOCSPSignature(t *testing.T) { - issuerCert, _ := hex.DecodeString(startComHex) - issuer, err := x509.ParseCertificate(issuerCert) - if err != nil { - t.Fatal(err) - } - - response, _ := hex.DecodeString(ocspResponseHex) - if _, err := ParseResponse(response, issuer); err != nil { - t.Error(err) - } -} - -func TestOCSPRequest(t *testing.T) { - leafCert, _ := hex.DecodeString(leafCertHex) - cert, err := x509.ParseCertificate(leafCert) - if err != nil { - t.Fatal(err) - } - - issuerCert, _ := hex.DecodeString(issuerCertHex) - issuer, err := x509.ParseCertificate(issuerCert) - if err != nil { - t.Fatal(err) - } - - request, err := CreateRequest(cert, issuer, nil) - if err != nil { - t.Fatal(err) - } - - expectedBytes, _ := hex.DecodeString(ocspRequestHex) - if !bytes.Equal(request, expectedBytes) { - t.Errorf("request: got %x, wanted %x", request, expectedBytes) - } - - decodedRequest, err := ParseRequest(expectedBytes) - if err != nil { - t.Fatal(err) - } - - if decodedRequest.HashAlgorithm != crypto.SHA1 { - t.Errorf("request.HashAlgorithm: got %v, want %v", decodedRequest.HashAlgorithm, crypto.SHA1) - } - - var publicKeyInfo struct { - Algorithm pkix.AlgorithmIdentifier - PublicKey asn1.BitString - } - _, err = asn1.Unmarshal(issuer.RawSubjectPublicKeyInfo, &publicKeyInfo) - if err != nil { - t.Fatal(err) - } - - h := sha1.New() - h.Write(publicKeyInfo.PublicKey.RightAlign()) - issuerKeyHash := h.Sum(nil) - - h.Reset() - h.Write(issuer.RawSubject) - issuerNameHash := h.Sum(nil) - - if got := decodedRequest.IssuerKeyHash; !bytes.Equal(got, issuerKeyHash) { - t.Errorf("request.IssuerKeyHash: got %x, want %x", got, issuerKeyHash) - } - - if got := decodedRequest.IssuerNameHash; !bytes.Equal(got, issuerNameHash) { - t.Errorf("request.IssuerKeyHash: got %x, want %x", got, issuerNameHash) - } - - if got := decodedRequest.SerialNumber; got.Cmp(cert.SerialNumber) != 0 { - t.Errorf("request.SerialNumber: got %x, want %x", got, cert.SerialNumber) - } - - marshaledRequest, err := decodedRequest.Marshal() - if err != nil { - t.Fatal(err) - } - - if bytes.Compare(expectedBytes, marshaledRequest) != 0 { - t.Errorf( - "Marshaled request doesn't match expected: wanted %x, got %x", - expectedBytes, - marshaledRequest, - ) - } -} - -func TestOCSPResponse(t *testing.T) { - leafCert, _ := hex.DecodeString(leafCertHex) - leaf, err := x509.ParseCertificate(leafCert) - if err != nil { - t.Fatal(err) - } - - issuerCert, _ := hex.DecodeString(issuerCertHex) - issuer, err := x509.ParseCertificate(issuerCert) - if err != nil { - t.Fatal(err) - } - - responderCert, _ := hex.DecodeString(responderCertHex) - responder, err := x509.ParseCertificate(responderCert) - if err != nil { - t.Fatal(err) - } - - responderPrivateKeyDER, _ := hex.DecodeString(responderPrivateKeyHex) - responderPrivateKey, err := x509.ParsePKCS1PrivateKey(responderPrivateKeyDER) - if err != nil { - t.Fatal(err) - } - - extensionBytes, _ := hex.DecodeString(ocspExtensionValueHex) - extensions := []pkix.Extension{ - { - Id: ocspExtensionOID, - Critical: false, - Value: extensionBytes, - }, - } - - thisUpdate := time.Date(2010, 7, 7, 15, 1, 5, 0, time.UTC) - nextUpdate := time.Date(2010, 7, 7, 18, 35, 17, 0, time.UTC) - template := Response{ - Status: Revoked, - SerialNumber: leaf.SerialNumber, - ThisUpdate: thisUpdate, - NextUpdate: nextUpdate, - RevokedAt: thisUpdate, - RevocationReason: KeyCompromise, - Certificate: responder, - ExtraExtensions: extensions, - } - - template.IssuerHash = crypto.MD5 - _, err = CreateResponse(issuer, responder, template, responderPrivateKey) - if err == nil { - t.Fatal("CreateResponse didn't fail with non-valid template.IssuerHash value crypto.MD5") - } - - testCases := []struct { - name string - issuerHash crypto.Hash - }{ - {"Zero value", 0}, - {"crypto.SHA1", crypto.SHA1}, - {"crypto.SHA256", crypto.SHA256}, - {"crypto.SHA384", crypto.SHA384}, - {"crypto.SHA512", crypto.SHA512}, - } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - template.IssuerHash = tc.issuerHash - responseBytes, err := CreateResponse(issuer, responder, template, responderPrivateKey) - if err != nil { - t.Fatalf("CreateResponse failed: %s", err) - } - - resp, err := ParseResponse(responseBytes, nil) - if err != nil { - t.Fatalf("ParseResponse failed: %s", err) - } - - if !reflect.DeepEqual(resp.ThisUpdate, template.ThisUpdate) { - t.Errorf("resp.ThisUpdate: got %v, want %v", resp.ThisUpdate, template.ThisUpdate) - } - - if !reflect.DeepEqual(resp.NextUpdate, template.NextUpdate) { - t.Errorf("resp.NextUpdate: got %v, want %v", resp.NextUpdate, template.NextUpdate) - } - - if !reflect.DeepEqual(resp.RevokedAt, template.RevokedAt) { - t.Errorf("resp.RevokedAt: got %v, want %v", resp.RevokedAt, template.RevokedAt) - } - - if !reflect.DeepEqual(resp.Extensions, template.ExtraExtensions) { - t.Errorf("resp.Extensions: got %v, want %v", resp.Extensions, template.ExtraExtensions) - } - - delay := time.Since(resp.ProducedAt) - if delay < -time.Hour || delay > time.Hour { - t.Errorf("resp.ProducedAt: got %s, want close to current time (%s)", resp.ProducedAt, time.Now()) - } - - if resp.Status != template.Status { - t.Errorf("resp.Status: got %d, want %d", resp.Status, template.Status) - } - - if resp.SerialNumber.Cmp(template.SerialNumber) != 0 { - t.Errorf("resp.SerialNumber: got %x, want %x", resp.SerialNumber, template.SerialNumber) - } - - if resp.RevocationReason != template.RevocationReason { - t.Errorf("resp.RevocationReason: got %d, want %d", resp.RevocationReason, template.RevocationReason) - } - - expectedHash := tc.issuerHash - if tc.issuerHash == 0 { - expectedHash = crypto.SHA1 - } - - if resp.IssuerHash != expectedHash { - t.Errorf("resp.IssuerHash: got %d, want %d", resp.IssuerHash, expectedHash) - } - }) - } -} - -func TestErrorResponse(t *testing.T) { - responseBytes, _ := hex.DecodeString(errorResponseHex) - _, err := ParseResponse(responseBytes, nil) - - respErr, ok := err.(ResponseError) - if !ok { - t.Fatalf("expected ResponseError from ParseResponse but got %#v", err) - } - if respErr.Status != Malformed { - t.Fatalf("expected Malformed status from ParseResponse but got %d", respErr.Status) - } -} - -func TestOCSPDecodeMultiResponse(t *testing.T) { - inclCert, _ := hex.DecodeString(ocspMultiResponseCertHex) - cert, err := x509.ParseCertificate(inclCert) - if err != nil { - t.Fatal(err) - } - - responseBytes, _ := hex.DecodeString(ocspMultiResponseHex) - resp, err := ParseResponseForCert(responseBytes, cert, nil) - if err != nil { - t.Fatal(err) - } - - if resp.SerialNumber.Cmp(cert.SerialNumber) != 0 { - t.Errorf("resp.SerialNumber: got %x, want %x", resp.SerialNumber, cert.SerialNumber) - } -} - -func TestOCSPDecodeMultiResponseWithoutMatchingCert(t *testing.T) { - wrongCert, _ := hex.DecodeString(startComHex) - cert, err := x509.ParseCertificate(wrongCert) - if err != nil { - t.Fatal(err) - } - - responseBytes, _ := hex.DecodeString(ocspMultiResponseHex) - _, err = ParseResponseForCert(responseBytes, cert, nil) - want := ParseError("no response matching the supplied certificate") - if err != want { - t.Errorf("err: got %q, want %q", err, want) - } -} - -// This OCSP response was taken from Thawte's public OCSP responder. -// To recreate: -// $ openssl s_client -tls1 -showcerts -servername www.google.com -connect www.google.com:443 -// Copy and paste the first certificate into /tmp/cert.crt and the second into -// /tmp/intermediate.crt -// $ openssl ocsp -issuer /tmp/intermediate.crt -cert /tmp/cert.crt -url http://ocsp.thawte.com -resp_text -respout /tmp/ocsp.der -// Then hex encode the result: -// $ python -c 'print file("/tmp/ocsp.der", "r").read().encode("hex")' - -const ocspResponseHex = "308206bc0a0100a08206b5308206b106092b0601050507300101048206a23082069e3081" + - "c9a14e304c310b300906035504061302494c31163014060355040a130d5374617274436f" + - "6d204c74642e312530230603550403131c5374617274436f6d20436c6173732031204f43" + - "5350205369676e6572180f32303130303730373137333531375a30663064303c30090605" + - "2b0e03021a050004146568874f40750f016a3475625e1f5c93e5a26d580414eb4234d098" + - "b0ab9ff41b6b08f7cc642eef0e2c45020301d0fa8000180f323031303037303731353031" + - "30355aa011180f32303130303730373138333531375a300d06092a864886f70d01010505" + - "000382010100ab557ff070d1d7cebbb5f0ec91a15c3fed22eb2e1b8244f1b84545f013a4" + - "fb46214c5e3fbfbebb8a56acc2b9db19f68fd3c3201046b3824d5ba689f99864328710cb" + - "467195eb37d84f539e49f859316b32964dc3e47e36814ce94d6c56dd02733b1d0802f7ff" + - "4eebdbbd2927dcf580f16cbc290f91e81b53cb365e7223f1d6e20a88ea064104875e0145" + - "672b20fc14829d51ca122f5f5d77d3ad6c83889c55c7dc43680ba2fe3cef8b05dbcabdc0" + - "d3e09aaf9725597f8c858c2fa38c0d6aed2e6318194420dd1a1137445d13e1c97ab47896" + - "17a4e08925f46f867b72e3a4dc1f08cb870b2b0717f7207faa0ac512e628a029aba7457a" + - "e63dcf3281e2162d9349a08204ba308204b6308204b23082039aa003020102020101300d" + - "06092a864886f70d010105050030818c310b300906035504061302494c31163014060355" + - "040a130d5374617274436f6d204c74642e312b3029060355040b13225365637572652044" + - "69676974616c204365727469666963617465205369676e696e6731383036060355040313" + - "2f5374617274436f6d20436c6173732031205072696d61727920496e7465726d65646961" + - "746520536572766572204341301e170d3037313032353030323330365a170d3132313032" + - "333030323330365a304c310b300906035504061302494c31163014060355040a130d5374" + - "617274436f6d204c74642e312530230603550403131c5374617274436f6d20436c617373" + - "2031204f435350205369676e657230820122300d06092a864886f70d0101010500038201" + - "0f003082010a0282010100b9561b4c45318717178084e96e178df2255e18ed8d8ecc7c2b" + - "7b51a6c1c2e6bf0aa3603066f132fe10ae97b50e99fa24b83fc53dd2777496387d14e1c3" + - "a9b6a4933e2ac12413d085570a95b8147414a0bc007c7bcf222446ef7f1a156d7ea1c577" + - "fc5f0facdfd42eb0f5974990cb2f5cefebceef4d1bdc7ae5c1075c5a99a93171f2b0845b" + - "4ff0864e973fcfe32f9d7511ff87a3e943410c90a4493a306b6944359340a9ca96f02b66" + - "ce67f028df2980a6aaee8d5d5d452b8b0eb93f923cc1e23fcccbdbe7ffcb114d08fa7a6a" + - "3c404f825d1a0e715935cf623a8c7b59670014ed0622f6089a9447a7a19010f7fe58f841" + - "29a2765ea367824d1c3bb2fda308530203010001a382015c30820158300c0603551d1301" + - "01ff04023000300b0603551d0f0404030203a8301e0603551d250417301506082b060105" + - "0507030906092b0601050507300105301d0603551d0e0416041445e0a36695414c5dd449" + - "bc00e33cdcdbd2343e173081a80603551d230481a030819d8014eb4234d098b0ab9ff41b" + - "6b08f7cc642eef0e2c45a18181a47f307d310b300906035504061302494c311630140603" + - "55040a130d5374617274436f6d204c74642e312b3029060355040b132253656375726520" + - "4469676974616c204365727469666963617465205369676e696e67312930270603550403" + - "13205374617274436f6d2043657274696669636174696f6e20417574686f726974798201" + - "0a30230603551d12041c301a8618687474703a2f2f7777772e737461727473736c2e636f" + - "6d2f302c06096086480186f842010d041f161d5374617274436f6d205265766f63617469" + - "6f6e20417574686f72697479300d06092a864886f70d01010505000382010100182d2215" + - "8f0fc0291324fa8574c49bb8ff2835085adcbf7b7fc4191c397ab6951328253fffe1e5ec" + - "2a7da0d50fca1a404e6968481366939e666c0a6209073eca57973e2fefa9ed1718e8176f" + - "1d85527ff522c08db702e3b2b180f1cbff05d98128252cf0f450f7dd2772f4188047f19d" + - "c85317366f94bc52d60f453a550af58e308aaab00ced33040b62bf37f5b1ab2a4f7f0f80" + - "f763bf4d707bc8841d7ad9385ee2a4244469260b6f2bf085977af9074796048ecc2f9d48" + - "a1d24ce16e41a9941568fec5b42771e118f16c106a54ccc339a4b02166445a167902e75e" + - "6d8620b0825dcd18a069b90fd851d10fa8effd409deec02860d26d8d833f304b10669b42" - -const startComResponderCertHex = "308204b23082039aa003020102020101300d06092a864886f70d010105050030818c310b" + - "300906035504061302494c31163014060355040a130d5374617274436f6d204c74642e31" + - "2b3029060355040b1322536563757265204469676974616c204365727469666963617465" + - "205369676e696e67313830360603550403132f5374617274436f6d20436c617373203120" + - "5072696d61727920496e7465726d65646961746520536572766572204341301e170d3037" + - "313032353030323330365a170d3132313032333030323330365a304c310b300906035504" + - "061302494c31163014060355040a130d5374617274436f6d204c74642e31253023060355" + - "0403131c5374617274436f6d20436c6173732031204f435350205369676e657230820122" + - "300d06092a864886f70d01010105000382010f003082010a0282010100b9561b4c453187" + - "17178084e96e178df2255e18ed8d8ecc7c2b7b51a6c1c2e6bf0aa3603066f132fe10ae97" + - "b50e99fa24b83fc53dd2777496387d14e1c3a9b6a4933e2ac12413d085570a95b8147414" + - "a0bc007c7bcf222446ef7f1a156d7ea1c577fc5f0facdfd42eb0f5974990cb2f5cefebce" + - "ef4d1bdc7ae5c1075c5a99a93171f2b0845b4ff0864e973fcfe32f9d7511ff87a3e94341" + - "0c90a4493a306b6944359340a9ca96f02b66ce67f028df2980a6aaee8d5d5d452b8b0eb9" + - "3f923cc1e23fcccbdbe7ffcb114d08fa7a6a3c404f825d1a0e715935cf623a8c7b596700" + - "14ed0622f6089a9447a7a19010f7fe58f84129a2765ea367824d1c3bb2fda30853020301" + - "0001a382015c30820158300c0603551d130101ff04023000300b0603551d0f0404030203" + - "a8301e0603551d250417301506082b0601050507030906092b0601050507300105301d06" + - "03551d0e0416041445e0a36695414c5dd449bc00e33cdcdbd2343e173081a80603551d23" + - "0481a030819d8014eb4234d098b0ab9ff41b6b08f7cc642eef0e2c45a18181a47f307d31" + - "0b300906035504061302494c31163014060355040a130d5374617274436f6d204c74642e" + - "312b3029060355040b1322536563757265204469676974616c2043657274696669636174" + - "65205369676e696e6731293027060355040313205374617274436f6d2043657274696669" + - "636174696f6e20417574686f7269747982010a30230603551d12041c301a861868747470" + - "3a2f2f7777772e737461727473736c2e636f6d2f302c06096086480186f842010d041f16" + - "1d5374617274436f6d205265766f636174696f6e20417574686f72697479300d06092a86" + - "4886f70d01010505000382010100182d22158f0fc0291324fa8574c49bb8ff2835085adc" + - "bf7b7fc4191c397ab6951328253fffe1e5ec2a7da0d50fca1a404e6968481366939e666c" + - "0a6209073eca57973e2fefa9ed1718e8176f1d85527ff522c08db702e3b2b180f1cbff05" + - "d98128252cf0f450f7dd2772f4188047f19dc85317366f94bc52d60f453a550af58e308a" + - "aab00ced33040b62bf37f5b1ab2a4f7f0f80f763bf4d707bc8841d7ad9385ee2a4244469" + - "260b6f2bf085977af9074796048ecc2f9d48a1d24ce16e41a9941568fec5b42771e118f1" + - "6c106a54ccc339a4b02166445a167902e75e6d8620b0825dcd18a069b90fd851d10fa8ef" + - "fd409deec02860d26d8d833f304b10669b42" - -const startComHex = "308206343082041ca003020102020118300d06092a864886f70d0101050500307d310b30" + - "0906035504061302494c31163014060355040a130d5374617274436f6d204c74642e312b" + - "3029060355040b1322536563757265204469676974616c20436572746966696361746520" + - "5369676e696e6731293027060355040313205374617274436f6d20436572746966696361" + - "74696f6e20417574686f72697479301e170d3037313032343230353431375a170d313731" + - "3032343230353431375a30818c310b300906035504061302494c31163014060355040a13" + - "0d5374617274436f6d204c74642e312b3029060355040b13225365637572652044696769" + - "74616c204365727469666963617465205369676e696e67313830360603550403132f5374" + - "617274436f6d20436c6173732031205072696d61727920496e7465726d65646961746520" + - "53657276657220434130820122300d06092a864886f70d01010105000382010f00308201" + - "0a0282010100b689c6acef09527807ac9263d0f44418188480561f91aee187fa3250b4d3" + - "4706f0e6075f700e10f71dc0ce103634855a0f92ac83c6ac58523fba38e8fce7a724e240" + - "a60876c0926e9e2a6d4d3f6e61200adb59ded27d63b33e46fefa215118d7cd30a6ed076e" + - "3b7087b4f9faebee823c056f92f7a4dc0a301e9373fe07cad75f809d225852ae06da8b87" + - "2369b0e42ad8ea83d2bdf371db705a280faf5a387045123f304dcd3baf17e50fcba0a95d" + - "48aab16150cb34cd3c5cc30be810c08c9bf0030362feb26c3e720eee1c432ac9480e5739" + - "c43121c810c12c87fe5495521f523c31129b7fe7c0a0a559d5e28f3ef0d5a8e1d77031a9" + - "c4b3cfaf6d532f06f4a70203010001a38201ad308201a9300f0603551d130101ff040530" + - "030101ff300e0603551d0f0101ff040403020106301d0603551d0e04160414eb4234d098" + - "b0ab9ff41b6b08f7cc642eef0e2c45301f0603551d230418301680144e0bef1aa4405ba5" + - "17698730ca346843d041aef2306606082b06010505070101045a3058302706082b060105" + - "05073001861b687474703a2f2f6f6373702e737461727473736c2e636f6d2f6361302d06" + - "082b060105050730028621687474703a2f2f7777772e737461727473736c2e636f6d2f73" + - "667363612e637274305b0603551d1f045430523027a025a0238621687474703a2f2f7777" + - "772e737461727473736c2e636f6d2f73667363612e63726c3027a025a023862168747470" + - "3a2f2f63726c2e737461727473736c2e636f6d2f73667363612e63726c3081800603551d" + - "20047930773075060b2b0601040181b5370102013066302e06082b060105050702011622" + - "687474703a2f2f7777772e737461727473736c2e636f6d2f706f6c6963792e7064663034" + - "06082b060105050702011628687474703a2f2f7777772e737461727473736c2e636f6d2f" + - "696e7465726d6564696174652e706466300d06092a864886f70d01010505000382020100" + - "2109493ea5886ee00b8b48da314d8ff75657a2e1d36257e9b556f38545753be5501f048b" + - "e6a05a3ee700ae85d0fbff200364cbad02e1c69172f8a34dd6dee8cc3fa18aa2e37c37a7" + - "c64f8f35d6f4d66e067bdd21d9cf56ffcb302249fe8904f385e5aaf1e71fe875904dddf9" + - "46f74234f745580c110d84b0c6da5d3ef9019ee7e1da5595be741c7bfc4d144fac7e5547" + - "7d7bf4a50d491e95e8f712c1ccff76a62547d0f37535be97b75816ebaa5c786fec5330af" + - "ea044dcca902e3f0b60412f630b1113d904e5664d7dc3c435f7339ef4baf87ebf6fe6888" + - "4472ead207c669b0c1a18bef1749d761b145485f3b2021e95bb2ccf4d7e931f50b15613b" + - "7a94e3ebd9bc7f94ae6ae3626296a8647cb887f399327e92a252bebbf865cfc9f230fc8b" + - "c1c2a696d75f89e15c3480f58f47072fb491bfb1a27e5f4b5ad05b9f248605515a690365" + - "434971c5e06f94346bf61bd8a9b04c7e53eb8f48dfca33b548fa364a1a53a6330cd089cd" + - "4915cd89313c90c072d7654b52358a461144b93d8e2865a63e799e5c084429adb035112e" + - "214eb8d2e7103e5d8483b3c3c2e4d2c6fd094b7409ddf1b3d3193e800da20b19f038e7c5" + - "c2afe223db61e29d5c6e2089492e236ab262c145b49faf8ba7f1223bf87de290d07a19fb" + - "4a4ce3d27d5f4a8303ed27d6239e6b8db459a2d9ef6c8229dd75193c3f4c108defbb7527" + - "d2ae83a7a8ce5ba7" - -const ocspResponseWithoutCertHex = "308201d40a0100a08201cd308201c906092b0601050507300101048201ba3082" + - "01b630819fa2160414884451ff502a695e2d88f421bad90cf2cecbea7c180f3230313330" + - "3631383037323434335a30743072304a300906052b0e03021a0500041448b60d38238df8" + - "456e4ee5843ea394111802979f0414884451ff502a695e2d88f421bad90cf2cecbea7c02" + - "1100f78b13b946fc9635d8ab49de9d2148218000180f3230313330363138303732343433" + - "5aa011180f32303133303632323037323434335a300d06092a864886f70d010105050003" + - "82010100103e18b3d297a5e7a6c07a4fc52ac46a15c0eba96f3be17f0ffe84de5b8c8e05" + - "5a8f577586a849dc4abd6440eb6fedde4622451e2823c1cbf3558b4e8184959c9fe96eff" + - "8bc5f95866c58c6d087519faabfdae37e11d9874f1bc0db292208f645dd848185e4dd38b" + - "6a8547dfa7b74d514a8470015719064d35476b95bebb03d4d2845c5ca15202d2784878f2" + - "0f904c24f09736f044609e9c271381713400e563023d212db422236440c6f377bbf24b2b" + - "9e7dec8698e36a8df68b7592ad3489fb2937afb90eb85d2aa96b81c94c25057dbd4759d9" + - "20a1a65c7f0b6427a224b3c98edd96b9b61f706099951188b0289555ad30a216fb774651" + - "5a35fca2e054dfa8" - -// PKIX nonce extension -var ocspExtensionOID = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 48, 1, 2} -var ocspExtensionValueHex = "0403000000" - -const ocspResponseWithCriticalExtensionHex = "308204fe0a0100a08204f7308204f306092b0601050507300101048204e4308204e03081" + - "dba003020100a11b3019311730150603550403130e4f43535020526573706f6e64657218" + - "0f32303136303130343137303130305a3081a53081a23049300906052b0e03021a050004" + - "14c0fe0278fc99188891b3f212e9c7e1b21ab7bfc004140dfc1df0a9e0f01ce7f2b21317" + - "7e6f8d157cd4f60210017f77deb3bcbb235d44ccc7dba62e72a116180f32303130303730" + - "373135303130355aa0030a0101180f32303130303730373135303130355aa011180f3230" + - "3130303730373138333531375aa1193017301506092b06010505073001020101ff040504" + - "03000000300d06092a864886f70d01010b0500038201010031c730ca60a7a0d92d8e4010" + - "911b469de95b4d27e89de6537552436237967694f76f701cf6b45c932bd308bca4a8d092" + - "5c604ba94796903091d9e6c000178e72c1f0a24a277dd262835af5d17d3f9d7869606c9f" + - "e7c8e708a41645699895beee38bfa63bb46296683761c5d1d65439b8ab868dc3017c9eeb" + - "b70b82dbf3a31c55b457d48bb9e82b335ed49f445042eaf606b06a3e0639824924c89c63" + - "eccddfe85e6694314138b2536f5e15e07085d0f6e26d4b2f8244bab0d70de07283ac6384" + - "a0501fc3dea7cf0adfd4c7f34871080900e252ddc403e3f0265f2a704af905d3727504ed" + - "28f3214a219d898a022463c78439799ca81c8cbafdbcec34ea937cd6a08202ea308202e6" + - "308202e2308201caa003020102020101300d06092a864886f70d01010b05003019311730" + - "150603550403130e4f43535020526573706f6e646572301e170d31353031333031353530" + - "33335a170d3136303133303135353033335a3019311730150603550403130e4f43535020" + - "526573706f6e64657230820122300d06092a864886f70d01010105000382010f00308201" + - "0a0282010100e8155f2d3e6f2e8d14c62a788bd462f9f844e7a6977c83ef1099f0f6616e" + - "c5265b56f356e62c5400f0b06a2e7945a82752c636df32a895152d6074df1701dc6ccfbc" + - "bec75a70bd2b55ae2be7e6cad3b5fd4cd5b7790ab401a436d3f5f346074ffde8a99d5b72" + - "3350f0a112076614b12ef79c78991b119453445acf2416ab0046b540db14c9fc0f27b898" + - "9ad0f63aa4b8aefc91aa8a72160c36307c60fec78a93d3fddf4259902aa77e7332971c7d" + - "285b6a04f648993c6922a3e9da9adf5f81508c3228791843e5d49f24db2f1290bafd97e6" + - "55b1049a199f652cd603c4fafa330c390b0da78fbbc67e8fa021cbd74eb96222b12ace31" + - "a77dcf920334dc94581b0203010001a3353033300e0603551d0f0101ff04040302078030" + - "130603551d25040c300a06082b06010505070309300c0603551d130101ff04023000300d" + - "06092a864886f70d01010b05000382010100718012761b5063e18f0dc44644d8e6ab8612" + - "31c15fd5357805425d82aec1de85bf6d3e30fce205e3e3b8b795bbe52e40a439286d2288" + - "9064f4aeeb150359b9425f1da51b3a5c939018555d13ac42c565a0603786a919328f3267" + - "09dce52c22ad958ecb7873b9771d1148b1c4be2efe80ba868919fc9f68b6090c2f33c156" + - "d67156e42766a50b5d51e79637b7e58af74c2a951b1e642fa7741fec982cc937de37eff5" + - "9e2005d5939bfc031589ca143e6e8ab83f40ee08cc20a6b4a95a318352c28d18528dcaf9" + - "66705de17afa19d6e8ae91ddf33179d16ebb6ac2c69cae8373d408ebf8c55308be6c04d9" + - "3a25439a94299a65a709756c7a3e568be049d5c38839" - -const ocspResponseWithExtensionHex = "308204fb0a0100a08204f4308204f006092b0601050507300101048204e1308204dd3081" + - "d8a003020100a11b3019311730150603550403130e4f43535020526573706f6e64657218" + - "0f32303136303130343136353930305a3081a230819f3049300906052b0e03021a050004" + - "14c0fe0278fc99188891b3f212e9c7e1b21ab7bfc004140dfc1df0a9e0f01ce7f2b21317" + - "7e6f8d157cd4f60210017f77deb3bcbb235d44ccc7dba62e72a116180f32303130303730" + - "373135303130355aa0030a0101180f32303130303730373135303130355aa011180f3230" + - "3130303730373138333531375aa1163014301206092b0601050507300102040504030000" + - "00300d06092a864886f70d01010b05000382010100c09a33e0b2324c852421bb83f85ac9" + - "9113f5426012bd2d2279a8166e9241d18a33c870894250622ffc7ed0c4601b16d624f90b" + - "779265442cdb6868cf40ab304ab4b66e7315ed02cf663b1601d1d4751772b31bc299db23" + - "9aebac78ed6797c06ed815a7a8d18d63cfbb609cafb47ec2e89e37db255216eb09307848" + - "d01be0a3e943653c78212b96ff524b74c9ec456b17cdfb950cc97645c577b2e09ff41dde" + - "b03afb3adaa381cc0f7c1d95663ef22a0f72f2c45613ae8e2b2d1efc96e8463c7d1d8a1d" + - "7e3b35df8fe73a301fc3f804b942b2b3afa337ff105fc1462b7b1c1d75eb4566c8665e59" + - "f80393b0adbf8004ff6c3327ed34f007cb4a3348a7d55e06e3a08202ea308202e6308202" + - "e2308201caa003020102020101300d06092a864886f70d01010b05003019311730150603" + - "550403130e4f43535020526573706f6e646572301e170d3135303133303135353033335a" + - "170d3136303133303135353033335a3019311730150603550403130e4f43535020526573" + - "706f6e64657230820122300d06092a864886f70d01010105000382010f003082010a0282" + - "010100e8155f2d3e6f2e8d14c62a788bd462f9f844e7a6977c83ef1099f0f6616ec5265b" + - "56f356e62c5400f0b06a2e7945a82752c636df32a895152d6074df1701dc6ccfbcbec75a" + - "70bd2b55ae2be7e6cad3b5fd4cd5b7790ab401a436d3f5f346074ffde8a99d5b723350f0" + - "a112076614b12ef79c78991b119453445acf2416ab0046b540db14c9fc0f27b8989ad0f6" + - "3aa4b8aefc91aa8a72160c36307c60fec78a93d3fddf4259902aa77e7332971c7d285b6a" + - "04f648993c6922a3e9da9adf5f81508c3228791843e5d49f24db2f1290bafd97e655b104" + - "9a199f652cd603c4fafa330c390b0da78fbbc67e8fa021cbd74eb96222b12ace31a77dcf" + - "920334dc94581b0203010001a3353033300e0603551d0f0101ff04040302078030130603" + - "551d25040c300a06082b06010505070309300c0603551d130101ff04023000300d06092a" + - "864886f70d01010b05000382010100718012761b5063e18f0dc44644d8e6ab861231c15f" + - "d5357805425d82aec1de85bf6d3e30fce205e3e3b8b795bbe52e40a439286d22889064f4" + - "aeeb150359b9425f1da51b3a5c939018555d13ac42c565a0603786a919328f326709dce5" + - "2c22ad958ecb7873b9771d1148b1c4be2efe80ba868919fc9f68b6090c2f33c156d67156" + - "e42766a50b5d51e79637b7e58af74c2a951b1e642fa7741fec982cc937de37eff59e2005" + - "d5939bfc031589ca143e6e8ab83f40ee08cc20a6b4a95a318352c28d18528dcaf966705d" + - "e17afa19d6e8ae91ddf33179d16ebb6ac2c69cae8373d408ebf8c55308be6c04d93a2543" + - "9a94299a65a709756c7a3e568be049d5c38839" - -const ocspMultiResponseHex = "30820ee60a0100a0820edf30820edb06092b060105050730010104820ecc30820ec83082" + - "0839a216041445ac2ecd75f53f1cf6e4c51d3de0047ad0aa7465180f3230313530363032" + - "3130303033305a3082080c3065303d300906052b0e03021a05000414f7452a0080601527" + - "72e4a135e76e9e52fde0f1580414edd8f2ee977252853a330b297a18f5c993853b3f0204" + - "5456656a8000180f32303135303630323039303230375aa011180f323031353036303331" + - "30303033305a3065303d300906052b0e03021a05000414f7452a008060152772e4a135e7" + - "6e9e52fde0f1580414edd8f2ee977252853a330b297a18f5c993853b3f02045456656b80" + - "00180f32303135303630323039303230375aa011180f3230313530363033313030303330" + - "5a3065303d300906052b0e03021a05000414f7452a008060152772e4a135e76e9e52fde0" + - "f1580414edd8f2ee977252853a330b297a18f5c993853b3f02045456656c8000180f3230" + - "3135303630323039303230375aa011180f32303135303630333130303033305a3065303d" + - "300906052b0e03021a05000414f7452a008060152772e4a135e76e9e52fde0f1580414ed" + - "d8f2ee977252853a330b297a18f5c993853b3f02045456656d8000180f32303135303630" + - "323039303230375aa011180f32303135303630333130303033305a3065303d300906052b" + - "0e03021a05000414f7452a008060152772e4a135e76e9e52fde0f1580414edd8f2ee9772" + - "52853a330b297a18f5c993853b3f02045456656e8000180f323031353036303230393032" + - "30375aa011180f32303135303630333130303033305a3065303d300906052b0e03021a05" + - "000414f7452a008060152772e4a135e76e9e52fde0f1580414edd8f2ee977252853a330b" + - "297a18f5c993853b3f02045456656f8000180f32303135303630323039303230375aa011" + - "180f32303135303630333130303033305a3065303d300906052b0e03021a05000414f745" + - "2a008060152772e4a135e76e9e52fde0f1580414edd8f2ee977252853a330b297a18f5c9" + - "93853b3f0204545665708000180f32303135303630323039303230375aa011180f323031" + - "35303630333130303033305a3065303d300906052b0e03021a05000414f7452a00806015" + - "2772e4a135e76e9e52fde0f1580414edd8f2ee977252853a330b297a18f5c993853b3f02" + - "04545665718000180f32303135303630323039303230375aa011180f3230313530363033" + - "3130303033305a3065303d300906052b0e03021a05000414f7452a008060152772e4a135" + - "e76e9e52fde0f1580414edd8f2ee977252853a330b297a18f5c993853b3f020454566572" + - "8000180f32303135303630323039303230375aa011180f32303135303630333130303033" + - "305a3065303d300906052b0e03021a05000414f7452a008060152772e4a135e76e9e52fd" + - "e0f1580414edd8f2ee977252853a330b297a18f5c993853b3f0204545665738000180f32" + - "303135303630323039303230375aa011180f32303135303630333130303033305a306530" + - "3d300906052b0e03021a05000414f7452a008060152772e4a135e76e9e52fde0f1580414" + - "edd8f2ee977252853a330b297a18f5c993853b3f0204545665748000180f323031353036" + - "30323039303230375aa011180f32303135303630333130303033305a3065303d30090605" + - "2b0e03021a05000414f7452a008060152772e4a135e76e9e52fde0f1580414edd8f2ee97" + - "7252853a330b297a18f5c993853b3f0204545665758000180f3230313530363032303930" + - "3230375aa011180f32303135303630333130303033305a3065303d300906052b0e03021a" + - "05000414f7452a008060152772e4a135e76e9e52fde0f1580414edd8f2ee977252853a33" + - "0b297a18f5c993853b3f0204545665768000180f32303135303630323039303230375aa0" + - "11180f32303135303630333130303033305a3065303d300906052b0e03021a05000414f7" + - "452a008060152772e4a135e76e9e52fde0f1580414edd8f2ee977252853a330b297a18f5" + - "c993853b3f0204545665778000180f32303135303630323039303230375aa011180f3230" + - "3135303630333130303033305a3065303d300906052b0e03021a05000414f7452a008060" + - "152772e4a135e76e9e52fde0f1580414edd8f2ee977252853a330b297a18f5c993853b3f" + - "0204545665788000180f32303135303630323039303230375aa011180f32303135303630" + - "333130303033305a3065303d300906052b0e03021a05000414f7452a008060152772e4a1" + - "35e76e9e52fde0f1580414edd8f2ee977252853a330b297a18f5c993853b3f0204545665" + - "798000180f32303135303630323039303230375aa011180f323031353036303331303030" + - "33305a3065303d300906052b0e03021a05000414f7452a008060152772e4a135e76e9e52" + - "fde0f1580414edd8f2ee977252853a330b297a18f5c993853b3f02045456657a8000180f" + - "32303135303630323039303230375aa011180f32303135303630333130303033305a3065" + - "303d300906052b0e03021a05000414f7452a008060152772e4a135e76e9e52fde0f15804" + - "14edd8f2ee977252853a330b297a18f5c993853b3f02045456657b8000180f3230313530" + - "3630323039303230375aa011180f32303135303630333130303033305a3065303d300906" + - "052b0e03021a05000414f7452a008060152772e4a135e76e9e52fde0f1580414edd8f2ee" + - "977252853a330b297a18f5c993853b3f02045456657c8000180f32303135303630323039" + - "303230375aa011180f32303135303630333130303033305a3065303d300906052b0e0302" + - "1a05000414f7452a008060152772e4a135e76e9e52fde0f1580414edd8f2ee977252853a" + - "330b297a18f5c993853b3f02045456657d8000180f32303135303630323039303230375a" + - "a011180f32303135303630333130303033305a300d06092a864886f70d01010505000382" + - "01010016b73b92859979f27d15eb018cf069eed39c3d280213565f3026de11ba15bdb94d" + - "764cf2d0fdd204ef926c588d7b183483c8a2b1995079c7ed04dcefcc650c1965be4b6832" + - "a8839e832f7f60f638425eccdf9bc3a81fbe700fda426ddf4f06c29bee431bbbe81effda" + - "a60b7da5b378f199af2f3c8380be7ba6c21c8e27124f8a4d8989926aea19055700848d33" + - "799e833512945fd75364edbd2dd18b783c1e96e332266b17979a0b88c35b43f47c87c493" + - "19155056ad8dbbae5ff2afad3c0e1c69ed111206ffda49875e8e4efc0926264823bc4423" + - "c8a002f34288c4bc22516f98f54fc609943721f590ddd8d24f989457526b599b0eb75cb5" + - "a80da1ad93a621a08205733082056f3082056b30820453a0030201020204545638c4300d" + - "06092a864886f70d01010b0500308182310b300906035504061302555331183016060355" + - "040a130f552e532e20476f7665726e6d656e7431233021060355040b131a446570617274" + - "6d656e74206f662074686520547265617375727931223020060355040b13194365727469" + - "6669636174696f6e20417574686f7269746965733110300e060355040b13074f43494f20" + - "4341301e170d3135303332303131353531335a170d3135303633303034303030305a3081" + - "98310b300906035504061302555331183016060355040a130f552e532e20476f7665726e" + - "6d656e7431233021060355040b131a4465706172746d656e74206f662074686520547265" + - "617375727931223020060355040b131943657274696669636174696f6e20417574686f72" + - "69746965733110300e060355040b13074f43494f204341311430120603550403130b4f43" + - "5350205369676e657230820122300d06092a864886f70d01010105000382010f00308201" + - "0a0282010100c1b6fe1ba1ad50bb98c855811acbd67fe68057f48b8e08d3800e7f2c51b7" + - "9e20551934971fd92b9c9e6c49453097927cba83a94c0b2fea7124ba5ac442b38e37dba6" + - "7303d4962dd7d92b22a04b0e0e182e9ea67620b1c6ce09ee607c19e0e6e3adae81151db1" + - "2bb7f706149349a292e21c1eb28565b6839df055e1a838a772ff34b5a1452618e2c26042" + - "705d53f0af4b57aae6163f58216af12f3887813fe44b0321827b3a0c52b0e47d0aab94a2" + - "f768ab0ba3901d22f8bb263823090b0e37a7f8856db4b0d165c42f3aa7e94f5f6ce1855e" + - "98dc57adea0ae98ad39f67ecdec00b88685566e9e8d69f6cefb6ddced53015d0d3b862bc" + - "be21f3d72251eefcec730203010001a38201cf308201cb300e0603551d0f0101ff040403" + - "020780306b0603551d2004643062300c060a60864801650302010502300c060a60864801" + - "650302010503300c060a60864801650302010504300c060a60864801650302010507300c" + - "060a60864801650302010508300c060a6086480165030201030d300c060a608648016503" + - "020103113081e506082b060105050701010481d83081d5303006082b0601050507300286" + - "24687474703a2f2f706b692e74726561732e676f762f746f63615f65655f6169612e7037" + - "633081a006082b060105050730028681936c6461703a2f2f6c6461702e74726561732e67" + - "6f762f6f753d4f43494f25323043412c6f753d43657274696669636174696f6e25323041" + - "7574686f7269746965732c6f753d4465706172746d656e742532306f6625323074686525" + - "323054726561737572792c6f3d552e532e253230476f7665726e6d656e742c633d55533f" + - "634143657274696669636174653b62696e61727930130603551d25040c300a06082b0601" + - "0505070309300f06092b060105050730010504020500301f0603551d23041830168014a2" + - "13a8e5c607546c243d4eb72b27a2a7711ab5af301d0603551d0e0416041451f98046818a" + - "e46d953ac90c210ccfaa1a06980c300d06092a864886f70d01010b050003820101003a37" + - "0b301d14ffdeb370883639bec5ae6f572dcbddadd672af16ee2a8303316b14e1fbdca8c2" + - "8f4bad9c7b1410250e149c14e9830ca6f17370a8d13151205d956e28c141cc0500379596" + - "c5b9239fcfa3d2de8f1d4f1a2b1bf2d1851bed1c86012ee8135bdc395cd4496ce69fadd0" + - "3b682b90350ca7b4f458190b7a0ab5c33a04cf1347a77d541877a380a4c94988c5658908" + - "44fdc22637a72b9fa410333e2caf969477f9fe07f50e3681c204fb3bf073b9da01cd8d91" + - "8044c40b1159955af12a3263ab1d34119d7f59bfa6cae88ed058addc4e08250263f8f836" + - "2f5bdffd45636fea7474c60a55c535954477b2f286e1b2535f0dd12c162f1b353c370e08" + - "be67" - -const ocspMultiResponseCertHex = "308207943082067ca003020102020454566573300d06092a864886f70d01010b05003081" + - "82310b300906035504061302555331183016060355040a130f552e532e20476f7665726e" + - "6d656e7431233021060355040b131a4465706172746d656e74206f662074686520547265" + - "617375727931223020060355040b131943657274696669636174696f6e20417574686f72" + - "69746965733110300e060355040b13074f43494f204341301e170d313530343130313535" + - "3733385a170d3138303431303136323733385a30819d310b300906035504061302555331" + - "183016060355040a130f552e532e20476f7665726e6d656e7431233021060355040b131a" + - "4465706172746d656e74206f662074686520547265617375727931253023060355040b13" + - "1c427572656175206f66207468652046697363616c20536572766963653110300e060355" + - "040b130744657669636573311630140603550403130d706b692e74726561732e676f7630" + - "820122300d06092a864886f70d01010105000382010f003082010a0282010100c7273623" + - "8c49c48bf501515a2490ef6e5ae0c06e0ad2aa9a6bb77f3d0370d846b2571581ebf38fd3" + - "1948daad3dec7a4da095f1dcbe9654e65bcf7acdfd4ee802421dad9b90536c721d2bca58" + - "8413e6bfd739a72470560bb7d64f9a09284f90ff8af1d5a3c5c84d0f95a00f9c6d988dd0" + - "d87f1d0d3344580901c955139f54d09de0acdbd3322b758cb0c58881bf04913243401f44" + - "013fd9f6d8348044cc8bb0a71978ad93366b2a4687a5274b2ee07d0fb40225453eb244ed" + - "b20152251ac77c59455260ff07eeceb3cb3c60fb8121cf92afd3daa2a4650e1942ccb555" + - "de10b3d481feb299838ef05d0fd1810b146753472ae80da65dd34da25ca1f89971f10039" + - "0203010001a38203f3308203ef300e0603551d0f0101ff0404030205a030170603551d20" + - "0410300e300c060a60864801650302010503301106096086480186f84201010404030206" + - "4030130603551d25040c300a06082b060105050703013082010806082b06010505070101" + - "0481fb3081f8303006082b060105050730028624687474703a2f2f706b692e7472656173" + - "2e676f762f746f63615f65655f6169612e7037633081a006082b06010505073002868193" + - "6c6461703a2f2f6c6461702e74726561732e676f762f6f753d4f43494f25323043412c6f" + - "753d43657274696669636174696f6e253230417574686f7269746965732c6f753d446570" + - "6172746d656e742532306f6625323074686525323054726561737572792c6f3d552e532e" + - "253230476f7665726e6d656e742c633d55533f634143657274696669636174653b62696e" + - "617279302106082b060105050730018615687474703a2f2f6f6373702e74726561732e67" + - "6f76307b0603551d1104743072811c6373612d7465616d4066697363616c2e7472656173" + - "7572792e676f768210706b692e74726561737572792e676f768210706b692e64696d632e" + - "6468732e676f76820d706b692e74726561732e676f76811f6563622d686f7374696e6740" + - "66697363616c2e74726561737572792e676f76308201890603551d1f048201803082017c" + - "3027a025a0238621687474703a2f2f706b692e74726561732e676f762f4f43494f5f4341" + - "332e63726c3082014fa082014ba0820147a48197308194310b3009060355040613025553" + - "31183016060355040a130f552e532e20476f7665726e6d656e7431233021060355040b13" + - "1a4465706172746d656e74206f662074686520547265617375727931223020060355040b" + - "131943657274696669636174696f6e20417574686f7269746965733110300e060355040b" + - "13074f43494f2043413110300e0603550403130743524c313430398681aa6c6461703a2f" + - "2f6c6461702e74726561732e676f762f636e3d43524c313430392c6f753d4f43494f2532" + - "3043412c6f753d43657274696669636174696f6e253230417574686f7269746965732c6f" + - "753d4465706172746d656e742532306f6625323074686525323054726561737572792c6f" + - "3d552e532e253230476f7665726e6d656e742c633d55533f636572746966696361746552" + - "65766f636174696f6e4c6973743b62696e617279302b0603551d1004243022800f323031" + - "35303431303135353733385a810f32303138303431303136323733385a301f0603551d23" + - "041830168014a213a8e5c607546c243d4eb72b27a2a7711ab5af301d0603551d0e041604" + - "14b0869c12c293914cd460e33ed43e6c5a26e0d68f301906092a864886f67d074100040c" + - "300a1b0456382e31030203a8300d06092a864886f70d01010b050003820101004968d182" + - "8f9efdc147e747bb5dda15536a42a079b32d3d7f87e619b483aeee70b7e26bda393c6028" + - "7c733ecb468fe8b8b11bf809ff76add6b90eb25ad8d3a1052e43ee281e48a3a1ebe7efb5" + - "9e2c4a48765dedeb23f5346242145786cc988c762d230d28dd33bf4c2405d80cbb2cb1d6" + - "4c8f10ba130d50cb174f6ffb9cfc12808297a2cefba385f4fad170f39b51ebd87c12abf9" + - "3c51fc000af90d8aaba78f48923908804a5eb35f617ccf71d201e3708a559e6d16f9f13e" + - "074361eb9007e28d86bb4e0bfa13aad0e9ddd9124e84519de60e2fc6040b18d9fd602b02" + - "684b4c071c3019fc842197d00c120c41654bcbfbc4a096a1c637b79112b81ce1fa3899f9" - -const ocspRequestHex = "3051304f304d304b3049300906052b0e03021a05000414c0fe0278fc99188891b3f212e9" + - "c7e1b21ab7bfc004140dfc1df0a9e0f01ce7f2b213177e6f8d157cd4f60210017f77deb3" + - "bcbb235d44ccc7dba62e72" - -const leafCertHex = "308203c830820331a0030201020210017f77deb3bcbb235d44ccc7dba62e72300d06092a" + - "864886f70d01010505003081ba311f301d060355040a1316566572695369676e20547275" + - "7374204e6574776f726b31173015060355040b130e566572695369676e2c20496e632e31" + - "333031060355040b132a566572695369676e20496e7465726e6174696f6e616c20536572" + - "766572204341202d20436c617373203331493047060355040b13407777772e7665726973" + - "69676e2e636f6d2f43505320496e636f72702e6279205265662e204c494142494c495459" + - "204c54442e286329393720566572695369676e301e170d3132303632313030303030305a" + - "170d3133313233313233353935395a3068310b3009060355040613025553311330110603" + - "550408130a43616c69666f726e6961311230100603550407130950616c6f20416c746f31" + - "173015060355040a130e46616365626f6f6b2c20496e632e311730150603550403140e2a" + - "2e66616365626f6f6b2e636f6d30819f300d06092a864886f70d010101050003818d0030" + - "818902818100ae94b171e2deccc1693e051063240102e0689ae83c39b6b3e74b97d48d7b" + - "23689100b0b496ee62f0e6d356bcf4aa0f50643402f5d1766aa972835a7564723f39bbef" + - "5290ded9bcdbf9d3d55dfad23aa03dc604c54d29cf1d4b3bdbd1a809cfae47b44c7eae17" + - "c5109bee24a9cf4a8d911bb0fd0415ae4c3f430aa12a557e2ae10203010001a382011e30" + - "82011a30090603551d130402300030440603551d20043d303b3039060b6086480186f845" + - "01071703302a302806082b06010505070201161c68747470733a2f2f7777772e76657269" + - "7369676e2e636f6d2f727061303c0603551d1f043530333031a02fa02d862b687474703a" + - "2f2f535652496e746c2d63726c2e766572697369676e2e636f6d2f535652496e746c2e63" + - "726c301d0603551d250416301406082b0601050507030106082b06010505070302300b06" + - "03551d0f0404030205a0303406082b0601050507010104283026302406082b0601050507" + - "30018618687474703a2f2f6f6373702e766572697369676e2e636f6d30270603551d1104" + - "20301e820e2a2e66616365626f6f6b2e636f6d820c66616365626f6f6b2e636f6d300d06" + - "092a864886f70d0101050500038181005b6c2b75f8ed30aa51aad36aba595e555141951f" + - "81a53b447910ac1f76ff78fc2781616b58f3122afc1c87010425e9ed43df1a7ba6498060" + - "67e2688af03db58c7df4ee03309a6afc247ccb134dc33e54c6bc1d5133a532a73273b1d7" + - "9cadc08e7e1a83116d34523340b0305427a21742827c98916698ee7eaf8c3bdd71700817" - -const issuerCertHex = "30820383308202eca003020102021046fcebbab4d02f0f926098233f93078f300d06092a" + - "864886f70d0101050500305f310b300906035504061302555331173015060355040a130e" + - "566572695369676e2c20496e632e31373035060355040b132e436c617373203320507562" + - "6c6963205072696d6172792043657274696669636174696f6e20417574686f7269747930" + - "1e170d3937303431373030303030305a170d3136313032343233353935395a3081ba311f" + - "301d060355040a1316566572695369676e205472757374204e6574776f726b3117301506" + - "0355040b130e566572695369676e2c20496e632e31333031060355040b132a5665726953" + - "69676e20496e7465726e6174696f6e616c20536572766572204341202d20436c61737320" + - "3331493047060355040b13407777772e766572697369676e2e636f6d2f43505320496e63" + - "6f72702e6279205265662e204c494142494c495459204c54442e28632939372056657269" + - "5369676e30819f300d06092a864886f70d010101050003818d0030818902818100d88280" + - "e8d619027d1f85183925a2652be1bfd405d3bce6363baaf04c6c5bb6e7aa3c734555b2f1" + - "bdea9742ed9a340a15d4a95cf54025ddd907c132b2756cc4cabba3fe56277143aa63f530" + - "3e9328e5faf1093bf3b74d4e39f75c495ab8c11dd3b28afe70309542cbfe2b518b5a3c3a" + - "f9224f90b202a7539c4f34e7ab04b27b6f0203010001a381e33081e0300f0603551d1304" + - "0830060101ff02010030440603551d20043d303b3039060b6086480186f8450107010130" + - "2a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e" + - "636f6d2f43505330340603551d25042d302b06082b0601050507030106082b0601050507" + - "030206096086480186f8420401060a6086480186f845010801300b0603551d0f04040302" + - "0106301106096086480186f842010104040302010630310603551d1f042a30283026a024" + - "a0228620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726c" + - "300d06092a864886f70d010105050003818100408e4997968a73dd8e4def3e61b7caa062" + - "adf40e0abb753de26ed82cc7bff4b98c369bcaa2d09c724639f6a682036511c4bcbf2da6" + - "f5d93b0ab598fab378b91ef22b4c62d5fdb27a1ddf33fd73f9a5d82d8c2aead1fcb028b6" + - "e94948134b838a1b487b24f738de6f4154b8ab576b06dfc7a2d4a9f6f136628088f28b75" + - "d68071" - -// Key and certificate for the OCSP responder were not taken from the Thawte -// responder, since CreateResponse requires that we have the private key. -// Instead, they were generated randomly. -const responderPrivateKeyHex = "308204a40201000282010100e8155f2d3e6f2e8d14c62a788bd462f9f844e7a6977c83ef" + - "1099f0f6616ec5265b56f356e62c5400f0b06a2e7945a82752c636df32a895152d6074df" + - "1701dc6ccfbcbec75a70bd2b55ae2be7e6cad3b5fd4cd5b7790ab401a436d3f5f346074f" + - "fde8a99d5b723350f0a112076614b12ef79c78991b119453445acf2416ab0046b540db14" + - "c9fc0f27b8989ad0f63aa4b8aefc91aa8a72160c36307c60fec78a93d3fddf4259902aa7" + - "7e7332971c7d285b6a04f648993c6922a3e9da9adf5f81508c3228791843e5d49f24db2f" + - "1290bafd97e655b1049a199f652cd603c4fafa330c390b0da78fbbc67e8fa021cbd74eb9" + - "6222b12ace31a77dcf920334dc94581b02030100010282010100bcf0b93d7238bda329a8" + - "72e7149f61bcb37c154330ccb3f42a85c9002c2e2bdea039d77d8581cd19bed94078794e" + - "56293d601547fc4bf6a2f9002fe5772b92b21b254403b403585e3130cc99ccf08f0ef81a" + - "575b38f597ba4660448b54f44bfbb97072b5a2bf043bfeca828cf7741d13698e3f38162b" + - "679faa646b82abd9a72c5c7d722c5fc577a76d2c2daac588accad18516d1bbad10b0dfa2" + - "05cfe246b59e28608a43942e1b71b0c80498075121de5b900d727c31c42c78cf1db5c0aa" + - "5b491e10ea4ed5c0962aaf2ae025dd81fa4ce490d9d6b4a4465411d8e542fc88617e5695" + - "1aa4fc8ea166f2b4d0eb89ef17f2b206bd5f1014bf8fe0e71fe62f2cccf102818100f2dc" + - "ddf878d553286daad68bac4070a82ffec3dc4666a2750f47879eec913f91836f1d976b60" + - "daf9356e078446dafab5bd2e489e5d64f8572ba24a4ba4f3729b5e106c4dd831cc2497a7" + - "e6c7507df05cb64aeb1bbc81c1e340d58b5964cf39cff84ea30c29ec5d3f005ee1362698" + - "07395037955955655292c3e85f6187fa1f9502818100f4a33c102630840705f8c778a47b" + - "87e8da31e68809af981ac5e5999cf1551685d761cdf0d6520361b99aebd5777a940fa64d" + - "327c09fa63746fbb3247ec73a86edf115f1fe5c83598db803881ade71c33c6e956118345" + - "497b98b5e07bb5be75971465ec78f2f9467e1b74956ca9d4c7c3e314e742a72d8b33889c" + - "6c093a466cef0281801d3df0d02124766dd0be98349b19eb36a508c4e679e793ba0a8bef" + - "4d786888c1e9947078b1ea28938716677b4ad8c5052af12eb73ac194915264a913709a0b" + - "7b9f98d4a18edd781a13d49899f91c20dbd8eb2e61d991ba19b5cdc08893f5cb9d39e5a6" + - "0629ea16d426244673b1b3ee72bd30e41fac8395acac40077403de5efd028180050731dd" + - "d71b1a2b96c8d538ba90bb6b62c8b1c74c03aae9a9f59d21a7a82b0d572ef06fa9c807bf" + - "c373d6b30d809c7871df96510c577421d9860c7383fda0919ece19996b3ca13562159193" + - "c0c246471e287f975e8e57034e5136aaf44254e2650def3d51292474c515b1588969112e" + - "0a85cc77073e9d64d2c2fc497844284b02818100d71d63eabf416cf677401ebf965f8314" + - "120b568a57dd3bd9116c629c40dc0c6948bab3a13cc544c31c7da40e76132ef5dd3f7534" + - "45a635930c74326ae3df0edd1bfb1523e3aa259873ac7cf1ac31151ec8f37b528c275622" + - "48f99b8bed59fd4da2576aa6ee20d93a684900bf907e80c66d6e2261ae15e55284b4ed9d" + - "6bdaa059" - -const responderCertHex = "308202e2308201caa003020102020101300d06092a864886f70d01010b05003019311730" + - "150603550403130e4f43535020526573706f6e646572301e170d31353031333031353530" + - "33335a170d3136303133303135353033335a3019311730150603550403130e4f43535020" + - "526573706f6e64657230820122300d06092a864886f70d01010105000382010f00308201" + - "0a0282010100e8155f2d3e6f2e8d14c62a788bd462f9f844e7a6977c83ef1099f0f6616e" + - "c5265b56f356e62c5400f0b06a2e7945a82752c636df32a895152d6074df1701dc6ccfbc" + - "bec75a70bd2b55ae2be7e6cad3b5fd4cd5b7790ab401a436d3f5f346074ffde8a99d5b72" + - "3350f0a112076614b12ef79c78991b119453445acf2416ab0046b540db14c9fc0f27b898" + - "9ad0f63aa4b8aefc91aa8a72160c36307c60fec78a93d3fddf4259902aa77e7332971c7d" + - "285b6a04f648993c6922a3e9da9adf5f81508c3228791843e5d49f24db2f1290bafd97e6" + - "55b1049a199f652cd603c4fafa330c390b0da78fbbc67e8fa021cbd74eb96222b12ace31" + - "a77dcf920334dc94581b0203010001a3353033300e0603551d0f0101ff04040302078030" + - "130603551d25040c300a06082b06010505070309300c0603551d130101ff04023000300d" + - "06092a864886f70d01010b05000382010100718012761b5063e18f0dc44644d8e6ab8612" + - "31c15fd5357805425d82aec1de85bf6d3e30fce205e3e3b8b795bbe52e40a439286d2288" + - "9064f4aeeb150359b9425f1da51b3a5c939018555d13ac42c565a0603786a919328f3267" + - "09dce52c22ad958ecb7873b9771d1148b1c4be2efe80ba868919fc9f68b6090c2f33c156" + - "d67156e42766a50b5d51e79637b7e58af74c2a951b1e642fa7741fec982cc937de37eff5" + - "9e2005d5939bfc031589ca143e6e8ab83f40ee08cc20a6b4a95a318352c28d18528dcaf9" + - "66705de17afa19d6e8ae91ddf33179d16ebb6ac2c69cae8373d408ebf8c55308be6c04d9" + - "3a25439a94299a65a709756c7a3e568be049d5c38839" - -const errorResponseHex = "30030a0101" diff --git a/vendor/golang.org/x/crypto/pkcs12/bmp-string_test.go b/vendor/golang.org/x/crypto/pkcs12/bmp-string_test.go deleted file mode 100644 index 7fca55f..0000000 --- a/vendor/golang.org/x/crypto/pkcs12/bmp-string_test.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2015 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. - -package pkcs12 - -import ( - "bytes" - "encoding/hex" - "testing" -) - -var bmpStringTests = []struct { - in string - expectedHex string - shouldFail bool -}{ - {"", "0000", false}, - // Example from https://tools.ietf.org/html/rfc7292#appendix-B. - {"Beavis", "0042006500610076006900730000", false}, - // Some characters from the "Letterlike Symbols Unicode block". - {"\u2115 - Double-struck N", "21150020002d00200044006f00750062006c0065002d00730074007200750063006b0020004e0000", false}, - // any character outside the BMP should trigger an error. - {"\U0001f000 East wind (Mahjong)", "", true}, -} - -func TestBMPString(t *testing.T) { - for i, test := range bmpStringTests { - expected, err := hex.DecodeString(test.expectedHex) - if err != nil { - t.Fatalf("#%d: failed to decode expectation", i) - } - - out, err := bmpString(test.in) - if err == nil && test.shouldFail { - t.Errorf("#%d: expected to fail, but produced %x", i, out) - continue - } - - if err != nil && !test.shouldFail { - t.Errorf("#%d: failed unexpectedly: %s", i, err) - continue - } - - if !test.shouldFail { - if !bytes.Equal(out, expected) { - t.Errorf("#%d: expected %s, got %x", i, test.expectedHex, out) - continue - } - - roundTrip, err := decodeBMPString(out) - if err != nil { - t.Errorf("#%d: decoding output gave an error: %s", i, err) - continue - } - - if roundTrip != test.in { - t.Errorf("#%d: decoding output resulted in %q, but it should have been %q", i, roundTrip, test.in) - continue - } - } - } -} diff --git a/vendor/golang.org/x/crypto/pkcs12/crypto_test.go b/vendor/golang.org/x/crypto/pkcs12/crypto_test.go deleted file mode 100644 index eb4dae8..0000000 --- a/vendor/golang.org/x/crypto/pkcs12/crypto_test.go +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2015 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. - -package pkcs12 - -import ( - "bytes" - "crypto/x509/pkix" - "encoding/asn1" - "testing" -) - -var sha1WithTripleDES = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 12, 1, 3}) - -func TestPbDecrypterFor(t *testing.T) { - params, _ := asn1.Marshal(pbeParams{ - Salt: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - Iterations: 2048, - }) - alg := pkix.AlgorithmIdentifier{ - Algorithm: asn1.ObjectIdentifier([]int{1, 2, 3}), - Parameters: asn1.RawValue{ - FullBytes: params, - }, - } - - pass, _ := bmpString("Sesame open") - - _, _, err := pbDecrypterFor(alg, pass) - if _, ok := err.(NotImplementedError); !ok { - t.Errorf("expected not implemented error, got: %T %s", err, err) - } - - alg.Algorithm = sha1WithTripleDES - cbc, blockSize, err := pbDecrypterFor(alg, pass) - if err != nil { - t.Errorf("unexpected error from pbDecrypterFor %v", err) - } - if blockSize != 8 { - t.Errorf("unexpected block size %d, wanted 8", blockSize) - } - - plaintext := []byte{1, 2, 3, 4, 5, 6, 7, 8} - expectedCiphertext := []byte{185, 73, 135, 249, 137, 1, 122, 247} - ciphertext := make([]byte, len(plaintext)) - cbc.CryptBlocks(ciphertext, plaintext) - - if bytes.Compare(ciphertext, expectedCiphertext) != 0 { - t.Errorf("bad ciphertext, got %x but wanted %x", ciphertext, expectedCiphertext) - } -} - -var pbDecryptTests = []struct { - in []byte - expected []byte - expectedError error -}{ - { - []byte("\x33\x73\xf3\x9f\xda\x49\xae\xfc\xa0\x9a\xdf\x5a\x58\xa0\xea\x46"), // 7 padding bytes - []byte("A secret!"), - nil, - }, - { - []byte("\x33\x73\xf3\x9f\xda\x49\xae\xfc\x96\x24\x2f\x71\x7e\x32\x3f\xe7"), // 8 padding bytes - []byte("A secret"), - nil, - }, - { - []byte("\x35\x0c\xc0\x8d\xab\xa9\x5d\x30\x7f\x9a\xec\x6a\xd8\x9b\x9c\xd9"), // 9 padding bytes, incorrect - nil, - ErrDecryption, - }, - { - []byte("\xb2\xf9\x6e\x06\x60\xae\x20\xcf\x08\xa0\x7b\xd9\x6b\x20\xef\x41"), // incorrect padding bytes: [ ... 0x04 0x02 ] - nil, - ErrDecryption, - }, -} - -func TestPbDecrypt(t *testing.T) { - for i, test := range pbDecryptTests { - decryptable := testDecryptable{ - data: test.in, - algorithm: pkix.AlgorithmIdentifier{ - Algorithm: sha1WithTripleDES, - Parameters: pbeParams{ - Salt: []byte("\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8"), - Iterations: 4096, - }.RawASN1(), - }, - } - password, _ := bmpString("sesame") - - plaintext, err := pbDecrypt(decryptable, password) - if err != test.expectedError { - t.Errorf("#%d: got error %q, but wanted %q", i, err, test.expectedError) - continue - } - - if !bytes.Equal(plaintext, test.expected) { - t.Errorf("#%d: got %x, but wanted %x", i, plaintext, test.expected) - } - } -} - -type testDecryptable struct { - data []byte - algorithm pkix.AlgorithmIdentifier -} - -func (d testDecryptable) Algorithm() pkix.AlgorithmIdentifier { return d.algorithm } -func (d testDecryptable) Data() []byte { return d.data } - -func (params pbeParams) RawASN1() (raw asn1.RawValue) { - asn1Bytes, err := asn1.Marshal(params) - if err != nil { - panic(err) - } - _, err = asn1.Unmarshal(asn1Bytes, &raw) - if err != nil { - panic(err) - } - return -} diff --git a/vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go b/vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go deleted file mode 100644 index 3347f33..0000000 --- a/vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 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. - -package rc2 - -import ( - "testing" -) - -func BenchmarkEncrypt(b *testing.B) { - r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) - b.ResetTimer() - var src [8]byte - for i := 0; i < b.N; i++ { - r.Encrypt(src[:], src[:]) - } -} - -func BenchmarkDecrypt(b *testing.B) { - r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) - b.ResetTimer() - var src [8]byte - for i := 0; i < b.N; i++ { - r.Decrypt(src[:], src[:]) - } -} diff --git a/vendor/golang.org/x/crypto/pkcs12/internal/rc2/rc2_test.go b/vendor/golang.org/x/crypto/pkcs12/internal/rc2/rc2_test.go deleted file mode 100644 index 51a7efe..0000000 --- a/vendor/golang.org/x/crypto/pkcs12/internal/rc2/rc2_test.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2015 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. - -package rc2 - -import ( - "bytes" - "encoding/hex" - "testing" -) - -func TestEncryptDecrypt(t *testing.T) { - // TODO(dgryski): add the rest of the test vectors from the RFC - var tests = []struct { - key string - plain string - cipher string - t1 int - }{ - { - "0000000000000000", - "0000000000000000", - "ebb773f993278eff", - 63, - }, - { - "ffffffffffffffff", - "ffffffffffffffff", - "278b27e42e2f0d49", - 64, - }, - { - "3000000000000000", - "1000000000000001", - "30649edf9be7d2c2", - 64, - }, - { - "88", - "0000000000000000", - "61a8a244adacccf0", - 64, - }, - { - "88bca90e90875a", - "0000000000000000", - "6ccf4308974c267f", - 64, - }, - { - "88bca90e90875a7f0f79c384627bafb2", - "0000000000000000", - "1a807d272bbe5db1", - 64, - }, - { - "88bca90e90875a7f0f79c384627bafb2", - "0000000000000000", - "2269552ab0f85ca6", - 128, - }, - { - "88bca90e90875a7f0f79c384627bafb216f80a6f85920584c42fceb0be255daf1e", - "0000000000000000", - "5b78d3a43dfff1f1", - 129, - }, - } - - for _, tt := range tests { - k, _ := hex.DecodeString(tt.key) - p, _ := hex.DecodeString(tt.plain) - c, _ := hex.DecodeString(tt.cipher) - - b, _ := New(k, tt.t1) - - var dst [8]byte - - b.Encrypt(dst[:], p) - - if !bytes.Equal(dst[:], c) { - t.Errorf("encrypt failed: got % 2x wanted % 2x\n", dst, c) - } - - b.Decrypt(dst[:], c) - - if !bytes.Equal(dst[:], p) { - t.Errorf("decrypt failed: got % 2x wanted % 2x\n", dst, p) - } - } -} diff --git a/vendor/golang.org/x/crypto/pkcs12/mac_test.go b/vendor/golang.org/x/crypto/pkcs12/mac_test.go deleted file mode 100644 index 1ed4ff2..0000000 --- a/vendor/golang.org/x/crypto/pkcs12/mac_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015 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. - -package pkcs12 - -import ( - "encoding/asn1" - "testing" -) - -func TestVerifyMac(t *testing.T) { - td := macData{ - Mac: digestInfo{ - Digest: []byte{0x18, 0x20, 0x3d, 0xff, 0x1e, 0x16, 0xf4, 0x92, 0xf2, 0xaf, 0xc8, 0x91, 0xa9, 0xba, 0xd6, 0xca, 0x9d, 0xee, 0x51, 0x93}, - }, - MacSalt: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - Iterations: 2048, - } - - message := []byte{11, 12, 13, 14, 15} - password, _ := bmpString("") - - td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 2, 3}) - err := verifyMac(&td, message, password) - if _, ok := err.(NotImplementedError); !ok { - t.Errorf("err: %v", err) - } - - td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}) - err = verifyMac(&td, message, password) - if err != ErrIncorrectPassword { - t.Errorf("Expected incorrect password, got err: %v", err) - } - - password, _ = bmpString("Sesame open") - err = verifyMac(&td, message, password) - if err != nil { - t.Errorf("err: %v", err) - } - -} diff --git a/vendor/golang.org/x/crypto/pkcs12/pbkdf_test.go b/vendor/golang.org/x/crypto/pkcs12/pbkdf_test.go deleted file mode 100644 index 262037d..0000000 --- a/vendor/golang.org/x/crypto/pkcs12/pbkdf_test.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2015 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. - -package pkcs12 - -import ( - "bytes" - "testing" -) - -func TestThatPBKDFWorksCorrectlyForLongKeys(t *testing.T) { - cipherInfo := shaWithTripleDESCBC{} - - salt := []byte("\xff\xff\xff\xff\xff\xff\xff\xff") - password, _ := bmpString("sesame") - key := cipherInfo.deriveKey(salt, password, 2048) - - if expected := []byte("\x7c\xd9\xfd\x3e\x2b\x3b\xe7\x69\x1a\x44\xe3\xbe\xf0\xf9\xea\x0f\xb9\xb8\x97\xd4\xe3\x25\xd9\xd1"); bytes.Compare(key, expected) != 0 { - t.Fatalf("expected key '%x', but found '%x'", expected, key) - } -} - -func TestThatPBKDFHandlesLeadingZeros(t *testing.T) { - // This test triggers a case where I_j (in step 6C) ends up with leading zero - // byte, meaning that len(Ijb) < v (leading zeros get stripped by big.Int). - // This was previously causing bug whereby certain inputs would break the - // derivation and produce the wrong output. - key := pbkdf(sha1Sum, 20, 64, []byte("\xf3\x7e\x05\xb5\x18\x32\x4b\x4b"), []byte("\x00\x00"), 2048, 1, 24) - expected := []byte("\x00\xf7\x59\xff\x47\xd1\x4d\xd0\x36\x65\xd5\x94\x3c\xb3\xc4\xa3\x9a\x25\x55\xc0\x2a\xed\x66\xe1") - if bytes.Compare(key, expected) != 0 { - t.Fatalf("expected key '%x', but found '%x'", expected, key) - } -} diff --git a/vendor/golang.org/x/crypto/pkcs12/pkcs12_test.go b/vendor/golang.org/x/crypto/pkcs12/pkcs12_test.go deleted file mode 100644 index 14dd2a6..0000000 --- a/vendor/golang.org/x/crypto/pkcs12/pkcs12_test.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2015 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. - -package pkcs12 - -import ( - "crypto/rsa" - "crypto/tls" - "encoding/base64" - "encoding/pem" - "testing" -) - -func TestPfx(t *testing.T) { - for commonName, base64P12 := range testdata { - p12, _ := base64.StdEncoding.DecodeString(base64P12) - - priv, cert, err := Decode(p12, "") - if err != nil { - t.Fatal(err) - } - - if err := priv.(*rsa.PrivateKey).Validate(); err != nil { - t.Errorf("error while validating private key: %v", err) - } - - if cert.Subject.CommonName != commonName { - t.Errorf("expected common name to be %q, but found %q", commonName, cert.Subject.CommonName) - } - } -} - -func TestPEM(t *testing.T) { - for commonName, base64P12 := range testdata { - p12, _ := base64.StdEncoding.DecodeString(base64P12) - - blocks, err := ToPEM(p12, "") - if err != nil { - t.Fatalf("error while converting to PEM: %s", err) - } - - var pemData []byte - for _, b := range blocks { - pemData = append(pemData, pem.EncodeToMemory(b)...) - } - - cert, err := tls.X509KeyPair(pemData, pemData) - if err != nil { - t.Errorf("err while converting to key pair: %v", err) - } - config := tls.Config{ - Certificates: []tls.Certificate{cert}, - } - config.BuildNameToCertificate() - - if _, exists := config.NameToCertificate[commonName]; !exists { - t.Errorf("did not find our cert in PEM?: %v", config.NameToCertificate) - } - } -} - -func ExampleToPEM() { - p12, _ := base64.StdEncoding.DecodeString(`MIIJzgIBAzCCCZQGCS ... CA+gwggPk==`) - - blocks, err := ToPEM(p12, "password") - if err != nil { - panic(err) - } - - var pemData []byte - for _, b := range blocks { - pemData = append(pemData, pem.EncodeToMemory(b)...) - } - - // then use PEM data for tls to construct tls certificate: - cert, err := tls.X509KeyPair(pemData, pemData) - if err != nil { - panic(err) - } - - config := &tls.Config{ - Certificates: []tls.Certificate{cert}, - } - - _ = config -} - -var testdata = map[string]string{ - // 'null' password test case - "Windows Azure Tools": `MIIKDAIBAzCCCcwGCSqGSIb3DQEHAaCCCb0Eggm5MIIJtTCCBe4GCSqGSIb3DQEHAaCCBd8EggXbMIIF1zCCBdMGCyqGSIb3DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAhStUNnlTGV+gICB9AEggTIJ81JIossF6boFWpPtkiQRPtI6DW6e9QD4/WvHAVrM2bKdpMzSMsCML5NyuddANTKHBVq00Jc9keqGNAqJPKkjhSUebzQFyhe0E1oI9T4zY5UKr/I8JclOeccH4QQnsySzYUG2SnniXnQ+JrG3juetli7EKth9h6jLc6xbubPadY5HMB3wL/eG/kJymiXwU2KQ9Mgd4X6jbcV+NNCE/8jbZHvSTCPeYTJIjxfeX61Sj5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IBxq18bVHJ+STInhLhad4u10v/Xbx7wIL3f9DX1yLAkPrpBYbNHS2/ew6H/ySDJnoIDxkw2zZ4qJ+qUJZ1S0lbZVG+VT0OP5uF6tyOSpbMlcGkdl3z254n6MlCrTifcwkzscysDsgKXaYQw06rzrPW6RDub+t+hXzGny799fS9jhQMLDmOggaQ7+LA4oEZsfT89HLMWxJYDqjo3gIfjciV2mV54R684qLDS+AO09U49e6yEbwGlq8lpmO/pbXCbpGbB1b3EomcQbxdWxW2WEkkEd/VBn81K4M3obmywwXJkw+tPXDXfBmzzaqqCR+onMQ5ME1nMkY8ybnfoCc1bDIupjVWsEL2Wvq752RgI6KqzVNr1ew1IdqV5AWN2fOfek+0vi3Jd9FHF3hx8JMwjJL9dZsETV5kHtYJtE7wJ23J68BnCt2eI0GEuwXcCf5EdSKN/xXCTlIokc4Qk/gzRdIZsvcEJ6B1lGovKG54X4IohikqTjiepjbsMWj38yxDmK3mtENZ9ci8FPfbbvIEcOCZIinuY3qFUlRSbx7VUerEoV1IP3clUwexVQo4lHFee2jd7ocWsdSqSapW7OWUupBtDzRkqVhE7tGria+i1W2d6YLlJ21QTjyapWJehAMO637OdbJCCzDs1cXbodRRE7bsP492ocJy8OX66rKdhYbg8srSFNKdb3pF3UDNbN9jhI/t8iagRhNBhlQtTr1me2E/c86Q18qcRXl4bcXTt6acgCeffK6Y26LcVlrgjlD33AEYRRUeyC+rpxbT0aMjdFderlndKRIyG23mSp0HaUwNzAfMAcGBSsOAwIaBBRlviCbIyRrhIysg2dc/KbLFTc2vQQUg4rfwHMM4IKYRD/fsd1x6dda+wQ=`, - // empty string password test case - "testing@example.com": `MIIJzgIBAzCCCZQGCSqGSIb3DQEHAaCCCYUEggmBMIIJfTCCA/cGCSqGSIb3DQEHBqCCA+gwggPk -AgEAMIID3QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIIszfRGqcmPcCAggAgIIDsOZ9Eg1L -s5Wx8JhYoV3HAL4aRnkAWvTYB5N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ff --git a/vendor/golang.org/x/net/AUTHORS b/vendor/golang.org/x/net/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/net/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/net/CONTRIBUTORS b/vendor/golang.org/x/net/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/net/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/vendor/golang.org/x/net/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/net/PATENTS b/vendor/golang.org/x/net/PATENTS new file mode 100644 index 0000000..7330990 --- /dev/null +++ b/vendor/golang.org/x/net/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/net/context/context_test.go b/vendor/golang.org/x/net/context/context_test.go deleted file mode 100644 index 6284413..0000000 --- a/vendor/golang.org/x/net/context/context_test.go +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright 2014 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 !go1.7 - -package context - -import ( - "fmt" - "math/rand" - "runtime" - "strings" - "sync" - "testing" - "time" -) - -// otherContext is a Context that's not one of the types defined in context.go. -// This lets us test code paths that differ based on the underlying type of the -// Context. -type otherContext struct { - Context -} - -func TestBackground(t *testing.T) { - c := Background() - if c == nil { - t.Fatalf("Background returned nil") - } - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - if got, want := fmt.Sprint(c), "context.Background"; got != want { - t.Errorf("Background().String() = %q want %q", got, want) - } -} - -func TestTODO(t *testing.T) { - c := TODO() - if c == nil { - t.Fatalf("TODO returned nil") - } - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - if got, want := fmt.Sprint(c), "context.TODO"; got != want { - t.Errorf("TODO().String() = %q want %q", got, want) - } -} - -func TestWithCancel(t *testing.T) { - c1, cancel := WithCancel(Background()) - - if got, want := fmt.Sprint(c1), "context.Background.WithCancel"; got != want { - t.Errorf("c1.String() = %q want %q", got, want) - } - - o := otherContext{c1} - c2, _ := WithCancel(o) - contexts := []Context{c1, o, c2} - - for i, c := range contexts { - if d := c.Done(); d == nil { - t.Errorf("c[%d].Done() == %v want non-nil", i, d) - } - if e := c.Err(); e != nil { - t.Errorf("c[%d].Err() == %v want nil", i, e) - } - - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - } - - cancel() - time.Sleep(100 * time.Millisecond) // let cancelation propagate - - for i, c := range contexts { - select { - case <-c.Done(): - default: - t.Errorf("<-c[%d].Done() blocked, but shouldn't have", i) - } - if e := c.Err(); e != Canceled { - t.Errorf("c[%d].Err() == %v want %v", i, e, Canceled) - } - } -} - -func TestParentFinishesChild(t *testing.T) { - // Context tree: - // parent -> cancelChild - // parent -> valueChild -> timerChild - parent, cancel := WithCancel(Background()) - cancelChild, stop := WithCancel(parent) - defer stop() - valueChild := WithValue(parent, "key", "value") - timerChild, stop := WithTimeout(valueChild, 10000*time.Hour) - defer stop() - - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - case x := <-cancelChild.Done(): - t.Errorf("<-cancelChild.Done() == %v want nothing (it should block)", x) - case x := <-timerChild.Done(): - t.Errorf("<-timerChild.Done() == %v want nothing (it should block)", x) - case x := <-valueChild.Done(): - t.Errorf("<-valueChild.Done() == %v want nothing (it should block)", x) - default: - } - - // The parent's children should contain the two cancelable children. - pc := parent.(*cancelCtx) - cc := cancelChild.(*cancelCtx) - tc := timerChild.(*timerCtx) - pc.mu.Lock() - if len(pc.children) != 2 || !pc.children[cc] || !pc.children[tc] { - t.Errorf("bad linkage: pc.children = %v, want %v and %v", - pc.children, cc, tc) - } - pc.mu.Unlock() - - if p, ok := parentCancelCtx(cc.Context); !ok || p != pc { - t.Errorf("bad linkage: parentCancelCtx(cancelChild.Context) = %v, %v want %v, true", p, ok, pc) - } - if p, ok := parentCancelCtx(tc.Context); !ok || p != pc { - t.Errorf("bad linkage: parentCancelCtx(timerChild.Context) = %v, %v want %v, true", p, ok, pc) - } - - cancel() - - pc.mu.Lock() - if len(pc.children) != 0 { - t.Errorf("pc.cancel didn't clear pc.children = %v", pc.children) - } - pc.mu.Unlock() - - // parent and children should all be finished. - check := func(ctx Context, name string) { - select { - case <-ctx.Done(): - default: - t.Errorf("<-%s.Done() blocked, but shouldn't have", name) - } - if e := ctx.Err(); e != Canceled { - t.Errorf("%s.Err() == %v want %v", name, e, Canceled) - } - } - check(parent, "parent") - check(cancelChild, "cancelChild") - check(valueChild, "valueChild") - check(timerChild, "timerChild") - - // WithCancel should return a canceled context on a canceled parent. - precanceledChild := WithValue(parent, "key", "value") - select { - case <-precanceledChild.Done(): - default: - t.Errorf("<-precanceledChild.Done() blocked, but shouldn't have") - } - if e := precanceledChild.Err(); e != Canceled { - t.Errorf("precanceledChild.Err() == %v want %v", e, Canceled) - } -} - -func TestChildFinishesFirst(t *testing.T) { - cancelable, stop := WithCancel(Background()) - defer stop() - for _, parent := range []Context{Background(), cancelable} { - child, cancel := WithCancel(parent) - - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - case x := <-child.Done(): - t.Errorf("<-child.Done() == %v want nothing (it should block)", x) - default: - } - - cc := child.(*cancelCtx) - pc, pcok := parent.(*cancelCtx) // pcok == false when parent == Background() - if p, ok := parentCancelCtx(cc.Context); ok != pcok || (ok && pc != p) { - t.Errorf("bad linkage: parentCancelCtx(cc.Context) = %v, %v want %v, %v", p, ok, pc, pcok) - } - - if pcok { - pc.mu.Lock() - if len(pc.children) != 1 || !pc.children[cc] { - t.Errorf("bad linkage: pc.children = %v, cc = %v", pc.children, cc) - } - pc.mu.Unlock() - } - - cancel() - - if pcok { - pc.mu.Lock() - if len(pc.children) != 0 { - t.Errorf("child's cancel didn't remove self from pc.children = %v", pc.children) - } - pc.mu.Unlock() - } - - // child should be finished. - select { - case <-child.Done(): - default: - t.Errorf("<-child.Done() blocked, but shouldn't have") - } - if e := child.Err(); e != Canceled { - t.Errorf("child.Err() == %v want %v", e, Canceled) - } - - // parent should not be finished. - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - default: - } - if e := parent.Err(); e != nil { - t.Errorf("parent.Err() == %v want nil", e) - } - } -} - -func testDeadline(c Context, wait time.Duration, t *testing.T) { - select { - case <-time.After(wait): - t.Fatalf("context should have timed out") - case <-c.Done(): - } - if e := c.Err(); e != DeadlineExceeded { - t.Errorf("c.Err() == %v want %v", e, DeadlineExceeded) - } -} - -func TestDeadline(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithDeadline(Background(), time.Now().Add(1*timeUnit)) - if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { - t.Errorf("c.String() = %q want prefix %q", got, prefix) - } - testDeadline(c, 2*timeUnit, t) - - c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) - o := otherContext{c} - testDeadline(o, 2*timeUnit, t) - - c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) - o = otherContext{c} - c, _ = WithDeadline(o, time.Now().Add(3*timeUnit)) - testDeadline(c, 2*timeUnit, t) -} - -func TestTimeout(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithTimeout(Background(), 1*timeUnit) - if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { - t.Errorf("c.String() = %q want prefix %q", got, prefix) - } - testDeadline(c, 2*timeUnit, t) - - c, _ = WithTimeout(Background(), 1*timeUnit) - o := otherContext{c} - testDeadline(o, 2*timeUnit, t) - - c, _ = WithTimeout(Background(), 1*timeUnit) - o = otherContext{c} - c, _ = WithTimeout(o, 3*timeUnit) - testDeadline(c, 2*timeUnit, t) -} - -func TestCanceledTimeout(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithTimeout(Background(), 2*timeUnit) - o := otherContext{c} - c, cancel := WithTimeout(o, 4*timeUnit) - cancel() - time.Sleep(1 * timeUnit) // let cancelation propagate - select { - case <-c.Done(): - default: - t.Errorf("<-c.Done() blocked, but shouldn't have") - } - if e := c.Err(); e != Canceled { - t.Errorf("c.Err() == %v want %v", e, Canceled) - } -} - -type key1 int -type key2 int - -var k1 = key1(1) -var k2 = key2(1) // same int as k1, different type -var k3 = key2(3) // same type as k2, different int - -func TestValues(t *testing.T) { - check := func(c Context, nm, v1, v2, v3 string) { - if v, ok := c.Value(k1).(string); ok == (len(v1) == 0) || v != v1 { - t.Errorf(`%s.Value(k1).(string) = %q, %t want %q, %t`, nm, v, ok, v1, len(v1) != 0) - } - if v, ok := c.Value(k2).(string); ok == (len(v2) == 0) || v != v2 { - t.Errorf(`%s.Value(k2).(string) = %q, %t want %q, %t`, nm, v, ok, v2, len(v2) != 0) - } - if v, ok := c.Value(k3).(string); ok == (len(v3) == 0) || v != v3 { - t.Errorf(`%s.Value(k3).(string) = %q, %t want %q, %t`, nm, v, ok, v3, len(v3) != 0) - } - } - - c0 := Background() - check(c0, "c0", "", "", "") - - c1 := WithValue(Background(), k1, "c1k1") - check(c1, "c1", "c1k1", "", "") - - if got, want := fmt.Sprint(c1), `context.Background.WithValue(1, "c1k1")`; got != want { - t.Errorf("c.String() = %q want %q", got, want) - } - - c2 := WithValue(c1, k2, "c2k2") - check(c2, "c2", "c1k1", "c2k2", "") - - c3 := WithValue(c2, k3, "c3k3") - check(c3, "c2", "c1k1", "c2k2", "c3k3") - - c4 := WithValue(c3, k1, nil) - check(c4, "c4", "", "c2k2", "c3k3") - - o0 := otherContext{Background()} - check(o0, "o0", "", "", "") - - o1 := otherContext{WithValue(Background(), k1, "c1k1")} - check(o1, "o1", "c1k1", "", "") - - o2 := WithValue(o1, k2, "o2k2") - check(o2, "o2", "c1k1", "o2k2", "") - - o3 := otherContext{c4} - check(o3, "o3", "", "c2k2", "c3k3") - - o4 := WithValue(o3, k3, nil) - check(o4, "o4", "", "c2k2", "") -} - -func TestAllocs(t *testing.T) { - bg := Background() - for _, test := range []struct { - desc string - f func() - limit float64 - gccgoLimit float64 - }{ - { - desc: "Background()", - f: func() { Background() }, - limit: 0, - gccgoLimit: 0, - }, - { - desc: fmt.Sprintf("WithValue(bg, %v, nil)", k1), - f: func() { - c := WithValue(bg, k1, nil) - c.Value(k1) - }, - limit: 3, - gccgoLimit: 3, - }, - { - desc: "WithTimeout(bg, 15*time.Millisecond)", - f: func() { - c, _ := WithTimeout(bg, 15*time.Millisecond) - <-c.Done() - }, - limit: 8, - gccgoLimit: 16, - }, - { - desc: "WithCancel(bg)", - f: func() { - c, cancel := WithCancel(bg) - cancel() - <-c.Done() - }, - limit: 5, - gccgoLimit: 8, - }, - { - desc: "WithTimeout(bg, 100*time.Millisecond)", - f: func() { - c, cancel := WithTimeout(bg, 100*time.Millisecond) - cancel() - <-c.Done() - }, - limit: 8, - gccgoLimit: 25, - }, - } { - limit := test.limit - if runtime.Compiler == "gccgo" { - // gccgo does not yet do escape analysis. - // TODO(iant): Remove this when gccgo does do escape analysis. - limit = test.gccgoLimit - } - if n := testing.AllocsPerRun(100, test.f); n > limit { - t.Errorf("%s allocs = %f want %d", test.desc, n, int(limit)) - } - } -} - -func TestSimultaneousCancels(t *testing.T) { - root, cancel := WithCancel(Background()) - m := map[Context]CancelFunc{root: cancel} - q := []Context{root} - // Create a tree of contexts. - for len(q) != 0 && len(m) < 100 { - parent := q[0] - q = q[1:] - for i := 0; i < 4; i++ { - ctx, cancel := WithCancel(parent) - m[ctx] = cancel - q = append(q, ctx) - } - } - // Start all the cancels in a random order. - var wg sync.WaitGroup - wg.Add(len(m)) - for _, cancel := range m { - go func(cancel CancelFunc) { - cancel() - wg.Done() - }(cancel) - } - // Wait on all the contexts in a random order. - for ctx := range m { - select { - case <-ctx.Done(): - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for <-ctx.Done(); stacks:\n%s", buf[:n]) - } - } - // Wait for all the cancel functions to return. - done := make(chan struct{}) - go func() { - wg.Wait() - close(done) - }() - select { - case <-done: - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for cancel functions; stacks:\n%s", buf[:n]) - } -} - -func TestInterlockedCancels(t *testing.T) { - parent, cancelParent := WithCancel(Background()) - child, cancelChild := WithCancel(parent) - go func() { - parent.Done() - cancelChild() - }() - cancelParent() - select { - case <-child.Done(): - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for child.Done(); stacks:\n%s", buf[:n]) - } -} - -func TestLayersCancel(t *testing.T) { - testLayers(t, time.Now().UnixNano(), false) -} - -func TestLayersTimeout(t *testing.T) { - testLayers(t, time.Now().UnixNano(), true) -} - -func testLayers(t *testing.T, seed int64, testTimeout bool) { - rand.Seed(seed) - errorf := func(format string, a ...interface{}) { - t.Errorf(fmt.Sprintf("seed=%d: %s", seed, format), a...) - } - const ( - timeout = 200 * time.Millisecond - minLayers = 30 - ) - type value int - var ( - vals []*value - cancels []CancelFunc - numTimers int - ctx = Background() - ) - for i := 0; i < minLayers || numTimers == 0 || len(cancels) == 0 || len(vals) == 0; i++ { - switch rand.Intn(3) { - case 0: - v := new(value) - ctx = WithValue(ctx, v, v) - vals = append(vals, v) - case 1: - var cancel CancelFunc - ctx, cancel = WithCancel(ctx) - cancels = append(cancels, cancel) - case 2: - var cancel CancelFunc - ctx, cancel = WithTimeout(ctx, timeout) - cancels = append(cancels, cancel) - numTimers++ - } - } - checkValues := func(when string) { - for _, key := range vals { - if val := ctx.Value(key).(*value); key != val { - errorf("%s: ctx.Value(%p) = %p want %p", when, key, val, key) - } - } - } - select { - case <-ctx.Done(): - errorf("ctx should not be canceled yet") - default: - } - if s, prefix := fmt.Sprint(ctx), "context.Background."; !strings.HasPrefix(s, prefix) { - t.Errorf("ctx.String() = %q want prefix %q", s, prefix) - } - t.Log(ctx) - checkValues("before cancel") - if testTimeout { - select { - case <-ctx.Done(): - case <-time.After(timeout + 100*time.Millisecond): - errorf("ctx should have timed out") - } - checkValues("after timeout") - } else { - cancel := cancels[rand.Intn(len(cancels))] - cancel() - select { - case <-ctx.Done(): - default: - errorf("ctx should be canceled") - } - checkValues("after cancel") - } -} - -func TestCancelRemoves(t *testing.T) { - checkChildren := func(when string, ctx Context, want int) { - if got := len(ctx.(*cancelCtx).children); got != want { - t.Errorf("%s: context has %d children, want %d", when, got, want) - } - } - - ctx, _ := WithCancel(Background()) - checkChildren("after creation", ctx, 0) - _, cancel := WithCancel(ctx) - checkChildren("with WithCancel child ", ctx, 1) - cancel() - checkChildren("after cancelling WithCancel child", ctx, 0) - - ctx, _ = WithCancel(Background()) - checkChildren("after creation", ctx, 0) - _, cancel = WithTimeout(ctx, 60*time.Minute) - checkChildren("with WithTimeout child ", ctx, 1) - cancel() - checkChildren("after cancelling WithTimeout child", ctx, 0) -} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go deleted file mode 100644 index 72411b1..0000000 --- a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 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,go1.7 - -package ctxhttp - -import ( - "io" - "net/http" - "net/http/httptest" - "testing" - - "context" -) - -func TestGo17Context(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, "ok") - })) - defer ts.Close() - ctx := context.Background() - resp, err := Get(ctx, http.DefaultClient, ts.URL) - if resp == nil || err != nil { - t.Fatalf("error received from client: %v %v", err, resp) - } - resp.Body.Close() -} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17_test.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17_test.go deleted file mode 100644 index 9159cf0..0000000 --- a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17_test.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2015 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,!go1.7 - -package ctxhttp - -import ( - "net" - "net/http" - "net/http/httptest" - "sync" - "testing" - "time" - - "golang.org/x/net/context" -) - -// golang.org/issue/14065 -func TestClosesResponseBodyOnCancel(t *testing.T) { - defer func() { testHookContextDoneBeforeHeaders = nop }() - defer func() { testHookDoReturned = nop }() - defer func() { testHookDidBodyClose = nop }() - - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})) - defer ts.Close() - - ctx, cancel := context.WithCancel(context.Background()) - - // closed when Do enters select case <-ctx.Done() - enteredDonePath := make(chan struct{}) - - testHookContextDoneBeforeHeaders = func() { - close(enteredDonePath) - } - - testHookDoReturned = func() { - // We now have the result (the Flush'd headers) at least, - // so we can cancel the request. - cancel() - - // But block the client.Do goroutine from sending - // until Do enters into the <-ctx.Done() path, since - // otherwise if both channels are readable, select - // picks a random one. - <-enteredDonePath - } - - sawBodyClose := make(chan struct{}) - testHookDidBodyClose = func() { close(sawBodyClose) } - - tr := &http.Transport{} - defer tr.CloseIdleConnections() - c := &http.Client{Transport: tr} - req, _ := http.NewRequest("GET", ts.URL, nil) - _, doErr := Do(ctx, c, req) - - select { - case <-sawBodyClose: - case <-time.After(5 * time.Second): - t.Fatal("timeout waiting for body to close") - } - - if doErr != ctx.Err() { - t.Errorf("Do error = %v; want %v", doErr, ctx.Err()) - } -} - -type noteCloseConn struct { - net.Conn - onceClose sync.Once - closefn func() -} - -func (c *noteCloseConn) Close() error { - c.onceClose.Do(c.closefn) - return c.Conn.Close() -} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go deleted file mode 100644 index 1e41551..0000000 --- a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2015 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 ctxhttp - -import ( - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" - "time" - - "golang.org/x/net/context" -) - -const ( - requestDuration = 100 * time.Millisecond - requestBody = "ok" -) - -func okHandler(w http.ResponseWriter, r *http.Request) { - time.Sleep(requestDuration) - io.WriteString(w, requestBody) -} - -func TestNoTimeout(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(okHandler)) - defer ts.Close() - - ctx := context.Background() - res, err := Get(ctx, nil, ts.URL) - if err != nil { - t.Fatal(err) - } - defer res.Body.Close() - slurp, err := ioutil.ReadAll(res.Body) - if err != nil { - t.Fatal(err) - } - if string(slurp) != requestBody { - t.Errorf("body = %q; want %q", slurp, requestBody) - } -} - -func TestCancelBeforeHeaders(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - - blockServer := make(chan struct{}) - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - cancel() - <-blockServer - io.WriteString(w, requestBody) - })) - defer ts.Close() - defer close(blockServer) - - res, err := Get(ctx, nil, ts.URL) - if err == nil { - res.Body.Close() - t.Fatal("Get returned unexpected nil error") - } - if err != context.Canceled { - t.Errorf("err = %v; want %v", err, context.Canceled) - } -} - -func TestCancelAfterHangingRequest(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - w.(http.Flusher).Flush() - <-w.(http.CloseNotifier).CloseNotify() - })) - defer ts.Close() - - ctx, cancel := context.WithCancel(context.Background()) - resp, err := Get(ctx, nil, ts.URL) - if err != nil { - t.Fatalf("unexpected error in Get: %v", err) - } - - // Cancel befer reading the body. - // Reading Request.Body should fail, since the request was - // canceled before anything was written. - cancel() - - done := make(chan struct{}) - - go func() { - b, err := ioutil.ReadAll(resp.Body) - if len(b) != 0 || err == nil { - t.Errorf(`Read got (%q, %v); want ("", error)`, b, err) - } - close(done) - }() - - select { - case <-time.After(1 * time.Second): - t.Errorf("Test timed out") - case <-done: - } -} diff --git a/vendor/golang.org/x/net/context/withtimeout_test.go b/vendor/golang.org/x/net/context/withtimeout_test.go deleted file mode 100644 index e6f5669..0000000 --- a/vendor/golang.org/x/net/context/withtimeout_test.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 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. - -package context_test - -import ( - "fmt" - "time" - - "golang.org/x/net/context" -) - -// This example passes a context with a timeout to tell a blocking function that -// it should abandon its work after the timeout elapses. -func ExampleWithTimeout() { - // Pass a context with a timeout to tell a blocking function that it - // should abandon its work after the timeout elapses. - ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) - defer cancel() - - select { - case <-time.After(1 * time.Second): - fmt.Println("overslept") - case <-ctx.Done(): - fmt.Println(ctx.Err()) // prints "context deadline exceeded" - } - - // Output: - // context deadline exceeded -} diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go deleted file mode 100644 index 533438d..0000000 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 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. - -// Package errgroup provides synchronization, error propagation, and Context -// cancelation for groups of goroutines working on subtasks of a common task. -package errgroup - -import ( - "sync" - - "golang.org/x/net/context" -) - -// A Group is a collection of goroutines working on subtasks that are part of -// the same overall task. -// -// A zero Group is valid and does not cancel on error. -type Group struct { - cancel func() - - wg sync.WaitGroup - - errOnce sync.Once - err error -} - -// WithContext returns a new Group and an associated Context derived from ctx. -// -// The derived Context is canceled the first time a function passed to Go -// returns a non-nil error or the first time Wait returns, whichever occurs -// first. -func WithContext(ctx context.Context) (*Group, context.Context) { - ctx, cancel := context.WithCancel(ctx) - return &Group{cancel: cancel}, ctx -} - -// Wait blocks until all function calls from the Go method have returned, then -// returns the first non-nil error (if any) from them. -func (g *Group) Wait() error { - g.wg.Wait() - if g.cancel != nil { - g.cancel() - } - return g.err -} - -// Go calls the given function in a new goroutine. -// -// The first call to return a non-nil error cancels the group; its error will be -// returned by Wait. -func (g *Group) Go(f func() error) { - g.wg.Add(1) - - go func() { - defer g.wg.Done() - - if err := f(); err != nil { - g.errOnce.Do(func() { - g.err = err - if g.cancel != nil { - g.cancel() - } - }) - } - }() -} diff --git a/vendor/golang.org/x/sync/errgroup/errgroup_example_md5all_test.go b/vendor/golang.org/x/sync/errgroup/errgroup_example_md5all_test.go deleted file mode 100644 index 714b5ae..0000000 --- a/vendor/golang.org/x/sync/errgroup/errgroup_example_md5all_test.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2016 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. - -package errgroup_test - -import ( - "crypto/md5" - "fmt" - "io/ioutil" - "log" - "os" - "path/filepath" - - "golang.org/x/net/context" - "golang.org/x/sync/errgroup" -) - -// Pipeline demonstrates the use of a Group to implement a multi-stage -// pipeline: a version of the MD5All function with bounded parallelism from -// https://blog.golang.org/pipelines. -func ExampleGroup_pipeline() { - m, err := MD5All(context.Background(), ".") - if err != nil { - log.Fatal(err) - } - - for k, sum := range m { - fmt.Printf("%s:\t%x\n", k, sum) - } -} - -type result struct { - path string - sum [md5.Size]byte -} - -// MD5All reads all the files in the file tree rooted at root and returns a map -// from file path to the MD5 sum of the file's contents. If the directory walk -// fails or any read operation fails, MD5All returns an error. -func MD5All(ctx context.Context, root string) (map[string][md5.Size]byte, error) { - // ctx is canceled when g.Wait() returns. When this version of MD5All returns - // - even in case of error! - we know that all of the goroutines have finished - // and the memory they were using can be garbage-collected. - g, ctx := errgroup.WithContext(ctx) - paths := make(chan string) - - g.Go(func() error { - defer close(paths) - return filepath.Walk(root, func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if !info.Mode().IsRegular() { - return nil - } - select { - case paths <- path: - case <-ctx.Done(): - return ctx.Err() - } - return nil - }) - }) - - // Start a fixed number of goroutines to read and digest files. - c := make(chan result) - const numDigesters = 20 - for i := 0; i < numDigesters; i++ { - g.Go(func() error { - for path := range paths { - data, err := ioutil.ReadFile(path) - if err != nil { - return err - } - select { - case c <- result{path, md5.Sum(data)}: - case <-ctx.Done(): - return ctx.Err() - } - } - return nil - }) - } - go func() { - g.Wait() - close(c) - }() - - m := make(map[string][md5.Size]byte) - for r := range c { - m[r.path] = r.sum - } - // Check whether any of the goroutines failed. Since g is accumulating the - // errors, we don't need to send them (or check for them) in the individual - // results sent on the channel. - if err := g.Wait(); err != nil { - return nil, err - } - return m, nil -} diff --git a/vendor/golang.org/x/sync/errgroup/errgroup_test.go b/vendor/golang.org/x/sync/errgroup/errgroup_test.go deleted file mode 100644 index 6a9696e..0000000 --- a/vendor/golang.org/x/sync/errgroup/errgroup_test.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016 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. - -package errgroup_test - -import ( - "errors" - "fmt" - "net/http" - "os" - "testing" - - "golang.org/x/net/context" - "golang.org/x/sync/errgroup" -) - -var ( - Web = fakeSearch("web") - Image = fakeSearch("image") - Video = fakeSearch("video") -) - -type Result string -type Search func(ctx context.Context, query string) (Result, error) - -func fakeSearch(kind string) Search { - return func(_ context.Context, query string) (Result, error) { - return Result(fmt.Sprintf("%s result for %q", kind, query)), nil - } -} - -// JustErrors illustrates the use of a Group in place of a sync.WaitGroup to -// simplify goroutine counting and error handling. This example is derived from -// the sync.WaitGroup example at https://golang.org/pkg/sync/#example_WaitGroup. -func ExampleGroup_justErrors() { - var g errgroup.Group - var urls = []string{ - "http://www.golang.org/", - "http://www.google.com/", - "http://www.somestupidname.com/", - } - for _, url := range urls { - // Launch a goroutine to fetch the URL. - url := url // https://golang.org/doc/faq#closures_and_goroutines - g.Go(func() error { - // Fetch the URL. - resp, err := http.Get(url) - if err == nil { - resp.Body.Close() - } - return err - }) - } - // Wait for all HTTP fetches to complete. - if err := g.Wait(); err == nil { - fmt.Println("Successfully fetched all URLs.") - } -} - -// Parallel illustrates the use of a Group for synchronizing a simple parallel -// task: the "Google Search 2.0" function from -// https://talks.golang.org/2012/concurrency.slide#46, augmented with a Context -// and error-handling. -func ExampleGroup_parallel() { - Google := func(ctx context.Context, query string) ([]Result, error) { - g, ctx := errgroup.WithContext(ctx) - - searches := []Search{Web, Image, Video} - results := make([]Result, len(searches)) - for i, search := range searches { - i, search := i, search // https://golang.org/doc/faq#closures_and_goroutines - g.Go(func() error { - result, err := search(ctx, query) - if err == nil { - results[i] = result - } - return err - }) - } - if err := g.Wait(); err != nil { - return nil, err - } - return results, nil - } - - results, err := Google(context.Background(), "golang") - if err != nil { - fmt.Fprintln(os.Stderr, err) - return - } - for _, result := range results { - fmt.Println(result) - } - - // Output: - // web result for "golang" - // image result for "golang" - // video result for "golang" -} - -func TestZeroGroup(t *testing.T) { - err1 := errors.New("errgroup_test: 1") - err2 := errors.New("errgroup_test: 2") - - cases := []struct { - errs []error - }{ - {errs: []error{}}, - {errs: []error{nil}}, - {errs: []error{err1}}, - {errs: []error{err1, nil}}, - {errs: []error{err1, nil, err2}}, - } - - for _, tc := range cases { - var g errgroup.Group - - var firstErr error - for i, err := range tc.errs { - err := err - g.Go(func() error { return err }) - - if firstErr == nil && err != nil { - firstErr = err - } - - if gErr := g.Wait(); gErr != firstErr { - t.Errorf("after %T.Go(func() error { return err }) for err in %v\n"+ - "g.Wait() = %v; want %v", - g, tc.errs[:i+1], err, firstErr) - } - } - } -} - -func TestWithContext(t *testing.T) { - errDoom := errors.New("group_test: doomed") - - cases := []struct { - errs []error - want error - }{ - {want: nil}, - {errs: []error{nil}, want: nil}, - {errs: []error{errDoom}, want: errDoom}, - {errs: []error{errDoom, nil}, want: errDoom}, - } - - for _, tc := range cases { - g, ctx := errgroup.WithContext(context.Background()) - - for _, err := range tc.errs { - err := err - g.Go(func() error { return err }) - } - - if err := g.Wait(); err != tc.want { - t.Errorf("after %T.Go(func() error { return err }) for err in %v\n"+ - "g.Wait() = %v; want %v", - g, tc.errs, err, tc.want) - } - - canceled := false - select { - case <-ctx.Done(): - canceled = true - default: - } - if !canceled { - t.Errorf("after %T.Go(func() error { return err }) for err in %v\n"+ - "ctx.Done() was not closed", - g, tc.errs) - } - } -} diff --git a/vendor/gopkg.in/check.v1/.gitignore b/vendor/gopkg.in/check.v1/.gitignore deleted file mode 100644 index 191a536..0000000 --- a/vendor/gopkg.in/check.v1/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -_* -*.swp -*.[568] -[568].out diff --git a/vendor/gopkg.in/check.v1/.travis.yml b/vendor/gopkg.in/check.v1/.travis.yml deleted file mode 100644 index ead6735..0000000 --- a/vendor/gopkg.in/check.v1/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: go - -go_import_path: gopkg.in/check.v1 diff --git a/vendor/gopkg.in/check.v1/LICENSE b/vendor/gopkg.in/check.v1/LICENSE deleted file mode 100644 index 545cf2d..0000000 --- a/vendor/gopkg.in/check.v1/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Gocheck - A rich testing framework for Go - -Copyright (c) 2010-2013 Gustavo Niemeyer - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/gopkg.in/check.v1/README.md b/vendor/gopkg.in/check.v1/README.md deleted file mode 100644 index 0ca9e57..0000000 --- a/vendor/gopkg.in/check.v1/README.md +++ /dev/null @@ -1,20 +0,0 @@ -Instructions -============ - -Install the package with: - - go get gopkg.in/check.v1 - -Import it with: - - import "gopkg.in/check.v1" - -and use _check_ as the package name inside the code. - -For more details, visit the project page: - -* http://labix.org/gocheck - -and the API documentation: - -* https://gopkg.in/check.v1 diff --git a/vendor/gopkg.in/check.v1/TODO b/vendor/gopkg.in/check.v1/TODO deleted file mode 100644 index 3349827..0000000 --- a/vendor/gopkg.in/check.v1/TODO +++ /dev/null @@ -1,2 +0,0 @@ -- Assert(slice, Contains, item) -- Parallel test support diff --git a/vendor/gopkg.in/check.v1/benchmark.go b/vendor/gopkg.in/check.v1/benchmark.go deleted file mode 100644 index 46ea9dc..0000000 --- a/vendor/gopkg.in/check.v1/benchmark.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package check - -import ( - "fmt" - "runtime" - "time" -) - -var memStats runtime.MemStats - -// testingB is a type passed to Benchmark functions to manage benchmark -// timing and to specify the number of iterations to run. -type timer struct { - start time.Time // Time test or benchmark started - duration time.Duration - N int - bytes int64 - timerOn bool - benchTime time.Duration - // The initial states of memStats.Mallocs and memStats.TotalAlloc. - startAllocs uint64 - startBytes uint64 - // The net total of this test after being run. - netAllocs uint64 - netBytes uint64 -} - -// StartTimer starts timing a test. This function is called automatically -// before a benchmark starts, but it can also used to resume timing after -// a call to StopTimer. -func (c *C) StartTimer() { - if !c.timerOn { - c.start = time.Now() - c.timerOn = true - - runtime.ReadMemStats(&memStats) - c.startAllocs = memStats.Mallocs - c.startBytes = memStats.TotalAlloc - } -} - -// StopTimer stops timing a test. This can be used to pause the timer -// while performing complex initialization that you don't -// want to measure. -func (c *C) StopTimer() { - if c.timerOn { - c.duration += time.Now().Sub(c.start) - c.timerOn = false - runtime.ReadMemStats(&memStats) - c.netAllocs += memStats.Mallocs - c.startAllocs - c.netBytes += memStats.TotalAlloc - c.startBytes - } -} - -// ResetTimer sets the elapsed benchmark time to zero. -// It does not affect whether the timer is running. -func (c *C) ResetTimer() { - if c.timerOn { - c.start = time.Now() - runtime.ReadMemStats(&memStats) - c.startAllocs = memStats.Mallocs - c.startBytes = memStats.TotalAlloc - } - c.duration = 0 - c.netAllocs = 0 - c.netBytes = 0 -} - -// SetBytes informs the number of bytes that the benchmark processes -// on each iteration. If this is called in a benchmark it will also -// report MB/s. -func (c *C) SetBytes(n int64) { - c.bytes = n -} - -func (c *C) nsPerOp() int64 { - if c.N <= 0 { - return 0 - } - return c.duration.Nanoseconds() / int64(c.N) -} - -func (c *C) mbPerSec() float64 { - if c.bytes <= 0 || c.duration <= 0 || c.N <= 0 { - return 0 - } - return (float64(c.bytes) * float64(c.N) / 1e6) / c.duration.Seconds() -} - -func (c *C) timerString() string { - if c.N <= 0 { - return fmt.Sprintf("%3.3fs", float64(c.duration.Nanoseconds())/1e9) - } - mbs := c.mbPerSec() - mb := "" - if mbs != 0 { - mb = fmt.Sprintf("\t%7.2f MB/s", mbs) - } - nsop := c.nsPerOp() - ns := fmt.Sprintf("%10d ns/op", nsop) - if c.N > 0 && nsop < 100 { - // The format specifiers here make sure that - // the ones digits line up for all three possible formats. - if nsop < 10 { - ns = fmt.Sprintf("%13.2f ns/op", float64(c.duration.Nanoseconds())/float64(c.N)) - } else { - ns = fmt.Sprintf("%12.1f ns/op", float64(c.duration.Nanoseconds())/float64(c.N)) - } - } - memStats := "" - if c.benchMem { - allocedBytes := fmt.Sprintf("%8d B/op", int64(c.netBytes)/int64(c.N)) - allocs := fmt.Sprintf("%8d allocs/op", int64(c.netAllocs)/int64(c.N)) - memStats = fmt.Sprintf("\t%s\t%s", allocedBytes, allocs) - } - return fmt.Sprintf("%8d\t%s%s%s", c.N, ns, mb, memStats) -} - -func min(x, y int) int { - if x > y { - return y - } - return x -} - -func max(x, y int) int { - if x < y { - return y - } - return x -} - -// roundDown10 rounds a number down to the nearest power of 10. -func roundDown10(n int) int { - var tens = 0 - // tens = floor(log_10(n)) - for n > 10 { - n = n / 10 - tens++ - } - // result = 10^tens - result := 1 - for i := 0; i < tens; i++ { - result *= 10 - } - return result -} - -// roundUp rounds x up to a number of the form [1eX, 2eX, 5eX]. -func roundUp(n int) int { - base := roundDown10(n) - if n < (2 * base) { - return 2 * base - } - if n < (5 * base) { - return 5 * base - } - return 10 * base -} diff --git a/vendor/gopkg.in/check.v1/benchmark_test.go b/vendor/gopkg.in/check.v1/benchmark_test.go deleted file mode 100644 index 8b6a8a6..0000000 --- a/vendor/gopkg.in/check.v1/benchmark_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// These tests verify the test running logic. - -package check_test - -import ( - "time" - . "gopkg.in/check.v1" -) - -var benchmarkS = Suite(&BenchmarkS{}) - -type BenchmarkS struct{} - -func (s *BenchmarkS) TestCountSuite(c *C) { - suitesRun += 1 -} - -func (s *BenchmarkS) TestBasicTestTiming(c *C) { - helper := FixtureHelper{sleepOn: "Test1", sleep: 1000000 * time.Nanosecond} - output := String{} - runConf := RunConf{Output: &output, Verbose: true} - Run(&helper, &runConf) - - expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test1\t0\\.0[0-9]+s\n" + - "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test2\t0\\.0[0-9]+s\n" - c.Assert(output.value, Matches, expected) -} - -func (s *BenchmarkS) TestStreamTestTiming(c *C) { - helper := FixtureHelper{sleepOn: "SetUpSuite", sleep: 1000000 * time.Nanosecond} - output := String{} - runConf := RunConf{Output: &output, Stream: true} - Run(&helper, &runConf) - - expected := "(?s).*\nPASS: check_test\\.go:[0-9]+: FixtureHelper\\.SetUpSuite\t[0-9]+\\.[0-9]+s\n.*" - c.Assert(output.value, Matches, expected) -} - -func (s *BenchmarkS) TestBenchmark(c *C) { - helper := FixtureHelper{sleep: 100000} - output := String{} - runConf := RunConf{ - Output: &output, - Benchmark: true, - BenchmarkTime: 10000000, - Filter: "Benchmark1", - } - Run(&helper, &runConf) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Benchmark1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "SetUpTest") - c.Check(helper.calls[5], Equals, "Benchmark1") - c.Check(helper.calls[6], Equals, "TearDownTest") - // ... and more. - - expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Benchmark1\t\\s+[0-9]+\t\\s+[0-9]+ ns/op\n" - c.Assert(output.value, Matches, expected) -} - -func (s *BenchmarkS) TestBenchmarkBytes(c *C) { - helper := FixtureHelper{sleep: 100000} - output := String{} - runConf := RunConf{ - Output: &output, - Benchmark: true, - BenchmarkTime: 10000000, - Filter: "Benchmark2", - } - Run(&helper, &runConf) - - expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Benchmark2\t\\s+[0-9]+\t\\s+[0-9]+ ns/op\t\\s+ *[1-9]\\.[0-9]{2} MB/s\n" - c.Assert(output.value, Matches, expected) -} - -func (s *BenchmarkS) TestBenchmarkMem(c *C) { - helper := FixtureHelper{sleep: 100000} - output := String{} - runConf := RunConf{ - Output: &output, - Benchmark: true, - BenchmarkMem: true, - BenchmarkTime: 10000000, - Filter: "Benchmark3", - } - Run(&helper, &runConf) - - expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Benchmark3\t\\s+ [0-9]+\t\\s+ *[0-9]+ ns/op\t\\s+ [0-9]+ B/op\t\\s+ [1-9]+ allocs/op\n" - c.Assert(output.value, Matches, expected) -} diff --git a/vendor/gopkg.in/check.v1/bootstrap_test.go b/vendor/gopkg.in/check.v1/bootstrap_test.go deleted file mode 100644 index e55f327..0000000 --- a/vendor/gopkg.in/check.v1/bootstrap_test.go +++ /dev/null @@ -1,82 +0,0 @@ -// These initial tests are for bootstrapping. They verify that we can -// basically use the testing infrastructure itself to check if the test -// system is working. -// -// These tests use will break down the test runner badly in case of -// errors because if they simply fail, we can't be sure the developer -// will ever see anything (because failing means the failing system -// somehow isn't working! :-) -// -// Do not assume *any* internal functionality works as expected besides -// what's actually tested here. - -package check_test - -import ( - "fmt" - "gopkg.in/check.v1" - "strings" -) - -type BootstrapS struct{} - -var boostrapS = check.Suite(&BootstrapS{}) - -func (s *BootstrapS) TestCountSuite(c *check.C) { - suitesRun += 1 -} - -func (s *BootstrapS) TestFailedAndFail(c *check.C) { - if c.Failed() { - critical("c.Failed() must be false first!") - } - c.Fail() - if !c.Failed() { - critical("c.Fail() didn't put the test in a failed state!") - } - c.Succeed() -} - -func (s *BootstrapS) TestFailedAndSucceed(c *check.C) { - c.Fail() - c.Succeed() - if c.Failed() { - critical("c.Succeed() didn't put the test back in a non-failed state") - } -} - -func (s *BootstrapS) TestLogAndGetTestLog(c *check.C) { - c.Log("Hello there!") - log := c.GetTestLog() - if log != "Hello there!\n" { - critical(fmt.Sprintf("Log() or GetTestLog() is not working! Got: %#v", log)) - } -} - -func (s *BootstrapS) TestLogfAndGetTestLog(c *check.C) { - c.Logf("Hello %v", "there!") - log := c.GetTestLog() - if log != "Hello there!\n" { - critical(fmt.Sprintf("Logf() or GetTestLog() is not working! Got: %#v", log)) - } -} - -func (s *BootstrapS) TestRunShowsErrors(c *check.C) { - output := String{} - check.Run(&FailHelper{}, &check.RunConf{Output: &output}) - if strings.Index(output.value, "Expected failure!") == -1 { - critical(fmt.Sprintf("RunWithWriter() output did not contain the "+ - "expected failure! Got: %#v", - output.value)) - } -} - -func (s *BootstrapS) TestRunDoesntShowSuccesses(c *check.C) { - output := String{} - check.Run(&SuccessHelper{}, &check.RunConf{Output: &output}) - if strings.Index(output.value, "Expected success!") != -1 { - critical(fmt.Sprintf("RunWithWriter() output contained a successful "+ - "test! Got: %#v", - output.value)) - } -} diff --git a/vendor/gopkg.in/check.v1/check.go b/vendor/gopkg.in/check.v1/check.go deleted file mode 100644 index de714c2..0000000 --- a/vendor/gopkg.in/check.v1/check.go +++ /dev/null @@ -1,882 +0,0 @@ -// Package check is a rich testing extension for Go's testing package. -// -// For details about the project, see: -// -// http://labix.org/gocheck -// -package check - -import ( - "bytes" - "errors" - "fmt" - "io" - "math/rand" - "os" - "path" - "path/filepath" - "reflect" - "regexp" - "runtime" - "strconv" - "strings" - "sync" - "sync/atomic" - "time" -) - -// ----------------------------------------------------------------------- -// Internal type which deals with suite method calling. - -const ( - fixtureKd = iota - testKd -) - -type funcKind int - -const ( - succeededSt = iota - failedSt - skippedSt - panickedSt - fixturePanickedSt - missedSt -) - -type funcStatus uint32 - -// A method value can't reach its own Method structure. -type methodType struct { - reflect.Value - Info reflect.Method -} - -func newMethod(receiver reflect.Value, i int) *methodType { - return &methodType{receiver.Method(i), receiver.Type().Method(i)} -} - -func (method *methodType) PC() uintptr { - return method.Info.Func.Pointer() -} - -func (method *methodType) suiteName() string { - t := method.Info.Type.In(0) - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - return t.Name() -} - -func (method *methodType) String() string { - return method.suiteName() + "." + method.Info.Name -} - -func (method *methodType) matches(re *regexp.Regexp) bool { - return (re.MatchString(method.Info.Name) || - re.MatchString(method.suiteName()) || - re.MatchString(method.String())) -} - -type C struct { - method *methodType - kind funcKind - testName string - _status funcStatus - logb *logger - logw io.Writer - done chan *C - reason string - mustFail bool - tempDir *tempDir - benchMem bool - startTime time.Time - timer -} - -func (c *C) status() funcStatus { - return funcStatus(atomic.LoadUint32((*uint32)(&c._status))) -} - -func (c *C) setStatus(s funcStatus) { - atomic.StoreUint32((*uint32)(&c._status), uint32(s)) -} - -func (c *C) stopNow() { - runtime.Goexit() -} - -// logger is a concurrency safe byte.Buffer -type logger struct { - sync.Mutex - writer bytes.Buffer -} - -func (l *logger) Write(buf []byte) (int, error) { - l.Lock() - defer l.Unlock() - return l.writer.Write(buf) -} - -func (l *logger) WriteTo(w io.Writer) (int64, error) { - l.Lock() - defer l.Unlock() - return l.writer.WriteTo(w) -} - -func (l *logger) String() string { - l.Lock() - defer l.Unlock() - return l.writer.String() -} - -// ----------------------------------------------------------------------- -// Handling of temporary files and directories. - -type tempDir struct { - sync.Mutex - path string - counter int -} - -func (td *tempDir) newPath() string { - td.Lock() - defer td.Unlock() - if td.path == "" { - var err error - for i := 0; i != 100; i++ { - path := fmt.Sprintf("%s%ccheck-%d", os.TempDir(), os.PathSeparator, rand.Int()) - if err = os.Mkdir(path, 0700); err == nil { - td.path = path - break - } - } - if td.path == "" { - panic("Couldn't create temporary directory: " + err.Error()) - } - } - result := filepath.Join(td.path, strconv.Itoa(td.counter)) - td.counter++ - return result -} - -func (td *tempDir) removeAll() { - td.Lock() - defer td.Unlock() - if td.path != "" { - err := os.RemoveAll(td.path) - if err != nil { - fmt.Fprintf(os.Stderr, "WARNING: Error cleaning up temporaries: "+err.Error()) - } - } -} - -// Create a new temporary directory which is automatically removed after -// the suite finishes running. -func (c *C) MkDir() string { - path := c.tempDir.newPath() - if err := os.Mkdir(path, 0700); err != nil { - panic(fmt.Sprintf("Couldn't create temporary directory %s: %s", path, err.Error())) - } - return path -} - -// ----------------------------------------------------------------------- -// Low-level logging functions. - -func (c *C) log(args ...interface{}) { - c.writeLog([]byte(fmt.Sprint(args...) + "\n")) -} - -func (c *C) logf(format string, args ...interface{}) { - c.writeLog([]byte(fmt.Sprintf(format+"\n", args...))) -} - -func (c *C) logNewLine() { - c.writeLog([]byte{'\n'}) -} - -func (c *C) writeLog(buf []byte) { - c.logb.Write(buf) - if c.logw != nil { - c.logw.Write(buf) - } -} - -func hasStringOrError(x interface{}) (ok bool) { - _, ok = x.(fmt.Stringer) - if ok { - return - } - _, ok = x.(error) - return -} - -func (c *C) logValue(label string, value interface{}) { - if label == "" { - if hasStringOrError(value) { - c.logf("... %#v (%q)", value, value) - } else { - c.logf("... %#v", value) - } - } else if value == nil { - c.logf("... %s = nil", label) - } else { - if hasStringOrError(value) { - fv := fmt.Sprintf("%#v", value) - qv := fmt.Sprintf("%q", value) - if fv != qv { - c.logf("... %s %s = %s (%s)", label, reflect.TypeOf(value), fv, qv) - return - } - } - if s, ok := value.(string); ok && isMultiLine(s) { - c.logf(`... %s %s = "" +`, label, reflect.TypeOf(value)) - c.logMultiLine(s) - } else { - c.logf("... %s %s = %#v", label, reflect.TypeOf(value), value) - } - } -} - -func formatMultiLine(s string, quote bool) []byte { - b := make([]byte, 0, len(s)*2) - i := 0 - n := len(s) - for i < n { - j := i + 1 - for j < n && s[j-1] != '\n' { - j++ - } - b = append(b, "... "...) - if quote { - b = strconv.AppendQuote(b, s[i:j]) - } else { - b = append(b, s[i:j]...) - b = bytes.TrimSpace(b) - } - if quote && j < n { - b = append(b, " +"...) - } - b = append(b, '\n') - i = j - } - return b -} - -func (c *C) logMultiLine(s string) { - c.writeLog(formatMultiLine(s, true)) -} - -func isMultiLine(s string) bool { - for i := 0; i+1 < len(s); i++ { - if s[i] == '\n' { - return true - } - } - return false -} - -func (c *C) logString(issue string) { - c.log("... ", issue) -} - -func (c *C) logCaller(skip int) { - // This is a bit heavier than it ought to be. - skip++ // Our own frame. - pc, callerFile, callerLine, ok := runtime.Caller(skip) - if !ok { - return - } - var testFile string - var testLine int - testFunc := runtime.FuncForPC(c.method.PC()) - if runtime.FuncForPC(pc) != testFunc { - for { - skip++ - if pc, file, line, ok := runtime.Caller(skip); ok { - // Note that the test line may be different on - // distinct calls for the same test. Showing - // the "internal" line is helpful when debugging. - if runtime.FuncForPC(pc) == testFunc { - testFile, testLine = file, line - break - } - } else { - break - } - } - } - if testFile != "" && (testFile != callerFile || testLine != callerLine) { - c.logCode(testFile, testLine) - } - c.logCode(callerFile, callerLine) -} - -func (c *C) logCode(path string, line int) { - c.logf("%s:%d:", nicePath(path), line) - code, err := printLine(path, line) - if code == "" { - code = "..." // XXX Open the file and take the raw line. - if err != nil { - code += err.Error() - } - } - c.log(indent(code, " ")) -} - -var valueGo = filepath.Join("reflect", "value.go") -var asmGo = filepath.Join("runtime", "asm_") - -func (c *C) logPanic(skip int, value interface{}) { - skip++ // Our own frame. - initialSkip := skip - for ; ; skip++ { - if pc, file, line, ok := runtime.Caller(skip); ok { - if skip == initialSkip { - c.logf("... Panic: %s (PC=0x%X)\n", value, pc) - } - name := niceFuncName(pc) - path := nicePath(file) - if strings.Contains(path, "/gopkg.in/check.v") { - continue - } - if name == "Value.call" && strings.HasSuffix(path, valueGo) { - continue - } - if (name == "call16" || name == "call32") && strings.Contains(path, asmGo) { - continue - } - c.logf("%s:%d\n in %s", nicePath(file), line, name) - } else { - break - } - } -} - -func (c *C) logSoftPanic(issue string) { - c.log("... Panic: ", issue) -} - -func (c *C) logArgPanic(method *methodType, expectedType string) { - c.logf("... Panic: %s argument should be %s", - niceFuncName(method.PC()), expectedType) -} - -// ----------------------------------------------------------------------- -// Some simple formatting helpers. - -var initWD, initWDErr = os.Getwd() - -func init() { - if initWDErr == nil { - initWD = strings.Replace(initWD, "\\", "/", -1) + "/" - } -} - -func nicePath(path string) string { - if initWDErr == nil { - if strings.HasPrefix(path, initWD) { - return path[len(initWD):] - } - } - return path -} - -func niceFuncPath(pc uintptr) string { - function := runtime.FuncForPC(pc) - if function != nil { - filename, line := function.FileLine(pc) - return fmt.Sprintf("%s:%d", nicePath(filename), line) - } - return "" -} - -func niceFuncName(pc uintptr) string { - function := runtime.FuncForPC(pc) - if function != nil { - name := path.Base(function.Name()) - if i := strings.Index(name, "."); i > 0 { - name = name[i+1:] - } - if strings.HasPrefix(name, "(*") { - if i := strings.Index(name, ")"); i > 0 { - name = name[2:i] + name[i+1:] - } - } - if i := strings.LastIndex(name, ".*"); i != -1 { - name = name[:i] + "." + name[i+2:] - } - if i := strings.LastIndex(name, "·"); i != -1 { - name = name[:i] + "." + name[i+2:] - } - return name - } - return "" -} - -// ----------------------------------------------------------------------- -// Result tracker to aggregate call results. - -type Result struct { - Succeeded int - Failed int - Skipped int - Panicked int - FixturePanicked int - ExpectedFailures int - Missed int // Not even tried to run, related to a panic in the fixture. - RunError error // Houston, we've got a problem. - WorkDir string // If KeepWorkDir is true -} - -type resultTracker struct { - result Result - _lastWasProblem bool - _waiting int - _missed int - _expectChan chan *C - _doneChan chan *C - _stopChan chan bool -} - -func newResultTracker() *resultTracker { - return &resultTracker{_expectChan: make(chan *C), // Synchronous - _doneChan: make(chan *C, 32), // Asynchronous - _stopChan: make(chan bool)} // Synchronous -} - -func (tracker *resultTracker) start() { - go tracker._loopRoutine() -} - -func (tracker *resultTracker) waitAndStop() { - <-tracker._stopChan -} - -func (tracker *resultTracker) expectCall(c *C) { - tracker._expectChan <- c -} - -func (tracker *resultTracker) callDone(c *C) { - tracker._doneChan <- c -} - -func (tracker *resultTracker) _loopRoutine() { - for { - var c *C - if tracker._waiting > 0 { - // Calls still running. Can't stop. - select { - // XXX Reindent this (not now to make diff clear) - case <-tracker._expectChan: - tracker._waiting++ - case c = <-tracker._doneChan: - tracker._waiting-- - switch c.status() { - case succeededSt: - if c.kind == testKd { - if c.mustFail { - tracker.result.ExpectedFailures++ - } else { - tracker.result.Succeeded++ - } - } - case failedSt: - tracker.result.Failed++ - case panickedSt: - if c.kind == fixtureKd { - tracker.result.FixturePanicked++ - } else { - tracker.result.Panicked++ - } - case fixturePanickedSt: - // Track it as missed, since the panic - // was on the fixture, not on the test. - tracker.result.Missed++ - case missedSt: - tracker.result.Missed++ - case skippedSt: - if c.kind == testKd { - tracker.result.Skipped++ - } - } - } - } else { - // No calls. Can stop, but no done calls here. - select { - case tracker._stopChan <- true: - return - case <-tracker._expectChan: - tracker._waiting++ - case <-tracker._doneChan: - panic("Tracker got an unexpected done call.") - } - } - } -} - -// ----------------------------------------------------------------------- -// The underlying suite runner. - -type suiteRunner struct { - suite interface{} - setUpSuite, tearDownSuite *methodType - setUpTest, tearDownTest *methodType - tests []*methodType - tracker *resultTracker - tempDir *tempDir - keepDir bool - output *outputWriter - reportedProblemLast bool - benchTime time.Duration - benchMem bool -} - -type RunConf struct { - Output io.Writer - Stream bool - Verbose bool - Filter string - Benchmark bool - BenchmarkTime time.Duration // Defaults to 1 second - BenchmarkMem bool - KeepWorkDir bool -} - -// Create a new suiteRunner able to run all methods in the given suite. -func newSuiteRunner(suite interface{}, runConf *RunConf) *suiteRunner { - var conf RunConf - if runConf != nil { - conf = *runConf - } - if conf.Output == nil { - conf.Output = os.Stdout - } - if conf.Benchmark { - conf.Verbose = true - } - - suiteType := reflect.TypeOf(suite) - suiteNumMethods := suiteType.NumMethod() - suiteValue := reflect.ValueOf(suite) - - runner := &suiteRunner{ - suite: suite, - output: newOutputWriter(conf.Output, conf.Stream, conf.Verbose), - tracker: newResultTracker(), - benchTime: conf.BenchmarkTime, - benchMem: conf.BenchmarkMem, - tempDir: &tempDir{}, - keepDir: conf.KeepWorkDir, - tests: make([]*methodType, 0, suiteNumMethods), - } - if runner.benchTime == 0 { - runner.benchTime = 1 * time.Second - } - - var filterRegexp *regexp.Regexp - if conf.Filter != "" { - regexp, err := regexp.Compile(conf.Filter) - if err != nil { - msg := "Bad filter expression: " + err.Error() - runner.tracker.result.RunError = errors.New(msg) - return runner - } - filterRegexp = regexp - } - - for i := 0; i != suiteNumMethods; i++ { - method := newMethod(suiteValue, i) - switch method.Info.Name { - case "SetUpSuite": - runner.setUpSuite = method - case "TearDownSuite": - runner.tearDownSuite = method - case "SetUpTest": - runner.setUpTest = method - case "TearDownTest": - runner.tearDownTest = method - default: - prefix := "Test" - if conf.Benchmark { - prefix = "Benchmark" - } - if !strings.HasPrefix(method.Info.Name, prefix) { - continue - } - if filterRegexp == nil || method.matches(filterRegexp) { - runner.tests = append(runner.tests, method) - } - } - } - return runner -} - -// Run all methods in the given suite. -func (runner *suiteRunner) run() *Result { - if runner.tracker.result.RunError == nil && len(runner.tests) > 0 { - runner.tracker.start() - if runner.checkFixtureArgs() { - c := runner.runFixture(runner.setUpSuite, "", nil) - if c == nil || c.status() == succeededSt { - for i := 0; i != len(runner.tests); i++ { - c := runner.runTest(runner.tests[i]) - if c.status() == fixturePanickedSt { - runner.skipTests(missedSt, runner.tests[i+1:]) - break - } - } - } else if c != nil && c.status() == skippedSt { - runner.skipTests(skippedSt, runner.tests) - } else { - runner.skipTests(missedSt, runner.tests) - } - runner.runFixture(runner.tearDownSuite, "", nil) - } else { - runner.skipTests(missedSt, runner.tests) - } - runner.tracker.waitAndStop() - if runner.keepDir { - runner.tracker.result.WorkDir = runner.tempDir.path - } else { - runner.tempDir.removeAll() - } - } - return &runner.tracker.result -} - -// Create a call object with the given suite method, and fork a -// goroutine with the provided dispatcher for running it. -func (runner *suiteRunner) forkCall(method *methodType, kind funcKind, testName string, logb *logger, dispatcher func(c *C)) *C { - var logw io.Writer - if runner.output.Stream { - logw = runner.output - } - if logb == nil { - logb = new(logger) - } - c := &C{ - method: method, - kind: kind, - testName: testName, - logb: logb, - logw: logw, - tempDir: runner.tempDir, - done: make(chan *C, 1), - timer: timer{benchTime: runner.benchTime}, - startTime: time.Now(), - benchMem: runner.benchMem, - } - runner.tracker.expectCall(c) - go (func() { - runner.reportCallStarted(c) - defer runner.callDone(c) - dispatcher(c) - })() - return c -} - -// Same as forkCall(), but wait for call to finish before returning. -func (runner *suiteRunner) runFunc(method *methodType, kind funcKind, testName string, logb *logger, dispatcher func(c *C)) *C { - c := runner.forkCall(method, kind, testName, logb, dispatcher) - <-c.done - return c -} - -// Handle a finished call. If there were any panics, update the call status -// accordingly. Then, mark the call as done and report to the tracker. -func (runner *suiteRunner) callDone(c *C) { - value := recover() - if value != nil { - switch v := value.(type) { - case *fixturePanic: - if v.status == skippedSt { - c.setStatus(skippedSt) - } else { - c.logSoftPanic("Fixture has panicked (see related PANIC)") - c.setStatus(fixturePanickedSt) - } - default: - c.logPanic(1, value) - c.setStatus(panickedSt) - } - } - if c.mustFail { - switch c.status() { - case failedSt: - c.setStatus(succeededSt) - case succeededSt: - c.setStatus(failedSt) - c.logString("Error: Test succeeded, but was expected to fail") - c.logString("Reason: " + c.reason) - } - } - - runner.reportCallDone(c) - c.done <- c -} - -// Runs a fixture call synchronously. The fixture will still be run in a -// goroutine like all suite methods, but this method will not return -// while the fixture goroutine is not done, because the fixture must be -// run in a desired order. -func (runner *suiteRunner) runFixture(method *methodType, testName string, logb *logger) *C { - if method != nil { - c := runner.runFunc(method, fixtureKd, testName, logb, func(c *C) { - c.ResetTimer() - c.StartTimer() - defer c.StopTimer() - c.method.Call([]reflect.Value{reflect.ValueOf(c)}) - }) - return c - } - return nil -} - -// Run the fixture method with runFixture(), but panic with a fixturePanic{} -// in case the fixture method panics. This makes it easier to track the -// fixture panic together with other call panics within forkTest(). -func (runner *suiteRunner) runFixtureWithPanic(method *methodType, testName string, logb *logger, skipped *bool) *C { - if skipped != nil && *skipped { - return nil - } - c := runner.runFixture(method, testName, logb) - if c != nil && c.status() != succeededSt { - if skipped != nil { - *skipped = c.status() == skippedSt - } - panic(&fixturePanic{c.status(), method}) - } - return c -} - -type fixturePanic struct { - status funcStatus - method *methodType -} - -// Run the suite test method, together with the test-specific fixture, -// asynchronously. -func (runner *suiteRunner) forkTest(method *methodType) *C { - testName := method.String() - return runner.forkCall(method, testKd, testName, nil, func(c *C) { - var skipped bool - defer runner.runFixtureWithPanic(runner.tearDownTest, testName, nil, &skipped) - defer c.StopTimer() - benchN := 1 - for { - runner.runFixtureWithPanic(runner.setUpTest, testName, c.logb, &skipped) - mt := c.method.Type() - if mt.NumIn() != 1 || mt.In(0) != reflect.TypeOf(c) { - // Rather than a plain panic, provide a more helpful message when - // the argument type is incorrect. - c.setStatus(panickedSt) - c.logArgPanic(c.method, "*check.C") - return - } - if strings.HasPrefix(c.method.Info.Name, "Test") { - c.ResetTimer() - c.StartTimer() - c.method.Call([]reflect.Value{reflect.ValueOf(c)}) - return - } - if !strings.HasPrefix(c.method.Info.Name, "Benchmark") { - panic("unexpected method prefix: " + c.method.Info.Name) - } - - runtime.GC() - c.N = benchN - c.ResetTimer() - c.StartTimer() - c.method.Call([]reflect.Value{reflect.ValueOf(c)}) - c.StopTimer() - if c.status() != succeededSt || c.duration >= c.benchTime || benchN >= 1e9 { - return - } - perOpN := int(1e9) - if c.nsPerOp() != 0 { - perOpN = int(c.benchTime.Nanoseconds() / c.nsPerOp()) - } - - // Logic taken from the stock testing package: - // - Run more iterations than we think we'll need for a second (1.5x). - // - Don't grow too fast in case we had timing errors previously. - // - Be sure to run at least one more than last time. - benchN = max(min(perOpN+perOpN/2, 100*benchN), benchN+1) - benchN = roundUp(benchN) - - skipped = true // Don't run the deferred one if this panics. - runner.runFixtureWithPanic(runner.tearDownTest, testName, nil, nil) - skipped = false - } - }) -} - -// Same as forkTest(), but wait for the test to finish before returning. -func (runner *suiteRunner) runTest(method *methodType) *C { - c := runner.forkTest(method) - <-c.done - return c -} - -// Helper to mark tests as skipped or missed. A bit heavy for what -// it does, but it enables homogeneous handling of tracking, including -// nice verbose output. -func (runner *suiteRunner) skipTests(status funcStatus, methods []*methodType) { - for _, method := range methods { - runner.runFunc(method, testKd, "", nil, func(c *C) { - c.setStatus(status) - }) - } -} - -// Verify if the fixture arguments are *check.C. In case of errors, -// log the error as a panic in the fixture method call, and return false. -func (runner *suiteRunner) checkFixtureArgs() bool { - succeeded := true - argType := reflect.TypeOf(&C{}) - for _, method := range []*methodType{runner.setUpSuite, runner.tearDownSuite, runner.setUpTest, runner.tearDownTest} { - if method != nil { - mt := method.Type() - if mt.NumIn() != 1 || mt.In(0) != argType { - succeeded = false - runner.runFunc(method, fixtureKd, "", nil, func(c *C) { - c.logArgPanic(method, "*check.C") - c.setStatus(panickedSt) - }) - } - } - } - return succeeded -} - -func (runner *suiteRunner) reportCallStarted(c *C) { - runner.output.WriteCallStarted("START", c) -} - -func (runner *suiteRunner) reportCallDone(c *C) { - runner.tracker.callDone(c) - switch c.status() { - case succeededSt: - if c.mustFail { - runner.output.WriteCallSuccess("FAIL EXPECTED", c) - } else { - runner.output.WriteCallSuccess("PASS", c) - } - case skippedSt: - runner.output.WriteCallSuccess("SKIP", c) - case failedSt: - runner.output.WriteCallProblem("FAIL", c) - case panickedSt: - runner.output.WriteCallProblem("PANIC", c) - case fixturePanickedSt: - // That's a testKd call reporting that its fixture - // has panicked. The fixture call which caused the - // panic itself was tracked above. We'll report to - // aid debugging. - runner.output.WriteCallProblem("PANIC", c) - case missedSt: - runner.output.WriteCallSuccess("MISS", c) - } -} diff --git a/vendor/gopkg.in/check.v1/check_test.go b/vendor/gopkg.in/check.v1/check_test.go deleted file mode 100644 index e8b0f52..0000000 --- a/vendor/gopkg.in/check.v1/check_test.go +++ /dev/null @@ -1,207 +0,0 @@ -// This file contains just a few generic helpers which are used by the -// other test files. - -package check_test - -import ( - "flag" - "fmt" - "os" - "regexp" - "runtime" - "testing" - "time" - - "gopkg.in/check.v1" -) - -// We count the number of suites run at least to get a vague hint that the -// test suite is behaving as it should. Otherwise a bug introduced at the -// very core of the system could go unperceived. -const suitesRunExpected = 8 - -var suitesRun int = 0 - -func Test(t *testing.T) { - check.TestingT(t) - if suitesRun != suitesRunExpected && flag.Lookup("check.f").Value.String() == "" { - critical(fmt.Sprintf("Expected %d suites to run rather than %d", - suitesRunExpected, suitesRun)) - } -} - -// ----------------------------------------------------------------------- -// Helper functions. - -// Break down badly. This is used in test cases which can't yet assume -// that the fundamental bits are working. -func critical(error string) { - fmt.Fprintln(os.Stderr, "CRITICAL: "+error) - os.Exit(1) -} - -// Return the file line where it's called. -func getMyLine() int { - if _, _, line, ok := runtime.Caller(1); ok { - return line - } - return -1 -} - -// ----------------------------------------------------------------------- -// Helper type implementing a basic io.Writer for testing output. - -// Type implementing the io.Writer interface for analyzing output. -type String struct { - value string -} - -// The only function required by the io.Writer interface. Will append -// written data to the String.value string. -func (s *String) Write(p []byte) (n int, err error) { - s.value += string(p) - return len(p), nil -} - -// Trivial wrapper to test errors happening on a different file -// than the test itself. -func checkEqualWrapper(c *check.C, obtained, expected interface{}) (result bool, line int) { - return c.Check(obtained, check.Equals, expected), getMyLine() -} - -// ----------------------------------------------------------------------- -// Helper suite for testing basic fail behavior. - -type FailHelper struct { - testLine int -} - -func (s *FailHelper) TestLogAndFail(c *check.C) { - s.testLine = getMyLine() - 1 - c.Log("Expected failure!") - c.Fail() -} - -// ----------------------------------------------------------------------- -// Helper suite for testing basic success behavior. - -type SuccessHelper struct{} - -func (s *SuccessHelper) TestLogAndSucceed(c *check.C) { - c.Log("Expected success!") -} - -// ----------------------------------------------------------------------- -// Helper suite for testing ordering and behavior of fixture. - -type FixtureHelper struct { - calls []string - panicOn string - skip bool - skipOnN int - sleepOn string - sleep time.Duration - bytes int64 -} - -func (s *FixtureHelper) trace(name string, c *check.C) { - s.calls = append(s.calls, name) - if name == s.panicOn { - panic(name) - } - if s.sleep > 0 && s.sleepOn == name { - time.Sleep(s.sleep) - } - if s.skip && s.skipOnN == len(s.calls)-1 { - c.Skip("skipOnN == n") - } -} - -func (s *FixtureHelper) SetUpSuite(c *check.C) { - s.trace("SetUpSuite", c) -} - -func (s *FixtureHelper) TearDownSuite(c *check.C) { - s.trace("TearDownSuite", c) -} - -func (s *FixtureHelper) SetUpTest(c *check.C) { - s.trace("SetUpTest", c) -} - -func (s *FixtureHelper) TearDownTest(c *check.C) { - s.trace("TearDownTest", c) -} - -func (s *FixtureHelper) Test1(c *check.C) { - s.trace("Test1", c) -} - -func (s *FixtureHelper) Test2(c *check.C) { - s.trace("Test2", c) -} - -func (s *FixtureHelper) Benchmark1(c *check.C) { - s.trace("Benchmark1", c) - for i := 0; i < c.N; i++ { - time.Sleep(s.sleep) - } -} - -func (s *FixtureHelper) Benchmark2(c *check.C) { - s.trace("Benchmark2", c) - c.SetBytes(1024) - for i := 0; i < c.N; i++ { - time.Sleep(s.sleep) - } -} - -func (s *FixtureHelper) Benchmark3(c *check.C) { - var x []int64 - s.trace("Benchmark3", c) - for i := 0; i < c.N; i++ { - time.Sleep(s.sleep) - x = make([]int64, 5) - _ = x - } -} - -// ----------------------------------------------------------------------- -// Helper which checks the state of the test and ensures that it matches -// the given expectations. Depends on c.Errorf() working, so shouldn't -// be used to test this one function. - -type expectedState struct { - name string - result interface{} - failed bool - log string -} - -// Verify the state of the test. Note that since this also verifies if -// the test is supposed to be in a failed state, no other checks should -// be done in addition to what is being tested. -func checkState(c *check.C, result interface{}, expected *expectedState) { - failed := c.Failed() - c.Succeed() - log := c.GetTestLog() - matched, matchError := regexp.MatchString("^"+expected.log+"$", log) - if matchError != nil { - c.Errorf("Error in matching expression used in testing %s: %v", - expected.name, matchError) - } else if !matched { - c.Errorf("%s logged:\n----------\n%s----------\n\nExpected:\n----------\n%s\n----------", - expected.name, log, expected.log) - } - if result != expected.result { - c.Errorf("%s returned %#v rather than %#v", - expected.name, result, expected.result) - } - if failed != expected.failed { - if failed { - c.Errorf("%s has failed when it shouldn't", expected.name) - } else { - c.Errorf("%s has not failed when it should", expected.name) - } - } -} diff --git a/vendor/gopkg.in/check.v1/checkers.go b/vendor/gopkg.in/check.v1/checkers.go deleted file mode 100644 index cdd7f9a..0000000 --- a/vendor/gopkg.in/check.v1/checkers.go +++ /dev/null @@ -1,524 +0,0 @@ -package check - -import ( - "fmt" - "reflect" - "regexp" - "strings" - - "github.com/kr/pretty" -) - -// ----------------------------------------------------------------------- -// CommentInterface and Commentf helper, to attach extra information to checks. - -type comment struct { - format string - args []interface{} -} - -// Commentf returns an infomational value to use with Assert or Check calls. -// If the checker test fails, the provided arguments will be passed to -// fmt.Sprintf, and will be presented next to the logged failure. -// -// For example: -// -// c.Assert(v, Equals, 42, Commentf("Iteration #%d failed.", i)) -// -// Note that if the comment is constant, a better option is to -// simply use a normal comment right above or next to the line, as -// it will also get printed with any errors: -// -// c.Assert(l, Equals, 8192) // Ensure buffer size is correct (bug #123) -// -func Commentf(format string, args ...interface{}) CommentInterface { - return &comment{format, args} -} - -// CommentInterface must be implemented by types that attach extra -// information to failed checks. See the Commentf function for details. -type CommentInterface interface { - CheckCommentString() string -} - -func (c *comment) CheckCommentString() string { - return fmt.Sprintf(c.format, c.args...) -} - -// ----------------------------------------------------------------------- -// The Checker interface. - -// The Checker interface must be provided by checkers used with -// the Assert and Check verification methods. -type Checker interface { - Info() *CheckerInfo - Check(params []interface{}, names []string) (result bool, error string) -} - -// See the Checker interface. -type CheckerInfo struct { - Name string - Params []string -} - -func (info *CheckerInfo) Info() *CheckerInfo { - return info -} - -// ----------------------------------------------------------------------- -// Not checker logic inverter. - -// The Not checker inverts the logic of the provided checker. The -// resulting checker will succeed where the original one failed, and -// vice-versa. -// -// For example: -// -// c.Assert(a, Not(Equals), b) -// -func Not(checker Checker) Checker { - return ¬Checker{checker} -} - -type notChecker struct { - sub Checker -} - -func (checker *notChecker) Info() *CheckerInfo { - info := *checker.sub.Info() - info.Name = "Not(" + info.Name + ")" - return &info -} - -func (checker *notChecker) Check(params []interface{}, names []string) (result bool, error string) { - result, error = checker.sub.Check(params, names) - result = !result - if result { - // clear error message if the new result is true - error = "" - } - return -} - -// ----------------------------------------------------------------------- -// IsNil checker. - -type isNilChecker struct { - *CheckerInfo -} - -// The IsNil checker tests whether the obtained value is nil. -// -// For example: -// -// c.Assert(err, IsNil) -// -var IsNil Checker = &isNilChecker{ - &CheckerInfo{Name: "IsNil", Params: []string{"value"}}, -} - -func (checker *isNilChecker) Check(params []interface{}, names []string) (result bool, error string) { - return isNil(params[0]), "" -} - -func isNil(obtained interface{}) (result bool) { - if obtained == nil { - result = true - } else { - switch v := reflect.ValueOf(obtained); v.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - return v.IsNil() - } - } - return -} - -// ----------------------------------------------------------------------- -// NotNil checker. Alias for Not(IsNil), since it's so common. - -type notNilChecker struct { - *CheckerInfo -} - -// The NotNil checker verifies that the obtained value is not nil. -// -// For example: -// -// c.Assert(iface, NotNil) -// -// This is an alias for Not(IsNil), made available since it's a -// fairly common check. -// -var NotNil Checker = ¬NilChecker{ - &CheckerInfo{Name: "NotNil", Params: []string{"value"}}, -} - -func (checker *notNilChecker) Check(params []interface{}, names []string) (result bool, error string) { - return !isNil(params[0]), "" -} - -// ----------------------------------------------------------------------- -// Equals checker. - -func diffworthy(a interface{}) bool { - t := reflect.TypeOf(a) - switch t.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.Struct, reflect.String, reflect.Ptr: - return true - } - return false -} - -// formatUnequal will dump the actual and expected values into a textual -// representation and return an error message containing a diff. -func formatUnequal(obtained interface{}, expected interface{}) string { - // We do not do diffs for basic types because go-check already - // shows them very cleanly. - if !diffworthy(obtained) || !diffworthy(expected) { - return "" - } - - // Handle strings, short strings are ignored (go-check formats - // them very nicely already). We do multi-line strings by - // generating two string slices and using kr.Diff to compare - // those (kr.Diff does not do string diffs by itself). - aStr, aOK := obtained.(string) - bStr, bOK := expected.(string) - if aOK && bOK { - l1 := strings.Split(aStr, "\n") - l2 := strings.Split(bStr, "\n") - // the "2" here is a bit arbitrary - if len(l1) > 2 && len(l2) > 2 { - diff := pretty.Diff(l1, l2) - return fmt.Sprintf(`String difference: -%s`, formatMultiLine(strings.Join(diff, "\n"), false)) - } - // string too short - return "" - } - - // generic diff - diff := pretty.Diff(obtained, expected) - if len(diff) == 0 { - // No diff, this happens when e.g. just struct - // pointers are different but the structs have - // identical values. - return "" - } - - return fmt.Sprintf(`Difference: -%s`, formatMultiLine(strings.Join(diff, "\n"), false)) -} - -type equalsChecker struct { - *CheckerInfo -} - -// The Equals checker verifies that the obtained value is equal to -// the expected value, according to usual Go semantics for ==. -// -// For example: -// -// c.Assert(value, Equals, 42) -// -var Equals Checker = &equalsChecker{ - &CheckerInfo{Name: "Equals", Params: []string{"obtained", "expected"}}, -} - -func (checker *equalsChecker) Check(params []interface{}, names []string) (result bool, error string) { - defer func() { - if v := recover(); v != nil { - result = false - error = fmt.Sprint(v) - } - }() - - result = params[0] == params[1] - if !result { - error = formatUnequal(params[0], params[1]) - } - return -} - -// ----------------------------------------------------------------------- -// DeepEquals checker. - -type deepEqualsChecker struct { - *CheckerInfo -} - -// The DeepEquals checker verifies that the obtained value is deep-equal to -// the expected value. The check will work correctly even when facing -// slices, interfaces, and values of different types (which always fail -// the test). -// -// For example: -// -// c.Assert(value, DeepEquals, 42) -// c.Assert(array, DeepEquals, []string{"hi", "there"}) -// -var DeepEquals Checker = &deepEqualsChecker{ - &CheckerInfo{Name: "DeepEquals", Params: []string{"obtained", "expected"}}, -} - -func (checker *deepEqualsChecker) Check(params []interface{}, names []string) (result bool, error string) { - result = reflect.DeepEqual(params[0], params[1]) - if !result { - error = formatUnequal(params[0], params[1]) - } - return -} - -// ----------------------------------------------------------------------- -// HasLen checker. - -type hasLenChecker struct { - *CheckerInfo -} - -// The HasLen checker verifies that the obtained value has the -// provided length. In many cases this is superior to using Equals -// in conjunction with the len function because in case the check -// fails the value itself will be printed, instead of its length, -// providing more details for figuring the problem. -// -// For example: -// -// c.Assert(list, HasLen, 5) -// -var HasLen Checker = &hasLenChecker{ - &CheckerInfo{Name: "HasLen", Params: []string{"obtained", "n"}}, -} - -func (checker *hasLenChecker) Check(params []interface{}, names []string) (result bool, error string) { - n, ok := params[1].(int) - if !ok { - return false, "n must be an int" - } - value := reflect.ValueOf(params[0]) - switch value.Kind() { - case reflect.Map, reflect.Array, reflect.Slice, reflect.Chan, reflect.String: - default: - return false, "obtained value type has no length" - } - return value.Len() == n, "" -} - -// ----------------------------------------------------------------------- -// ErrorMatches checker. - -type errorMatchesChecker struct { - *CheckerInfo -} - -// The ErrorMatches checker verifies that the error value -// is non nil and matches the regular expression provided. -// -// For example: -// -// c.Assert(err, ErrorMatches, "perm.*denied") -// -var ErrorMatches Checker = errorMatchesChecker{ - &CheckerInfo{Name: "ErrorMatches", Params: []string{"value", "regex"}}, -} - -func (checker errorMatchesChecker) Check(params []interface{}, names []string) (result bool, errStr string) { - if params[0] == nil { - return false, "Error value is nil" - } - err, ok := params[0].(error) - if !ok { - return false, "Value is not an error" - } - params[0] = err.Error() - names[0] = "error" - return matches(params[0], params[1]) -} - -// ----------------------------------------------------------------------- -// Matches checker. - -type matchesChecker struct { - *CheckerInfo -} - -// The Matches checker verifies that the string provided as the obtained -// value (or the string resulting from obtained.String()) matches the -// regular expression provided. -// -// For example: -// -// c.Assert(err, Matches, "perm.*denied") -// -var Matches Checker = &matchesChecker{ - &CheckerInfo{Name: "Matches", Params: []string{"value", "regex"}}, -} - -func (checker *matchesChecker) Check(params []interface{}, names []string) (result bool, error string) { - return matches(params[0], params[1]) -} - -func matches(value, regex interface{}) (result bool, error string) { - reStr, ok := regex.(string) - if !ok { - return false, "Regex must be a string" - } - valueStr, valueIsStr := value.(string) - if !valueIsStr { - if valueWithStr, valueHasStr := value.(fmt.Stringer); valueHasStr { - valueStr, valueIsStr = valueWithStr.String(), true - } - } - if valueIsStr { - matches, err := regexp.MatchString("^"+reStr+"$", valueStr) - if err != nil { - return false, "Can't compile regex: " + err.Error() - } - return matches, "" - } - return false, "Obtained value is not a string and has no .String()" -} - -// ----------------------------------------------------------------------- -// Panics checker. - -type panicsChecker struct { - *CheckerInfo -} - -// The Panics checker verifies that calling the provided zero-argument -// function will cause a panic which is deep-equal to the provided value. -// -// For example: -// -// c.Assert(func() { f(1, 2) }, Panics, &SomeErrorType{"BOOM"}). -// -// -var Panics Checker = &panicsChecker{ - &CheckerInfo{Name: "Panics", Params: []string{"function", "expected"}}, -} - -func (checker *panicsChecker) Check(params []interface{}, names []string) (result bool, error string) { - f := reflect.ValueOf(params[0]) - if f.Kind() != reflect.Func || f.Type().NumIn() != 0 { - return false, "Function must take zero arguments" - } - defer func() { - // If the function has not panicked, then don't do the check. - if error != "" { - return - } - params[0] = recover() - names[0] = "panic" - result = reflect.DeepEqual(params[0], params[1]) - }() - f.Call(nil) - return false, "Function has not panicked" -} - -type panicMatchesChecker struct { - *CheckerInfo -} - -// The PanicMatches checker verifies that calling the provided zero-argument -// function will cause a panic with an error value matching -// the regular expression provided. -// -// For example: -// -// c.Assert(func() { f(1, 2) }, PanicMatches, `open.*: no such file or directory`). -// -// -var PanicMatches Checker = &panicMatchesChecker{ - &CheckerInfo{Name: "PanicMatches", Params: []string{"function", "expected"}}, -} - -func (checker *panicMatchesChecker) Check(params []interface{}, names []string) (result bool, errmsg string) { - f := reflect.ValueOf(params[0]) - if f.Kind() != reflect.Func || f.Type().NumIn() != 0 { - return false, "Function must take zero arguments" - } - defer func() { - // If the function has not panicked, then don't do the check. - if errmsg != "" { - return - } - obtained := recover() - names[0] = "panic" - if e, ok := obtained.(error); ok { - params[0] = e.Error() - } else if _, ok := obtained.(string); ok { - params[0] = obtained - } else { - errmsg = "Panic value is not a string or an error" - return - } - result, errmsg = matches(params[0], params[1]) - }() - f.Call(nil) - return false, "Function has not panicked" -} - -// ----------------------------------------------------------------------- -// FitsTypeOf checker. - -type fitsTypeChecker struct { - *CheckerInfo -} - -// The FitsTypeOf checker verifies that the obtained value is -// assignable to a variable with the same type as the provided -// sample value. -// -// For example: -// -// c.Assert(value, FitsTypeOf, int64(0)) -// c.Assert(value, FitsTypeOf, os.Error(nil)) -// -var FitsTypeOf Checker = &fitsTypeChecker{ - &CheckerInfo{Name: "FitsTypeOf", Params: []string{"obtained", "sample"}}, -} - -func (checker *fitsTypeChecker) Check(params []interface{}, names []string) (result bool, error string) { - obtained := reflect.ValueOf(params[0]) - sample := reflect.ValueOf(params[1]) - if !obtained.IsValid() { - return false, "" - } - if !sample.IsValid() { - return false, "Invalid sample value" - } - return obtained.Type().AssignableTo(sample.Type()), "" -} - -// ----------------------------------------------------------------------- -// Implements checker. - -type implementsChecker struct { - *CheckerInfo -} - -// The Implements checker verifies that the obtained value -// implements the interface specified via a pointer to an interface -// variable. -// -// For example: -// -// var e os.Error -// c.Assert(err, Implements, &e) -// -var Implements Checker = &implementsChecker{ - &CheckerInfo{Name: "Implements", Params: []string{"obtained", "ifaceptr"}}, -} - -func (checker *implementsChecker) Check(params []interface{}, names []string) (result bool, error string) { - obtained := reflect.ValueOf(params[0]) - ifaceptr := reflect.ValueOf(params[1]) - if !obtained.IsValid() { - return false, "" - } - if !ifaceptr.IsValid() || ifaceptr.Kind() != reflect.Ptr || ifaceptr.Elem().Kind() != reflect.Interface { - return false, "ifaceptr should be a pointer to an interface variable" - } - return obtained.Type().Implements(ifaceptr.Elem().Type()), "" -} diff --git a/vendor/gopkg.in/check.v1/checkers_test.go b/vendor/gopkg.in/check.v1/checkers_test.go deleted file mode 100644 index a2e87b6..0000000 --- a/vendor/gopkg.in/check.v1/checkers_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package check_test - -import ( - "errors" - "reflect" - "runtime" - - "gopkg.in/check.v1" -) - -type CheckersS struct{} - -var _ = check.Suite(&CheckersS{}) - -func testInfo(c *check.C, checker check.Checker, name string, paramNames []string) { - info := checker.Info() - if info.Name != name { - c.Fatalf("Got name %s, expected %s", info.Name, name) - } - if !reflect.DeepEqual(info.Params, paramNames) { - c.Fatalf("Got param names %#v, expected %#v", info.Params, paramNames) - } -} - -func testCheck(c *check.C, checker check.Checker, result bool, error string, params ...interface{}) ([]interface{}, []string) { - info := checker.Info() - if len(params) != len(info.Params) { - c.Fatalf("unexpected param count in test; expected %d got %d", len(info.Params), len(params)) - } - names := append([]string{}, info.Params...) - result_, error_ := checker.Check(params, names) - if result_ != result || error_ != error { - c.Fatalf("%s.Check(%#v) returned (%#v, %#v) rather than (%#v, %#v)", - info.Name, params, result_, error_, result, error) - } - return params, names -} - -func (s *CheckersS) TestComment(c *check.C) { - bug := check.Commentf("a %d bc", 42) - comment := bug.CheckCommentString() - if comment != "a 42 bc" { - c.Fatalf("Commentf returned %#v", comment) - } -} - -func (s *CheckersS) TestIsNil(c *check.C) { - testInfo(c, check.IsNil, "IsNil", []string{"value"}) - - testCheck(c, check.IsNil, true, "", nil) - testCheck(c, check.IsNil, false, "", "a") - - testCheck(c, check.IsNil, true, "", (chan int)(nil)) - testCheck(c, check.IsNil, false, "", make(chan int)) - testCheck(c, check.IsNil, true, "", (error)(nil)) - testCheck(c, check.IsNil, false, "", errors.New("")) - testCheck(c, check.IsNil, true, "", ([]int)(nil)) - testCheck(c, check.IsNil, false, "", make([]int, 1)) - testCheck(c, check.IsNil, false, "", int(0)) -} - -func (s *CheckersS) TestNotNil(c *check.C) { - testInfo(c, check.NotNil, "NotNil", []string{"value"}) - - testCheck(c, check.NotNil, false, "", nil) - testCheck(c, check.NotNil, true, "", "a") - - testCheck(c, check.NotNil, false, "", (chan int)(nil)) - testCheck(c, check.NotNil, true, "", make(chan int)) - testCheck(c, check.NotNil, false, "", (error)(nil)) - testCheck(c, check.NotNil, true, "", errors.New("")) - testCheck(c, check.NotNil, false, "", ([]int)(nil)) - testCheck(c, check.NotNil, true, "", make([]int, 1)) -} - -func (s *CheckersS) TestNot(c *check.C) { - testInfo(c, check.Not(check.IsNil), "Not(IsNil)", []string{"value"}) - - testCheck(c, check.Not(check.IsNil), false, "", nil) - testCheck(c, check.Not(check.IsNil), true, "", "a") - testCheck(c, check.Not(check.Equals), true, "", 42, 43) -} - -type simpleStruct struct { - i int -} - -func (s *CheckersS) TestEquals(c *check.C) { - testInfo(c, check.Equals, "Equals", []string{"obtained", "expected"}) - - // The simplest. - testCheck(c, check.Equals, true, "", 42, 42) - testCheck(c, check.Equals, false, "", 42, 43) - - // Different native types. - testCheck(c, check.Equals, false, "", int32(42), int64(42)) - - // With nil. - testCheck(c, check.Equals, false, "", 42, nil) - - // Slices - testCheck(c, check.Equals, false, "runtime error: comparing uncomparable type []uint8", []byte{1, 2}, []byte{1, 2}) - - // Struct values - testCheck(c, check.Equals, true, "", simpleStruct{1}, simpleStruct{1}) - testCheck(c, check.Equals, false, `Difference: -... i: 1 != 2 -`, simpleStruct{1}, simpleStruct{2}) - - // Struct pointers, no difference in values, just pointer - testCheck(c, check.Equals, false, "", &simpleStruct{1}, &simpleStruct{1}) - // Struct pointers, different pointers and different values - testCheck(c, check.Equals, false, `Difference: -... i: 1 != 2 -`, &simpleStruct{1}, &simpleStruct{2}) -} - -func (s *CheckersS) TestDeepEquals(c *check.C) { - testInfo(c, check.DeepEquals, "DeepEquals", []string{"obtained", "expected"}) - - // The simplest. - testCheck(c, check.DeepEquals, true, "", 42, 42) - testCheck(c, check.DeepEquals, false, "", 42, 43) - - // Different native types. - testCheck(c, check.DeepEquals, false, "", int32(42), int64(42)) - - // With nil. - testCheck(c, check.DeepEquals, false, "", 42, nil) - - // Slices - testCheck(c, check.DeepEquals, true, "", []byte{1, 2}, []byte{1, 2}) - testCheck(c, check.DeepEquals, false, `Difference: -... [1]: 2 != 3 -`, []byte{1, 2}, []byte{1, 3}) - - // Struct values - testCheck(c, check.DeepEquals, true, "", simpleStruct{1}, simpleStruct{1}) - testCheck(c, check.DeepEquals, false, `Difference: -... i: 1 != 2 -`, simpleStruct{1}, simpleStruct{2}) - - // Struct pointers - testCheck(c, check.DeepEquals, true, "", &simpleStruct{1}, &simpleStruct{1}) - s1 := &simpleStruct{1} - s2 := &simpleStruct{2} - testCheck(c, check.DeepEquals, false, `Difference: -... i: 1 != 2 -`, s1, s2) -} - -func (s *CheckersS) TestHasLen(c *check.C) { - testInfo(c, check.HasLen, "HasLen", []string{"obtained", "n"}) - - testCheck(c, check.HasLen, true, "", "abcd", 4) - testCheck(c, check.HasLen, true, "", []int{1, 2}, 2) - testCheck(c, check.HasLen, false, "", []int{1, 2}, 3) - - testCheck(c, check.HasLen, false, "n must be an int", []int{1, 2}, "2") - testCheck(c, check.HasLen, false, "obtained value type has no length", nil, 2) -} - -func (s *CheckersS) TestErrorMatches(c *check.C) { - testInfo(c, check.ErrorMatches, "ErrorMatches", []string{"value", "regex"}) - - testCheck(c, check.ErrorMatches, false, "Error value is nil", nil, "some error") - testCheck(c, check.ErrorMatches, false, "Value is not an error", 1, "some error") - testCheck(c, check.ErrorMatches, true, "", errors.New("some error"), "some error") - testCheck(c, check.ErrorMatches, true, "", errors.New("some error"), "so.*or") - - // Verify params mutation - params, names := testCheck(c, check.ErrorMatches, false, "", errors.New("some error"), "other error") - c.Assert(params[0], check.Equals, "some error") - c.Assert(names[0], check.Equals, "error") -} - -func (s *CheckersS) TestMatches(c *check.C) { - testInfo(c, check.Matches, "Matches", []string{"value", "regex"}) - - // Simple matching - testCheck(c, check.Matches, true, "", "abc", "abc") - testCheck(c, check.Matches, true, "", "abc", "a.c") - - // Must match fully - testCheck(c, check.Matches, false, "", "abc", "ab") - testCheck(c, check.Matches, false, "", "abc", "bc") - - // String()-enabled values accepted - testCheck(c, check.Matches, true, "", reflect.ValueOf("abc"), "a.c") - testCheck(c, check.Matches, false, "", reflect.ValueOf("abc"), "a.d") - - // Some error conditions. - testCheck(c, check.Matches, false, "Obtained value is not a string and has no .String()", 1, "a.c") - testCheck(c, check.Matches, false, "Can't compile regex: error parsing regexp: missing closing ]: `[c$`", "abc", "a[c") -} - -func (s *CheckersS) TestPanics(c *check.C) { - testInfo(c, check.Panics, "Panics", []string{"function", "expected"}) - - // Some errors. - testCheck(c, check.Panics, false, "Function has not panicked", func() bool { return false }, "BOOM") - testCheck(c, check.Panics, false, "Function must take zero arguments", 1, "BOOM") - - // Plain strings. - testCheck(c, check.Panics, true, "", func() { panic("BOOM") }, "BOOM") - testCheck(c, check.Panics, false, "", func() { panic("KABOOM") }, "BOOM") - testCheck(c, check.Panics, true, "", func() bool { panic("BOOM") }, "BOOM") - - // Error values. - testCheck(c, check.Panics, true, "", func() { panic(errors.New("BOOM")) }, errors.New("BOOM")) - testCheck(c, check.Panics, false, "", func() { panic(errors.New("KABOOM")) }, errors.New("BOOM")) - - type deep struct{ i int } - // Deep value - testCheck(c, check.Panics, true, "", func() { panic(&deep{99}) }, &deep{99}) - - // Verify params/names mutation - params, names := testCheck(c, check.Panics, false, "", func() { panic(errors.New("KABOOM")) }, errors.New("BOOM")) - c.Assert(params[0], check.ErrorMatches, "KABOOM") - c.Assert(names[0], check.Equals, "panic") - - // Verify a nil panic - testCheck(c, check.Panics, true, "", func() { panic(nil) }, nil) - testCheck(c, check.Panics, false, "", func() { panic(nil) }, "NOPE") -} - -func (s *CheckersS) TestPanicMatches(c *check.C) { - testInfo(c, check.PanicMatches, "PanicMatches", []string{"function", "expected"}) - - // Error matching. - testCheck(c, check.PanicMatches, true, "", func() { panic(errors.New("BOOM")) }, "BO.M") - testCheck(c, check.PanicMatches, false, "", func() { panic(errors.New("KABOOM")) }, "BO.M") - - // Some errors. - testCheck(c, check.PanicMatches, false, "Function has not panicked", func() bool { return false }, "BOOM") - testCheck(c, check.PanicMatches, false, "Function must take zero arguments", 1, "BOOM") - - // Plain strings. - testCheck(c, check.PanicMatches, true, "", func() { panic("BOOM") }, "BO.M") - testCheck(c, check.PanicMatches, false, "", func() { panic("KABOOM") }, "BOOM") - testCheck(c, check.PanicMatches, true, "", func() bool { panic("BOOM") }, "BO.M") - - // Verify params/names mutation - params, names := testCheck(c, check.PanicMatches, false, "", func() { panic(errors.New("KABOOM")) }, "BOOM") - c.Assert(params[0], check.Equals, "KABOOM") - c.Assert(names[0], check.Equals, "panic") - - // Verify a nil panic - testCheck(c, check.PanicMatches, false, "Panic value is not a string or an error", func() { panic(nil) }, "") -} - -func (s *CheckersS) TestFitsTypeOf(c *check.C) { - testInfo(c, check.FitsTypeOf, "FitsTypeOf", []string{"obtained", "sample"}) - - // Basic types - testCheck(c, check.FitsTypeOf, true, "", 1, 0) - testCheck(c, check.FitsTypeOf, false, "", 1, int64(0)) - - // Aliases - testCheck(c, check.FitsTypeOf, false, "", 1, errors.New("")) - testCheck(c, check.FitsTypeOf, false, "", "error", errors.New("")) - testCheck(c, check.FitsTypeOf, true, "", errors.New("error"), errors.New("")) - - // Structures - testCheck(c, check.FitsTypeOf, false, "", 1, simpleStruct{}) - testCheck(c, check.FitsTypeOf, false, "", simpleStruct{42}, &simpleStruct{}) - testCheck(c, check.FitsTypeOf, true, "", simpleStruct{42}, simpleStruct{}) - testCheck(c, check.FitsTypeOf, true, "", &simpleStruct{42}, &simpleStruct{}) - - // Some bad values - testCheck(c, check.FitsTypeOf, false, "Invalid sample value", 1, interface{}(nil)) - testCheck(c, check.FitsTypeOf, false, "", interface{}(nil), 0) -} - -func (s *CheckersS) TestImplements(c *check.C) { - testInfo(c, check.Implements, "Implements", []string{"obtained", "ifaceptr"}) - - var e error - var re runtime.Error - testCheck(c, check.Implements, true, "", errors.New(""), &e) - testCheck(c, check.Implements, false, "", errors.New(""), &re) - - // Some bad values - testCheck(c, check.Implements, false, "ifaceptr should be a pointer to an interface variable", 0, errors.New("")) - testCheck(c, check.Implements, false, "ifaceptr should be a pointer to an interface variable", 0, interface{}(nil)) - testCheck(c, check.Implements, false, "", interface{}(nil), &e) -} diff --git a/vendor/gopkg.in/check.v1/export_test.go b/vendor/gopkg.in/check.v1/export_test.go deleted file mode 100644 index abb89a2..0000000 --- a/vendor/gopkg.in/check.v1/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package check - -import "io" - -func PrintLine(filename string, line int) (string, error) { - return printLine(filename, line) -} - -func Indent(s, with string) string { - return indent(s, with) -} - -func NewOutputWriter(writer io.Writer, stream, verbose bool) *outputWriter { - return newOutputWriter(writer, stream, verbose) -} - -func (c *C) FakeSkip(reason string) { - c.reason = reason -} diff --git a/vendor/gopkg.in/check.v1/fixture_test.go b/vendor/gopkg.in/check.v1/fixture_test.go deleted file mode 100644 index 2bff9e1..0000000 --- a/vendor/gopkg.in/check.v1/fixture_test.go +++ /dev/null @@ -1,484 +0,0 @@ -// Tests for the behavior of the test fixture system. - -package check_test - -import ( - . "gopkg.in/check.v1" -) - -// ----------------------------------------------------------------------- -// Fixture test suite. - -type FixtureS struct{} - -var fixtureS = Suite(&FixtureS{}) - -func (s *FixtureS) TestCountSuite(c *C) { - suitesRun += 1 -} - -// ----------------------------------------------------------------------- -// Basic fixture ordering verification. - -func (s *FixtureS) TestOrder(c *C) { - helper := FixtureHelper{} - Run(&helper, nil) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "SetUpTest") - c.Check(helper.calls[5], Equals, "Test2") - c.Check(helper.calls[6], Equals, "TearDownTest") - c.Check(helper.calls[7], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 8) -} - -// ----------------------------------------------------------------------- -// Check the behavior when panics occur within tests and fixtures. - -func (s *FixtureS) TestPanicOnTest(c *C) { - helper := FixtureHelper{panicOn: "Test1"} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "SetUpTest") - c.Check(helper.calls[5], Equals, "Test2") - c.Check(helper.calls[6], Equals, "TearDownTest") - c.Check(helper.calls[7], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 8) - - expected := "^\n-+\n" + - "PANIC: check_test\\.go:[0-9]+: FixtureHelper.Test1\n\n" + - "\\.\\.\\. Panic: Test1 \\(PC=[xA-F0-9]+\\)\n\n" + - ".+:[0-9]+\n" + - " in (go)?panic\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.trace\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.Test1\n" + - "(.|\n)*$" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnSetUpTest(c *C) { - helper := FixtureHelper{panicOn: "SetUpTest"} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "TearDownTest") - c.Check(helper.calls[3], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 4) - - expected := "^\n-+\n" + - "PANIC: check_test\\.go:[0-9]+: " + - "FixtureHelper\\.SetUpTest\n\n" + - "\\.\\.\\. Panic: SetUpTest \\(PC=[xA-F0-9]+\\)\n\n" + - ".+:[0-9]+\n" + - " in (go)?panic\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.trace\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.SetUpTest\n" + - "(.|\n)*" + - "\n-+\n" + - "PANIC: check_test\\.go:[0-9]+: " + - "FixtureHelper\\.Test1\n\n" + - "\\.\\.\\. Panic: Fixture has panicked " + - "\\(see related PANIC\\)\n$" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnTearDownTest(c *C) { - helper := FixtureHelper{panicOn: "TearDownTest"} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 5) - - expected := "^\n-+\n" + - "PANIC: check_test\\.go:[0-9]+: " + - "FixtureHelper.TearDownTest\n\n" + - "\\.\\.\\. Panic: TearDownTest \\(PC=[xA-F0-9]+\\)\n\n" + - ".+:[0-9]+\n" + - " in (go)?panic\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.trace\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.TearDownTest\n" + - "(.|\n)*" + - "\n-+\n" + - "PANIC: check_test\\.go:[0-9]+: " + - "FixtureHelper\\.Test1\n\n" + - "\\.\\.\\. Panic: Fixture has panicked " + - "\\(see related PANIC\\)\n$" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnSetUpSuite(c *C) { - helper := FixtureHelper{panicOn: "SetUpSuite"} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 2) - - expected := "^\n-+\n" + - "PANIC: check_test\\.go:[0-9]+: " + - "FixtureHelper.SetUpSuite\n\n" + - "\\.\\.\\. Panic: SetUpSuite \\(PC=[xA-F0-9]+\\)\n\n" + - ".+:[0-9]+\n" + - " in (go)?panic\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.trace\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.SetUpSuite\n" + - "(.|\n)*$" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnTearDownSuite(c *C) { - helper := FixtureHelper{panicOn: "TearDownSuite"} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "SetUpTest") - c.Check(helper.calls[5], Equals, "Test2") - c.Check(helper.calls[6], Equals, "TearDownTest") - c.Check(helper.calls[7], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 8) - - expected := "^\n-+\n" + - "PANIC: check_test\\.go:[0-9]+: " + - "FixtureHelper.TearDownSuite\n\n" + - "\\.\\.\\. Panic: TearDownSuite \\(PC=[xA-F0-9]+\\)\n\n" + - ".+:[0-9]+\n" + - " in (go)?panic\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.trace\n" + - ".*check_test.go:[0-9]+\n" + - " in FixtureHelper.TearDownSuite\n" + - "(.|\n)*$" - - c.Check(output.value, Matches, expected) -} - -// ----------------------------------------------------------------------- -// A wrong argument on a test or fixture will produce a nice error. - -func (s *FixtureS) TestPanicOnWrongTestArg(c *C) { - helper := WrongTestArgHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "TearDownTest") - c.Check(helper.calls[3], Equals, "SetUpTest") - c.Check(helper.calls[4], Equals, "Test2") - c.Check(helper.calls[5], Equals, "TearDownTest") - c.Check(helper.calls[6], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 7) - - expected := "^\n-+\n" + - "PANIC: fixture_test\\.go:[0-9]+: " + - "WrongTestArgHelper\\.Test1\n\n" + - "\\.\\.\\. Panic: WrongTestArgHelper\\.Test1 argument " + - "should be \\*check\\.C\n" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnWrongSetUpTestArg(c *C) { - helper := WrongSetUpTestArgHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(len(helper.calls), Equals, 0) - - expected := - "^\n-+\n" + - "PANIC: fixture_test\\.go:[0-9]+: " + - "WrongSetUpTestArgHelper\\.SetUpTest\n\n" + - "\\.\\.\\. Panic: WrongSetUpTestArgHelper\\.SetUpTest argument " + - "should be \\*check\\.C\n" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnWrongSetUpSuiteArg(c *C) { - helper := WrongSetUpSuiteArgHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(len(helper.calls), Equals, 0) - - expected := - "^\n-+\n" + - "PANIC: fixture_test\\.go:[0-9]+: " + - "WrongSetUpSuiteArgHelper\\.SetUpSuite\n\n" + - "\\.\\.\\. Panic: WrongSetUpSuiteArgHelper\\.SetUpSuite argument " + - "should be \\*check\\.C\n" - - c.Check(output.value, Matches, expected) -} - -// ----------------------------------------------------------------------- -// Nice errors also when tests or fixture have wrong arg count. - -func (s *FixtureS) TestPanicOnWrongTestArgCount(c *C) { - helper := WrongTestArgCountHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "TearDownTest") - c.Check(helper.calls[3], Equals, "SetUpTest") - c.Check(helper.calls[4], Equals, "Test2") - c.Check(helper.calls[5], Equals, "TearDownTest") - c.Check(helper.calls[6], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 7) - - expected := "^\n-+\n" + - "PANIC: fixture_test\\.go:[0-9]+: " + - "WrongTestArgCountHelper\\.Test1\n\n" + - "\\.\\.\\. Panic: WrongTestArgCountHelper\\.Test1 argument " + - "should be \\*check\\.C\n" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnWrongSetUpTestArgCount(c *C) { - helper := WrongSetUpTestArgCountHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(len(helper.calls), Equals, 0) - - expected := - "^\n-+\n" + - "PANIC: fixture_test\\.go:[0-9]+: " + - "WrongSetUpTestArgCountHelper\\.SetUpTest\n\n" + - "\\.\\.\\. Panic: WrongSetUpTestArgCountHelper\\.SetUpTest argument " + - "should be \\*check\\.C\n" - - c.Check(output.value, Matches, expected) -} - -func (s *FixtureS) TestPanicOnWrongSetUpSuiteArgCount(c *C) { - helper := WrongSetUpSuiteArgCountHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(len(helper.calls), Equals, 0) - - expected := - "^\n-+\n" + - "PANIC: fixture_test\\.go:[0-9]+: " + - "WrongSetUpSuiteArgCountHelper\\.SetUpSuite\n\n" + - "\\.\\.\\. Panic: WrongSetUpSuiteArgCountHelper" + - "\\.SetUpSuite argument should be \\*check\\.C\n" - - c.Check(output.value, Matches, expected) -} - -// ----------------------------------------------------------------------- -// Helper test suites with wrong function arguments. - -type WrongTestArgHelper struct { - FixtureHelper -} - -func (s *WrongTestArgHelper) Test1(t int) { -} - -type WrongSetUpTestArgHelper struct { - FixtureHelper -} - -func (s *WrongSetUpTestArgHelper) SetUpTest(t int) { -} - -type WrongSetUpSuiteArgHelper struct { - FixtureHelper -} - -func (s *WrongSetUpSuiteArgHelper) SetUpSuite(t int) { -} - -type WrongTestArgCountHelper struct { - FixtureHelper -} - -func (s *WrongTestArgCountHelper) Test1(c *C, i int) { -} - -type WrongSetUpTestArgCountHelper struct { - FixtureHelper -} - -func (s *WrongSetUpTestArgCountHelper) SetUpTest(c *C, i int) { -} - -type WrongSetUpSuiteArgCountHelper struct { - FixtureHelper -} - -func (s *WrongSetUpSuiteArgCountHelper) SetUpSuite(c *C, i int) { -} - -// ----------------------------------------------------------------------- -// Ensure fixture doesn't run without tests. - -type NoTestsHelper struct { - hasRun bool -} - -func (s *NoTestsHelper) SetUpSuite(c *C) { - s.hasRun = true -} - -func (s *NoTestsHelper) TearDownSuite(c *C) { - s.hasRun = true -} - -func (s *FixtureS) TestFixtureDoesntRunWithoutTests(c *C) { - helper := NoTestsHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Check(helper.hasRun, Equals, false) -} - -// ----------------------------------------------------------------------- -// Verify that checks and assertions work correctly inside the fixture. - -type FixtureCheckHelper struct { - fail string - completed bool -} - -func (s *FixtureCheckHelper) SetUpSuite(c *C) { - switch s.fail { - case "SetUpSuiteAssert": - c.Assert(false, Equals, true) - case "SetUpSuiteCheck": - c.Check(false, Equals, true) - } - s.completed = true -} - -func (s *FixtureCheckHelper) SetUpTest(c *C) { - switch s.fail { - case "SetUpTestAssert": - c.Assert(false, Equals, true) - case "SetUpTestCheck": - c.Check(false, Equals, true) - } - s.completed = true -} - -func (s *FixtureCheckHelper) Test(c *C) { - // Do nothing. -} - -func (s *FixtureS) TestSetUpSuiteCheck(c *C) { - helper := FixtureCheckHelper{fail: "SetUpSuiteCheck"} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Assert(output.value, Matches, - "\n---+\n"+ - "FAIL: fixture_test\\.go:[0-9]+: "+ - "FixtureCheckHelper\\.SetUpSuite\n\n"+ - "fixture_test\\.go:[0-9]+:\n"+ - " c\\.Check\\(false, Equals, true\\)\n"+ - "\\.+ obtained bool = false\n"+ - "\\.+ expected bool = true\n\n") - c.Assert(helper.completed, Equals, true) -} - -func (s *FixtureS) TestSetUpSuiteAssert(c *C) { - helper := FixtureCheckHelper{fail: "SetUpSuiteAssert"} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Assert(output.value, Matches, - "\n---+\n"+ - "FAIL: fixture_test\\.go:[0-9]+: "+ - "FixtureCheckHelper\\.SetUpSuite\n\n"+ - "fixture_test\\.go:[0-9]+:\n"+ - " c\\.Assert\\(false, Equals, true\\)\n"+ - "\\.+ obtained bool = false\n"+ - "\\.+ expected bool = true\n\n") - c.Assert(helper.completed, Equals, false) -} - -// ----------------------------------------------------------------------- -// Verify that logging within SetUpTest() persists within the test log itself. - -type FixtureLogHelper struct { - c *C -} - -func (s *FixtureLogHelper) SetUpTest(c *C) { - s.c = c - c.Log("1") -} - -func (s *FixtureLogHelper) Test(c *C) { - c.Log("2") - s.c.Log("3") - c.Log("4") - c.Fail() -} - -func (s *FixtureLogHelper) TearDownTest(c *C) { - s.c.Log("5") -} - -func (s *FixtureS) TestFixtureLogging(c *C) { - helper := FixtureLogHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Assert(output.value, Matches, - "\n---+\n"+ - "FAIL: fixture_test\\.go:[0-9]+: "+ - "FixtureLogHelper\\.Test\n\n"+ - "1\n2\n3\n4\n5\n") -} - -// ----------------------------------------------------------------------- -// Skip() within fixture methods. - -func (s *FixtureS) TestSkipSuite(c *C) { - helper := FixtureHelper{skip: true, skipOnN: 0} - output := String{} - result := Run(&helper, &RunConf{Output: &output}) - c.Assert(output.value, Equals, "") - c.Assert(helper.calls[0], Equals, "SetUpSuite") - c.Assert(helper.calls[1], Equals, "TearDownSuite") - c.Assert(len(helper.calls), Equals, 2) - c.Assert(result.Skipped, Equals, 2) -} - -func (s *FixtureS) TestSkipTest(c *C) { - helper := FixtureHelper{skip: true, skipOnN: 1} - output := String{} - result := Run(&helper, &RunConf{Output: &output}) - c.Assert(helper.calls[0], Equals, "SetUpSuite") - c.Assert(helper.calls[1], Equals, "SetUpTest") - c.Assert(helper.calls[2], Equals, "SetUpTest") - c.Assert(helper.calls[3], Equals, "Test2") - c.Assert(helper.calls[4], Equals, "TearDownTest") - c.Assert(helper.calls[5], Equals, "TearDownSuite") - c.Assert(len(helper.calls), Equals, 6) - c.Assert(result.Skipped, Equals, 1) -} diff --git a/vendor/gopkg.in/check.v1/foundation_test.go b/vendor/gopkg.in/check.v1/foundation_test.go deleted file mode 100644 index 8ecf791..0000000 --- a/vendor/gopkg.in/check.v1/foundation_test.go +++ /dev/null @@ -1,335 +0,0 @@ -// These tests check that the foundations of gocheck are working properly. -// They already assume that fundamental failing is working already, though, -// since this was tested in bootstrap_test.go. Even then, some care may -// still have to be taken when using external functions, since they should -// of course not rely on functionality tested here. - -package check_test - -import ( - "fmt" - "gopkg.in/check.v1" - "log" - "os" - "regexp" - "strings" -) - -// ----------------------------------------------------------------------- -// Foundation test suite. - -type FoundationS struct{} - -var foundationS = check.Suite(&FoundationS{}) - -func (s *FoundationS) TestCountSuite(c *check.C) { - suitesRun += 1 -} - -func (s *FoundationS) TestErrorf(c *check.C) { - // Do not use checkState() here. It depends on Errorf() working. - expectedLog := fmt.Sprintf("foundation_test.go:%d:\n"+ - " c.Errorf(\"Error %%v!\", \"message\")\n"+ - "... Error: Error message!\n\n", - getMyLine()+1) - c.Errorf("Error %v!", "message") - failed := c.Failed() - c.Succeed() - if log := c.GetTestLog(); log != expectedLog { - c.Logf("Errorf() logged %#v rather than %#v", log, expectedLog) - c.Fail() - } - if !failed { - c.Logf("Errorf() didn't put the test in a failed state") - c.Fail() - } -} - -func (s *FoundationS) TestError(c *check.C) { - expectedLog := fmt.Sprintf("foundation_test.go:%d:\n"+ - " c\\.Error\\(\"Error \", \"message!\"\\)\n"+ - "\\.\\.\\. Error: Error message!\n\n", - getMyLine()+1) - c.Error("Error ", "message!") - checkState(c, nil, - &expectedState{ - name: "Error(`Error `, `message!`)", - failed: true, - log: expectedLog, - }) -} - -func (s *FoundationS) TestFailNow(c *check.C) { - defer (func() { - if !c.Failed() { - c.Error("FailNow() didn't fail the test") - } else { - c.Succeed() - if c.GetTestLog() != "" { - c.Error("Something got logged:\n" + c.GetTestLog()) - } - } - })() - - c.FailNow() - c.Log("FailNow() didn't stop the test") -} - -func (s *FoundationS) TestSucceedNow(c *check.C) { - defer (func() { - if c.Failed() { - c.Error("SucceedNow() didn't succeed the test") - } - if c.GetTestLog() != "" { - c.Error("Something got logged:\n" + c.GetTestLog()) - } - })() - - c.Fail() - c.SucceedNow() - c.Log("SucceedNow() didn't stop the test") -} - -func (s *FoundationS) TestFailureHeader(c *check.C) { - output := String{} - failHelper := FailHelper{} - check.Run(&failHelper, &check.RunConf{Output: &output}) - header := fmt.Sprintf(""+ - "\n-----------------------------------"+ - "-----------------------------------\n"+ - "FAIL: check_test.go:%d: FailHelper.TestLogAndFail\n", - failHelper.testLine) - if strings.Index(output.value, header) == -1 { - c.Errorf(""+ - "Failure didn't print a proper header.\n"+ - "... Got:\n%s... Expected something with:\n%s", - output.value, header) - } -} - -func (s *FoundationS) TestFatal(c *check.C) { - var line int - defer (func() { - if !c.Failed() { - c.Error("Fatal() didn't fail the test") - } else { - c.Succeed() - expected := fmt.Sprintf("foundation_test.go:%d:\n"+ - " c.Fatal(\"Die \", \"now!\")\n"+ - "... Error: Die now!\n\n", - line) - if c.GetTestLog() != expected { - c.Error("Incorrect log:", c.GetTestLog()) - } - } - })() - - line = getMyLine() + 1 - c.Fatal("Die ", "now!") - c.Log("Fatal() didn't stop the test") -} - -func (s *FoundationS) TestFatalf(c *check.C) { - var line int - defer (func() { - if !c.Failed() { - c.Error("Fatalf() didn't fail the test") - } else { - c.Succeed() - expected := fmt.Sprintf("foundation_test.go:%d:\n"+ - " c.Fatalf(\"Die %%s!\", \"now\")\n"+ - "... Error: Die now!\n\n", - line) - if c.GetTestLog() != expected { - c.Error("Incorrect log:", c.GetTestLog()) - } - } - })() - - line = getMyLine() + 1 - c.Fatalf("Die %s!", "now") - c.Log("Fatalf() didn't stop the test") -} - -func (s *FoundationS) TestCallerLoggingInsideTest(c *check.C) { - log := fmt.Sprintf(""+ - "foundation_test.go:%d:\n"+ - " result := c.Check\\(10, check.Equals, 20\\)\n"+ - "\\.\\.\\. obtained int = 10\n"+ - "\\.\\.\\. expected int = 20\n\n", - getMyLine()+1) - result := c.Check(10, check.Equals, 20) - checkState(c, result, - &expectedState{ - name: "Check(10, Equals, 20)", - result: false, - failed: true, - log: log, - }) -} - -func (s *FoundationS) TestCallerLoggingInDifferentFile(c *check.C) { - result, line := checkEqualWrapper(c, 10, 20) - testLine := getMyLine() - 1 - log := fmt.Sprintf(""+ - "foundation_test.go:%d:\n"+ - " result, line := checkEqualWrapper\\(c, 10, 20\\)\n"+ - "check_test.go:%d:\n"+ - " return c.Check\\(obtained, check.Equals, expected\\), getMyLine\\(\\)\n"+ - "\\.\\.\\. obtained int = 10\n"+ - "\\.\\.\\. expected int = 20\n\n", - testLine, line) - checkState(c, result, - &expectedState{ - name: "Check(10, Equals, 20)", - result: false, - failed: true, - log: log, - }) -} - -// ----------------------------------------------------------------------- -// ExpectFailure() inverts the logic of failure. - -type ExpectFailureSucceedHelper struct{} - -func (s *ExpectFailureSucceedHelper) TestSucceed(c *check.C) { - c.ExpectFailure("It booms!") - c.Error("Boom!") -} - -type ExpectFailureFailHelper struct{} - -func (s *ExpectFailureFailHelper) TestFail(c *check.C) { - c.ExpectFailure("Bug #XYZ") -} - -func (s *FoundationS) TestExpectFailureFail(c *check.C) { - helper := ExpectFailureFailHelper{} - output := String{} - result := check.Run(&helper, &check.RunConf{Output: &output}) - - expected := "" + - "^\n-+\n" + - "FAIL: foundation_test\\.go:[0-9]+:" + - " ExpectFailureFailHelper\\.TestFail\n\n" + - "\\.\\.\\. Error: Test succeeded, but was expected to fail\n" + - "\\.\\.\\. Reason: Bug #XYZ\n$" - - matched, err := regexp.MatchString(expected, output.value) - if err != nil { - c.Error("Bad expression: ", expected) - } else if !matched { - c.Error("ExpectFailure() didn't log properly:\n", output.value) - } - - c.Assert(result.ExpectedFailures, check.Equals, 0) -} - -func (s *FoundationS) TestExpectFailureSucceed(c *check.C) { - helper := ExpectFailureSucceedHelper{} - output := String{} - result := check.Run(&helper, &check.RunConf{Output: &output}) - - c.Assert(output.value, check.Equals, "") - c.Assert(result.ExpectedFailures, check.Equals, 1) -} - -func (s *FoundationS) TestExpectFailureSucceedVerbose(c *check.C) { - helper := ExpectFailureSucceedHelper{} - output := String{} - result := check.Run(&helper, &check.RunConf{Output: &output, Verbose: true}) - - expected := "" + - "FAIL EXPECTED: foundation_test\\.go:[0-9]+:" + - " ExpectFailureSucceedHelper\\.TestSucceed \\(It booms!\\)\t *[.0-9]+s\n" - - matched, err := regexp.MatchString(expected, output.value) - if err != nil { - c.Error("Bad expression: ", expected) - } else if !matched { - c.Error("ExpectFailure() didn't log properly:\n", output.value) - } - - c.Assert(result.ExpectedFailures, check.Equals, 1) -} - -// ----------------------------------------------------------------------- -// Skip() allows stopping a test without positive/negative results. - -type SkipTestHelper struct{} - -func (s *SkipTestHelper) TestFail(c *check.C) { - c.Skip("Wrong platform or whatever") - c.Error("Boom!") -} - -func (s *FoundationS) TestSkip(c *check.C) { - helper := SkipTestHelper{} - output := String{} - check.Run(&helper, &check.RunConf{Output: &output}) - - if output.value != "" { - c.Error("Skip() logged something:\n", output.value) - } -} - -func (s *FoundationS) TestSkipVerbose(c *check.C) { - helper := SkipTestHelper{} - output := String{} - check.Run(&helper, &check.RunConf{Output: &output, Verbose: true}) - - expected := "SKIP: foundation_test\\.go:[0-9]+: SkipTestHelper\\.TestFail" + - " \\(Wrong platform or whatever\\)" - matched, err := regexp.MatchString(expected, output.value) - if err != nil { - c.Error("Bad expression: ", expected) - } else if !matched { - c.Error("Skip() didn't log properly:\n", output.value) - } -} - -// ----------------------------------------------------------------------- -// Check minimum *log.Logger interface provided by *check.C. - -type minLogger interface { - Output(calldepth int, s string) error -} - -func (s *BootstrapS) TestMinLogger(c *check.C) { - var logger minLogger - logger = log.New(os.Stderr, "", 0) - logger = c - logger.Output(0, "Hello there") - expected := `\[LOG\] [0-9]+:[0-9][0-9]\.[0-9][0-9][0-9] +Hello there\n` - output := c.GetTestLog() - c.Assert(output, check.Matches, expected) -} - -// ----------------------------------------------------------------------- -// Ensure that suites with embedded types are working fine, including the -// the workaround for issue 906. - -type EmbeddedInternalS struct { - called bool -} - -type EmbeddedS struct { - EmbeddedInternalS -} - -var embeddedS = check.Suite(&EmbeddedS{}) - -func (s *EmbeddedS) TestCountSuite(c *check.C) { - suitesRun += 1 -} - -func (s *EmbeddedInternalS) TestMethod(c *check.C) { - c.Error("TestMethod() of the embedded type was called!?") -} - -func (s *EmbeddedS) TestMethod(c *check.C) { - // http://code.google.com/p/go/issues/detail?id=906 - c.Check(s.called, check.Equals, false) // Go issue 906 is affecting the runner? - s.called = true -} diff --git a/vendor/gopkg.in/check.v1/helpers.go b/vendor/gopkg.in/check.v1/helpers.go deleted file mode 100644 index 58a733b..0000000 --- a/vendor/gopkg.in/check.v1/helpers.go +++ /dev/null @@ -1,231 +0,0 @@ -package check - -import ( - "fmt" - "strings" - "time" -) - -// TestName returns the current test name in the form "SuiteName.TestName" -func (c *C) TestName() string { - return c.testName -} - -// ----------------------------------------------------------------------- -// Basic succeeding/failing logic. - -// Failed returns whether the currently running test has already failed. -func (c *C) Failed() bool { - return c.status() == failedSt -} - -// Fail marks the currently running test as failed. -// -// Something ought to have been previously logged so the developer can tell -// what went wrong. The higher level helper functions will fail the test -// and do the logging properly. -func (c *C) Fail() { - c.setStatus(failedSt) -} - -// FailNow marks the currently running test as failed and stops running it. -// Something ought to have been previously logged so the developer can tell -// what went wrong. The higher level helper functions will fail the test -// and do the logging properly. -func (c *C) FailNow() { - c.Fail() - c.stopNow() -} - -// Succeed marks the currently running test as succeeded, undoing any -// previous failures. -func (c *C) Succeed() { - c.setStatus(succeededSt) -} - -// SucceedNow marks the currently running test as succeeded, undoing any -// previous failures, and stops running the test. -func (c *C) SucceedNow() { - c.Succeed() - c.stopNow() -} - -// ExpectFailure informs that the running test is knowingly broken for -// the provided reason. If the test does not fail, an error will be reported -// to raise attention to this fact. This method is useful to temporarily -// disable tests which cover well known problems until a better time to -// fix the problem is found, without forgetting about the fact that a -// failure still exists. -func (c *C) ExpectFailure(reason string) { - if reason == "" { - panic("Missing reason why the test is expected to fail") - } - c.mustFail = true - c.reason = reason -} - -// Skip skips the running test for the provided reason. If run from within -// SetUpTest, the individual test being set up will be skipped, and if run -// from within SetUpSuite, the whole suite is skipped. -func (c *C) Skip(reason string) { - if reason == "" { - panic("Missing reason why the test is being skipped") - } - c.reason = reason - c.setStatus(skippedSt) - c.stopNow() -} - -// ----------------------------------------------------------------------- -// Basic logging. - -// GetTestLog returns the current test error output. -func (c *C) GetTestLog() string { - return c.logb.String() -} - -// Log logs some information into the test error output. -// The provided arguments are assembled together into a string with fmt.Sprint. -func (c *C) Log(args ...interface{}) { - c.log(args...) -} - -// Log logs some information into the test error output. -// The provided arguments are assembled together into a string with fmt.Sprintf. -func (c *C) Logf(format string, args ...interface{}) { - c.logf(format, args...) -} - -// Output enables *C to be used as a logger in functions that require only -// the minimum interface of *log.Logger. -func (c *C) Output(calldepth int, s string) error { - d := time.Now().Sub(c.startTime) - msec := d / time.Millisecond - sec := d / time.Second - min := d / time.Minute - - c.Logf("[LOG] %d:%02d.%03d %s", min, sec%60, msec%1000, s) - return nil -} - -// Error logs an error into the test error output and marks the test as failed. -// The provided arguments are assembled together into a string with fmt.Sprint. -func (c *C) Error(args ...interface{}) { - c.logCaller(1) - c.logString(fmt.Sprint("Error: ", fmt.Sprint(args...))) - c.logNewLine() - c.Fail() -} - -// Errorf logs an error into the test error output and marks the test as failed. -// The provided arguments are assembled together into a string with fmt.Sprintf. -func (c *C) Errorf(format string, args ...interface{}) { - c.logCaller(1) - c.logString(fmt.Sprintf("Error: "+format, args...)) - c.logNewLine() - c.Fail() -} - -// Fatal logs an error into the test error output, marks the test as failed, and -// stops the test execution. The provided arguments are assembled together into -// a string with fmt.Sprint. -func (c *C) Fatal(args ...interface{}) { - c.logCaller(1) - c.logString(fmt.Sprint("Error: ", fmt.Sprint(args...))) - c.logNewLine() - c.FailNow() -} - -// Fatlaf logs an error into the test error output, marks the test as failed, and -// stops the test execution. The provided arguments are assembled together into -// a string with fmt.Sprintf. -func (c *C) Fatalf(format string, args ...interface{}) { - c.logCaller(1) - c.logString(fmt.Sprint("Error: ", fmt.Sprintf(format, args...))) - c.logNewLine() - c.FailNow() -} - -// ----------------------------------------------------------------------- -// Generic checks and assertions based on checkers. - -// Check verifies if the first value matches the expected value according -// to the provided checker. If they do not match, an error is logged, the -// test is marked as failed, and the test execution continues. -// -// Some checkers may not need the expected argument (e.g. IsNil). -// -// Extra arguments provided to the function are logged next to the reported -// problem when the matching fails. -func (c *C) Check(obtained interface{}, checker Checker, args ...interface{}) bool { - return c.internalCheck("Check", obtained, checker, args...) -} - -// Assert ensures that the first value matches the expected value according -// to the provided checker. If they do not match, an error is logged, the -// test is marked as failed, and the test execution stops. -// -// Some checkers may not need the expected argument (e.g. IsNil). -// -// Extra arguments provided to the function are logged next to the reported -// problem when the matching fails. -func (c *C) Assert(obtained interface{}, checker Checker, args ...interface{}) { - if !c.internalCheck("Assert", obtained, checker, args...) { - c.stopNow() - } -} - -func (c *C) internalCheck(funcName string, obtained interface{}, checker Checker, args ...interface{}) bool { - if checker == nil { - c.logCaller(2) - c.logString(fmt.Sprintf("%s(obtained, nil!?, ...):", funcName)) - c.logString("Oops.. you've provided a nil checker!") - c.logNewLine() - c.Fail() - return false - } - - // If the last argument is a bug info, extract it out. - var comment CommentInterface - if len(args) > 0 { - if c, ok := args[len(args)-1].(CommentInterface); ok { - comment = c - args = args[:len(args)-1] - } - } - - params := append([]interface{}{obtained}, args...) - info := checker.Info() - - if len(params) != len(info.Params) { - names := append([]string{info.Params[0], info.Name}, info.Params[1:]...) - c.logCaller(2) - c.logString(fmt.Sprintf("%s(%s):", funcName, strings.Join(names, ", "))) - c.logString(fmt.Sprintf("Wrong number of parameters for %s: want %d, got %d", info.Name, len(names), len(params)+1)) - c.logNewLine() - c.Fail() - return false - } - - // Copy since it may be mutated by Check. - names := append([]string{}, info.Params...) - - // Do the actual check. - result, error := checker.Check(params, names) - if !result || error != "" { - c.logCaller(2) - for i := 0; i != len(params); i++ { - c.logValue(names[i], params[i]) - } - if comment != nil { - c.logString(comment.CheckCommentString()) - } - if error != "" { - c.logString(error) - } - c.logNewLine() - c.Fail() - return false - } - return true -} diff --git a/vendor/gopkg.in/check.v1/helpers_test.go b/vendor/gopkg.in/check.v1/helpers_test.go deleted file mode 100644 index 4baa656..0000000 --- a/vendor/gopkg.in/check.v1/helpers_test.go +++ /dev/null @@ -1,519 +0,0 @@ -// These tests verify the inner workings of the helper methods associated -// with check.T. - -package check_test - -import ( - "gopkg.in/check.v1" - "os" - "reflect" - "runtime" - "sync" -) - -var helpersS = check.Suite(&HelpersS{}) - -type HelpersS struct{} - -func (s *HelpersS) TestCountSuite(c *check.C) { - suitesRun += 1 -} - -// ----------------------------------------------------------------------- -// Fake checker and bug info to verify the behavior of Assert() and Check(). - -type MyChecker struct { - info *check.CheckerInfo - params []interface{} - names []string - result bool - error string -} - -func (checker *MyChecker) Info() *check.CheckerInfo { - if checker.info == nil { - return &check.CheckerInfo{Name: "MyChecker", Params: []string{"myobtained", "myexpected"}} - } - return checker.info -} - -func (checker *MyChecker) Check(params []interface{}, names []string) (bool, string) { - rparams := checker.params - rnames := checker.names - checker.params = append([]interface{}{}, params...) - checker.names = append([]string{}, names...) - if rparams != nil { - copy(params, rparams) - } - if rnames != nil { - copy(names, rnames) - } - return checker.result, checker.error -} - -type myCommentType string - -func (c myCommentType) CheckCommentString() string { - return string(c) -} - -func myComment(s string) myCommentType { - return myCommentType(s) -} - -// ----------------------------------------------------------------------- -// Ensure a real checker actually works fine. - -func (s *HelpersS) TestCheckerInterface(c *check.C) { - testHelperSuccess(c, "Check(1, Equals, 1)", true, func() interface{} { - return c.Check(1, check.Equals, 1) - }) -} - -// ----------------------------------------------------------------------- -// Tests for Check(), mostly the same as for Assert() following these. - -func (s *HelpersS) TestCheckSucceedWithExpected(c *check.C) { - checker := &MyChecker{result: true} - testHelperSuccess(c, "Check(1, checker, 2)", true, func() interface{} { - return c.Check(1, checker, 2) - }) - if !reflect.DeepEqual(checker.params, []interface{}{1, 2}) { - c.Fatalf("Bad params for check: %#v", checker.params) - } -} - -func (s *HelpersS) TestCheckSucceedWithoutExpected(c *check.C) { - checker := &MyChecker{result: true, info: &check.CheckerInfo{Params: []string{"myvalue"}}} - testHelperSuccess(c, "Check(1, checker)", true, func() interface{} { - return c.Check(1, checker) - }) - if !reflect.DeepEqual(checker.params, []interface{}{1}) { - c.Fatalf("Bad params for check: %#v", checker.params) - } -} - -func (s *HelpersS) TestCheckFailWithExpected(c *check.C) { - checker := &MyChecker{result: false} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker, 2\\)\n" + - "\\.+ myobtained int = 1\n" + - "\\.+ myexpected int = 2\n\n" - testHelperFailure(c, "Check(1, checker, 2)", false, false, log, - func() interface{} { - return c.Check(1, checker, 2) - }) -} - -func (s *HelpersS) TestCheckFailWithExpectedAndComment(c *check.C) { - checker := &MyChecker{result: false} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker, 2, myComment\\(\"Hello world!\"\\)\\)\n" + - "\\.+ myobtained int = 1\n" + - "\\.+ myexpected int = 2\n" + - "\\.+ Hello world!\n\n" - testHelperFailure(c, "Check(1, checker, 2, msg)", false, false, log, - func() interface{} { - return c.Check(1, checker, 2, myComment("Hello world!")) - }) -} - -func (s *HelpersS) TestCheckFailWithExpectedAndStaticComment(c *check.C) { - checker := &MyChecker{result: false} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " // Nice leading comment\\.\n" + - " return c\\.Check\\(1, checker, 2\\) // Hello there\n" + - "\\.+ myobtained int = 1\n" + - "\\.+ myexpected int = 2\n\n" - testHelperFailure(c, "Check(1, checker, 2, msg)", false, false, log, - func() interface{} { - // Nice leading comment. - return c.Check(1, checker, 2) // Hello there - }) -} - -func (s *HelpersS) TestCheckFailWithoutExpected(c *check.C) { - checker := &MyChecker{result: false, info: &check.CheckerInfo{Params: []string{"myvalue"}}} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker\\)\n" + - "\\.+ myvalue int = 1\n\n" - testHelperFailure(c, "Check(1, checker)", false, false, log, - func() interface{} { - return c.Check(1, checker) - }) -} - -func (s *HelpersS) TestCheckFailWithoutExpectedAndMessage(c *check.C) { - checker := &MyChecker{result: false, info: &check.CheckerInfo{Params: []string{"myvalue"}}} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker, myComment\\(\"Hello world!\"\\)\\)\n" + - "\\.+ myvalue int = 1\n" + - "\\.+ Hello world!\n\n" - testHelperFailure(c, "Check(1, checker, msg)", false, false, log, - func() interface{} { - return c.Check(1, checker, myComment("Hello world!")) - }) -} - -func (s *HelpersS) TestCheckWithMissingExpected(c *check.C) { - checker := &MyChecker{result: true} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker\\)\n" + - "\\.+ Check\\(myobtained, MyChecker, myexpected\\):\n" + - "\\.+ Wrong number of parameters for MyChecker: " + - "want 3, got 2\n\n" - testHelperFailure(c, "Check(1, checker, !?)", false, false, log, - func() interface{} { - return c.Check(1, checker) - }) -} - -func (s *HelpersS) TestCheckWithTooManyExpected(c *check.C) { - checker := &MyChecker{result: true} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker, 2, 3\\)\n" + - "\\.+ Check\\(myobtained, MyChecker, myexpected\\):\n" + - "\\.+ Wrong number of parameters for MyChecker: " + - "want 3, got 4\n\n" - testHelperFailure(c, "Check(1, checker, 2, 3)", false, false, log, - func() interface{} { - return c.Check(1, checker, 2, 3) - }) -} - -func (s *HelpersS) TestCheckWithError(c *check.C) { - checker := &MyChecker{result: false, error: "Some not so cool data provided!"} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker, 2\\)\n" + - "\\.+ myobtained int = 1\n" + - "\\.+ myexpected int = 2\n" + - "\\.+ Some not so cool data provided!\n\n" - testHelperFailure(c, "Check(1, checker, 2)", false, false, log, - func() interface{} { - return c.Check(1, checker, 2) - }) -} - -func (s *HelpersS) TestCheckWithNilChecker(c *check.C) { - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, nil\\)\n" + - "\\.+ Check\\(obtained, nil!\\?, \\.\\.\\.\\):\n" + - "\\.+ Oops\\.\\. you've provided a nil checker!\n\n" - testHelperFailure(c, "Check(obtained, nil)", false, false, log, - func() interface{} { - return c.Check(1, nil) - }) -} - -func (s *HelpersS) TestCheckWithParamsAndNamesMutation(c *check.C) { - checker := &MyChecker{result: false, params: []interface{}{3, 4}, names: []string{"newobtained", "newexpected"}} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " return c\\.Check\\(1, checker, 2\\)\n" + - "\\.+ newobtained int = 3\n" + - "\\.+ newexpected int = 4\n\n" - testHelperFailure(c, "Check(1, checker, 2) with mutation", false, false, log, - func() interface{} { - return c.Check(1, checker, 2) - }) -} - -// ----------------------------------------------------------------------- -// Tests for Assert(), mostly the same as for Check() above. - -func (s *HelpersS) TestAssertSucceedWithExpected(c *check.C) { - checker := &MyChecker{result: true} - testHelperSuccess(c, "Assert(1, checker, 2)", nil, func() interface{} { - c.Assert(1, checker, 2) - return nil - }) - if !reflect.DeepEqual(checker.params, []interface{}{1, 2}) { - c.Fatalf("Bad params for check: %#v", checker.params) - } -} - -func (s *HelpersS) TestAssertSucceedWithoutExpected(c *check.C) { - checker := &MyChecker{result: true, info: &check.CheckerInfo{Params: []string{"myvalue"}}} - testHelperSuccess(c, "Assert(1, checker)", nil, func() interface{} { - c.Assert(1, checker) - return nil - }) - if !reflect.DeepEqual(checker.params, []interface{}{1}) { - c.Fatalf("Bad params for check: %#v", checker.params) - } -} - -func (s *HelpersS) TestAssertFailWithExpected(c *check.C) { - checker := &MyChecker{result: false} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " c\\.Assert\\(1, checker, 2\\)\n" + - "\\.+ myobtained int = 1\n" + - "\\.+ myexpected int = 2\n\n" - testHelperFailure(c, "Assert(1, checker, 2)", nil, true, log, - func() interface{} { - c.Assert(1, checker, 2) - return nil - }) -} - -func (s *HelpersS) TestAssertFailWithExpectedAndMessage(c *check.C) { - checker := &MyChecker{result: false} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " c\\.Assert\\(1, checker, 2, myComment\\(\"Hello world!\"\\)\\)\n" + - "\\.+ myobtained int = 1\n" + - "\\.+ myexpected int = 2\n" + - "\\.+ Hello world!\n\n" - testHelperFailure(c, "Assert(1, checker, 2, msg)", nil, true, log, - func() interface{} { - c.Assert(1, checker, 2, myComment("Hello world!")) - return nil - }) -} - -func (s *HelpersS) TestAssertFailWithoutExpected(c *check.C) { - checker := &MyChecker{result: false, info: &check.CheckerInfo{Params: []string{"myvalue"}}} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " c\\.Assert\\(1, checker\\)\n" + - "\\.+ myvalue int = 1\n\n" - testHelperFailure(c, "Assert(1, checker)", nil, true, log, - func() interface{} { - c.Assert(1, checker) - return nil - }) -} - -func (s *HelpersS) TestAssertFailWithoutExpectedAndMessage(c *check.C) { - checker := &MyChecker{result: false, info: &check.CheckerInfo{Params: []string{"myvalue"}}} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " c\\.Assert\\(1, checker, myComment\\(\"Hello world!\"\\)\\)\n" + - "\\.+ myvalue int = 1\n" + - "\\.+ Hello world!\n\n" - testHelperFailure(c, "Assert(1, checker, msg)", nil, true, log, - func() interface{} { - c.Assert(1, checker, myComment("Hello world!")) - return nil - }) -} - -func (s *HelpersS) TestAssertWithMissingExpected(c *check.C) { - checker := &MyChecker{result: true} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " c\\.Assert\\(1, checker\\)\n" + - "\\.+ Assert\\(myobtained, MyChecker, myexpected\\):\n" + - "\\.+ Wrong number of parameters for MyChecker: " + - "want 3, got 2\n\n" - testHelperFailure(c, "Assert(1, checker, !?)", nil, true, log, - func() interface{} { - c.Assert(1, checker) - return nil - }) -} - -func (s *HelpersS) TestAssertWithError(c *check.C) { - checker := &MyChecker{result: false, error: "Some not so cool data provided!"} - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " c\\.Assert\\(1, checker, 2\\)\n" + - "\\.+ myobtained int = 1\n" + - "\\.+ myexpected int = 2\n" + - "\\.+ Some not so cool data provided!\n\n" - testHelperFailure(c, "Assert(1, checker, 2)", nil, true, log, - func() interface{} { - c.Assert(1, checker, 2) - return nil - }) -} - -func (s *HelpersS) TestAssertWithNilChecker(c *check.C) { - log := "(?s)helpers_test\\.go:[0-9]+:.*\nhelpers_test\\.go:[0-9]+:\n" + - " c\\.Assert\\(1, nil\\)\n" + - "\\.+ Assert\\(obtained, nil!\\?, \\.\\.\\.\\):\n" + - "\\.+ Oops\\.\\. you've provided a nil checker!\n\n" - testHelperFailure(c, "Assert(obtained, nil)", nil, true, log, - func() interface{} { - c.Assert(1, nil) - return nil - }) -} - -// ----------------------------------------------------------------------- -// Ensure that values logged work properly in some interesting cases. - -func (s *HelpersS) TestValueLoggingWithArrays(c *check.C) { - checker := &MyChecker{result: false} - log := "(?s)helpers_test.go:[0-9]+:.*\nhelpers_test.go:[0-9]+:\n" + - " return c\\.Check\\(\\[\\]byte{1, 2}, checker, \\[\\]byte{1, 3}\\)\n" + - "\\.+ myobtained \\[\\]uint8 = \\[\\]byte{0x1, 0x2}\n" + - "\\.+ myexpected \\[\\]uint8 = \\[\\]byte{0x1, 0x3}\n\n" - testHelperFailure(c, "Check([]byte{1}, chk, []byte{3})", false, false, log, - func() interface{} { - return c.Check([]byte{1, 2}, checker, []byte{1, 3}) - }) -} - -func (s *HelpersS) TestValueLoggingWithMultiLine(c *check.C) { - checker := &MyChecker{result: false} - log := "(?s)helpers_test.go:[0-9]+:.*\nhelpers_test.go:[0-9]+:\n" + - " return c\\.Check\\(\"a\\\\nb\\\\n\", checker, \"a\\\\nb\\\\nc\"\\)\n" + - "\\.+ myobtained string = \"\" \\+\n" + - "\\.+ \"a\\\\n\" \\+\n" + - "\\.+ \"b\\\\n\"\n" + - "\\.+ myexpected string = \"\" \\+\n" + - "\\.+ \"a\\\\n\" \\+\n" + - "\\.+ \"b\\\\n\" \\+\n" + - "\\.+ \"c\"\n\n" - testHelperFailure(c, `Check("a\nb\n", chk, "a\nb\nc")`, false, false, log, - func() interface{} { - return c.Check("a\nb\n", checker, "a\nb\nc") - }) -} - -func (s *HelpersS) TestValueLoggingWithMultiLineException(c *check.C) { - // If the newline is at the end of the string, don't log as multi-line. - checker := &MyChecker{result: false} - log := "(?s)helpers_test.go:[0-9]+:.*\nhelpers_test.go:[0-9]+:\n" + - " return c\\.Check\\(\"a b\\\\n\", checker, \"a\\\\nb\"\\)\n" + - "\\.+ myobtained string = \"a b\\\\n\"\n" + - "\\.+ myexpected string = \"\" \\+\n" + - "\\.+ \"a\\\\n\" \\+\n" + - "\\.+ \"b\"\n\n" - testHelperFailure(c, `Check("a b\n", chk, "a\nb")`, false, false, log, - func() interface{} { - return c.Check("a b\n", checker, "a\nb") - }) -} - -// ----------------------------------------------------------------------- -// MakeDir() tests. - -type MkDirHelper struct { - path1 string - path2 string - isDir1 bool - isDir2 bool - isDir3 bool - isDir4 bool -} - -func (s *MkDirHelper) SetUpSuite(c *check.C) { - s.path1 = c.MkDir() - s.isDir1 = isDir(s.path1) -} - -func (s *MkDirHelper) Test(c *check.C) { - s.path2 = c.MkDir() - s.isDir2 = isDir(s.path2) -} - -func (s *MkDirHelper) TearDownSuite(c *check.C) { - s.isDir3 = isDir(s.path1) - s.isDir4 = isDir(s.path2) -} - -func (s *HelpersS) TestMkDir(c *check.C) { - helper := MkDirHelper{} - output := String{} - check.Run(&helper, &check.RunConf{Output: &output}) - c.Assert(output.value, check.Equals, "") - c.Check(helper.isDir1, check.Equals, true) - c.Check(helper.isDir2, check.Equals, true) - c.Check(helper.isDir3, check.Equals, true) - c.Check(helper.isDir4, check.Equals, true) - c.Check(helper.path1, check.Not(check.Equals), - helper.path2) - c.Check(isDir(helper.path1), check.Equals, false) - c.Check(isDir(helper.path2), check.Equals, false) -} - -func isDir(path string) bool { - if stat, err := os.Stat(path); err == nil { - return stat.IsDir() - } - return false -} - -// Concurrent logging should not corrupt the underling buffer. -// Use go test -race to detect the race in this test. -func (s *HelpersS) TestConcurrentLogging(c *check.C) { - defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(runtime.NumCPU())) - var start, stop sync.WaitGroup - start.Add(1) - for i, n := 0, runtime.NumCPU()*2; i < n; i++ { - stop.Add(1) - go func(i int) { - start.Wait() - for j := 0; j < 30; j++ { - c.Logf("Worker %d: line %d", i, j) - } - stop.Done() - }(i) - } - start.Done() - stop.Wait() -} - -// ----------------------------------------------------------------------- -// Test the TestName function - -type TestNameHelper struct { - name1 string - name2 string - name3 string - name4 string - name5 string -} - -func (s *TestNameHelper) SetUpSuite(c *check.C) { s.name1 = c.TestName() } -func (s *TestNameHelper) SetUpTest(c *check.C) { s.name2 = c.TestName() } -func (s *TestNameHelper) Test(c *check.C) { s.name3 = c.TestName() } -func (s *TestNameHelper) TearDownTest(c *check.C) { s.name4 = c.TestName() } -func (s *TestNameHelper) TearDownSuite(c *check.C) { s.name5 = c.TestName() } - -func (s *HelpersS) TestTestName(c *check.C) { - helper := TestNameHelper{} - output := String{} - check.Run(&helper, &check.RunConf{Output: &output}) - c.Check(helper.name1, check.Equals, "") - c.Check(helper.name2, check.Equals, "TestNameHelper.Test") - c.Check(helper.name3, check.Equals, "TestNameHelper.Test") - c.Check(helper.name4, check.Equals, "TestNameHelper.Test") - c.Check(helper.name5, check.Equals, "") -} - -// ----------------------------------------------------------------------- -// A couple of helper functions to test helper functions. :-) - -func testHelperSuccess(c *check.C, name string, expectedResult interface{}, closure func() interface{}) { - var result interface{} - defer (func() { - if err := recover(); err != nil { - panic(err) - } - checkState(c, result, - &expectedState{ - name: name, - result: expectedResult, - failed: false, - log: "", - }) - })() - result = closure() -} - -func testHelperFailure(c *check.C, name string, expectedResult interface{}, shouldStop bool, log string, closure func() interface{}) { - var result interface{} - defer (func() { - if err := recover(); err != nil { - panic(err) - } - checkState(c, result, - &expectedState{ - name: name, - result: expectedResult, - failed: true, - log: log, - }) - })() - result = closure() - if shouldStop { - c.Logf("%s didn't stop when it should", name) - } -} diff --git a/vendor/gopkg.in/check.v1/integration_test.go b/vendor/gopkg.in/check.v1/integration_test.go deleted file mode 100644 index dfcd952..0000000 --- a/vendor/gopkg.in/check.v1/integration_test.go +++ /dev/null @@ -1,94 +0,0 @@ -// Integration tests - -package check_test - -import ( - . "gopkg.in/check.v1" -) - -// ----------------------------------------------------------------------- -// Integration test suite. - -type integrationS struct{} - -var _ = Suite(&integrationS{}) - -type integrationTestHelper struct{} - -func (s *integrationTestHelper) TestMultiLineStringEqualFails(c *C) { - c.Check("foo\nbar\nbaz\nboom\n", Equals, "foo\nbaar\nbaz\nboom\n") -} - -func (s *integrationTestHelper) TestStringEqualFails(c *C) { - c.Check("foo", Equals, "bar") -} - -func (s *integrationTestHelper) TestIntEqualFails(c *C) { - c.Check(42, Equals, 43) -} - -type complexStruct struct { - r, i int -} - -func (s *integrationTestHelper) TestStructEqualFails(c *C) { - c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4}) -} - -func (s *integrationS) TestOutput(c *C) { - helper := integrationTestHelper{} - output := String{} - Run(&helper, &RunConf{Output: &output}) - c.Assert(output.value, Equals, ` ----------------------------------------------------------------------- -FAIL: integration_test.go:26: integrationTestHelper.TestIntEqualFails - -integration_test.go:27: - c.Check(42, Equals, 43) -... obtained int = 42 -... expected int = 43 - - ----------------------------------------------------------------------- -FAIL: integration_test.go:18: integrationTestHelper.TestMultiLineStringEqualFails - -integration_test.go:19: - c.Check("foo\nbar\nbaz\nboom\n", Equals, "foo\nbaar\nbaz\nboom\n") -... obtained string = "" + -... "foo\n" + -... "bar\n" + -... "baz\n" + -... "boom\n" -... expected string = "" + -... "foo\n" + -... "baar\n" + -... "baz\n" + -... "boom\n" -... String difference: -... [1]: "bar" != "baar" - - - ----------------------------------------------------------------------- -FAIL: integration_test.go:22: integrationTestHelper.TestStringEqualFails - -integration_test.go:23: - c.Check("foo", Equals, "bar") -... obtained string = "foo" -... expected string = "bar" - - ----------------------------------------------------------------------- -FAIL: integration_test.go:34: integrationTestHelper.TestStructEqualFails - -integration_test.go:35: - c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4}) -... obtained check_test.complexStruct = check_test.complexStruct{r:1, i:2} -... expected check_test.complexStruct = check_test.complexStruct{r:3, i:4} -... Difference: -... r: 1 != 3 -... i: 2 != 4 - - -`) -} diff --git a/vendor/gopkg.in/check.v1/printer.go b/vendor/gopkg.in/check.v1/printer.go deleted file mode 100644 index e0f7557..0000000 --- a/vendor/gopkg.in/check.v1/printer.go +++ /dev/null @@ -1,168 +0,0 @@ -package check - -import ( - "bytes" - "go/ast" - "go/parser" - "go/printer" - "go/token" - "os" -) - -func indent(s, with string) (r string) { - eol := true - for i := 0; i != len(s); i++ { - c := s[i] - switch { - case eol && c == '\n' || c == '\r': - case c == '\n' || c == '\r': - eol = true - case eol: - eol = false - s = s[:i] + with + s[i:] - i += len(with) - } - } - return s -} - -func printLine(filename string, line int) (string, error) { - fset := token.NewFileSet() - file, err := os.Open(filename) - if err != nil { - return "", err - } - fnode, err := parser.ParseFile(fset, filename, file, parser.ParseComments) - if err != nil { - return "", err - } - config := &printer.Config{Mode: printer.UseSpaces, Tabwidth: 4} - lp := &linePrinter{fset: fset, fnode: fnode, line: line, config: config} - ast.Walk(lp, fnode) - result := lp.output.Bytes() - // Comments leave \n at the end. - n := len(result) - for n > 0 && result[n-1] == '\n' { - n-- - } - return string(result[:n]), nil -} - -type linePrinter struct { - config *printer.Config - fset *token.FileSet - fnode *ast.File - line int - output bytes.Buffer - stmt ast.Stmt -} - -func (lp *linePrinter) emit() bool { - if lp.stmt != nil { - lp.trim(lp.stmt) - lp.printWithComments(lp.stmt) - lp.stmt = nil - return true - } - return false -} - -func (lp *linePrinter) printWithComments(n ast.Node) { - nfirst := lp.fset.Position(n.Pos()).Line - nlast := lp.fset.Position(n.End()).Line - for _, g := range lp.fnode.Comments { - cfirst := lp.fset.Position(g.Pos()).Line - clast := lp.fset.Position(g.End()).Line - if clast == nfirst-1 && lp.fset.Position(n.Pos()).Column == lp.fset.Position(g.Pos()).Column { - for _, c := range g.List { - lp.output.WriteString(c.Text) - lp.output.WriteByte('\n') - } - } - if cfirst >= nfirst && cfirst <= nlast && n.End() <= g.List[0].Slash { - // The printer will not include the comment if it starts past - // the node itself. Trick it into printing by overlapping the - // slash with the end of the statement. - g.List[0].Slash = n.End() - 1 - } - } - node := &printer.CommentedNode{n, lp.fnode.Comments} - lp.config.Fprint(&lp.output, lp.fset, node) -} - -func (lp *linePrinter) Visit(n ast.Node) (w ast.Visitor) { - if n == nil { - if lp.output.Len() == 0 { - lp.emit() - } - return nil - } - first := lp.fset.Position(n.Pos()).Line - last := lp.fset.Position(n.End()).Line - if first <= lp.line && last >= lp.line { - // Print the innermost statement containing the line. - if stmt, ok := n.(ast.Stmt); ok { - if _, ok := n.(*ast.BlockStmt); !ok { - lp.stmt = stmt - } - } - if first == lp.line && lp.emit() { - return nil - } - return lp - } - return nil -} - -func (lp *linePrinter) trim(n ast.Node) bool { - stmt, ok := n.(ast.Stmt) - if !ok { - return true - } - line := lp.fset.Position(n.Pos()).Line - if line != lp.line { - return false - } - switch stmt := stmt.(type) { - case *ast.IfStmt: - stmt.Body = lp.trimBlock(stmt.Body) - case *ast.SwitchStmt: - stmt.Body = lp.trimBlock(stmt.Body) - case *ast.TypeSwitchStmt: - stmt.Body = lp.trimBlock(stmt.Body) - case *ast.CaseClause: - stmt.Body = lp.trimList(stmt.Body) - case *ast.CommClause: - stmt.Body = lp.trimList(stmt.Body) - case *ast.BlockStmt: - stmt.List = lp.trimList(stmt.List) - } - return true -} - -func (lp *linePrinter) trimBlock(stmt *ast.BlockStmt) *ast.BlockStmt { - if !lp.trim(stmt) { - return lp.emptyBlock(stmt) - } - stmt.Rbrace = stmt.Lbrace - return stmt -} - -func (lp *linePrinter) trimList(stmts []ast.Stmt) []ast.Stmt { - for i := 0; i != len(stmts); i++ { - if !lp.trim(stmts[i]) { - stmts[i] = lp.emptyStmt(stmts[i]) - break - } - } - return stmts -} - -func (lp *linePrinter) emptyStmt(n ast.Node) *ast.ExprStmt { - return &ast.ExprStmt{&ast.Ellipsis{n.Pos(), nil}} -} - -func (lp *linePrinter) emptyBlock(n ast.Node) *ast.BlockStmt { - p := n.Pos() - return &ast.BlockStmt{p, []ast.Stmt{lp.emptyStmt(n)}, p} -} diff --git a/vendor/gopkg.in/check.v1/printer_test.go b/vendor/gopkg.in/check.v1/printer_test.go deleted file mode 100644 index 538b2d5..0000000 --- a/vendor/gopkg.in/check.v1/printer_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package check_test - -import ( - . "gopkg.in/check.v1" -) - -var _ = Suite(&PrinterS{}) - -type PrinterS struct{} - -func (s *PrinterS) TestCountSuite(c *C) { - suitesRun += 1 -} - -var printTestFuncLine int - -func init() { - printTestFuncLine = getMyLine() + 3 -} - -func printTestFunc() { - println(1) // Comment1 - if 2 == 2 { // Comment2 - println(3) // Comment3 - } - switch 5 { - case 6: println(6) // Comment6 - println(7) - } - switch interface{}(9).(type) {// Comment9 - case int: println(10) - println(11) - } - select { - case <-(chan bool)(nil): println(14) - println(15) - default: println(16) - println(17) - } - println(19, - 20) - _ = func() { println(21) - println(22) - } - println(24, func() { - println(25) - }) - // Leading comment - // with multiple lines. - println(29) // Comment29 -} - -var printLineTests = []struct { - line int - output string -}{ - {1, "println(1) // Comment1"}, - {2, "if 2 == 2 { // Comment2\n ...\n}"}, - {3, "println(3) // Comment3"}, - {5, "switch 5 {\n...\n}"}, - {6, "case 6:\n println(6) // Comment6\n ..."}, - {7, "println(7)"}, - {9, "switch interface{}(9).(type) { // Comment9\n...\n}"}, - {10, "case int:\n println(10)\n ..."}, - {14, "case <-(chan bool)(nil):\n println(14)\n ..."}, - {15, "println(15)"}, - {16, "default:\n println(16)\n ..."}, - {17, "println(17)"}, - {19, "println(19,\n 20)"}, - {20, "println(19,\n 20)"}, - {21, "_ = func() {\n println(21)\n println(22)\n}"}, - {22, "println(22)"}, - {24, "println(24, func() {\n println(25)\n})"}, - {25, "println(25)"}, - {26, "println(24, func() {\n println(25)\n})"}, - {29, "// Leading comment\n// with multiple lines.\nprintln(29) // Comment29"}, -} - -func (s *PrinterS) TestPrintLine(c *C) { - for _, test := range printLineTests { - output, err := PrintLine("printer_test.go", printTestFuncLine+test.line) - c.Assert(err, IsNil) - c.Assert(output, Equals, test.output) - } -} - -var indentTests = []struct { - in, out string -}{ - {"", ""}, - {"\n", "\n"}, - {"a", ">>>a"}, - {"a\n", ">>>a\n"}, - {"a\nb", ">>>a\n>>>b"}, - {" ", ">>> "}, -} - -func (s *PrinterS) TestIndent(c *C) { - for _, test := range indentTests { - out := Indent(test.in, ">>>") - c.Assert(out, Equals, test.out) - } - -} diff --git a/vendor/gopkg.in/check.v1/reporter.go b/vendor/gopkg.in/check.v1/reporter.go deleted file mode 100644 index fb04f76..0000000 --- a/vendor/gopkg.in/check.v1/reporter.go +++ /dev/null @@ -1,88 +0,0 @@ -package check - -import ( - "fmt" - "io" - "sync" -) - -// ----------------------------------------------------------------------- -// Output writer manages atomic output writing according to settings. - -type outputWriter struct { - m sync.Mutex - writer io.Writer - wroteCallProblemLast bool - Stream bool - Verbose bool -} - -func newOutputWriter(writer io.Writer, stream, verbose bool) *outputWriter { - return &outputWriter{writer: writer, Stream: stream, Verbose: verbose} -} - -func (ow *outputWriter) Write(content []byte) (n int, err error) { - ow.m.Lock() - n, err = ow.writer.Write(content) - ow.m.Unlock() - return -} - -func (ow *outputWriter) WriteCallStarted(label string, c *C) { - if ow.Stream { - header := renderCallHeader(label, c, "", "\n") - ow.m.Lock() - ow.writer.Write([]byte(header)) - ow.m.Unlock() - } -} - -func (ow *outputWriter) WriteCallProblem(label string, c *C) { - var prefix string - if !ow.Stream { - prefix = "\n-----------------------------------" + - "-----------------------------------\n" - } - header := renderCallHeader(label, c, prefix, "\n\n") - ow.m.Lock() - ow.wroteCallProblemLast = true - ow.writer.Write([]byte(header)) - if !ow.Stream { - c.logb.WriteTo(ow.writer) - } - ow.m.Unlock() -} - -func (ow *outputWriter) WriteCallSuccess(label string, c *C) { - if ow.Stream || (ow.Verbose && c.kind == testKd) { - // TODO Use a buffer here. - var suffix string - if c.reason != "" { - suffix = " (" + c.reason + ")" - } - if c.status() == succeededSt { - suffix += "\t" + c.timerString() - } - suffix += "\n" - if ow.Stream { - suffix += "\n" - } - header := renderCallHeader(label, c, "", suffix) - ow.m.Lock() - // Resist temptation of using line as prefix above due to race. - if !ow.Stream && ow.wroteCallProblemLast { - header = "\n-----------------------------------" + - "-----------------------------------\n" + - header - } - ow.wroteCallProblemLast = false - ow.writer.Write([]byte(header)) - ow.m.Unlock() - } -} - -func renderCallHeader(label string, c *C, prefix, suffix string) string { - pc := c.method.PC() - return fmt.Sprintf("%s%s: %s: %s%s", prefix, label, niceFuncPath(pc), - niceFuncName(pc), suffix) -} diff --git a/vendor/gopkg.in/check.v1/reporter_test.go b/vendor/gopkg.in/check.v1/reporter_test.go deleted file mode 100644 index 0b7ed76..0000000 --- a/vendor/gopkg.in/check.v1/reporter_test.go +++ /dev/null @@ -1,159 +0,0 @@ -package check_test - -import ( - "fmt" - "path/filepath" - "runtime" - - . "gopkg.in/check.v1" -) - -var _ = Suite(&reporterS{}) - -type reporterS struct { - testFile string -} - -func (s *reporterS) SetUpSuite(c *C) { - _, fileName, _, ok := runtime.Caller(0) - c.Assert(ok, Equals, true) - s.testFile = filepath.Base(fileName) -} - -func (s *reporterS) TestWrite(c *C) { - testString := "test string" - output := String{} - - dummyStream := true - dummyVerbose := true - o := NewOutputWriter(&output, dummyStream, dummyVerbose) - - o.Write([]byte(testString)) - c.Assert(output.value, Equals, testString) -} - -func (s *reporterS) TestWriteCallStartedWithStreamFlag(c *C) { - testLabel := "test started label" - stream := true - output := String{} - - dummyVerbose := true - o := NewOutputWriter(&output, stream, dummyVerbose) - - o.WriteCallStarted(testLabel, c) - expected := fmt.Sprintf("%s: %s:\\d+: %s\n", testLabel, s.testFile, c.TestName()) - c.Assert(output.value, Matches, expected) -} - -func (s *reporterS) TestWriteCallStartedWithoutStreamFlag(c *C) { - stream := false - output := String{} - - dummyLabel := "dummy" - dummyVerbose := true - o := NewOutputWriter(&output, stream, dummyVerbose) - - o.WriteCallStarted(dummyLabel, c) - c.Assert(output.value, Equals, "") -} - -func (s *reporterS) TestWriteCallProblemWithStreamFlag(c *C) { - testLabel := "test problem label" - stream := true - output := String{} - - dummyVerbose := true - o := NewOutputWriter(&output, stream, dummyVerbose) - - o.WriteCallProblem(testLabel, c) - expected := fmt.Sprintf("%s: %s:\\d+: %s\n\n", testLabel, s.testFile, c.TestName()) - c.Assert(output.value, Matches, expected) -} - -func (s *reporterS) TestWriteCallProblemWithoutStreamFlag(c *C) { - testLabel := "test problem label" - stream := false - output := String{} - - dummyVerbose := true - o := NewOutputWriter(&output, stream, dummyVerbose) - - o.WriteCallProblem(testLabel, c) - expected := fmt.Sprintf(""+ - "\n"+ - "----------------------------------------------------------------------\n"+ - "%s: %s:\\d+: %s\n\n", testLabel, s.testFile, c.TestName()) - c.Assert(output.value, Matches, expected) -} - -func (s *reporterS) TestWriteCallProblemWithoutStreamFlagWithLog(c *C) { - testLabel := "test problem label" - testLog := "test log" - stream := false - output := String{} - - dummyVerbose := true - o := NewOutputWriter(&output, stream, dummyVerbose) - - c.Log(testLog) - o.WriteCallProblem(testLabel, c) - expected := fmt.Sprintf(""+ - "\n"+ - "----------------------------------------------------------------------\n"+ - "%s: %s:\\d+: %s\n\n%s\n", testLabel, s.testFile, c.TestName(), testLog) - c.Assert(output.value, Matches, expected) -} - -func (s *reporterS) TestWriteCallSuccessWithStreamFlag(c *C) { - testLabel := "test success label" - stream := true - output := String{} - - dummyVerbose := true - o := NewOutputWriter(&output, stream, dummyVerbose) - - o.WriteCallSuccess(testLabel, c) - expected := fmt.Sprintf("%s: %s:\\d+: %s\t\\d\\.\\d+s\n\n", testLabel, s.testFile, c.TestName()) - c.Assert(output.value, Matches, expected) -} - -func (s *reporterS) TestWriteCallSuccessWithStreamFlagAndReason(c *C) { - testLabel := "test success label" - testReason := "test skip reason" - stream := true - output := String{} - - dummyVerbose := true - o := NewOutputWriter(&output, stream, dummyVerbose) - c.FakeSkip(testReason) - - o.WriteCallSuccess(testLabel, c) - expected := fmt.Sprintf("%s: %s:\\d+: %s \\(%s\\)\t\\d\\.\\d+s\n\n", - testLabel, s.testFile, c.TestName(), testReason) - c.Assert(output.value, Matches, expected) -} - -func (s *reporterS) TestWriteCallSuccessWithoutStreamFlagWithVerboseFlag(c *C) { - testLabel := "test success label" - stream := false - verbose := true - output := String{} - - o := NewOutputWriter(&output, stream, verbose) - - o.WriteCallSuccess(testLabel, c) - expected := fmt.Sprintf("%s: %s:\\d+: %s\t\\d\\.\\d+s\n", testLabel, s.testFile, c.TestName()) - c.Assert(output.value, Matches, expected) -} - -func (s *reporterS) TestWriteCallSuccessWithoutStreamFlagWithoutVerboseFlag(c *C) { - testLabel := "test success label" - stream := false - verbose := false - output := String{} - - o := NewOutputWriter(&output, stream, verbose) - - o.WriteCallSuccess(testLabel, c) - c.Assert(output.value, Equals, "") -} diff --git a/vendor/gopkg.in/check.v1/run.go b/vendor/gopkg.in/check.v1/run.go deleted file mode 100644 index da8fd79..0000000 --- a/vendor/gopkg.in/check.v1/run.go +++ /dev/null @@ -1,175 +0,0 @@ -package check - -import ( - "bufio" - "flag" - "fmt" - "os" - "testing" - "time" -) - -// ----------------------------------------------------------------------- -// Test suite registry. - -var allSuites []interface{} - -// Suite registers the given value as a test suite to be run. Any methods -// starting with the Test prefix in the given value will be considered as -// a test method. -func Suite(suite interface{}) interface{} { - allSuites = append(allSuites, suite) - return suite -} - -// ----------------------------------------------------------------------- -// Public running interface. - -var ( - oldFilterFlag = flag.String("gocheck.f", "", "Regular expression selecting which tests and/or suites to run") - oldVerboseFlag = flag.Bool("gocheck.v", false, "Verbose mode") - oldStreamFlag = flag.Bool("gocheck.vv", false, "Super verbose mode (disables output caching)") - oldBenchFlag = flag.Bool("gocheck.b", false, "Run benchmarks") - oldBenchTime = flag.Duration("gocheck.btime", 1*time.Second, "approximate run time for each benchmark") - oldListFlag = flag.Bool("gocheck.list", false, "List the names of all tests that will be run") - oldWorkFlag = flag.Bool("gocheck.work", false, "Display and do not remove the test working directory") - - newFilterFlag = flag.String("check.f", "", "Regular expression selecting which tests and/or suites to run") - newVerboseFlag = flag.Bool("check.v", false, "Verbose mode") - newStreamFlag = flag.Bool("check.vv", false, "Super verbose mode (disables output caching)") - newBenchFlag = flag.Bool("check.b", false, "Run benchmarks") - newBenchTime = flag.Duration("check.btime", 1*time.Second, "approximate run time for each benchmark") - newBenchMem = flag.Bool("check.bmem", false, "Report memory benchmarks") - newListFlag = flag.Bool("check.list", false, "List the names of all tests that will be run") - newWorkFlag = flag.Bool("check.work", false, "Display and do not remove the test working directory") -) - -// TestingT runs all test suites registered with the Suite function, -// printing results to stdout, and reporting any failures back to -// the "testing" package. -func TestingT(testingT *testing.T) { - benchTime := *newBenchTime - if benchTime == 1*time.Second { - benchTime = *oldBenchTime - } - conf := &RunConf{ - Filter: *oldFilterFlag + *newFilterFlag, - Verbose: *oldVerboseFlag || *newVerboseFlag, - Stream: *oldStreamFlag || *newStreamFlag, - Benchmark: *oldBenchFlag || *newBenchFlag, - BenchmarkTime: benchTime, - BenchmarkMem: *newBenchMem, - KeepWorkDir: *oldWorkFlag || *newWorkFlag, - } - if *oldListFlag || *newListFlag { - w := bufio.NewWriter(os.Stdout) - for _, name := range ListAll(conf) { - fmt.Fprintln(w, name) - } - w.Flush() - return - } - result := RunAll(conf) - println(result.String()) - if !result.Passed() { - testingT.Fail() - } -} - -// RunAll runs all test suites registered with the Suite function, using the -// provided run configuration. -func RunAll(runConf *RunConf) *Result { - result := Result{} - for _, suite := range allSuites { - result.Add(Run(suite, runConf)) - } - return &result -} - -// Run runs the provided test suite using the provided run configuration. -func Run(suite interface{}, runConf *RunConf) *Result { - runner := newSuiteRunner(suite, runConf) - return runner.run() -} - -// ListAll returns the names of all the test functions registered with the -// Suite function that will be run with the provided run configuration. -func ListAll(runConf *RunConf) []string { - var names []string - for _, suite := range allSuites { - names = append(names, List(suite, runConf)...) - } - return names -} - -// List returns the names of the test functions in the given -// suite that will be run with the provided run configuration. -func List(suite interface{}, runConf *RunConf) []string { - var names []string - runner := newSuiteRunner(suite, runConf) - for _, t := range runner.tests { - names = append(names, t.String()) - } - return names -} - -// ----------------------------------------------------------------------- -// Result methods. - -func (r *Result) Add(other *Result) { - r.Succeeded += other.Succeeded - r.Skipped += other.Skipped - r.Failed += other.Failed - r.Panicked += other.Panicked - r.FixturePanicked += other.FixturePanicked - r.ExpectedFailures += other.ExpectedFailures - r.Missed += other.Missed - if r.WorkDir != "" && other.WorkDir != "" { - r.WorkDir += ":" + other.WorkDir - } else if other.WorkDir != "" { - r.WorkDir = other.WorkDir - } -} - -func (r *Result) Passed() bool { - return (r.Failed == 0 && r.Panicked == 0 && - r.FixturePanicked == 0 && r.Missed == 0 && - r.RunError == nil) -} - -func (r *Result) String() string { - if r.RunError != nil { - return "ERROR: " + r.RunError.Error() - } - - var value string - if r.Failed == 0 && r.Panicked == 0 && r.FixturePanicked == 0 && - r.Missed == 0 { - value = "OK: " - } else { - value = "OOPS: " - } - value += fmt.Sprintf("%d passed", r.Succeeded) - if r.Skipped != 0 { - value += fmt.Sprintf(", %d skipped", r.Skipped) - } - if r.ExpectedFailures != 0 { - value += fmt.Sprintf(", %d expected failures", r.ExpectedFailures) - } - if r.Failed != 0 { - value += fmt.Sprintf(", %d FAILED", r.Failed) - } - if r.Panicked != 0 { - value += fmt.Sprintf(", %d PANICKED", r.Panicked) - } - if r.FixturePanicked != 0 { - value += fmt.Sprintf(", %d FIXTURE-PANICKED", r.FixturePanicked) - } - if r.Missed != 0 { - value += fmt.Sprintf(", %d MISSED", r.Missed) - } - if r.WorkDir != "" { - value += "\nWORK=" + r.WorkDir - } - return value -} diff --git a/vendor/gopkg.in/check.v1/run_test.go b/vendor/gopkg.in/check.v1/run_test.go deleted file mode 100644 index f41fffc..0000000 --- a/vendor/gopkg.in/check.v1/run_test.go +++ /dev/null @@ -1,419 +0,0 @@ -// These tests verify the test running logic. - -package check_test - -import ( - "errors" - . "gopkg.in/check.v1" - "os" - "sync" -) - -var runnerS = Suite(&RunS{}) - -type RunS struct{} - -func (s *RunS) TestCountSuite(c *C) { - suitesRun += 1 -} - -// ----------------------------------------------------------------------- -// Tests ensuring result counting works properly. - -func (s *RunS) TestSuccess(c *C) { - output := String{} - result := Run(&SuccessHelper{}, &RunConf{Output: &output}) - c.Check(result.Succeeded, Equals, 1) - c.Check(result.Failed, Equals, 0) - c.Check(result.Skipped, Equals, 0) - c.Check(result.Panicked, Equals, 0) - c.Check(result.FixturePanicked, Equals, 0) - c.Check(result.Missed, Equals, 0) - c.Check(result.RunError, IsNil) -} - -func (s *RunS) TestFailure(c *C) { - output := String{} - result := Run(&FailHelper{}, &RunConf{Output: &output}) - c.Check(result.Succeeded, Equals, 0) - c.Check(result.Failed, Equals, 1) - c.Check(result.Skipped, Equals, 0) - c.Check(result.Panicked, Equals, 0) - c.Check(result.FixturePanicked, Equals, 0) - c.Check(result.Missed, Equals, 0) - c.Check(result.RunError, IsNil) -} - -func (s *RunS) TestFixture(c *C) { - output := String{} - result := Run(&FixtureHelper{}, &RunConf{Output: &output}) - c.Check(result.Succeeded, Equals, 2) - c.Check(result.Failed, Equals, 0) - c.Check(result.Skipped, Equals, 0) - c.Check(result.Panicked, Equals, 0) - c.Check(result.FixturePanicked, Equals, 0) - c.Check(result.Missed, Equals, 0) - c.Check(result.RunError, IsNil) -} - -func (s *RunS) TestPanicOnTest(c *C) { - output := String{} - helper := &FixtureHelper{panicOn: "Test1"} - result := Run(helper, &RunConf{Output: &output}) - c.Check(result.Succeeded, Equals, 1) - c.Check(result.Failed, Equals, 0) - c.Check(result.Skipped, Equals, 0) - c.Check(result.Panicked, Equals, 1) - c.Check(result.FixturePanicked, Equals, 0) - c.Check(result.Missed, Equals, 0) - c.Check(result.RunError, IsNil) -} - -func (s *RunS) TestPanicOnSetUpTest(c *C) { - output := String{} - helper := &FixtureHelper{panicOn: "SetUpTest"} - result := Run(helper, &RunConf{Output: &output}) - c.Check(result.Succeeded, Equals, 0) - c.Check(result.Failed, Equals, 0) - c.Check(result.Skipped, Equals, 0) - c.Check(result.Panicked, Equals, 0) - c.Check(result.FixturePanicked, Equals, 1) - c.Check(result.Missed, Equals, 2) - c.Check(result.RunError, IsNil) -} - -func (s *RunS) TestPanicOnSetUpSuite(c *C) { - output := String{} - helper := &FixtureHelper{panicOn: "SetUpSuite"} - result := Run(helper, &RunConf{Output: &output}) - c.Check(result.Succeeded, Equals, 0) - c.Check(result.Failed, Equals, 0) - c.Check(result.Skipped, Equals, 0) - c.Check(result.Panicked, Equals, 0) - c.Check(result.FixturePanicked, Equals, 1) - c.Check(result.Missed, Equals, 2) - c.Check(result.RunError, IsNil) -} - -// ----------------------------------------------------------------------- -// Check result aggregation. - -func (s *RunS) TestAdd(c *C) { - result := &Result{ - Succeeded: 1, - Skipped: 2, - Failed: 3, - Panicked: 4, - FixturePanicked: 5, - Missed: 6, - ExpectedFailures: 7, - } - result.Add(&Result{ - Succeeded: 10, - Skipped: 20, - Failed: 30, - Panicked: 40, - FixturePanicked: 50, - Missed: 60, - ExpectedFailures: 70, - }) - c.Check(result.Succeeded, Equals, 11) - c.Check(result.Skipped, Equals, 22) - c.Check(result.Failed, Equals, 33) - c.Check(result.Panicked, Equals, 44) - c.Check(result.FixturePanicked, Equals, 55) - c.Check(result.Missed, Equals, 66) - c.Check(result.ExpectedFailures, Equals, 77) - c.Check(result.RunError, IsNil) -} - -// ----------------------------------------------------------------------- -// Check the Passed() method. - -func (s *RunS) TestPassed(c *C) { - c.Assert((&Result{}).Passed(), Equals, true) - c.Assert((&Result{Succeeded: 1}).Passed(), Equals, true) - c.Assert((&Result{Skipped: 1}).Passed(), Equals, true) - c.Assert((&Result{Failed: 1}).Passed(), Equals, false) - c.Assert((&Result{Panicked: 1}).Passed(), Equals, false) - c.Assert((&Result{FixturePanicked: 1}).Passed(), Equals, false) - c.Assert((&Result{Missed: 1}).Passed(), Equals, false) - c.Assert((&Result{RunError: errors.New("!")}).Passed(), Equals, false) -} - -// ----------------------------------------------------------------------- -// Check that result printing is working correctly. - -func (s *RunS) TestPrintSuccess(c *C) { - result := &Result{Succeeded: 5} - c.Check(result.String(), Equals, "OK: 5 passed") -} - -func (s *RunS) TestPrintFailure(c *C) { - result := &Result{Failed: 5} - c.Check(result.String(), Equals, "OOPS: 0 passed, 5 FAILED") -} - -func (s *RunS) TestPrintSkipped(c *C) { - result := &Result{Skipped: 5} - c.Check(result.String(), Equals, "OK: 0 passed, 5 skipped") -} - -func (s *RunS) TestPrintExpectedFailures(c *C) { - result := &Result{ExpectedFailures: 5} - c.Check(result.String(), Equals, "OK: 0 passed, 5 expected failures") -} - -func (s *RunS) TestPrintPanicked(c *C) { - result := &Result{Panicked: 5} - c.Check(result.String(), Equals, "OOPS: 0 passed, 5 PANICKED") -} - -func (s *RunS) TestPrintFixturePanicked(c *C) { - result := &Result{FixturePanicked: 5} - c.Check(result.String(), Equals, "OOPS: 0 passed, 5 FIXTURE-PANICKED") -} - -func (s *RunS) TestPrintMissed(c *C) { - result := &Result{Missed: 5} - c.Check(result.String(), Equals, "OOPS: 0 passed, 5 MISSED") -} - -func (s *RunS) TestPrintAll(c *C) { - result := &Result{Succeeded: 1, Skipped: 2, ExpectedFailures: 3, - Panicked: 4, FixturePanicked: 5, Missed: 6} - c.Check(result.String(), Equals, - "OOPS: 1 passed, 2 skipped, 3 expected failures, 4 PANICKED, "+ - "5 FIXTURE-PANICKED, 6 MISSED") -} - -func (s *RunS) TestPrintRunError(c *C) { - result := &Result{Succeeded: 1, Failed: 1, - RunError: errors.New("Kaboom!")} - c.Check(result.String(), Equals, "ERROR: Kaboom!") -} - -// ----------------------------------------------------------------------- -// Verify that the method pattern flag works correctly. - -func (s *RunS) TestFilterTestName(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Filter: "Test[91]"} - Run(&helper, &runConf) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 5) -} - -func (s *RunS) TestFilterTestNameWithAll(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Filter: ".*"} - Run(&helper, &runConf) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "SetUpTest") - c.Check(helper.calls[5], Equals, "Test2") - c.Check(helper.calls[6], Equals, "TearDownTest") - c.Check(helper.calls[7], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 8) -} - -func (s *RunS) TestFilterSuiteName(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Filter: "FixtureHelper"} - Run(&helper, &runConf) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test1") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "SetUpTest") - c.Check(helper.calls[5], Equals, "Test2") - c.Check(helper.calls[6], Equals, "TearDownTest") - c.Check(helper.calls[7], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 8) -} - -func (s *RunS) TestFilterSuiteNameAndTestName(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Filter: "FixtureHelper\\.Test2"} - Run(&helper, &runConf) - c.Check(helper.calls[0], Equals, "SetUpSuite") - c.Check(helper.calls[1], Equals, "SetUpTest") - c.Check(helper.calls[2], Equals, "Test2") - c.Check(helper.calls[3], Equals, "TearDownTest") - c.Check(helper.calls[4], Equals, "TearDownSuite") - c.Check(len(helper.calls), Equals, 5) -} - -func (s *RunS) TestFilterAllOut(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Filter: "NotFound"} - Run(&helper, &runConf) - c.Check(len(helper.calls), Equals, 0) -} - -func (s *RunS) TestRequirePartialMatch(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Filter: "est"} - Run(&helper, &runConf) - c.Check(len(helper.calls), Equals, 8) -} - -func (s *RunS) TestFilterError(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Filter: "]["} - result := Run(&helper, &runConf) - c.Check(result.String(), Equals, - "ERROR: Bad filter expression: error parsing regexp: missing closing ]: `[`") - c.Check(len(helper.calls), Equals, 0) -} - -// ----------------------------------------------------------------------- -// Verify that List works correctly. - -func (s *RunS) TestListFiltered(c *C) { - names := List(&FixtureHelper{}, &RunConf{Filter: "1"}) - c.Assert(names, DeepEquals, []string{ - "FixtureHelper.Test1", - }) -} - -func (s *RunS) TestList(c *C) { - names := List(&FixtureHelper{}, &RunConf{}) - c.Assert(names, DeepEquals, []string{ - "FixtureHelper.Test1", - "FixtureHelper.Test2", - }) -} - -// ----------------------------------------------------------------------- -// Verify that verbose mode prints tests which pass as well. - -func (s *RunS) TestVerboseMode(c *C) { - helper := FixtureHelper{} - output := String{} - runConf := RunConf{Output: &output, Verbose: true} - Run(&helper, &runConf) - - expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test1\t *[.0-9]+s\n" + - "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test2\t *[.0-9]+s\n" - - c.Assert(output.value, Matches, expected) -} - -func (s *RunS) TestVerboseModeWithFailBeforePass(c *C) { - helper := FixtureHelper{panicOn: "Test1"} - output := String{} - runConf := RunConf{Output: &output, Verbose: true} - Run(&helper, &runConf) - - expected := "(?s).*PANIC.*\n-+\n" + // Should have an extra line. - "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test2\t *[.0-9]+s\n" - - c.Assert(output.value, Matches, expected) -} - -// ----------------------------------------------------------------------- -// Verify the stream output mode. In this mode there's no output caching. - -type StreamHelper struct { - l2 sync.Mutex - l3 sync.Mutex -} - -func (s *StreamHelper) SetUpSuite(c *C) { - c.Log("0") -} - -func (s *StreamHelper) Test1(c *C) { - c.Log("1") - s.l2.Lock() - s.l3.Lock() - go func() { - s.l2.Lock() // Wait for "2". - c.Log("3") - s.l3.Unlock() - }() -} - -func (s *StreamHelper) Test2(c *C) { - c.Log("2") - s.l2.Unlock() - s.l3.Lock() // Wait for "3". - c.Fail() - c.Log("4") -} - -func (s *RunS) TestStreamMode(c *C) { - helper := &StreamHelper{} - output := String{} - runConf := RunConf{Output: &output, Stream: true} - Run(helper, &runConf) - - expected := "START: run_test\\.go:[0-9]+: StreamHelper\\.SetUpSuite\n0\n" + - "PASS: run_test\\.go:[0-9]+: StreamHelper\\.SetUpSuite\t *[.0-9]+s\n\n" + - "START: run_test\\.go:[0-9]+: StreamHelper\\.Test1\n1\n" + - "PASS: run_test\\.go:[0-9]+: StreamHelper\\.Test1\t *[.0-9]+s\n\n" + - "START: run_test\\.go:[0-9]+: StreamHelper\\.Test2\n2\n3\n4\n" + - "FAIL: run_test\\.go:[0-9]+: StreamHelper\\.Test2\n\n" - - c.Assert(output.value, Matches, expected) -} - -type StreamMissHelper struct{} - -func (s *StreamMissHelper) SetUpSuite(c *C) { - c.Log("0") - c.Fail() -} - -func (s *StreamMissHelper) Test1(c *C) { - c.Log("1") -} - -func (s *RunS) TestStreamModeWithMiss(c *C) { - helper := &StreamMissHelper{} - output := String{} - runConf := RunConf{Output: &output, Stream: true} - Run(helper, &runConf) - - expected := "START: run_test\\.go:[0-9]+: StreamMissHelper\\.SetUpSuite\n0\n" + - "FAIL: run_test\\.go:[0-9]+: StreamMissHelper\\.SetUpSuite\n\n" + - "START: run_test\\.go:[0-9]+: StreamMissHelper\\.Test1\n" + - "MISS: run_test\\.go:[0-9]+: StreamMissHelper\\.Test1\n\n" - - c.Assert(output.value, Matches, expected) -} - -// ----------------------------------------------------------------------- -// Verify that that the keep work dir request indeed does so. - -type WorkDirSuite struct {} - -func (s *WorkDirSuite) Test(c *C) { - c.MkDir() -} - -func (s *RunS) TestKeepWorkDir(c *C) { - output := String{} - runConf := RunConf{Output: &output, Verbose: true, KeepWorkDir: true} - result := Run(&WorkDirSuite{}, &runConf) - - c.Assert(result.String(), Matches, ".*\nWORK=" + result.WorkDir) - - stat, err := os.Stat(result.WorkDir) - c.Assert(err, IsNil) - c.Assert(stat.IsDir(), Equals, true) -} diff --git a/vendor/gopkg.in/yaml.v2/decode_test.go b/vendor/gopkg.in/yaml.v2/decode_test.go deleted file mode 100644 index 9269f12..0000000 --- a/vendor/gopkg.in/yaml.v2/decode_test.go +++ /dev/null @@ -1,1326 +0,0 @@ -package yaml_test - -import ( - "errors" - "io" - "math" - "reflect" - "strings" - "time" - - . "gopkg.in/check.v1" - "gopkg.in/yaml.v2" -) - -var unmarshalIntTest = 123 - -var unmarshalTests = []struct { - data string - value interface{} -}{ - { - "", - (*struct{})(nil), - }, - { - "{}", &struct{}{}, - }, { - "v: hi", - map[string]string{"v": "hi"}, - }, { - "v: hi", map[string]interface{}{"v": "hi"}, - }, { - "v: true", - map[string]string{"v": "true"}, - }, { - "v: true", - map[string]interface{}{"v": true}, - }, { - "v: 10", - map[string]interface{}{"v": 10}, - }, { - "v: 0b10", - map[string]interface{}{"v": 2}, - }, { - "v: 0xA", - map[string]interface{}{"v": 10}, - }, { - "v: 4294967296", - map[string]int64{"v": 4294967296}, - }, { - "v: 0.1", - map[string]interface{}{"v": 0.1}, - }, { - "v: .1", - map[string]interface{}{"v": 0.1}, - }, { - "v: .Inf", - map[string]interface{}{"v": math.Inf(+1)}, - }, { - "v: -.Inf", - map[string]interface{}{"v": math.Inf(-1)}, - }, { - "v: -10", - map[string]interface{}{"v": -10}, - }, { - "v: -.1", - map[string]interface{}{"v": -0.1}, - }, - - // Simple values. - { - "123", - &unmarshalIntTest, - }, - - // Floats from spec - { - "canonical: 6.8523e+5", - map[string]interface{}{"canonical": 6.8523e+5}, - }, { - "expo: 685.230_15e+03", - map[string]interface{}{"expo": 685.23015e+03}, - }, { - "fixed: 685_230.15", - map[string]interface{}{"fixed": 685230.15}, - }, { - "neginf: -.inf", - map[string]interface{}{"neginf": math.Inf(-1)}, - }, { - "fixed: 685_230.15", - map[string]float64{"fixed": 685230.15}, - }, - //{"sexa: 190:20:30.15", map[string]interface{}{"sexa": 0}}, // Unsupported - //{"notanum: .NaN", map[string]interface{}{"notanum": math.NaN()}}, // Equality of NaN fails. - - // Bools from spec - { - "canonical: y", - map[string]interface{}{"canonical": true}, - }, { - "answer: NO", - map[string]interface{}{"answer": false}, - }, { - "logical: True", - map[string]interface{}{"logical": true}, - }, { - "option: on", - map[string]interface{}{"option": true}, - }, { - "option: on", - map[string]bool{"option": true}, - }, - // Ints from spec - { - "canonical: 685230", - map[string]interface{}{"canonical": 685230}, - }, { - "decimal: +685_230", - map[string]interface{}{"decimal": 685230}, - }, { - "octal: 02472256", - map[string]interface{}{"octal": 685230}, - }, { - "hexa: 0x_0A_74_AE", - map[string]interface{}{"hexa": 685230}, - }, { - "bin: 0b1010_0111_0100_1010_1110", - map[string]interface{}{"bin": 685230}, - }, { - "bin: -0b101010", - map[string]interface{}{"bin": -42}, - }, { - "bin: -0b1000000000000000000000000000000000000000000000000000000000000000", - map[string]interface{}{"bin": -9223372036854775808}, - }, { - "decimal: +685_230", - map[string]int{"decimal": 685230}, - }, - - //{"sexa: 190:20:30", map[string]interface{}{"sexa": 0}}, // Unsupported - - // Nulls from spec - { - "empty:", - map[string]interface{}{"empty": nil}, - }, { - "canonical: ~", - map[string]interface{}{"canonical": nil}, - }, { - "english: null", - map[string]interface{}{"english": nil}, - }, { - "~: null key", - map[interface{}]string{nil: "null key"}, - }, { - "empty:", - map[string]*bool{"empty": nil}, - }, - - // Flow sequence - { - "seq: [A,B]", - map[string]interface{}{"seq": []interface{}{"A", "B"}}, - }, { - "seq: [A,B,C,]", - map[string][]string{"seq": []string{"A", "B", "C"}}, - }, { - "seq: [A,1,C]", - map[string][]string{"seq": []string{"A", "1", "C"}}, - }, { - "seq: [A,1,C]", - map[string][]int{"seq": []int{1}}, - }, { - "seq: [A,1,C]", - map[string]interface{}{"seq": []interface{}{"A", 1, "C"}}, - }, - // Block sequence - { - "seq:\n - A\n - B", - map[string]interface{}{"seq": []interface{}{"A", "B"}}, - }, { - "seq:\n - A\n - B\n - C", - map[string][]string{"seq": []string{"A", "B", "C"}}, - }, { - "seq:\n - A\n - 1\n - C", - map[string][]string{"seq": []string{"A", "1", "C"}}, - }, { - "seq:\n - A\n - 1\n - C", - map[string][]int{"seq": []int{1}}, - }, { - "seq:\n - A\n - 1\n - C", - map[string]interface{}{"seq": []interface{}{"A", 1, "C"}}, - }, - - // Literal block scalar - { - "scalar: | # Comment\n\n literal\n\n \ttext\n\n", - map[string]string{"scalar": "\nliteral\n\n\ttext\n"}, - }, - - // Folded block scalar - { - "scalar: > # Comment\n\n folded\n line\n \n next\n line\n * one\n * two\n\n last\n line\n\n", - map[string]string{"scalar": "\nfolded line\nnext line\n * one\n * two\n\nlast line\n"}, - }, - - // Map inside interface with no type hints. - { - "a: {b: c}", - map[interface{}]interface{}{"a": map[interface{}]interface{}{"b": "c"}}, - }, - - // Structs and type conversions. - { - "hello: world", - &struct{ Hello string }{"world"}, - }, { - "a: {b: c}", - &struct{ A struct{ B string } }{struct{ B string }{"c"}}, - }, { - "a: {b: c}", - &struct{ A *struct{ B string } }{&struct{ B string }{"c"}}, - }, { - "a: {b: c}", - &struct{ A map[string]string }{map[string]string{"b": "c"}}, - }, { - "a: {b: c}", - &struct{ A *map[string]string }{&map[string]string{"b": "c"}}, - }, { - "a:", - &struct{ A map[string]string }{}, - }, { - "a: 1", - &struct{ A int }{1}, - }, { - "a: 1", - &struct{ A float64 }{1}, - }, { - "a: 1.0", - &struct{ A int }{1}, - }, { - "a: 1.0", - &struct{ A uint }{1}, - }, { - "a: [1, 2]", - &struct{ A []int }{[]int{1, 2}}, - }, { - "a: [1, 2]", - &struct{ A [2]int }{[2]int{1, 2}}, - }, { - "a: 1", - &struct{ B int }{0}, - }, { - "a: 1", - &struct { - B int "a" - }{1}, - }, { - "a: y", - &struct{ A bool }{true}, - }, - - // Some cross type conversions - { - "v: 42", - map[string]uint{"v": 42}, - }, { - "v: -42", - map[string]uint{}, - }, { - "v: 4294967296", - map[string]uint64{"v": 4294967296}, - }, { - "v: -4294967296", - map[string]uint64{}, - }, - - // int - { - "int_max: 2147483647", - map[string]int{"int_max": math.MaxInt32}, - }, - { - "int_min: -2147483648", - map[string]int{"int_min": math.MinInt32}, - }, - { - "int_overflow: 9223372036854775808", // math.MaxInt64 + 1 - map[string]int{}, - }, - - // int64 - { - "int64_max: 9223372036854775807", - map[string]int64{"int64_max": math.MaxInt64}, - }, - { - "int64_max_base2: 0b111111111111111111111111111111111111111111111111111111111111111", - map[string]int64{"int64_max_base2": math.MaxInt64}, - }, - { - "int64_min: -9223372036854775808", - map[string]int64{"int64_min": math.MinInt64}, - }, - { - "int64_neg_base2: -0b111111111111111111111111111111111111111111111111111111111111111", - map[string]int64{"int64_neg_base2": -math.MaxInt64}, - }, - { - "int64_overflow: 9223372036854775808", // math.MaxInt64 + 1 - map[string]int64{}, - }, - - // uint - { - "uint_min: 0", - map[string]uint{"uint_min": 0}, - }, - { - "uint_max: 4294967295", - map[string]uint{"uint_max": math.MaxUint32}, - }, - { - "uint_underflow: -1", - map[string]uint{}, - }, - - // uint64 - { - "uint64_min: 0", - map[string]uint{"uint64_min": 0}, - }, - { - "uint64_max: 18446744073709551615", - map[string]uint64{"uint64_max": math.MaxUint64}, - }, - { - "uint64_max_base2: 0b1111111111111111111111111111111111111111111111111111111111111111", - map[string]uint64{"uint64_max_base2": math.MaxUint64}, - }, - { - "uint64_maxint64: 9223372036854775807", - map[string]uint64{"uint64_maxint64": math.MaxInt64}, - }, - { - "uint64_underflow: -1", - map[string]uint64{}, - }, - - // float32 - { - "float32_max: 3.40282346638528859811704183484516925440e+38", - map[string]float32{"float32_max": math.MaxFloat32}, - }, - { - "float32_nonzero: 1.401298464324817070923729583289916131280e-45", - map[string]float32{"float32_nonzero": math.SmallestNonzeroFloat32}, - }, - { - "float32_maxuint64: 18446744073709551615", - map[string]float32{"float32_maxuint64": float32(math.MaxUint64)}, - }, - { - "float32_maxuint64+1: 18446744073709551616", - map[string]float32{"float32_maxuint64+1": float32(math.MaxUint64 + 1)}, - }, - - // float64 - { - "float64_max: 1.797693134862315708145274237317043567981e+308", - map[string]float64{"float64_max": math.MaxFloat64}, - }, - { - "float64_nonzero: 4.940656458412465441765687928682213723651e-324", - map[string]float64{"float64_nonzero": math.SmallestNonzeroFloat64}, - }, - { - "float64_maxuint64: 18446744073709551615", - map[string]float64{"float64_maxuint64": float64(math.MaxUint64)}, - }, - { - "float64_maxuint64+1: 18446744073709551616", - map[string]float64{"float64_maxuint64+1": float64(math.MaxUint64 + 1)}, - }, - - // Overflow cases. - { - "v: 4294967297", - map[string]int32{}, - }, { - "v: 128", - map[string]int8{}, - }, - - // Quoted values. - { - "'1': '\"2\"'", - map[interface{}]interface{}{"1": "\"2\""}, - }, { - "v:\n- A\n- 'B\n\n C'\n", - map[string][]string{"v": []string{"A", "B\nC"}}, - }, - - // Explicit tags. - { - "v: !!float '1.1'", - map[string]interface{}{"v": 1.1}, - }, { - "v: !!float 0", - map[string]interface{}{"v": float64(0)}, - }, { - "v: !!float -1", - map[string]interface{}{"v": float64(-1)}, - }, { - "v: !!null ''", - map[string]interface{}{"v": nil}, - }, { - "%TAG !y! tag:yaml.org,2002:\n---\nv: !y!int '1'", - map[string]interface{}{"v": 1}, - }, - - // Non-specific tag (Issue #75) - { - "v: ! test", - map[string]interface{}{"v": "test"}, - }, - - // Anchors and aliases. - { - "a: &x 1\nb: &y 2\nc: *x\nd: *y\n", - &struct{ A, B, C, D int }{1, 2, 1, 2}, - }, { - "a: &a {c: 1}\nb: *a", - &struct { - A, B struct { - C int - } - }{struct{ C int }{1}, struct{ C int }{1}}, - }, { - "a: &a [1, 2]\nb: *a", - &struct{ B []int }{[]int{1, 2}}, - }, - - // Bug #1133337 - { - "foo: ''", - map[string]*string{"foo": new(string)}, - }, { - "foo: null", - map[string]*string{"foo": nil}, - }, { - "foo: null", - map[string]string{"foo": ""}, - }, { - "foo: null", - map[string]interface{}{"foo": nil}, - }, - - // Support for ~ - { - "foo: ~", - map[string]*string{"foo": nil}, - }, { - "foo: ~", - map[string]string{"foo": ""}, - }, { - "foo: ~", - map[string]interface{}{"foo": nil}, - }, - - // Ignored field - { - "a: 1\nb: 2\n", - &struct { - A int - B int "-" - }{1, 0}, - }, - - // Bug #1191981 - { - "" + - "%YAML 1.1\n" + - "--- !!str\n" + - `"Generic line break (no glyph)\n\` + "\n" + - ` Generic line break (glyphed)\n\` + "\n" + - ` Line separator\u2028\` + "\n" + - ` Paragraph separator\u2029"` + "\n", - "" + - "Generic line break (no glyph)\n" + - "Generic line break (glyphed)\n" + - "Line separator\u2028Paragraph separator\u2029", - }, - - // Struct inlining - { - "a: 1\nb: 2\nc: 3\n", - &struct { - A int - C inlineB `yaml:",inline"` - }{1, inlineB{2, inlineC{3}}}, - }, - - // Map inlining - { - "a: 1\nb: 2\nc: 3\n", - &struct { - A int - C map[string]int `yaml:",inline"` - }{1, map[string]int{"b": 2, "c": 3}}, - }, - - // bug 1243827 - { - "a: -b_c", - map[string]interface{}{"a": "-b_c"}, - }, - { - "a: +b_c", - map[string]interface{}{"a": "+b_c"}, - }, - { - "a: 50cent_of_dollar", - map[string]interface{}{"a": "50cent_of_dollar"}, - }, - - // issue #295 (allow scalars with colons in flow mappings and sequences) - { - "a: {b: https://github.com/go-yaml/yaml}", - map[string]interface{}{"a": map[interface{}]interface{}{ - "b": "https://github.com/go-yaml/yaml", - }}, - }, - { - "a: [https://github.com/go-yaml/yaml]", - map[string]interface{}{"a": []interface{}{"https://github.com/go-yaml/yaml"}}, - }, - - // Duration - { - "a: 3s", - map[string]time.Duration{"a": 3 * time.Second}, - }, - - // Issue #24. - { - "a: ", - map[string]string{"a": ""}, - }, - - // Base 60 floats are obsolete and unsupported. - { - "a: 1:1\n", - map[string]string{"a": "1:1"}, - }, - - // Binary data. - { - "a: !!binary gIGC\n", - map[string]string{"a": "\x80\x81\x82"}, - }, { - "a: !!binary |\n " + strings.Repeat("kJCQ", 17) + "kJ\n CQ\n", - map[string]string{"a": strings.Repeat("\x90", 54)}, - }, { - "a: !!binary |\n " + strings.Repeat("A", 70) + "\n ==\n", - map[string]string{"a": strings.Repeat("\x00", 52)}, - }, - - // Ordered maps. - { - "{b: 2, a: 1, d: 4, c: 3, sub: {e: 5}}", - &yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}}, - }, - - // Issue #39. - { - "a:\n b:\n c: d\n", - map[string]struct{ B interface{} }{"a": {map[interface{}]interface{}{"c": "d"}}}, - }, - - // Custom map type. - { - "a: {b: c}", - M{"a": M{"b": "c"}}, - }, - - // Support encoding.TextUnmarshaler. - { - "a: 1.2.3.4\n", - map[string]textUnmarshaler{"a": textUnmarshaler{S: "1.2.3.4"}}, - }, - { - "a: 2015-02-24T18:19:39Z\n", - map[string]textUnmarshaler{"a": textUnmarshaler{"2015-02-24T18:19:39Z"}}, - }, - - // Timestamps - { - // Date only. - "a: 2015-01-01\n", - map[string]time.Time{"a": time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC)}, - }, - { - // RFC3339 - "a: 2015-02-24T18:19:39.12Z\n", - map[string]time.Time{"a": time.Date(2015, 2, 24, 18, 19, 39, .12e9, time.UTC)}, - }, - { - // RFC3339 with short dates. - "a: 2015-2-3T3:4:5Z", - map[string]time.Time{"a": time.Date(2015, 2, 3, 3, 4, 5, 0, time.UTC)}, - }, - { - // ISO8601 lower case t - "a: 2015-02-24t18:19:39Z\n", - map[string]time.Time{"a": time.Date(2015, 2, 24, 18, 19, 39, 0, time.UTC)}, - }, - { - // space separate, no time zone - "a: 2015-02-24 18:19:39\n", - map[string]time.Time{"a": time.Date(2015, 2, 24, 18, 19, 39, 0, time.UTC)}, - }, - // Some cases not currently handled. Uncomment these when - // the code is fixed. - // { - // // space separated with time zone - // "a: 2001-12-14 21:59:43.10 -5", - // map[string]interface{}{"a": time.Date(2001, 12, 14, 21, 59, 43, .1e9, time.UTC)}, - // }, - // { - // // arbitrary whitespace between fields - // "a: 2001-12-14 \t\t \t21:59:43.10 \t Z", - // map[string]interface{}{"a": time.Date(2001, 12, 14, 21, 59, 43, .1e9, time.UTC)}, - // }, - { - // explicit string tag - "a: !!str 2015-01-01", - map[string]interface{}{"a": "2015-01-01"}, - }, - { - // explicit timestamp tag on quoted string - "a: !!timestamp \"2015-01-01\"", - map[string]time.Time{"a": time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC)}, - }, - { - // explicit timestamp tag on unquoted string - "a: !!timestamp 2015-01-01", - map[string]time.Time{"a": time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC)}, - }, - { - // quoted string that's a valid timestamp - "a: \"2015-01-01\"", - map[string]interface{}{"a": "2015-01-01"}, - }, - { - // explicit timestamp tag into interface. - "a: !!timestamp \"2015-01-01\"", - map[string]interface{}{"a": "2015-01-01"}, - }, - { - // implicit timestamp tag into interface. - "a: 2015-01-01", - map[string]interface{}{"a": "2015-01-01"}, - }, - - // Encode empty lists as zero-length slices. - { - "a: []", - &struct{ A []int }{[]int{}}, - }, - - // UTF-16-LE - { - "\xff\xfe\xf1\x00o\x00\xf1\x00o\x00:\x00 \x00v\x00e\x00r\x00y\x00 \x00y\x00e\x00s\x00\n\x00", - M{"ñoño": "very yes"}, - }, - // UTF-16-LE with surrogate. - { - "\xff\xfe\xf1\x00o\x00\xf1\x00o\x00:\x00 \x00v\x00e\x00r\x00y\x00 \x00y\x00e\x00s\x00 \x00=\xd8\xd4\xdf\n\x00", - M{"ñoño": "very yes 🟔"}, - }, - - // UTF-16-BE - { - "\xfe\xff\x00\xf1\x00o\x00\xf1\x00o\x00:\x00 \x00v\x00e\x00r\x00y\x00 \x00y\x00e\x00s\x00\n", - M{"ñoño": "very yes"}, - }, - // UTF-16-BE with surrogate. - { - "\xfe\xff\x00\xf1\x00o\x00\xf1\x00o\x00:\x00 \x00v\x00e\x00r\x00y\x00 \x00y\x00e\x00s\x00 \xd8=\xdf\xd4\x00\n", - M{"ñoño": "very yes 🟔"}, - }, - - // YAML Float regex shouldn't match this - { - "a: 123456e1\n", - M{"a": "123456e1"}, - }, { - "a: 123456E1\n", - M{"a": "123456E1"}, - }, - // yaml-test-suite 3GZX: Spec Example 7.1. Alias Nodes - { - "First occurrence: &anchor Foo\nSecond occurrence: *anchor\nOverride anchor: &anchor Bar\nReuse anchor: *anchor\n", - map[interface{}]interface{}{ - "Reuse anchor": "Bar", - "First occurrence": "Foo", - "Second occurrence": "Foo", - "Override anchor": "Bar", - }, - }, - // Single document with garbage following it. - { - "---\nhello\n...\n}not yaml", - "hello", - }, -} - -type M map[interface{}]interface{} - -type inlineB struct { - B int - inlineC `yaml:",inline"` -} - -type inlineC struct { - C int -} - -func (s *S) TestUnmarshal(c *C) { - for i, item := range unmarshalTests { - c.Logf("test %d: %q", i, item.data) - t := reflect.ValueOf(item.value).Type() - value := reflect.New(t) - err := yaml.Unmarshal([]byte(item.data), value.Interface()) - if _, ok := err.(*yaml.TypeError); !ok { - c.Assert(err, IsNil) - } - c.Assert(value.Elem().Interface(), DeepEquals, item.value, Commentf("error: %v", err)) - } -} - -// TODO(v3): This test should also work when unmarshaling onto an interface{}. -func (s *S) TestUnmarshalFullTimestamp(c *C) { - // Full timestamp in same format as encoded. This is confirmed to be - // properly decoded by Python as a timestamp as well. - var str = "2015-02-24T18:19:39.123456789-03:00" - var t time.Time - err := yaml.Unmarshal([]byte(str), &t) - c.Assert(err, IsNil) - c.Assert(t, Equals, time.Date(2015, 2, 24, 18, 19, 39, 123456789, t.Location())) - c.Assert(t.In(time.UTC), Equals, time.Date(2015, 2, 24, 21, 19, 39, 123456789, time.UTC)) -} - -func (s *S) TestDecoderSingleDocument(c *C) { - // Test that Decoder.Decode works as expected on - // all the unmarshal tests. - for i, item := range unmarshalTests { - c.Logf("test %d: %q", i, item.data) - if item.data == "" { - // Behaviour differs when there's no YAML. - continue - } - t := reflect.ValueOf(item.value).Type() - value := reflect.New(t) - err := yaml.NewDecoder(strings.NewReader(item.data)).Decode(value.Interface()) - if _, ok := err.(*yaml.TypeError); !ok { - c.Assert(err, IsNil) - } - c.Assert(value.Elem().Interface(), DeepEquals, item.value) - } -} - -var decoderTests = []struct { - data string - values []interface{} -}{{ - "", - nil, -}, { - "a: b", - []interface{}{ - map[interface{}]interface{}{"a": "b"}, - }, -}, { - "---\na: b\n...\n", - []interface{}{ - map[interface{}]interface{}{"a": "b"}, - }, -}, { - "---\n'hello'\n...\n---\ngoodbye\n...\n", - []interface{}{ - "hello", - "goodbye", - }, -}} - -func (s *S) TestDecoder(c *C) { - for i, item := range decoderTests { - c.Logf("test %d: %q", i, item.data) - var values []interface{} - dec := yaml.NewDecoder(strings.NewReader(item.data)) - for { - var value interface{} - err := dec.Decode(&value) - if err == io.EOF { - break - } - c.Assert(err, IsNil) - values = append(values, value) - } - c.Assert(values, DeepEquals, item.values) - } -} - -type errReader struct{} - -func (errReader) Read([]byte) (int, error) { - return 0, errors.New("some read error") -} - -func (s *S) TestDecoderReadError(c *C) { - err := yaml.NewDecoder(errReader{}).Decode(&struct{}{}) - c.Assert(err, ErrorMatches, `yaml: input error: some read error`) -} - -func (s *S) TestUnmarshalNaN(c *C) { - value := map[string]interface{}{} - err := yaml.Unmarshal([]byte("notanum: .NaN"), &value) - c.Assert(err, IsNil) - c.Assert(math.IsNaN(value["notanum"].(float64)), Equals, true) -} - -var unmarshalErrorTests = []struct { - data, error string -}{ - {"v: !!float 'error'", "yaml: cannot decode !!str `error` as a !!float"}, - {"v: [A,", "yaml: line 1: did not find expected node content"}, - {"v:\n- [A,", "yaml: line 2: did not find expected node content"}, - {"a:\n- b: *,", "yaml: line 2: did not find expected alphabetic or numeric character"}, - {"a: *b\n", "yaml: unknown anchor 'b' referenced"}, - {"a: &a\n b: *a\n", "yaml: anchor 'a' value contains itself"}, - {"value: -", "yaml: block sequence entries are not allowed in this context"}, - {"a: !!binary ==", "yaml: !!binary value contains invalid base64 data"}, - {"{[.]}", `yaml: invalid map key: \[\]interface \{\}\{"\."\}`}, - {"{{.}}", `yaml: invalid map key: map\[interface\ \{\}\]interface \{\}\{".":interface \{\}\(nil\)\}`}, - {"b: *a\na: &a {c: 1}", `yaml: unknown anchor 'a' referenced`}, - {"%TAG !%79! tag:yaml.org,2002:\n---\nv: !%79!int '1'", "yaml: did not find expected whitespace"}, -} - -func (s *S) TestUnmarshalErrors(c *C) { - for i, item := range unmarshalErrorTests { - c.Logf("test %d: %q", i, item.data) - var value interface{} - err := yaml.Unmarshal([]byte(item.data), &value) - c.Assert(err, ErrorMatches, item.error, Commentf("Partial unmarshal: %#v", value)) - } -} - -func (s *S) TestDecoderErrors(c *C) { - for _, item := range unmarshalErrorTests { - var value interface{} - err := yaml.NewDecoder(strings.NewReader(item.data)).Decode(&value) - c.Assert(err, ErrorMatches, item.error, Commentf("Partial unmarshal: %#v", value)) - } -} - -var unmarshalerTests = []struct { - data, tag string - value interface{} -}{ - {"_: {hi: there}", "!!map", map[interface{}]interface{}{"hi": "there"}}, - {"_: [1,A]", "!!seq", []interface{}{1, "A"}}, - {"_: 10", "!!int", 10}, - {"_: null", "!!null", nil}, - {`_: BAR!`, "!!str", "BAR!"}, - {`_: "BAR!"`, "!!str", "BAR!"}, - {"_: !!foo 'BAR!'", "!!foo", "BAR!"}, - {`_: ""`, "!!str", ""}, -} - -var unmarshalerResult = map[int]error{} - -type unmarshalerType struct { - value interface{} -} - -func (o *unmarshalerType) UnmarshalYAML(unmarshal func(v interface{}) error) error { - if err := unmarshal(&o.value); err != nil { - return err - } - if i, ok := o.value.(int); ok { - if result, ok := unmarshalerResult[i]; ok { - return result - } - } - return nil -} - -type unmarshalerPointer struct { - Field *unmarshalerType "_" -} - -type unmarshalerValue struct { - Field unmarshalerType "_" -} - -func (s *S) TestUnmarshalerPointerField(c *C) { - for _, item := range unmarshalerTests { - obj := &unmarshalerPointer{} - err := yaml.Unmarshal([]byte(item.data), obj) - c.Assert(err, IsNil) - if item.value == nil { - c.Assert(obj.Field, IsNil) - } else { - c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value)) - c.Assert(obj.Field.value, DeepEquals, item.value) - } - } -} - -func (s *S) TestUnmarshalerValueField(c *C) { - for _, item := range unmarshalerTests { - obj := &unmarshalerValue{} - err := yaml.Unmarshal([]byte(item.data), obj) - c.Assert(err, IsNil) - c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value)) - c.Assert(obj.Field.value, DeepEquals, item.value) - } -} - -func (s *S) TestUnmarshalerWholeDocument(c *C) { - obj := &unmarshalerType{} - err := yaml.Unmarshal([]byte(unmarshalerTests[0].data), obj) - c.Assert(err, IsNil) - value, ok := obj.value.(map[interface{}]interface{}) - c.Assert(ok, Equals, true, Commentf("value: %#v", obj.value)) - c.Assert(value["_"], DeepEquals, unmarshalerTests[0].value) -} - -func (s *S) TestUnmarshalerTypeError(c *C) { - unmarshalerResult[2] = &yaml.TypeError{[]string{"foo"}} - unmarshalerResult[4] = &yaml.TypeError{[]string{"bar"}} - defer func() { - delete(unmarshalerResult, 2) - delete(unmarshalerResult, 4) - }() - - type T struct { - Before int - After int - M map[string]*unmarshalerType - } - var v T - data := `{before: A, m: {abc: 1, def: 2, ghi: 3, jkl: 4}, after: B}` - err := yaml.Unmarshal([]byte(data), &v) - c.Assert(err, ErrorMatches, ""+ - "yaml: unmarshal errors:\n"+ - " line 1: cannot unmarshal !!str `A` into int\n"+ - " foo\n"+ - " bar\n"+ - " line 1: cannot unmarshal !!str `B` into int") - c.Assert(v.M["abc"], NotNil) - c.Assert(v.M["def"], IsNil) - c.Assert(v.M["ghi"], NotNil) - c.Assert(v.M["jkl"], IsNil) - - c.Assert(v.M["abc"].value, Equals, 1) - c.Assert(v.M["ghi"].value, Equals, 3) -} - -type proxyTypeError struct{} - -func (v *proxyTypeError) UnmarshalYAML(unmarshal func(interface{}) error) error { - var s string - var a int32 - var b int64 - if err := unmarshal(&s); err != nil { - panic(err) - } - if s == "a" { - if err := unmarshal(&b); err == nil { - panic("should have failed") - } - return unmarshal(&a) - } - if err := unmarshal(&a); err == nil { - panic("should have failed") - } - return unmarshal(&b) -} - -func (s *S) TestUnmarshalerTypeErrorProxying(c *C) { - type T struct { - Before int - After int - M map[string]*proxyTypeError - } - var v T - data := `{before: A, m: {abc: a, def: b}, after: B}` - err := yaml.Unmarshal([]byte(data), &v) - c.Assert(err, ErrorMatches, ""+ - "yaml: unmarshal errors:\n"+ - " line 1: cannot unmarshal !!str `A` into int\n"+ - " line 1: cannot unmarshal !!str `a` into int32\n"+ - " line 1: cannot unmarshal !!str `b` into int64\n"+ - " line 1: cannot unmarshal !!str `B` into int") -} - -type failingUnmarshaler struct{} - -var failingErr = errors.New("failingErr") - -func (ft *failingUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error { - return failingErr -} - -func (s *S) TestUnmarshalerError(c *C) { - err := yaml.Unmarshal([]byte("a: b"), &failingUnmarshaler{}) - c.Assert(err, Equals, failingErr) -} - -type sliceUnmarshaler []int - -func (su *sliceUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error { - var slice []int - err := unmarshal(&slice) - if err == nil { - *su = slice - return nil - } - - var intVal int - err = unmarshal(&intVal) - if err == nil { - *su = []int{intVal} - return nil - } - - return err -} - -func (s *S) TestUnmarshalerRetry(c *C) { - var su sliceUnmarshaler - err := yaml.Unmarshal([]byte("[1, 2, 3]"), &su) - c.Assert(err, IsNil) - c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1, 2, 3})) - - err = yaml.Unmarshal([]byte("1"), &su) - c.Assert(err, IsNil) - c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1})) -} - -// From http://yaml.org/type/merge.html -var mergeTests = ` -anchors: - list: - - &CENTER { "x": 1, "y": 2 } - - &LEFT { "x": 0, "y": 2 } - - &BIG { "r": 10 } - - &SMALL { "r": 1 } - -# All the following maps are equal: - -plain: - # Explicit keys - "x": 1 - "y": 2 - "r": 10 - label: center/big - -mergeOne: - # Merge one map - << : *CENTER - "r": 10 - label: center/big - -mergeMultiple: - # Merge multiple maps - << : [ *CENTER, *BIG ] - label: center/big - -override: - # Override - << : [ *BIG, *LEFT, *SMALL ] - "x": 1 - label: center/big - -shortTag: - # Explicit short merge tag - !!merge "<<" : [ *CENTER, *BIG ] - label: center/big - -longTag: - # Explicit merge long tag - ! "<<" : [ *CENTER, *BIG ] - label: center/big - -inlineMap: - # Inlined map - << : {"x": 1, "y": 2, "r": 10} - label: center/big - -inlineSequenceMap: - # Inlined map in sequence - << : [ *CENTER, {"r": 10} ] - label: center/big -` - -func (s *S) TestMerge(c *C) { - var want = map[interface{}]interface{}{ - "x": 1, - "y": 2, - "r": 10, - "label": "center/big", - } - - var m map[interface{}]interface{} - err := yaml.Unmarshal([]byte(mergeTests), &m) - c.Assert(err, IsNil) - for name, test := range m { - if name == "anchors" { - continue - } - c.Assert(test, DeepEquals, want, Commentf("test %q failed", name)) - } -} - -func (s *S) TestMergeStruct(c *C) { - type Data struct { - X, Y, R int - Label string - } - want := Data{1, 2, 10, "center/big"} - - var m map[string]Data - err := yaml.Unmarshal([]byte(mergeTests), &m) - c.Assert(err, IsNil) - for name, test := range m { - if name == "anchors" { - continue - } - c.Assert(test, Equals, want, Commentf("test %q failed", name)) - } -} - -var unmarshalNullTests = []func() interface{}{ - func() interface{} { var v interface{}; v = "v"; return &v }, - func() interface{} { var s = "s"; return &s }, - func() interface{} { var s = "s"; sptr := &s; return &sptr }, - func() interface{} { var i = 1; return &i }, - func() interface{} { var i = 1; iptr := &i; return &iptr }, - func() interface{} { m := map[string]int{"s": 1}; return &m }, - func() interface{} { m := map[string]int{"s": 1}; return m }, -} - -func (s *S) TestUnmarshalNull(c *C) { - for _, test := range unmarshalNullTests { - item := test() - zero := reflect.Zero(reflect.TypeOf(item).Elem()).Interface() - err := yaml.Unmarshal([]byte("null"), item) - c.Assert(err, IsNil) - if reflect.TypeOf(item).Kind() == reflect.Map { - c.Assert(reflect.ValueOf(item).Interface(), DeepEquals, reflect.MakeMap(reflect.TypeOf(item)).Interface()) - } else { - c.Assert(reflect.ValueOf(item).Elem().Interface(), DeepEquals, zero) - } - } -} - -func (s *S) TestUnmarshalSliceOnPreset(c *C) { - // Issue #48. - v := struct{ A []int }{[]int{1}} - yaml.Unmarshal([]byte("a: [2]"), &v) - c.Assert(v.A, DeepEquals, []int{2}) -} - -var unmarshalStrictTests = []struct { - data string - value interface{} - error string -}{{ - data: "a: 1\nc: 2\n", - value: struct{ A, B int }{A: 1}, - error: `yaml: unmarshal errors:\n line 2: field c not found in type struct { A int; B int }`, -}, { - data: "a: 1\nb: 2\na: 3\n", - value: struct{ A, B int }{A: 3, B: 2}, - error: `yaml: unmarshal errors:\n line 3: field a already set in type struct { A int; B int }`, -}, { - data: "c: 3\na: 1\nb: 2\nc: 4\n", - value: struct { - A int - inlineB `yaml:",inline"` - }{ - A: 1, - inlineB: inlineB{ - B: 2, - inlineC: inlineC{ - C: 4, - }, - }, - }, - error: `yaml: unmarshal errors:\n line 4: field c already set in type struct { A int; yaml_test.inlineB "yaml:\\",inline\\"" }`, -}, { - data: "c: 0\na: 1\nb: 2\nc: 1\n", - value: struct { - A int - inlineB `yaml:",inline"` - }{ - A: 1, - inlineB: inlineB{ - B: 2, - inlineC: inlineC{ - C: 1, - }, - }, - }, - error: `yaml: unmarshal errors:\n line 4: field c already set in type struct { A int; yaml_test.inlineB "yaml:\\",inline\\"" }`, -}, { - data: "c: 1\na: 1\nb: 2\nc: 3\n", - value: struct { - A int - M map[string]interface{} `yaml:",inline"` - }{ - A: 1, - M: map[string]interface{}{ - "b": 2, - "c": 3, - }, - }, - error: `yaml: unmarshal errors:\n line 4: key "c" already set in map`, -}, { - data: "a: 1\n9: 2\nnull: 3\n9: 4", - value: map[interface{}]interface{}{ - "a": 1, - nil: 3, - 9: 4, - }, - error: `yaml: unmarshal errors:\n line 4: key 9 already set in map`, -}} - -func (s *S) TestUnmarshalStrict(c *C) { - for i, item := range unmarshalStrictTests { - c.Logf("test %d: %q", i, item.data) - // First test that normal Unmarshal unmarshals to the expected value. - t := reflect.ValueOf(item.value).Type() - value := reflect.New(t) - err := yaml.Unmarshal([]byte(item.data), value.Interface()) - c.Assert(err, Equals, nil) - c.Assert(value.Elem().Interface(), DeepEquals, item.value) - - // Then test that UnmarshalStrict fails on the same thing. - t = reflect.ValueOf(item.value).Type() - value = reflect.New(t) - err = yaml.UnmarshalStrict([]byte(item.data), value.Interface()) - c.Assert(err, ErrorMatches, item.error) - } -} - -type textUnmarshaler struct { - S string -} - -func (t *textUnmarshaler) UnmarshalText(s []byte) error { - t.S = string(s) - return nil -} - -func (s *S) TestFuzzCrashers(c *C) { - cases := []string{ - // runtime error: index out of range - "\"\\0\\\r\n", - - // should not happen - " 0: [\n] 0", - "? ? \"\n\" 0", - " - {\n000}0", - "0:\n 0: [0\n] 0", - " - \"\n000\"0", - " - \"\n000\"\"", - "0:\n - {\n000}0", - "0:\n - \"\n000\"0", - "0:\n - \"\n000\"\"", - - // runtime error: index out of range - " \ufeff\n", - "? \ufeff\n", - "? \ufeff:\n", - "0: \ufeff\n", - "? \ufeff: \ufeff\n", - } - for _, data := range cases { - var v interface{} - _ = yaml.Unmarshal([]byte(data), &v) - } -} - -//var data []byte -//func init() { -// var err error -// data, err = ioutil.ReadFile("/tmp/file.yaml") -// if err != nil { -// panic(err) -// } -//} -// -//func (s *S) BenchmarkUnmarshal(c *C) { -// var err error -// for i := 0; i < c.N; i++ { -// var v map[string]interface{} -// err = yaml.Unmarshal(data, &v) -// } -// if err != nil { -// panic(err) -// } -//} -// -//func (s *S) BenchmarkMarshal(c *C) { -// var v map[string]interface{} -// yaml.Unmarshal(data, &v) -// c.ResetTimer() -// for i := 0; i < c.N; i++ { -// yaml.Marshal(&v) -// } -//} diff --git a/vendor/gopkg.in/yaml.v2/encode_test.go b/vendor/gopkg.in/yaml.v2/encode_test.go deleted file mode 100644 index f0911a7..0000000 --- a/vendor/gopkg.in/yaml.v2/encode_test.go +++ /dev/null @@ -1,595 +0,0 @@ -package yaml_test - -import ( - "bytes" - "fmt" - "math" - "strconv" - "strings" - "time" - - "net" - "os" - - . "gopkg.in/check.v1" - "gopkg.in/yaml.v2" -) - -var marshalIntTest = 123 - -var marshalTests = []struct { - value interface{} - data string -}{ - { - nil, - "null\n", - }, { - (*marshalerType)(nil), - "null\n", - }, { - &struct{}{}, - "{}\n", - }, { - map[string]string{"v": "hi"}, - "v: hi\n", - }, { - map[string]interface{}{"v": "hi"}, - "v: hi\n", - }, { - map[string]string{"v": "true"}, - "v: \"true\"\n", - }, { - map[string]string{"v": "false"}, - "v: \"false\"\n", - }, { - map[string]interface{}{"v": true}, - "v: true\n", - }, { - map[string]interface{}{"v": false}, - "v: false\n", - }, { - map[string]interface{}{"v": 10}, - "v: 10\n", - }, { - map[string]interface{}{"v": -10}, - "v: -10\n", - }, { - map[string]uint{"v": 42}, - "v: 42\n", - }, { - map[string]interface{}{"v": int64(4294967296)}, - "v: 4294967296\n", - }, { - map[string]int64{"v": int64(4294967296)}, - "v: 4294967296\n", - }, { - map[string]uint64{"v": 4294967296}, - "v: 4294967296\n", - }, { - map[string]interface{}{"v": "10"}, - "v: \"10\"\n", - }, { - map[string]interface{}{"v": 0.1}, - "v: 0.1\n", - }, { - map[string]interface{}{"v": float64(0.1)}, - "v: 0.1\n", - }, { - map[string]interface{}{"v": float32(0.99)}, - "v: 0.99\n", - }, { - map[string]interface{}{"v": -0.1}, - "v: -0.1\n", - }, { - map[string]interface{}{"v": math.Inf(+1)}, - "v: .inf\n", - }, { - map[string]interface{}{"v": math.Inf(-1)}, - "v: -.inf\n", - }, { - map[string]interface{}{"v": math.NaN()}, - "v: .nan\n", - }, { - map[string]interface{}{"v": nil}, - "v: null\n", - }, { - map[string]interface{}{"v": ""}, - "v: \"\"\n", - }, { - map[string][]string{"v": []string{"A", "B"}}, - "v:\n- A\n- B\n", - }, { - map[string][]string{"v": []string{"A", "B\nC"}}, - "v:\n- A\n- |-\n B\n C\n", - }, { - map[string][]interface{}{"v": []interface{}{"A", 1, map[string][]int{"B": []int{2, 3}}}}, - "v:\n- A\n- 1\n- B:\n - 2\n - 3\n", - }, { - map[string]interface{}{"a": map[interface{}]interface{}{"b": "c"}}, - "a:\n b: c\n", - }, { - map[string]interface{}{"a": "-"}, - "a: '-'\n", - }, - - // Simple values. - { - &marshalIntTest, - "123\n", - }, - - // Structures - { - &struct{ Hello string }{"world"}, - "hello: world\n", - }, { - &struct { - A struct { - B string - } - }{struct{ B string }{"c"}}, - "a:\n b: c\n", - }, { - &struct { - A *struct { - B string - } - }{&struct{ B string }{"c"}}, - "a:\n b: c\n", - }, { - &struct { - A *struct { - B string - } - }{}, - "a: null\n", - }, { - &struct{ A int }{1}, - "a: 1\n", - }, { - &struct{ A []int }{[]int{1, 2}}, - "a:\n- 1\n- 2\n", - }, { - &struct{ A [2]int }{[2]int{1, 2}}, - "a:\n- 1\n- 2\n", - }, { - &struct { - B int "a" - }{1}, - "a: 1\n", - }, { - &struct{ A bool }{true}, - "a: true\n", - }, - - // Conditional flag - { - &struct { - A int "a,omitempty" - B int "b,omitempty" - }{1, 0}, - "a: 1\n", - }, { - &struct { - A int "a,omitempty" - B int "b,omitempty" - }{0, 0}, - "{}\n", - }, { - &struct { - A *struct{ X, y int } "a,omitempty,flow" - }{&struct{ X, y int }{1, 2}}, - "a: {x: 1}\n", - }, { - &struct { - A *struct{ X, y int } "a,omitempty,flow" - }{nil}, - "{}\n", - }, { - &struct { - A *struct{ X, y int } "a,omitempty,flow" - }{&struct{ X, y int }{}}, - "a: {x: 0}\n", - }, { - &struct { - A struct{ X, y int } "a,omitempty,flow" - }{struct{ X, y int }{1, 2}}, - "a: {x: 1}\n", - }, { - &struct { - A struct{ X, y int } "a,omitempty,flow" - }{struct{ X, y int }{0, 1}}, - "{}\n", - }, { - &struct { - A float64 "a,omitempty" - B float64 "b,omitempty" - }{1, 0}, - "a: 1\n", - }, - { - &struct { - T1 time.Time "t1,omitempty" - T2 time.Time "t2,omitempty" - T3 *time.Time "t3,omitempty" - T4 *time.Time "t4,omitempty" - }{ - T2: time.Date(2018, 1, 9, 10, 40, 47, 0, time.UTC), - T4: newTime(time.Date(2098, 1, 9, 10, 40, 47, 0, time.UTC)), - }, - "t2: 2018-01-09T10:40:47Z\nt4: 2098-01-09T10:40:47Z\n", - }, - // Nil interface that implements Marshaler. - { - map[string]yaml.Marshaler{ - "a": nil, - }, - "a: null\n", - }, - - // Flow flag - { - &struct { - A []int "a,flow" - }{[]int{1, 2}}, - "a: [1, 2]\n", - }, { - &struct { - A map[string]string "a,flow" - }{map[string]string{"b": "c", "d": "e"}}, - "a: {b: c, d: e}\n", - }, { - &struct { - A struct { - B, D string - } "a,flow" - }{struct{ B, D string }{"c", "e"}}, - "a: {b: c, d: e}\n", - }, - - // Unexported field - { - &struct { - u int - A int - }{0, 1}, - "a: 1\n", - }, - - // Ignored field - { - &struct { - A int - B int "-" - }{1, 2}, - "a: 1\n", - }, - - // Struct inlining - { - &struct { - A int - C inlineB `yaml:",inline"` - }{1, inlineB{2, inlineC{3}}}, - "a: 1\nb: 2\nc: 3\n", - }, - - // Map inlining - { - &struct { - A int - C map[string]int `yaml:",inline"` - }{1, map[string]int{"b": 2, "c": 3}}, - "a: 1\nb: 2\nc: 3\n", - }, - - // Duration - { - map[string]time.Duration{"a": 3 * time.Second}, - "a: 3s\n", - }, - - // Issue #24: bug in map merging logic. - { - map[string]string{"a": ""}, - "a: \n", - }, - - // Issue #34: marshal unsupported base 60 floats quoted for compatibility - // with old YAML 1.1 parsers. - { - map[string]string{"a": "1:1"}, - "a: \"1:1\"\n", - }, - - // Binary data. - { - map[string]string{"a": "\x00"}, - "a: \"\\0\"\n", - }, { - map[string]string{"a": "\x80\x81\x82"}, - "a: !!binary gIGC\n", - }, { - map[string]string{"a": strings.Repeat("\x90", 54)}, - "a: !!binary |\n " + strings.Repeat("kJCQ", 17) + "kJ\n CQ\n", - }, - - // Ordered maps. - { - &yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}}, - "b: 2\na: 1\nd: 4\nc: 3\nsub:\n e: 5\n", - }, - - // Encode unicode as utf-8 rather than in escaped form. - { - map[string]string{"a": "你好"}, - "a: 你好\n", - }, - - // Support encoding.TextMarshaler. - { - map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)}, - "a: 1.2.3.4\n", - }, - // time.Time gets a timestamp tag. - { - map[string]time.Time{"a": time.Date(2015, 2, 24, 18, 19, 39, 0, time.UTC)}, - "a: 2015-02-24T18:19:39Z\n", - }, - { - map[string]*time.Time{"a": newTime(time.Date(2015, 2, 24, 18, 19, 39, 0, time.UTC))}, - "a: 2015-02-24T18:19:39Z\n", - }, - { - // This is confirmed to be properly decoded in Python (libyaml) without a timestamp tag. - map[string]time.Time{"a": time.Date(2015, 2, 24, 18, 19, 39, 123456789, time.FixedZone("FOO", -3*60*60))}, - "a: 2015-02-24T18:19:39.123456789-03:00\n", - }, - // Ensure timestamp-like strings are quoted. - { - map[string]string{"a": "2015-02-24T18:19:39Z"}, - "a: \"2015-02-24T18:19:39Z\"\n", - }, - - // Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible). - { - map[string]string{"a": "b: c"}, - "a: 'b: c'\n", - }, - - // Containing hash mark ('#') in string should be quoted - { - map[string]string{"a": "Hello #comment"}, - "a: 'Hello #comment'\n", - }, - { - map[string]string{"a": "你好 #comment"}, - "a: '你好 #comment'\n", - }, -} - -func (s *S) TestMarshal(c *C) { - defer os.Setenv("TZ", os.Getenv("TZ")) - os.Setenv("TZ", "UTC") - for i, item := range marshalTests { - c.Logf("test %d: %q", i, item.data) - data, err := yaml.Marshal(item.value) - c.Assert(err, IsNil) - c.Assert(string(data), Equals, item.data) - } -} - -func (s *S) TestEncoderSingleDocument(c *C) { - for i, item := range marshalTests { - c.Logf("test %d. %q", i, item.data) - var buf bytes.Buffer - enc := yaml.NewEncoder(&buf) - err := enc.Encode(item.value) - c.Assert(err, Equals, nil) - err = enc.Close() - c.Assert(err, Equals, nil) - c.Assert(buf.String(), Equals, item.data) - } -} - -func (s *S) TestEncoderMultipleDocuments(c *C) { - var buf bytes.Buffer - enc := yaml.NewEncoder(&buf) - err := enc.Encode(map[string]string{"a": "b"}) - c.Assert(err, Equals, nil) - err = enc.Encode(map[string]string{"c": "d"}) - c.Assert(err, Equals, nil) - err = enc.Close() - c.Assert(err, Equals, nil) - c.Assert(buf.String(), Equals, "a: b\n---\nc: d\n") -} - -func (s *S) TestEncoderWriteError(c *C) { - enc := yaml.NewEncoder(errorWriter{}) - err := enc.Encode(map[string]string{"a": "b"}) - c.Assert(err, ErrorMatches, `yaml: write error: some write error`) // Data not flushed yet -} - -type errorWriter struct{} - -func (errorWriter) Write([]byte) (int, error) { - return 0, fmt.Errorf("some write error") -} - -var marshalErrorTests = []struct { - value interface{} - error string - panic string -}{{ - value: &struct { - B int - inlineB ",inline" - }{1, inlineB{2, inlineC{3}}}, - panic: `Duplicated key 'b' in struct struct \{ B int; .*`, -}, { - value: &struct { - A int - B map[string]int ",inline" - }{1, map[string]int{"a": 2}}, - panic: `Can't have key "a" in inlined map; conflicts with struct field`, -}} - -func (s *S) TestMarshalErrors(c *C) { - for _, item := range marshalErrorTests { - if item.panic != "" { - c.Assert(func() { yaml.Marshal(item.value) }, PanicMatches, item.panic) - } else { - _, err := yaml.Marshal(item.value) - c.Assert(err, ErrorMatches, item.error) - } - } -} - -func (s *S) TestMarshalTypeCache(c *C) { - var data []byte - var err error - func() { - type T struct{ A int } - data, err = yaml.Marshal(&T{}) - c.Assert(err, IsNil) - }() - func() { - type T struct{ B int } - data, err = yaml.Marshal(&T{}) - c.Assert(err, IsNil) - }() - c.Assert(string(data), Equals, "b: 0\n") -} - -var marshalerTests = []struct { - data string - value interface{} -}{ - {"_:\n hi: there\n", map[interface{}]interface{}{"hi": "there"}}, - {"_:\n- 1\n- A\n", []interface{}{1, "A"}}, - {"_: 10\n", 10}, - {"_: null\n", nil}, - {"_: BAR!\n", "BAR!"}, -} - -type marshalerType struct { - value interface{} -} - -func (o marshalerType) MarshalText() ([]byte, error) { - panic("MarshalText called on type with MarshalYAML") -} - -func (o marshalerType) MarshalYAML() (interface{}, error) { - return o.value, nil -} - -type marshalerValue struct { - Field marshalerType "_" -} - -func (s *S) TestMarshaler(c *C) { - for _, item := range marshalerTests { - obj := &marshalerValue{} - obj.Field.value = item.value - data, err := yaml.Marshal(obj) - c.Assert(err, IsNil) - c.Assert(string(data), Equals, string(item.data)) - } -} - -func (s *S) TestMarshalerWholeDocument(c *C) { - obj := &marshalerType{} - obj.value = map[string]string{"hello": "world!"} - data, err := yaml.Marshal(obj) - c.Assert(err, IsNil) - c.Assert(string(data), Equals, "hello: world!\n") -} - -type failingMarshaler struct{} - -func (ft *failingMarshaler) MarshalYAML() (interface{}, error) { - return nil, failingErr -} - -func (s *S) TestMarshalerError(c *C) { - _, err := yaml.Marshal(&failingMarshaler{}) - c.Assert(err, Equals, failingErr) -} - -func (s *S) TestSortedOutput(c *C) { - order := []interface{}{ - false, - true, - 1, - uint(1), - 1.0, - 1.1, - 1.2, - 2, - uint(2), - 2.0, - 2.1, - "", - ".1", - ".2", - ".a", - "1", - "2", - "a!10", - "a/0001", - "a/002", - "a/3", - "a/10", - "a/11", - "a/0012", - "a/100", - "a~10", - "ab/1", - "b/1", - "b/01", - "b/2", - "b/02", - "b/3", - "b/03", - "b1", - "b01", - "b3", - "c2.10", - "c10.2", - "d1", - "d7", - "d7abc", - "d12", - "d12a", - } - m := make(map[interface{}]int) - for _, k := range order { - m[k] = 1 - } - data, err := yaml.Marshal(m) - c.Assert(err, IsNil) - out := "\n" + string(data) - last := 0 - for i, k := range order { - repr := fmt.Sprint(k) - if s, ok := k.(string); ok { - if _, err = strconv.ParseFloat(repr, 32); s == "" || err == nil { - repr = `"` + repr + `"` - } - } - index := strings.Index(out, "\n"+repr+":") - if index == -1 { - c.Fatalf("%#v is not in the output: %#v", k, out) - } - if index < last { - c.Fatalf("%#v was generated before %#v: %q", k, order[i-1], out) - } - last = index - } -} - -func newTime(t time.Time) *time.Time { - return &t -} diff --git a/vendor/gopkg.in/yaml.v2/example_embedded_test.go b/vendor/gopkg.in/yaml.v2/example_embedded_test.go deleted file mode 100644 index 171c093..0000000 --- a/vendor/gopkg.in/yaml.v2/example_embedded_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package yaml_test - -import ( - "fmt" - "log" - - "gopkg.in/yaml.v2" -) - -// An example showing how to unmarshal embedded -// structs from YAML. - -type StructA struct { - A string `yaml:"a"` -} - -type StructB struct { - // Embedded structs are not treated as embedded in YAML by default. To do that, - // add the ",inline" annotation below - StructA `yaml:",inline"` - B string `yaml:"b"` -} - -var data = ` -a: a string from struct A -b: a string from struct B -` - -func ExampleUnmarshal_embedded() { - var b StructB - - err := yaml.Unmarshal([]byte(data), &b) - if err != nil { - log.Fatalf("cannot unmarshal data: %v", err) - } - fmt.Println(b.A) - fmt.Println(b.B) - // Output: - // a string from struct A - // a string from struct B -} diff --git a/vendor/gopkg.in/yaml.v2/suite_test.go b/vendor/gopkg.in/yaml.v2/suite_test.go deleted file mode 100644 index c5cf1ed..0000000 --- a/vendor/gopkg.in/yaml.v2/suite_test.go +++ /dev/null @@ -1,12 +0,0 @@ -package yaml_test - -import ( - . "gopkg.in/check.v1" - "testing" -) - -func Test(t *testing.T) { TestingT(t) } - -type S struct{} - -var _ = Suite(&S{}) diff --git a/vendor/k8s.io/apimachinery/LICENSE b/vendor/k8s.io/apimachinery/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/vendor/k8s.io/apimachinery/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/k8s.io/apimachinery/pkg/util/errors/doc.go b/vendor/k8s.io/apimachinery/pkg/util/errors/doc.go new file mode 100644 index 0000000..5d4d625 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/errors/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package errors implements various utility functions and types around errors. +package errors // import "k8s.io/apimachinery/pkg/util/errors" diff --git a/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go b/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go new file mode 100644 index 0000000..88e9376 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go @@ -0,0 +1,201 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package errors + +import ( + "errors" + "fmt" +) + +// MessageCountMap contains occurrence for each error message. +type MessageCountMap map[string]int + +// Aggregate represents an object that contains multiple errors, but does not +// necessarily have singular semantic meaning. +type Aggregate interface { + error + Errors() []error +} + +// NewAggregate converts a slice of errors into an Aggregate interface, which +// is itself an implementation of the error interface. If the slice is empty, +// this returns nil. +// It will check if any of the element of input error list is nil, to avoid +// nil pointer panic when call Error(). +func NewAggregate(errlist []error) Aggregate { + if len(errlist) == 0 { + return nil + } + // In case of input error list contains nil + var errs []error + for _, e := range errlist { + if e != nil { + errs = append(errs, e) + } + } + if len(errs) == 0 { + return nil + } + return aggregate(errs) +} + +// This helper implements the error and Errors interfaces. Keeping it private +// prevents people from making an aggregate of 0 errors, which is not +// an error, but does satisfy the error interface. +type aggregate []error + +// Error is part of the error interface. +func (agg aggregate) Error() string { + if len(agg) == 0 { + // This should never happen, really. + return "" + } + if len(agg) == 1 { + return agg[0].Error() + } + result := fmt.Sprintf("[%s", agg[0].Error()) + for i := 1; i < len(agg); i++ { + result += fmt.Sprintf(", %s", agg[i].Error()) + } + result += "]" + return result +} + +// Errors is part of the Aggregate interface. +func (agg aggregate) Errors() []error { + return []error(agg) +} + +// Matcher is used to match errors. Returns true if the error matches. +type Matcher func(error) bool + +// FilterOut removes all errors that match any of the matchers from the input +// error. If the input is a singular error, only that error is tested. If the +// input implements the Aggregate interface, the list of errors will be +// processed recursively. +// +// This can be used, for example, to remove known-OK errors (such as io.EOF or +// os.PathNotFound) from a list of errors. +func FilterOut(err error, fns ...Matcher) error { + if err == nil { + return nil + } + if agg, ok := err.(Aggregate); ok { + return NewAggregate(filterErrors(agg.Errors(), fns...)) + } + if !matchesError(err, fns...) { + return err + } + return nil +} + +// matchesError returns true if any Matcher returns true +func matchesError(err error, fns ...Matcher) bool { + for _, fn := range fns { + if fn(err) { + return true + } + } + return false +} + +// filterErrors returns any errors (or nested errors, if the list contains +// nested Errors) for which all fns return false. If no errors +// remain a nil list is returned. The resulting silec will have all +// nested slices flattened as a side effect. +func filterErrors(list []error, fns ...Matcher) []error { + result := []error{} + for _, err := range list { + r := FilterOut(err, fns...) + if r != nil { + result = append(result, r) + } + } + return result +} + +// Flatten takes an Aggregate, which may hold other Aggregates in arbitrary +// nesting, and flattens them all into a single Aggregate, recursively. +func Flatten(agg Aggregate) Aggregate { + result := []error{} + if agg == nil { + return nil + } + for _, err := range agg.Errors() { + if a, ok := err.(Aggregate); ok { + r := Flatten(a) + if r != nil { + result = append(result, r.Errors()...) + } + } else { + if err != nil { + result = append(result, err) + } + } + } + return NewAggregate(result) +} + +// CreateAggregateFromMessageCountMap converts MessageCountMap Aggregate +func CreateAggregateFromMessageCountMap(m MessageCountMap) Aggregate { + if m == nil { + return nil + } + result := make([]error, 0, len(m)) + for errStr, count := range m { + var countStr string + if count > 1 { + countStr = fmt.Sprintf(" (repeated %v times)", count) + } + result = append(result, fmt.Errorf("%v%v", errStr, countStr)) + } + return NewAggregate(result) +} + +// Reduce will return err or, if err is an Aggregate and only has one item, +// the first item in the aggregate. +func Reduce(err error) error { + if agg, ok := err.(Aggregate); ok && err != nil { + switch len(agg.Errors()) { + case 1: + return agg.Errors()[0] + case 0: + return nil + } + } + return err +} + +// AggregateGoroutines runs the provided functions in parallel, stuffing all +// non-nil errors into the returned Aggregate. +// Returns nil if all the functions complete successfully. +func AggregateGoroutines(funcs ...func() error) Aggregate { + errChan := make(chan error, len(funcs)) + for _, f := range funcs { + go func(f func() error) { errChan <- f() }(f) + } + errs := make([]error, 0) + for i := 0; i < cap(errChan); i++ { + if err := <-errChan; err != nil { + errs = append(errs, err) + } + } + return NewAggregate(errs) +} + +// ErrPreconditionViolated is returned when the precondition is violated +var ErrPreconditionViolated = errors.New("precondition is violated") diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/byte.go b/vendor/k8s.io/apimachinery/pkg/util/sets/byte.go new file mode 100644 index 0000000..766f450 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/sets/byte.go @@ -0,0 +1,203 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.Byte is a set of bytes, implemented via map[byte]struct{} for minimal memory consumption. +type Byte map[byte]Empty + +// NewByte creates a Byte from a list of values. +func NewByte(items ...byte) Byte { + ss := Byte{} + ss.Insert(items...) + return ss +} + +// ByteKeySet creates a Byte from a keys of a map[byte](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func ByteKeySet(theMap interface{}) Byte { + v := reflect.ValueOf(theMap) + ret := Byte{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(byte)) + } + return ret +} + +// Insert adds items to the set. +func (s Byte) Insert(items ...byte) { + for _, item := range items { + s[item] = Empty{} + } +} + +// Delete removes all items from the set. +func (s Byte) Delete(items ...byte) { + for _, item := range items { + delete(s, item) + } +} + +// Has returns true if and only if item is contained in the set. +func (s Byte) Has(item byte) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s Byte) HasAll(items ...byte) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s Byte) HasAny(items ...byte) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s Byte) Difference(s2 Byte) Byte { + result := NewByte() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 Byte) Union(s2 Byte) Byte { + result := NewByte() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 Byte) Intersection(s2 Byte) Byte { + var walk, other Byte + result := NewByte() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 Byte) IsSuperset(s2 Byte) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 Byte) Equal(s2 Byte) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfByte []byte + +func (s sortableSliceOfByte) Len() int { return len(s) } +func (s sortableSliceOfByte) Less(i, j int) bool { return lessByte(s[i], s[j]) } +func (s sortableSliceOfByte) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted byte slice. +func (s Byte) List() []byte { + res := make(sortableSliceOfByte, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []byte(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s Byte) UnsortedList() []byte { + res := make([]byte, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s Byte) PopAny() (byte, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue byte + return zeroValue, false +} + +// Len returns the size of the set. +func (s Byte) Len() int { + return len(s) +} + +func lessByte(lhs, rhs byte) bool { + return lhs < rhs +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/doc.go b/vendor/k8s.io/apimachinery/pkg/util/sets/doc.go new file mode 100644 index 0000000..b152a0b --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/sets/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by set-gen. DO NOT EDIT. + +// Package sets has auto-generated set types. +package sets diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/empty.go b/vendor/k8s.io/apimachinery/pkg/util/sets/empty.go new file mode 100644 index 0000000..e11e622 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/sets/empty.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by set-gen. DO NOT EDIT. + +package sets + +// Empty is public since it is used by some internal API objects for conversions between external +// string arrays and internal sets, and conversion logic requires public types today. +type Empty struct{} diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/int.go b/vendor/k8s.io/apimachinery/pkg/util/sets/int.go new file mode 100644 index 0000000..a0a513c --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/sets/int.go @@ -0,0 +1,203 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.Int is a set of ints, implemented via map[int]struct{} for minimal memory consumption. +type Int map[int]Empty + +// NewInt creates a Int from a list of values. +func NewInt(items ...int) Int { + ss := Int{} + ss.Insert(items...) + return ss +} + +// IntKeySet creates a Int from a keys of a map[int](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func IntKeySet(theMap interface{}) Int { + v := reflect.ValueOf(theMap) + ret := Int{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(int)) + } + return ret +} + +// Insert adds items to the set. +func (s Int) Insert(items ...int) { + for _, item := range items { + s[item] = Empty{} + } +} + +// Delete removes all items from the set. +func (s Int) Delete(items ...int) { + for _, item := range items { + delete(s, item) + } +} + +// Has returns true if and only if item is contained in the set. +func (s Int) Has(item int) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s Int) HasAll(items ...int) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s Int) HasAny(items ...int) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s Int) Difference(s2 Int) Int { + result := NewInt() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 Int) Union(s2 Int) Int { + result := NewInt() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 Int) Intersection(s2 Int) Int { + var walk, other Int + result := NewInt() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 Int) IsSuperset(s2 Int) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 Int) Equal(s2 Int) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfInt []int + +func (s sortableSliceOfInt) Len() int { return len(s) } +func (s sortableSliceOfInt) Less(i, j int) bool { return lessInt(s[i], s[j]) } +func (s sortableSliceOfInt) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted int slice. +func (s Int) List() []int { + res := make(sortableSliceOfInt, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []int(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s Int) UnsortedList() []int { + res := make([]int, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s Int) PopAny() (int, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue int + return zeroValue, false +} + +// Len returns the size of the set. +func (s Int) Len() int { + return len(s) +} + +func lessInt(lhs, rhs int) bool { + return lhs < rhs +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/int64.go b/vendor/k8s.io/apimachinery/pkg/util/sets/int64.go new file mode 100644 index 0000000..9ca9af0 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/sets/int64.go @@ -0,0 +1,203 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.Int64 is a set of int64s, implemented via map[int64]struct{} for minimal memory consumption. +type Int64 map[int64]Empty + +// NewInt64 creates a Int64 from a list of values. +func NewInt64(items ...int64) Int64 { + ss := Int64{} + ss.Insert(items...) + return ss +} + +// Int64KeySet creates a Int64 from a keys of a map[int64](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func Int64KeySet(theMap interface{}) Int64 { + v := reflect.ValueOf(theMap) + ret := Int64{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(int64)) + } + return ret +} + +// Insert adds items to the set. +func (s Int64) Insert(items ...int64) { + for _, item := range items { + s[item] = Empty{} + } +} + +// Delete removes all items from the set. +func (s Int64) Delete(items ...int64) { + for _, item := range items { + delete(s, item) + } +} + +// Has returns true if and only if item is contained in the set. +func (s Int64) Has(item int64) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s Int64) HasAll(items ...int64) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s Int64) HasAny(items ...int64) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s Int64) Difference(s2 Int64) Int64 { + result := NewInt64() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 Int64) Union(s2 Int64) Int64 { + result := NewInt64() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 Int64) Intersection(s2 Int64) Int64 { + var walk, other Int64 + result := NewInt64() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 Int64) IsSuperset(s2 Int64) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 Int64) Equal(s2 Int64) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfInt64 []int64 + +func (s sortableSliceOfInt64) Len() int { return len(s) } +func (s sortableSliceOfInt64) Less(i, j int) bool { return lessInt64(s[i], s[j]) } +func (s sortableSliceOfInt64) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted int64 slice. +func (s Int64) List() []int64 { + res := make(sortableSliceOfInt64, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []int64(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s Int64) UnsortedList() []int64 { + res := make([]int64, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s Int64) PopAny() (int64, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue int64 + return zeroValue, false +} + +// Len returns the size of the set. +func (s Int64) Len() int { + return len(s) +} + +func lessInt64(lhs, rhs int64) bool { + return lhs < rhs +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/string.go b/vendor/k8s.io/apimachinery/pkg/util/sets/string.go new file mode 100644 index 0000000..ba00ad7 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/sets/string.go @@ -0,0 +1,203 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by set-gen. DO NOT EDIT. + +package sets + +import ( + "reflect" + "sort" +) + +// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. +type String map[string]Empty + +// NewString creates a String from a list of values. +func NewString(items ...string) String { + ss := String{} + ss.Insert(items...) + return ss +} + +// StringKeySet creates a String from a keys of a map[string](? extends interface{}). +// If the value passed in is not actually a map, this will panic. +func StringKeySet(theMap interface{}) String { + v := reflect.ValueOf(theMap) + ret := String{} + + for _, keyValue := range v.MapKeys() { + ret.Insert(keyValue.Interface().(string)) + } + return ret +} + +// Insert adds items to the set. +func (s String) Insert(items ...string) { + for _, item := range items { + s[item] = Empty{} + } +} + +// Delete removes all items from the set. +func (s String) Delete(items ...string) { + for _, item := range items { + delete(s, item) + } +} + +// Has returns true if and only if item is contained in the set. +func (s String) Has(item string) bool { + _, contained := s[item] + return contained +} + +// HasAll returns true if and only if all items are contained in the set. +func (s String) HasAll(items ...string) bool { + for _, item := range items { + if !s.Has(item) { + return false + } + } + return true +} + +// HasAny returns true if any items are contained in the set. +func (s String) HasAny(items ...string) bool { + for _, item := range items { + if s.Has(item) { + return true + } + } + return false +} + +// Difference returns a set of objects that are not in s2 +// For example: +// s1 = {a1, a2, a3} +// s2 = {a1, a2, a4, a5} +// s1.Difference(s2) = {a3} +// s2.Difference(s1) = {a4, a5} +func (s String) Difference(s2 String) String { + result := NewString() + for key := range s { + if !s2.Has(key) { + result.Insert(key) + } + } + return result +} + +// Union returns a new set which includes items in either s1 or s2. +// For example: +// s1 = {a1, a2} +// s2 = {a3, a4} +// s1.Union(s2) = {a1, a2, a3, a4} +// s2.Union(s1) = {a1, a2, a3, a4} +func (s1 String) Union(s2 String) String { + result := NewString() + for key := range s1 { + result.Insert(key) + } + for key := range s2 { + result.Insert(key) + } + return result +} + +// Intersection returns a new set which includes the item in BOTH s1 and s2 +// For example: +// s1 = {a1, a2} +// s2 = {a2, a3} +// s1.Intersection(s2) = {a2} +func (s1 String) Intersection(s2 String) String { + var walk, other String + result := NewString() + if s1.Len() < s2.Len() { + walk = s1 + other = s2 + } else { + walk = s2 + other = s1 + } + for key := range walk { + if other.Has(key) { + result.Insert(key) + } + } + return result +} + +// IsSuperset returns true if and only if s1 is a superset of s2. +func (s1 String) IsSuperset(s2 String) bool { + for item := range s2 { + if !s1.Has(item) { + return false + } + } + return true +} + +// Equal returns true if and only if s1 is equal (as a set) to s2. +// Two sets are equal if their membership is identical. +// (In practice, this means same elements, order doesn't matter) +func (s1 String) Equal(s2 String) bool { + return len(s1) == len(s2) && s1.IsSuperset(s2) +} + +type sortableSliceOfString []string + +func (s sortableSliceOfString) Len() int { return len(s) } +func (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) } +func (s sortableSliceOfString) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// List returns the contents as a sorted string slice. +func (s String) List() []string { + res := make(sortableSliceOfString, 0, len(s)) + for key := range s { + res = append(res, key) + } + sort.Sort(res) + return []string(res) +} + +// UnsortedList returns the slice with contents in random order. +func (s String) UnsortedList() []string { + res := make([]string, 0, len(s)) + for key := range s { + res = append(res, key) + } + return res +} + +// Returns a single element from the set. +func (s String) PopAny() (string, bool) { + for key := range s { + s.Delete(key) + return key, true + } + var zeroValue string + return zeroValue, false +} + +// Len returns the size of the set. +func (s String) Len() int { + return len(s) +} + +func lessString(lhs, rhs string) bool { + return lhs < rhs +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go b/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go new file mode 100644 index 0000000..4767fd1 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go @@ -0,0 +1,259 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package field + +import ( + "fmt" + "reflect" + "strconv" + "strings" + + utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/sets" +) + +// Error is an implementation of the 'error' interface, which represents a +// field-level validation error. +type Error struct { + Type ErrorType + Field string + BadValue interface{} + Detail string +} + +var _ error = &Error{} + +// Error implements the error interface. +func (v *Error) Error() string { + return fmt.Sprintf("%s: %s", v.Field, v.ErrorBody()) +} + +// ErrorBody returns the error message without the field name. This is useful +// for building nice-looking higher-level error reporting. +func (v *Error) ErrorBody() string { + var s string + switch v.Type { + case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeInternal: + s = v.Type.String() + default: + value := v.BadValue + valueType := reflect.TypeOf(value) + if value == nil || valueType == nil { + value = "null" + } else if valueType.Kind() == reflect.Ptr { + if reflectValue := reflect.ValueOf(value); reflectValue.IsNil() { + value = "null" + } else { + value = reflectValue.Elem().Interface() + } + } + switch t := value.(type) { + case int64, int32, float64, float32, bool: + // use simple printer for simple types + s = fmt.Sprintf("%s: %v", v.Type, value) + case string: + s = fmt.Sprintf("%s: %q", v.Type, t) + case fmt.Stringer: + // anything that defines String() is better than raw struct + s = fmt.Sprintf("%s: %s", v.Type, t.String()) + default: + // fallback to raw struct + // TODO: internal types have panic guards against json.Marshalling to prevent + // accidental use of internal types in external serialized form. For now, use + // %#v, although it would be better to show a more expressive output in the future + s = fmt.Sprintf("%s: %#v", v.Type, value) + } + } + if len(v.Detail) != 0 { + s += fmt.Sprintf(": %s", v.Detail) + } + return s +} + +// ErrorType is a machine readable value providing more detail about why +// a field is invalid. These values are expected to match 1-1 with +// CauseType in api/types.go. +type ErrorType string + +// TODO: These values are duplicated in api/types.go, but there's a circular dep. Fix it. +const ( + // ErrorTypeNotFound is used to report failure to find a requested value + // (e.g. looking up an ID). See NotFound(). + ErrorTypeNotFound ErrorType = "FieldValueNotFound" + // ErrorTypeRequired is used to report required values that are not + // provided (e.g. empty strings, null values, or empty arrays). See + // Required(). + ErrorTypeRequired ErrorType = "FieldValueRequired" + // ErrorTypeDuplicate is used to report collisions of values that must be + // unique (e.g. unique IDs). See Duplicate(). + ErrorTypeDuplicate ErrorType = "FieldValueDuplicate" + // ErrorTypeInvalid is used to report malformed values (e.g. failed regex + // match, too long, out of bounds). See Invalid(). + ErrorTypeInvalid ErrorType = "FieldValueInvalid" + // ErrorTypeNotSupported is used to report unknown values for enumerated + // fields (e.g. a list of valid values). See NotSupported(). + ErrorTypeNotSupported ErrorType = "FieldValueNotSupported" + // ErrorTypeForbidden is used to report valid (as per formatting rules) + // values which would be accepted under some conditions, but which are not + // permitted by the current conditions (such as security policy). See + // Forbidden(). + ErrorTypeForbidden ErrorType = "FieldValueForbidden" + // ErrorTypeTooLong is used to report that the given value is too long. + // This is similar to ErrorTypeInvalid, but the error will not include the + // too-long value. See TooLong(). + ErrorTypeTooLong ErrorType = "FieldValueTooLong" + // ErrorTypeInternal is used to report other errors that are not related + // to user input. See InternalError(). + ErrorTypeInternal ErrorType = "InternalError" +) + +// String converts a ErrorType into its corresponding canonical error message. +func (t ErrorType) String() string { + switch t { + case ErrorTypeNotFound: + return "Not found" + case ErrorTypeRequired: + return "Required value" + case ErrorTypeDuplicate: + return "Duplicate value" + case ErrorTypeInvalid: + return "Invalid value" + case ErrorTypeNotSupported: + return "Unsupported value" + case ErrorTypeForbidden: + return "Forbidden" + case ErrorTypeTooLong: + return "Too long" + case ErrorTypeInternal: + return "Internal error" + default: + panic(fmt.Sprintf("unrecognized validation error: %q", string(t))) + } +} + +// NotFound returns a *Error indicating "value not found". This is +// used to report failure to find a requested value (e.g. looking up an ID). +func NotFound(field *Path, value interface{}) *Error { + return &Error{ErrorTypeNotFound, field.String(), value, ""} +} + +// Required returns a *Error indicating "value required". This is used +// to report required values that are not provided (e.g. empty strings, null +// values, or empty arrays). +func Required(field *Path, detail string) *Error { + return &Error{ErrorTypeRequired, field.String(), "", detail} +} + +// Duplicate returns a *Error indicating "duplicate value". This is +// used to report collisions of values that must be unique (e.g. names or IDs). +func Duplicate(field *Path, value interface{}) *Error { + return &Error{ErrorTypeDuplicate, field.String(), value, ""} +} + +// Invalid returns a *Error indicating "invalid value". This is used +// to report malformed values (e.g. failed regex match, too long, out of bounds). +func Invalid(field *Path, value interface{}, detail string) *Error { + return &Error{ErrorTypeInvalid, field.String(), value, detail} +} + +// NotSupported returns a *Error indicating "unsupported value". +// This is used to report unknown values for enumerated fields (e.g. a list of +// valid values). +func NotSupported(field *Path, value interface{}, validValues []string) *Error { + detail := "" + if validValues != nil && len(validValues) > 0 { + quotedValues := make([]string, len(validValues)) + for i, v := range validValues { + quotedValues[i] = strconv.Quote(v) + } + detail = "supported values: " + strings.Join(quotedValues, ", ") + } + return &Error{ErrorTypeNotSupported, field.String(), value, detail} +} + +// Forbidden returns a *Error indicating "forbidden". This is used to +// report valid (as per formatting rules) values which would be accepted under +// some conditions, but which are not permitted by current conditions (e.g. +// security policy). +func Forbidden(field *Path, detail string) *Error { + return &Error{ErrorTypeForbidden, field.String(), "", detail} +} + +// TooLong returns a *Error indicating "too long". This is used to +// report that the given value is too long. This is similar to +// Invalid, but the returned error will not include the too-long +// value. +func TooLong(field *Path, value interface{}, maxLength int) *Error { + return &Error{ErrorTypeTooLong, field.String(), value, fmt.Sprintf("must have at most %d characters", maxLength)} +} + +// InternalError returns a *Error indicating "internal error". This is used +// to signal that an error was found that was not directly related to user +// input. The err argument must be non-nil. +func InternalError(field *Path, err error) *Error { + return &Error{ErrorTypeInternal, field.String(), nil, err.Error()} +} + +// ErrorList holds a set of Errors. It is plausible that we might one day have +// non-field errors in this same umbrella package, but for now we don't, so +// we can keep it simple and leave ErrorList here. +type ErrorList []*Error + +// NewErrorTypeMatcher returns an errors.Matcher that returns true +// if the provided error is a Error and has the provided ErrorType. +func NewErrorTypeMatcher(t ErrorType) utilerrors.Matcher { + return func(err error) bool { + if e, ok := err.(*Error); ok { + return e.Type == t + } + return false + } +} + +// ToAggregate converts the ErrorList into an errors.Aggregate. +func (list ErrorList) ToAggregate() utilerrors.Aggregate { + errs := make([]error, 0, len(list)) + errorMsgs := sets.NewString() + for _, err := range list { + msg := fmt.Sprintf("%v", err) + if errorMsgs.Has(msg) { + continue + } + errorMsgs.Insert(msg) + errs = append(errs, err) + } + return utilerrors.NewAggregate(errs) +} + +func fromAggregate(agg utilerrors.Aggregate) ErrorList { + errs := agg.Errors() + list := make(ErrorList, len(errs)) + for i := range errs { + list[i] = errs[i].(*Error) + } + return list +} + +// Filter removes items from the ErrorList that match the provided fns. +func (list ErrorList) Filter(fns ...utilerrors.Matcher) ErrorList { + err := utilerrors.FilterOut(list.ToAggregate(), fns...) + if err == nil { + return nil + } + // FilterOut takes an Aggregate and returns an Aggregate + return fromAggregate(err.(utilerrors.Aggregate)) +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/field/path.go b/vendor/k8s.io/apimachinery/pkg/util/validation/field/path.go new file mode 100644 index 0000000..2efc8ee --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/field/path.go @@ -0,0 +1,91 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package field + +import ( + "bytes" + "fmt" + "strconv" +) + +// Path represents the path from some root to a particular field. +type Path struct { + name string // the name of this field or "" if this is an index + index string // if name == "", this is a subscript (index or map key) of the previous element + parent *Path // nil if this is the root element +} + +// NewPath creates a root Path object. +func NewPath(name string, moreNames ...string) *Path { + r := &Path{name: name, parent: nil} + for _, anotherName := range moreNames { + r = &Path{name: anotherName, parent: r} + } + return r +} + +// Root returns the root element of this Path. +func (p *Path) Root() *Path { + for ; p.parent != nil; p = p.parent { + // Do nothing. + } + return p +} + +// Child creates a new Path that is a child of the method receiver. +func (p *Path) Child(name string, moreNames ...string) *Path { + r := NewPath(name, moreNames...) + r.Root().parent = p + return r +} + +// Index indicates that the previous Path is to be subscripted by an int. +// This sets the same underlying value as Key. +func (p *Path) Index(index int) *Path { + return &Path{index: strconv.Itoa(index), parent: p} +} + +// Key indicates that the previous Path is to be subscripted by a string. +// This sets the same underlying value as Index. +func (p *Path) Key(key string) *Path { + return &Path{index: key, parent: p} +} + +// String produces a string representation of the Path. +func (p *Path) String() string { + // make a slice to iterate + elems := []*Path{} + for ; p != nil; p = p.parent { + elems = append(elems, p) + } + + // iterate, but it has to be backwards + buf := bytes.NewBuffer(nil) + for i := range elems { + p := elems[len(elems)-1-i] + if p.parent != nil && len(p.name) > 0 { + // This is either the root or it is a subscript. + buf.WriteString(".") + } + if len(p.name) > 0 { + buf.WriteString(p.name) + } else { + fmt.Fprintf(buf, "[%s]", p.index) + } + } + return buf.String() +} diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go new file mode 100644 index 0000000..7da6a17 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go @@ -0,0 +1,391 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validation + +import ( + "fmt" + "math" + "net" + "regexp" + "strings" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +const qnameCharFmt string = "[A-Za-z0-9]" +const qnameExtCharFmt string = "[-A-Za-z0-9_.]" +const qualifiedNameFmt string = "(" + qnameCharFmt + qnameExtCharFmt + "*)?" + qnameCharFmt +const qualifiedNameErrMsg string = "must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character" +const qualifiedNameMaxLength int = 63 + +var qualifiedNameRegexp = regexp.MustCompile("^" + qualifiedNameFmt + "$") + +// IsQualifiedName tests whether the value passed is what Kubernetes calls a +// "qualified name". This is a format used in various places throughout the +// system. If the value is not valid, a list of error strings is returned. +// Otherwise an empty list (or nil) is returned. +func IsQualifiedName(value string) []string { + var errs []string + parts := strings.Split(value, "/") + var name string + switch len(parts) { + case 1: + name = parts[0] + case 2: + var prefix string + prefix, name = parts[0], parts[1] + if len(prefix) == 0 { + errs = append(errs, "prefix part "+EmptyError()) + } else if msgs := IsDNS1123Subdomain(prefix); len(msgs) != 0 { + errs = append(errs, prefixEach(msgs, "prefix part ")...) + } + default: + return append(errs, "a qualified name "+RegexError(qualifiedNameErrMsg, qualifiedNameFmt, "MyName", "my.name", "123-abc")+ + " with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')") + } + + if len(name) == 0 { + errs = append(errs, "name part "+EmptyError()) + } else if len(name) > qualifiedNameMaxLength { + errs = append(errs, "name part "+MaxLenError(qualifiedNameMaxLength)) + } + if !qualifiedNameRegexp.MatchString(name) { + errs = append(errs, "name part "+RegexError(qualifiedNameErrMsg, qualifiedNameFmt, "MyName", "my.name", "123-abc")) + } + return errs +} + +// IsFullyQualifiedName checks if the name is fully qualified. +func IsFullyQualifiedName(fldPath *field.Path, name string) field.ErrorList { + var allErrors field.ErrorList + if len(name) == 0 { + return append(allErrors, field.Required(fldPath, "")) + } + if errs := IsDNS1123Subdomain(name); len(errs) > 0 { + return append(allErrors, field.Invalid(fldPath, name, strings.Join(errs, ","))) + } + if len(strings.Split(name, ".")) < 3 { + return append(allErrors, field.Invalid(fldPath, name, "should be a domain with at least three segments separated by dots")) + } + return allErrors +} + +const labelValueFmt string = "(" + qualifiedNameFmt + ")?" +const labelValueErrMsg string = "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character" +const LabelValueMaxLength int = 63 + +var labelValueRegexp = regexp.MustCompile("^" + labelValueFmt + "$") + +// IsValidLabelValue tests whether the value passed is a valid label value. If +// the value is not valid, a list of error strings is returned. Otherwise an +// empty list (or nil) is returned. +func IsValidLabelValue(value string) []string { + var errs []string + if len(value) > LabelValueMaxLength { + errs = append(errs, MaxLenError(LabelValueMaxLength)) + } + if !labelValueRegexp.MatchString(value) { + errs = append(errs, RegexError(labelValueErrMsg, labelValueFmt, "MyValue", "my_value", "12345")) + } + return errs +} + +const dns1123LabelFmt string = "[a-z0-9]([-a-z0-9]*[a-z0-9])?" +const dns1123LabelErrMsg string = "a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character" +const DNS1123LabelMaxLength int = 63 + +var dns1123LabelRegexp = regexp.MustCompile("^" + dns1123LabelFmt + "$") + +// IsDNS1123Label tests for a string that conforms to the definition of a label in +// DNS (RFC 1123). +func IsDNS1123Label(value string) []string { + var errs []string + if len(value) > DNS1123LabelMaxLength { + errs = append(errs, MaxLenError(DNS1123LabelMaxLength)) + } + if !dns1123LabelRegexp.MatchString(value) { + errs = append(errs, RegexError(dns1123LabelErrMsg, dns1123LabelFmt, "my-name", "123-abc")) + } + return errs +} + +const dns1123SubdomainFmt string = dns1123LabelFmt + "(\\." + dns1123LabelFmt + ")*" +const dns1123SubdomainErrorMsg string = "a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character" +const DNS1123SubdomainMaxLength int = 253 + +var dns1123SubdomainRegexp = regexp.MustCompile("^" + dns1123SubdomainFmt + "$") + +// IsDNS1123Subdomain tests for a string that conforms to the definition of a +// subdomain in DNS (RFC 1123). +func IsDNS1123Subdomain(value string) []string { + var errs []string + if len(value) > DNS1123SubdomainMaxLength { + errs = append(errs, MaxLenError(DNS1123SubdomainMaxLength)) + } + if !dns1123SubdomainRegexp.MatchString(value) { + errs = append(errs, RegexError(dns1123SubdomainErrorMsg, dns1123SubdomainFmt, "example.com")) + } + return errs +} + +const dns1035LabelFmt string = "[a-z]([-a-z0-9]*[a-z0-9])?" +const dns1035LabelErrMsg string = "a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character" +const DNS1035LabelMaxLength int = 63 + +var dns1035LabelRegexp = regexp.MustCompile("^" + dns1035LabelFmt + "$") + +// IsDNS1035Label tests for a string that conforms to the definition of a label in +// DNS (RFC 1035). +func IsDNS1035Label(value string) []string { + var errs []string + if len(value) > DNS1035LabelMaxLength { + errs = append(errs, MaxLenError(DNS1035LabelMaxLength)) + } + if !dns1035LabelRegexp.MatchString(value) { + errs = append(errs, RegexError(dns1035LabelErrMsg, dns1035LabelFmt, "my-name", "abc-123")) + } + return errs +} + +// wildcard definition - RFC 1034 section 4.3.3. +// examples: +// - valid: *.bar.com, *.foo.bar.com +// - invalid: *.*.bar.com, *.foo.*.com, *bar.com, f*.bar.com, * +const wildcardDNS1123SubdomainFmt = "\\*\\." + dns1123SubdomainFmt +const wildcardDNS1123SubdomainErrMsg = "a wildcard DNS-1123 subdomain must start with '*.', followed by a valid DNS subdomain, which must consist of lower case alphanumeric characters, '-' or '.' and end with an alphanumeric character" + +// IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a +// wildcard subdomain in DNS (RFC 1034 section 4.3.3). +func IsWildcardDNS1123Subdomain(value string) []string { + wildcardDNS1123SubdomainRegexp := regexp.MustCompile("^" + wildcardDNS1123SubdomainFmt + "$") + + var errs []string + if len(value) > DNS1123SubdomainMaxLength { + errs = append(errs, MaxLenError(DNS1123SubdomainMaxLength)) + } + if !wildcardDNS1123SubdomainRegexp.MatchString(value) { + errs = append(errs, RegexError(wildcardDNS1123SubdomainErrMsg, wildcardDNS1123SubdomainFmt, "*.example.com")) + } + return errs +} + +const cIdentifierFmt string = "[A-Za-z_][A-Za-z0-9_]*" +const identifierErrMsg string = "a valid C identifier must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_'" + +var cIdentifierRegexp = regexp.MustCompile("^" + cIdentifierFmt + "$") + +// IsCIdentifier tests for a string that conforms the definition of an identifier +// in C. This checks the format, but not the length. +func IsCIdentifier(value string) []string { + if !cIdentifierRegexp.MatchString(value) { + return []string{RegexError(identifierErrMsg, cIdentifierFmt, "my_name", "MY_NAME", "MyName")} + } + return nil +} + +// IsValidPortNum tests that the argument is a valid, non-zero port number. +func IsValidPortNum(port int) []string { + if 1 <= port && port <= 65535 { + return nil + } + return []string{InclusiveRangeError(1, 65535)} +} + +// IsInRange tests that the argument is in an inclusive range. +func IsInRange(value int, min int, max int) []string { + if value >= min && value <= max { + return nil + } + return []string{InclusiveRangeError(min, max)} +} + +// Now in libcontainer UID/GID limits is 0 ~ 1<<31 - 1 +// TODO: once we have a type for UID/GID we should make these that type. +const ( + minUserID = 0 + maxUserID = math.MaxInt32 + minGroupID = 0 + maxGroupID = math.MaxInt32 +) + +// IsValidGroupID tests that the argument is a valid Unix GID. +func IsValidGroupID(gid int64) []string { + if minGroupID <= gid && gid <= maxGroupID { + return nil + } + return []string{InclusiveRangeError(minGroupID, maxGroupID)} +} + +// IsValidUserID tests that the argument is a valid Unix UID. +func IsValidUserID(uid int64) []string { + if minUserID <= uid && uid <= maxUserID { + return nil + } + return []string{InclusiveRangeError(minUserID, maxUserID)} +} + +var portNameCharsetRegex = regexp.MustCompile("^[-a-z0-9]+$") +var portNameOneLetterRegexp = regexp.MustCompile("[a-z]") + +// IsValidPortName check that the argument is valid syntax. It must be +// non-empty and no more than 15 characters long. It may contain only [-a-z0-9] +// and must contain at least one letter [a-z]. It must not start or end with a +// hyphen, nor contain adjacent hyphens. +// +// Note: We only allow lower-case characters, even though RFC 6335 is case +// insensitive. +func IsValidPortName(port string) []string { + var errs []string + if len(port) > 15 { + errs = append(errs, MaxLenError(15)) + } + if !portNameCharsetRegex.MatchString(port) { + errs = append(errs, "must contain only alpha-numeric characters (a-z, 0-9), and hyphens (-)") + } + if !portNameOneLetterRegexp.MatchString(port) { + errs = append(errs, "must contain at least one letter or number (a-z, 0-9)") + } + if strings.Contains(port, "--") { + errs = append(errs, "must not contain consecutive hyphens") + } + if len(port) > 0 && (port[0] == '-' || port[len(port)-1] == '-') { + errs = append(errs, "must not begin or end with a hyphen") + } + return errs +} + +// IsValidIP tests that the argument is a valid IP address. +func IsValidIP(value string) []string { + if net.ParseIP(value) == nil { + return []string{"must be a valid IP address, (e.g. 10.9.8.7)"} + } + return nil +} + +const percentFmt string = "[0-9]+%" +const percentErrMsg string = "a valid percent string must be a numeric string followed by an ending '%'" + +var percentRegexp = regexp.MustCompile("^" + percentFmt + "$") + +func IsValidPercent(percent string) []string { + if !percentRegexp.MatchString(percent) { + return []string{RegexError(percentErrMsg, percentFmt, "1%", "93%")} + } + return nil +} + +const httpHeaderNameFmt string = "[-A-Za-z0-9]+" +const httpHeaderNameErrMsg string = "a valid HTTP header must consist of alphanumeric characters or '-'" + +var httpHeaderNameRegexp = regexp.MustCompile("^" + httpHeaderNameFmt + "$") + +// IsHTTPHeaderName checks that a string conforms to the Go HTTP library's +// definition of a valid header field name (a stricter subset than RFC7230). +func IsHTTPHeaderName(value string) []string { + if !httpHeaderNameRegexp.MatchString(value) { + return []string{RegexError(httpHeaderNameErrMsg, httpHeaderNameFmt, "X-Header-Name")} + } + return nil +} + +const envVarNameFmt = "[-._a-zA-Z][-._a-zA-Z0-9]*" +const envVarNameFmtErrMsg string = "a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit" + +var envVarNameRegexp = regexp.MustCompile("^" + envVarNameFmt + "$") + +// IsEnvVarName tests if a string is a valid environment variable name. +func IsEnvVarName(value string) []string { + var errs []string + if !envVarNameRegexp.MatchString(value) { + errs = append(errs, RegexError(envVarNameFmtErrMsg, envVarNameFmt, "my.env-name", "MY_ENV.NAME", "MyEnvName1")) + } + + errs = append(errs, hasChDirPrefix(value)...) + return errs +} + +const configMapKeyFmt = `[-._a-zA-Z0-9]+` +const configMapKeyErrMsg string = "a valid config key must consist of alphanumeric characters, '-', '_' or '.'" + +var configMapKeyRegexp = regexp.MustCompile("^" + configMapKeyFmt + "$") + +// IsConfigMapKey tests for a string that is a valid key for a ConfigMap or Secret +func IsConfigMapKey(value string) []string { + var errs []string + if len(value) > DNS1123SubdomainMaxLength { + errs = append(errs, MaxLenError(DNS1123SubdomainMaxLength)) + } + if !configMapKeyRegexp.MatchString(value) { + errs = append(errs, RegexError(configMapKeyErrMsg, configMapKeyFmt, "key.name", "KEY_NAME", "key-name")) + } + errs = append(errs, hasChDirPrefix(value)...) + return errs +} + +// MaxLenError returns a string explanation of a "string too long" validation +// failure. +func MaxLenError(length int) string { + return fmt.Sprintf("must be no more than %d characters", length) +} + +// RegexError returns a string explanation of a regex validation failure. +func RegexError(msg string, fmt string, examples ...string) string { + if len(examples) == 0 { + return msg + " (regex used for validation is '" + fmt + "')" + } + msg += " (e.g. " + for i := range examples { + if i > 0 { + msg += " or " + } + msg += "'" + examples[i] + "', " + } + msg += "regex used for validation is '" + fmt + "')" + return msg +} + +// EmptyError returns a string explanation of a "must not be empty" validation +// failure. +func EmptyError() string { + return "must be non-empty" +} + +func prefixEach(msgs []string, prefix string) []string { + for i := range msgs { + msgs[i] = prefix + msgs[i] + } + return msgs +} + +// InclusiveRangeError returns a string explanation of a numeric "must be +// between" validation failure. +func InclusiveRangeError(lo, hi int) string { + return fmt.Sprintf(`must be between %d and %d, inclusive`, lo, hi) +} + +func hasChDirPrefix(value string) []string { + var errs []string + switch { + case value == ".": + errs = append(errs, `must not be '.'`) + case value == "..": + errs = append(errs, `must not be '..'`) + case strings.HasPrefix(value, ".."): + errs = append(errs, `must not start with '..'`) + } + return errs +} diff --git a/vendor/vgo.list b/vendor/modules.txt similarity index 76% rename from vendor/vgo.list rename to vendor/modules.txt index a76ca07..06cd50e 100644 --- a/vendor/vgo.list +++ b/vendor/modules.txt @@ -1,60 +1,51 @@ # github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e github.com/cavaliercoder/go-cpio # github.com/cloudflare/cfssl v0.0.0-20180705210102-ff56ab5eb62a -github.com/cloudflare/cfssl/auth -github.com/cloudflare/cfssl/certdb github.com/cloudflare/cfssl/config -github.com/cloudflare/cfssl/crypto/pkcs7 github.com/cloudflare/cfssl/csr -github.com/cloudflare/cfssl/errors github.com/cloudflare/cfssl/helpers -github.com/cloudflare/cfssl/helpers/derhelpers -github.com/cloudflare/cfssl/info github.com/cloudflare/cfssl/initca -github.com/cloudflare/cfssl/log -github.com/cloudflare/cfssl/ocsp/config github.com/cloudflare/cfssl/signer github.com/cloudflare/cfssl/signer/local +github.com/cloudflare/cfssl/auth +github.com/cloudflare/cfssl/errors +github.com/cloudflare/cfssl/log +github.com/cloudflare/cfssl/ocsp/config +github.com/cloudflare/cfssl/crypto/pkcs7 +github.com/cloudflare/cfssl/helpers/derhelpers +github.com/cloudflare/cfssl/certdb +github.com/cloudflare/cfssl/info # github.com/golang/protobuf v1.1.0 github.com/golang/protobuf/proto -github.com/golang/protobuf/proto/proto3_proto -github.com/golang/protobuf/proto/test_proto -github.com/golang/protobuf/protoc-gen-go/descriptor github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp # github.com/google/certificate-transparency-go v1.0.20 github.com/google/certificate-transparency-go -github.com/google/certificate-transparency-go/asn1 -github.com/google/certificate-transparency-go/client -github.com/google/certificate-transparency-go/client/configpb -github.com/google/certificate-transparency-go/gossip/minimal/x509ext -github.com/google/certificate-transparency-go/jsonclient -github.com/google/certificate-transparency-go/testdata github.com/google/certificate-transparency-go/tls github.com/google/certificate-transparency-go/x509 +github.com/google/certificate-transparency-go/client +github.com/google/certificate-transparency-go/jsonclient +github.com/google/certificate-transparency-go/asn1 github.com/google/certificate-transparency-go/x509/pkix -github.com/google/certificate-transparency-go/x509util -# github.com/kr/pretty v0.1.0 -github.com/kr/pretty -# github.com/kr/text v0.1.0 -github.com/kr/text +github.com/google/certificate-transparency-go/client/configpb # golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 -golang.org/x/crypto/cryptobyte -golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/ocsp golang.org/x/crypto/pkcs12 +golang.org/x/crypto/cryptobyte +golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/pkcs12/internal/rc2 # golang.org/x/net v0.0.0-20180706051357-32a936f46389 golang.org/x/net/context golang.org/x/net/context/ctxhttp -# golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f -golang.org/x/sync/errgroup -# gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 -gopkg.in/check.v1 # gopkg.in/yaml.v2 v2.2.1 gopkg.in/yaml.v2 +# k8s.io/apimachinery v0.0.0-20180808233214-a7b7e4de06b2 +k8s.io/apimachinery/pkg/util/validation +k8s.io/apimachinery/pkg/util/validation/field +k8s.io/apimachinery/pkg/util/errors +k8s.io/apimachinery/pkg/util/sets # novit.nc/direktil/pkg v0.0.0-20180707011528-e82b59c0324d novit.nc/direktil/pkg/cas novit.nc/direktil/pkg/clustersconfig diff --git a/vendor/novit.nc/direktil/pkg/LICENSE b/vendor/novit.nc/direktil/pkg/LICENSE new file mode 100644 index 0000000..a65f209 --- /dev/null +++ b/vendor/novit.nc/direktil/pkg/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018 novit-nc / direktil + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.